|
| 1 | +SAGE_SPKG_CONFIGURE([symengine], [ |
| 2 | + m4_pushdef(SAGE_SYMENGINE_VERSION_MAJOR, [0]) |
| 3 | + m4_pushdef(SAGE_SYMENGINE_VERSION_MINOR, [11]) |
| 4 | + SAGE_SPKG_DEPCHECK([gmp arb ecm flint mpc mpfr], [ |
| 5 | + AC_CHECK_HEADER([symengine/symengine_config.h], [], [sage_spkg_install_symengine=yes]) |
| 6 | + AC_MSG_CHECKING([whether we can link a program using symengine]) |
| 7 | + SYMENGINE_SAVED_LIBS=$LIBS |
| 8 | + LIBS="$LIBS -lsymengine" |
| 9 | + AC_LINK_IFELSE([ |
| 10 | + AC_LANG_PROGRAM([[#include <symengine/expression.h>]], |
| 11 | + [[using SymEngine::Expression; |
| 12 | + Expression x("x"); |
| 13 | + auto ex = pow(x+sqrt(Expression(2)), 6);]] |
| 14 | + )], [AC_MSG_RESULT([yes])], [ |
| 15 | + AC_MSG_RESULT([no]); sage_spkg_install_symengine=yes |
| 16 | + LIBS=$SYMENGINE_SAVED_LIBS |
| 17 | + ]) |
| 18 | + AC_MSG_CHECKING([symengine version >= ]SAGE_SYMENGINE_VERSION_MAJOR[.]SAGE_SYMENGINE_VERSION_MINOR) |
| 19 | + AC_RUN_IFELSE([ |
| 20 | + AC_LANG_PROGRAM( |
| 21 | + [[#include <symengine/symengine_config.h> |
| 22 | + #include <stdio.h> |
| 23 | + ]], [[ |
| 24 | + fprintf(stderr, "%s\n", SYMENGINE_VERSION); |
| 25 | + if (SYMENGINE_MAJOR_VERSION >]] SAGE_SYMENGINE_VERSION_MAJOR[[) return 0; |
| 26 | + else if (SYMENGINE_MAJOR_VERSION ==]] SAGE_SYMENGINE_VERSION_MAJOR[[ && |
| 27 | + SYMENGINE_MINOR_VERSION >=]] SAGE_SYMENGINE_VERSION_MINOR[[) return 0; |
| 28 | + else return 1; |
| 29 | + ]])], [ |
| 30 | + AC_MSG_RESULT([yes]) |
| 31 | + ], [ |
| 32 | + AC_MSG_RESULT([no]) |
| 33 | + sage_spkg_install_symengine=yes |
| 34 | + ], [ |
| 35 | + dnl assume that the person running cross-compiling |
| 36 | + dnl knows what they are doing |
| 37 | + AC_MSG_RESULT([yes]) |
| 38 | + ]) |
| 39 | + ]) |
| 40 | +
|
| 41 | + m4_popdef([SAGE_SYMENGINE_VERSION_MAJOR]) |
| 42 | + m4_popdef([SAGE_SYMENGINE_VERSION_MINOR]) |
| 43 | +], [], [], [] |
| 44 | +) |
| 45 | + |
0 commit comments