Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #27259: spkg-configure for mpc, adjustments for its dependents
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed May 22, 2019
1 parent 5e28c6e commit 32b79af
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/gcc/build-gcc
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/gdb/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions build/pkgs/mpc/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -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
])
2 changes: 1 addition & 1 deletion build/pkgs/mpfrcx/spkg-install
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions src/bin/sage-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -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=<prefix> 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

0 comments on commit 32b79af

Please sign in to comment.