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

spielwiese
Last change on this file since f5d2647 was 47e8b04, checked in by Yue Ren <ren@…>, 11 years ago
new: first try in polymake interface
  • Property mode set to 100644
File size: 1.9 KB
Line 
1# polymake.m4
2
3AC_DEFUN([SING_CHECK_POLYMAKE],
4[
5
6AC_ARG_ENABLE(polymake,
7AS_HELP_STRING([--enable-polymake], [Enables interface for Singular to Polymake (needs gfanlib)]),
8[ENABLE_POLYMAKE="yes"],
9[ENABLE_POLYMAKE="no"])
10
11AC_MSG_CHECKING(whether to build with polymake interface)
12
13if test "x$ENABLE_POLYMAKE" = xyes; then
14
15  AC_MSG_RESULT([yes])
16  if test "x$ENABLE_GFANLIB" != xyes; then
17    PASSED_ALL_TEST_FOR_POLYMAKE="no";
18    AC_MSG_RESULT([no])
19    AC_MSG_ERROR([gfanlib is not enabled])
20  else
21
22##  AC_MSG_CHECKING(whether polymake is properly installed)
23   AC_CHECK_PROG([PMCONFIG],[polymake-config],[1],[0])
24   if test $PMCONFIG = "1"; then
25##    AC_MSG_CHECKING([whether polymake is up-to-date])
26    SUPPORTEDPOLYMAKEVERSION="212"
27    CURRENTPOLYMAKEVERSION=`polymake-config --version | cut -c -4 -| sed s'/\.//'`
28    if test $CURRENTPOLYMAKEVERSION -ge $SUPPORTEDPOLYMAKEVERSION; then
29      PASSED_ALL_TEST_FOR_POLYMAKE="yes";
30      AC_MSG_RESULT([yes])
31
32      PM_INC=`polymake-config --includes`
33      PM_CFLAGS=`polymake-config --cflags`
34      PM_LIBS=`polymake-config --libs`
35      PM_LDFLAGS=`polymake-config --ldflags`
36
37                        AC_SUBST(PM_INC)
38                        AC_SUBST(PM_CFLAGS)
39                        AC_SUBST(PM_LIBS)
40                        AC_SUBST(PM_LDFLAGS)
41
42                        AC_DEFINE(HAVE_POLYMAKE,1,[Define if POLYMAKE is installed])
43
44      AC_MSG_CHECKING([polymake includes])
45      AC_MSG_RESULT($PM_INC)
46      AC_MSG_CHECKING([polymake cflags])
47      AC_MSG_RESULT($PM_CFLAGS)
48      AC_MSG_CHECKING([polymake libs])
49      AC_MSG_RESULT($PM_LIBS)
50      AC_MSG_CHECKING([polymake ldflags])
51      AC_MSG_RESULT($PM_LDFLAGS)
52
53    else
54      PASSED_ALL_TEST_FOR_POLYMAKE="no";
55      AC_MSG_RESULT([no])
56      AC_MSG_ERROR([outdated polymake version])
57    fi
58   else
59    PASSED_ALL_TEST_FOR_POLYMAKE="no";
60    AC_MSG_RESULT([no])
61    AC_MSG_ERROR([polymake not installed])
62   fi
63  fi
64else
65  PASSED_ALL_TEST_FOR_POLYMAKE="no";
66  AC_MSG_RESULT(no)
67fi
68
69AM_CONDITIONAL(SING_HAVE_POLYMAKE, test "x$PASSED_ALL_TEST_FOR_POLYMAKE" = xyes)
70
71])
Note: See TracBrowser for help on using the repository browser.