source: git/m4/polymake-check.m4 @ f234fb2

spielwiese
Last change on this file since f234fb2 was f234fb2, checked in by Hans Schoenemann <hannes@…>, 7 years ago
arghh: polymake-config --versioj changed its format: 3.0 -> 3.0.6
  • Property mode set to 100644
File size: 2.3 KB
Line 
1# polymake.m4
2
3AC_DEFUN([SING_CHECK_POLYMAKE],
4[
5
6AC_ARG_ENABLE(polymake,
7 AS_HELP_STRING([--enable-polymake], [Enables interface for Singular to Polymake (needs gfanlib)]),
8 [ENABLE_POLYMAKE="$enableval"], [ENABLE_POLYMAKE=""])
9
10AC_MSG_CHECKING(whether to check for polymake interface)
11
12if test "x$ENABLE_POLYMAKE" != xno; then
13  AC_MSG_RESULT([yes])
14
15
16  if test "x$PASSED_ALL_TESTS_FOR_GFANLIB" != x1; then
17
18   PASSED_ALL_TEST_FOR_POLYMAKE="no";
19
20   if test "x$ENABLE_POLYMAKE" = xyes; then
21    AC_MSG_ERROR([gfanlib was not enabled])
22   else
23    AC_MSG_WARN([gfanlib was not enabled])
24   fi
25
26  else
27
28##  AC_MSG_CHECKING(whether polymake is properly installed)
29   AC_CHECK_PROG([PMCONFIG],[polymake-config],[1],[0])
30   if test $PMCONFIG = "1"; then
31##    AC_MSG_CHECKING([whether polymake is up-to-date])
32    SUPPORTEDPOLYMAKEVERSION="21"
33    CURRENTPOLYMAKEVERSION=`polymake-config --version | cut -c -3 -| sed s'/\.//'`
34    if test $CURRENTPOLYMAKEVERSION -ge $SUPPORTEDPOLYMAKEVERSION; then
35      AC_MSG_RESULT([yes])
36
37      PM_INC=`polymake-config --includes`
38      PM_CFLAGS=`polymake-config --cflags`
39      PM_LIBS=`polymake-config --libs`
40      PM_LDFLAGS=`polymake-config --ldflags`
41      POLYMAKEVERSION=`polymake-config --version | cut -c -6 -| sed s'/\./*100+/'|sed s'/\./*10+/'`
42
43      AC_DEFINE_UNQUOTED(POLYMAKEVERSION,$POLYMAKEVERSION,[check the polymake version])
44      AC_SUBST(PM_INC)
45      AC_SUBST(PM_CFLAGS)
46      AC_SUBST(PM_LIBS)
47      AC_SUBST(PM_LDFLAGS)
48
49      AC_DEFINE(HAVE_POLYMAKE,1,[Define if POLYMAKE is installed])
50
51      AC_MSG_CHECKING([polymake includes])
52      AC_MSG_RESULT($PM_INC)
53      AC_MSG_CHECKING([polymake cflags])
54      AC_MSG_RESULT($PM_CFLAGS)
55      AC_MSG_CHECKING([polymake libs])
56      AC_MSG_RESULT($PM_LIBS)
57      AC_MSG_CHECKING([polymake ldflags])
58      AC_MSG_RESULT($PM_LDFLAGS)
59
60      PASSED_ALL_TEST_FOR_POLYMAKE="yes";
61    else
62      PASSED_ALL_TEST_FOR_POLYMAKE="no";
63
64      if test "x$ENABLE_POLYMAKE" = xyes; then
65        AC_MSG_ERROR([outdated polymake version])
66      fi
67    fi
68   else
69    PASSED_ALL_TEST_FOR_POLYMAKE="no";
70
71    if test "x$ENABLE_POLYMAKE" = xyes; then
72     AC_MSG_ERROR([polymake not installed])
73    fi
74   fi
75  fi
76else
77  AC_MSG_RESULT(no)
78
79  PASSED_ALL_TEST_FOR_POLYMAKE="no";
80fi
81
82AM_CONDITIONAL(SING_HAVE_POLYMAKE, test "x$PASSED_ALL_TEST_FOR_POLYMAKE" != xno)
83
84])
Note: See TracBrowser for help on using the repository browser.