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

spielwiese
Last change on this file since bd9a41 was bd9a41, checked in by Hans Schoenemann <hannes@…>, 8 years ago
add: POLYMAKEVERSION (for example "214") to libsingular.h
  • Property mode set to 100644
File size: 2.2 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="212"
33    CURRENTPOLYMAKEVERSION=`polymake-config --version | cut -c -4 -| 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
42      AC_DEFINE_UNQUOTED(POLYMAKEVERSION,"$CURRENTPOLYMAKEVERSION",[check the polymake version])
43      AC_SUBST(PM_INC)
44      AC_SUBST(PM_CFLAGS)
45      AC_SUBST(PM_LIBS)
46      AC_SUBST(PM_LDFLAGS)
47
48      AC_DEFINE(HAVE_POLYMAKE,1,[Define if POLYMAKE is installed])
49
50      AC_MSG_CHECKING([polymake includes])
51      AC_MSG_RESULT($PM_INC)
52      AC_MSG_CHECKING([polymake cflags])
53      AC_MSG_RESULT($PM_CFLAGS)
54      AC_MSG_CHECKING([polymake libs])
55      AC_MSG_RESULT($PM_LIBS)
56      AC_MSG_CHECKING([polymake ldflags])
57      AC_MSG_RESULT($PM_LDFLAGS)
58
59      PASSED_ALL_TEST_FOR_POLYMAKE="yes";
60    else
61      PASSED_ALL_TEST_FOR_POLYMAKE="no";
62
63      if test "x$ENABLE_POLYMAKE" = xyes; then
64        AC_MSG_ERROR([outdated polymake version])
65      fi
66    fi
67   else
68    PASSED_ALL_TEST_FOR_POLYMAKE="no";
69
70    if test "x$ENABLE_POLYMAKE" = xyes; then
71     AC_MSG_ERROR([polymake not installed])
72    fi
73   fi
74  fi
75else
76  AC_MSG_RESULT(no)
77
78  PASSED_ALL_TEST_FOR_POLYMAKE="no";
79fi
80
81AM_CONDITIONAL(SING_HAVE_POLYMAKE, test "x$PASSED_ALL_TEST_FOR_POLYMAKE" != xno)
82
83])
Note: See TracBrowser for help on using the repository browser.