forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspkg-configure.m4
36 lines (35 loc) · 1.21 KB
/
spkg-configure.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SAGE_SPKG_CONFIGURE([singular], [
SAGE_SPKG_DEPCHECK([gmp ntl flint readline mpfr cddlib], [
AC_PATH_PROG([SINGULAR_BIN], [Singular])
AC_SUBST([SINGULAR_BIN])
AS_IF([test -z "${SINGULAR_BIN}"], [sage_spkg_install_singular=yes], [
dnl Use pkg-config to ensure that Singular is new enough.
PKG_CHECK_MODULES([SINGULAR], [Singular >= 4.2.1], [
AC_MSG_CHECKING([whether Singular is built with FLINT])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
#include <singular/singularconfig.h>
#if !defined(HAVE_FLINT)
# error "Need Singular compiled with FLINT"
#endif
], [])
], [
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([that Singular's help is working])
AS_IF([test x`printf "system(\"--browser\", \"builtin\"); \n help;" | Singular 2>&1 | grep "error occurred"` = x], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
sage_spkg_install_singular=yes
])
], [
AC_MSG_RESULT([no])
sage_spkg_install_singular=yes
])
], [
dnl pkg-config version check failed
sage_spkg_install_singular=yes
])
])
])
])