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

Commit

Permalink
rebase, deal with --with-mpc
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Mar 20, 2019
1 parent ec32471 commit 91f423f
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 23 deletions.
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_MPC_PREFIX" \
$SAGE_CONFIGURE_MPC \
$SAGE_CONFIGURE_MPFR \
$SAGE_CONFIGURE_GMP
sdh_make
Expand Down
66 changes: 46 additions & 20 deletions build/pkgs/mpc/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
SAGE_SPKG_CONFIGURE([mpc], [
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])
AC_ARG_WITH([mpc],
[AS_HELP_STRING([--with-mpc=system],
[use the system MPC, if possible (default)])]
[AS_HELP_STRING([--with-mpc=install],
[use the Sage SPKG for MPC])])
if test x$sage_spkg_install_mpc = xyes; then
AC_SUBST(SAGE_MPC_PREFIX, ['$SAGE_LOCAL'])
dnl Just part the options here
case "$with_mpc" in
system) ;;
install) ;;
"") with_mpc=system;;
*)
AC_MSG_ERROR([allowed values for --with-mpc are system and install]);;
esac
case "$with_mpc" in
system)
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])
if test x$sage_spkg_install_mpc = xyes; then
AC_SUBST(SAGE_MPC_PREFIX, ['$SAGE_LOCAL'])
dnl AC_SUBST(SAGE_MPC_INCLUDE, ['$SAGE_LOCAL/include']) --- not used
AC_MSG_RESULT([using Sage's mpc SPKG])
else
dnl If found, we want to get the absolute path to where we
dnl found it for use with some packages want
dnl this information at configure time
AX_ABSOLUTE_HEADER([mpc.h])
if test x$gl_cv_absolute_mpc_h = x; then
AC_MSG_ERROR(m4_normalize([
failed to find absolute path to mpc.h despite it being reported found
]))
fi
dnl AC_SUBST(SAGE_MPC_INCLUDE, [`AS_DIRNAME($gl_cv_absolute_mpc_h)`])
AC_SUBST(SAGE_MPC_PREFIX, [''])
AC_MSG_RESULT([using mpc library from the system])
fi
;;
install)
sage_spkg_install_mpc=yes
AC_SUBST(SAGE_MPC_PREFIX, ['$SAGE_LOCAL'])
dnl AC_SUBST(SAGE_MPC_INCLUDE, ['$SAGE_LOCAL/include'])
AC_MSG_RESULT([using Sage's mpc SPKG])
else
dnl If found, we want to get the absolute path to where we
dnl found it for use with some packages want
dnl this information at configure time
AX_ABSOLUTE_HEADER([mpc.h])
if test x$gl_cv_absolute_mpc_h = x; then
AC_MSG_ERROR(m4_normalize([
failed to find absolute path to mpc.h despite it being reported found
]))
fi
dnl AC_SUBST(SAGE_MPC_INCLUDE, [`AS_DIRNAME($gl_cv_absolute_mpc_h)`])
AC_SUBST(SAGE_MPC_PREFIX, [''])
AC_MSG_RESULT([using mpc library from the system])
fi
AC_MSG_RESULT([using Sage's mpc SPKG])
;;
esac
])
4 changes: 2 additions & 2 deletions 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_MPC_PREFIX" --disable-static --enable-shared
sdh_configure $SAGE_CONFIGURE_GMP $SAGE_CONFIGURE_MPFR \
$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 91f423f

Please sign in to comment.