source: git/m4/gfanlib-check.m4 @ 138612

spielwiese
Last change on this file since 138612 was 138612, checked in by Jakob Kröker <kroeker@…>, 9 years ago
use g++ instead of gcc for libcddgmp check - otherwise the check fails on some systems
  • Property mode set to 100644
File size: 1.8 KB
Line 
1# gfanlib.m4
2
3AC_DEFUN([SING_CHECK_GFANLIB],
4[
5
6AC_ARG_ENABLE(gfanlib,
7AS_HELP_STRING([--enable-gfanlib], [Enables gfanlib, a package for basic convex geometry]),
8[ENABLE_GFANLIB="$enableval"],
9[ENABLE_GFANLIB=""])
10
11AC_MSG_CHECKING(whether to check for gfanlib)
12
13if test "x$ENABLE_GFANLIB" != "xno"; then
14 AC_MSG_RESULT([yes])
15
16 AC_CHECK_HEADERS([setoper.h cdd/setoper.h cddlib/setoper.h])
17
18 if test "x$ac_cv_header_setoper_h" = xno -a "x$ac_cv_header_cdd_setoper_h" = xno -a "x$ac_cv_header_cddlib_setoper_h" = xno; then
19   AC_MSG_WARN([Note that setoper.h is missing!])
20 fi
21
22 AC_MSG_CHECKING([whether libcddgmp is usable])
23
24 BACKUP_LIBS=$LIBS
25
26 LIBS="$LIBS -lcddgmp $GMP_LIBS "
27
28 AC_LANG_PUSH(C++)
29 AC_LINK_IFELSE(
30  [
31   AC_LANG_PROGRAM(
32    [
33    #define GMPRATIONAL
34     #ifdef HAVE_SETOPER_H
35     # include <setoper.h>
36     # include <cdd.h>
37     #endif
38     #ifdef HAVE_CDD_SETOPER_H
39     # include <cdd/setoper.h>
40     # include <cdd/cdd.h>
41     #endif
42     #ifdef HAVE_CDDLIB_SETOPER_H
43     # include <cddlib/setoper.h>
44     # include <cddlib/cdd.h>
45     #endif
46    ], [dd_set_global_constants(); dd_log=dd_FALSE; ]
47    )
48  ],
49  [PASSED_ALL_TESTS_FOR_GFANLIB="1"] [CDDGMPLDFLAGS="-lcddgmp $GMP_LIBS"]  [CDDGMPCPPFLAGS="-DGMPRATIONAL"],
50  [PASSED_ALL_TESTS_FOR_GFANLIB="0"]
51 )
52 AC_LANG_POP()
53
54 LIBS=$BACKUP_LIBS
55
56 if test "x$PASSED_ALL_TESTS_FOR_GFANLIB" = x1; then
57  AC_MSG_RESULT([yes])
58  AC_SUBST(CDDGMPLDFLAGS)
59  AC_SUBST(CDDGMPCPPFLAGS)
60 else
61  AC_MSG_RESULT([no])
62  if test "x$ENABLE_GFANLIB" = "xyes"; then
63   AC_MSG_ERROR([Error, could not use libcddgmp])
64  fi
65 fi
66else
67 AC_MSG_RESULT(no)
68 PASSED_ALL_TESTS_FOR_GFANLIB="0"
69fi
70
71
72
73AM_CONDITIONAL(HAVE_GFANLIB, test "x$PASSED_ALL_TESTS_FOR_GFANLIB" = x1)
74AC_DEFINE_UNQUOTED(HAVE_GFANLIB, ${PASSED_ALL_TESTS_FOR_GFANLIB}, [whether gfanlib support is enabled])
75
76])
Note: See TracBrowser for help on using the repository browser.