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

Commit

Permalink
implement --with-mpfr=system/install
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Feb 27, 2019
1 parent 18fbf7b commit 50aebab
Showing 1 changed file with 46 additions and 20 deletions.
66 changes: 46 additions & 20 deletions build/pkgs/mpfr/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
SAGE_SPKG_CONFIGURE([mpfr], [
AC_CHECK_HEADER(mpfr.h, [], [sage_spkg_install_mpfr=yes])
dnl mpfr_free_pool appeared in r11922 (Dec 2017) on MPFR svn
AC_SEARCH_LIBS([mpfr_free_pool], [mpfr], [break], [sage_spkg_install_mpfr=yes])
AC_ARG_WITH([mpfr],
[AS_HELP_STRING([--with-mpfr=system],
[use the system MPFR, if possible (default)])]
[AS_HELP_STRING([--with-mpfr=install],
[use the Sage SPKG for MPFR])])
if test x$sage_spkg_install_mpfr = xyes; then
AC_SUBST(SAGE_MPFR_PREFIX, ['$SAGE_LOCAL'])
dnl Just part the options here
case "$with_mpfr" in
system) ;;
install) ;;
"") with_mpfr=system;;
*)
AC_MSG_ERROR([allowed values for --with-mpfr are system and install]);;
esac
case "$with_mpfr" in
system)
AC_CHECK_HEADER(mpfr.h, [], [sage_spkg_install_mpfr=yes])
dnl mpfr_free_pool appeared in r11922 (Dec 2017) on MPFR svn
AC_SEARCH_LIBS([mpfr_free_pool], [mpfr], [break], [sage_spkg_install_mpfr=yes])
if test x$sage_spkg_install_mpfr = xyes; then
AC_SUBST(SAGE_MPFR_PREFIX, ['$SAGE_LOCAL'])
dnl AC_SUBST(SAGE_MPFR_INCLUDE, ['$SAGE_LOCAL/include']) --- not used
AC_MSG_RESULT([using Sage's mpfr 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([mpfr.h])
if test x$gl_cv_absolute_mpfr_h = x; then
AC_MSG_ERROR(m4_normalize([
failed to find absolute path to mpfr.h despite it being reported found
]))
fi
dnl AC_SUBST(SAGE_MPFR_INCLUDE, [`AS_DIRNAME($gl_cv_absolute_mpfr_h)`])
AC_SUBST(SAGE_MPFR_PREFIX, [''])
AC_MSG_RESULT([using mpfr library from the system])
fi
;;
install)
sage_spkg_install_mpfr=yes
AC_SUBST(SAGE_MPFR_PREFIX, ['$SAGE_LOCAL'])
dnl AC_SUBST(SAGE_MPFR_INCLUDE, ['$SAGE_LOCAL/include'])
AC_MSG_RESULT([using Sage's mpfr 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([mpfr.h])
if test x$gl_cv_absolute_mpfr_h = x; then
AC_MSG_ERROR(m4_normalize([
failed to find absolute path to mpfr.h despite it being reported found
]))
fi
dnl AC_SUBST(SAGE_MPFR_INCLUDE, [`AS_DIRNAME($gl_cv_absolute_mpfr_h)`])
AC_SUBST(SAGE_MPFR_PREFIX, [''])
AC_MSG_RESULT([using mpfr library from the system])
fi
AC_MSG_RESULT([using Sage's mpfr SPKG])
;;
esac
])

0 comments on commit 50aebab

Please sign in to comment.