diff --git a/build/pkgs/gcc/build-gcc b/build/pkgs/gcc/build-gcc index d00edaf74e5..106e1f20a79 100755 --- a/build/pkgs/gcc/build-gcc +++ b/build/pkgs/gcc/build-gcc @@ -61,7 +61,7 @@ fi ../src/configure \ --prefix="$SAGE_LOCAL" \ --with-local-prefix="$SAGE_LOCAL" \ - $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR --with-mpc="$SAGE_LOCAL" \ + $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR $SAGE_CONFIGURE_MPC \ --with-system-zlib \ --disable-multilib \ --disable-nls \ diff --git a/build/pkgs/gdb/spkg-install b/build/pkgs/gdb/spkg-install index b64e38d0b5d..1c33ff83595 100644 --- a/build/pkgs/gdb/spkg-install +++ b/build/pkgs/gdb/spkg-install @@ -4,7 +4,7 @@ cd src export LDFLAGS="${LDFLAGS} -L${SAGE_LOCAL}/lib -ltinfo" sdh_configure \ - --with-mpc="$SAGE_LOCAL" \ + $SAGE_CONFIGURE_MPC \ $SAGE_CONFIGURE_MPFR \ $SAGE_CONFIGURE_GMP sdh_make diff --git a/build/pkgs/mpc/spkg-configure.m4 b/build/pkgs/mpc/spkg-configure.m4 new file mode 100644 index 00000000000..9ec14a7c980 --- /dev/null +++ b/build/pkgs/mpc/spkg-configure.m4 @@ -0,0 +1,21 @@ +SAGE_SPKG_CONFIGURE([mpc], [ + AC_REQUIRE([SAGE_SPKG_CONFIGURE_MPFR]) + AC_MSG_CHECKING([installing mpfr? ]) + if test x$sage_spkg_install_mpfr = xyes; then + AC_MSG_RESULT([yes; install mpc as well]) + sage_spkg_install_mpc=yes + else + AC_MSG_RESULT([no]) + AC_CHECK_HEADER(mpc.h, [], [sage_spkg_install_mpc=yes]) + dnl mpc_cmp_abs appeared in MPC 1.1.0 + AC_SEARCH_LIBS([mpc_cmp_abs], [mpc], [break], [sage_spkg_install_mpc=yes]) + fi +], [], [], [ + if test x$sage_spkg_install_mpc = xyes; then + AC_SUBST(SAGE_MPC_PREFIX, ['$SAGE_LOCAL']) + AC_MSG_RESULT([using Sage's mpc SPKG]) + else + AC_SUBST(SAGE_MPC_PREFIX, ['']) + AC_MSG_RESULT([using mpc library from the system]) + fi +]) diff --git a/build/pkgs/mpfrcx/spkg-install b/build/pkgs/mpfrcx/spkg-install index 268fc36a880..faf548f2543 100644 --- a/build/pkgs/mpfrcx/spkg-install +++ b/build/pkgs/mpfrcx/spkg-install @@ -1,6 +1,6 @@ cd src sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR \ - --with-mpc="$SAGE_LOCAL" --disable-static --enable-shared + $SAGE_CONFIGURE_MPC --disable-static --enable-shared sdh_make sdh_make_install diff --git a/src/bin/sage-env-config.in b/src/bin/sage-env-config.in index 859984b7caf..36c42d87982 100644 --- a/src/bin/sage-env-config.in +++ b/src/bin/sage-env-config.in @@ -58,3 +58,12 @@ if [ -n "$SAGE_MPFR_PREFIX" ]; then # their ./configure scripts. Thus we deal with this just as with GMP above. export SAGE_CONFIGURE_MPFR="--with-mpfr=$SAGE_MPFR_PREFIX" fi + +# The MPC case is very close to the MPFR case above +# This is usually blank if the system MPC is used, or $SAGE_LOCAL otherwise +export SAGE_MPC_PREFIX="@SAGE_MPC_PREFIX@" +if [ -n "$SAGE_MPC_PREFIX" ]; then + # Some packages that depend on MPC accept a --with-mpc= flag to + # their ./configure scripts. Thus we deal with this just as with GMP above. + export SAGE_CONFIGURE_MPC="--with-mpc=$SAGE_MPC_PREFIX" +fi