Skip to content

Commit

Permalink
Trac #28333: spkg-configure.m4 for eclib
Browse files Browse the repository at this point in the history
the main issue here is how to check that the version installed on the
system is good enough.

We check for a header that only appeared in 2018, that's all we could
find atm.

URL: https://trac.sagemath.org/28333
Reported by: dimpase
Ticket author(s): Dima Pasechnik
Reviewer(s): Isuru Fernando
  • Loading branch information
Release Manager committed Aug 10, 2019
2 parents ea6f35b + 699f220 commit b656376
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions build/pkgs/eclib/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SAGE_SPKG_CONFIGURE([eclib], [
AC_REQUIRE([SAGE_SPKG_CONFIGURE_NTL])
AC_REQUIRE([SAGE_SPKG_CONFIGURE_PARI])
AC_MSG_CHECKING([installing ntl or pari? ])
if test x$sage_spkg_install_ntl = xyes -o x$sage_spkg_install_pari = xyes; then
AC_MSG_RESULT([yes; install eclib as well])
sage_spkg_install_eclib=yes
else
dnl header types.h appeared in v20180710
AC_CHECK_HEADER([eclib/types.h], [
AC_MSG_CHECKING([whether we can link and run a program using eclib])
ECLIB_SAVED_LIBS=$LIBS
LIBS="$LIBS -lec"
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <eclib/version.h>]
[#include <eclib/interface.h>]],
[[set_bit_precision(42); /* test for versions >= v20190226 */
show_version();
return 0;]]
)], [AC_MSG_RESULT([yes; use eclib from the system])], [
AC_MSG_RESULT([no; install eclib])
sage_spkg_install_eclib=yes
LIBS=$ECLIB_SAVED_LIBS
])
], [sage_spkg_install_eclib=yes])
fi
])
2 changes: 1 addition & 1 deletion build/pkgs/eclib/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cd src/

sdh_configure $SAGE_CONFIGURE_NTL \
$SAGE_CONFIGURE_PARI \
$SAGE_CONFIGURE_FLINT \
--with-flint=$SAGE_FLINT_PREFIX \
--with-boost="no" \
--disable-allprogs
sdh_make
Expand Down

0 comments on commit b656376

Please sign in to comment.