Skip to content

Commit

Permalink
build/pkgs/mpc/spkg-configure.m4: Check for version using AC_LINK_IFELSE
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 14, 2023
1 parent 97d02ee commit a664359
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build/pkgs/mpc/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
SAGE_SPKG_CONFIGURE([mpc], [
SAGE_SPKG_DEPCHECK([mpfr], [
AC_CHECK_HEADER(mpc.h, [], [sage_spkg_install_mpc=yes])
dnl gmpy2 2.2 needs MPC >= 1.2.1 according https://github.com/aleaxit/gmpy/blob/master/src/gmpy2.h#L86
dnl mpc_sum was added in MPC 1.2.0 according to https://www.multiprecision.org/mpc/olds.html
AC_SEARCH_LIBS([mpc_sum], [mpc], [], [sage_spkg_install_mpc=yes])
AC_MSG_CHECKING([for MPC >= 1.2.1])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mpc.h>]], [[
#if (!defined(MPC_VERSION) || (MPC_VERSION < MPC_VERSION_NUM(1,2,1)))
# error "Sage requires MPC 1.2.1 or later (for gmpy2 2.2)."
#endif
]])], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
sage_spkg_install_mpc=yes
])
])
], [], [], [
if test x$sage_spkg_install_mpc = xyes; then
Expand Down

0 comments on commit a664359

Please sign in to comment.