source: git/m4/gfanlib-check.m4 @ 24aeb0f

spielwiese
Last change on this file since 24aeb0f was 24aeb0f, checked in by Hans Schoenemann <hannes@…>, 10 years ago
fix: cddlib detection for fedora
  • Property mode set to 100644
File size: 1.6 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="yes"],
9[ENABLE_GFANLIB="no"])
10
11AC_MSG_CHECKING(whether to build with gfanlib)
12if test "x$ENABLE_GFANLIB" = xyes; then
13 AC_MSG_RESULT(yes)
14 AC_LANG_PUSH(C++)
15 SAVE_LIBS=$LIBS
16 LIBS="-lcddgmp $GMP_LIBS $LIBS"
17AC_LINK_IFELSE(
18  [AC_LANG_PROGRAM([#include <cdd/setoper.h>
19  #include <cdd/cdd.h>],
20    [dd_set_global_constants()])],
21  [LIBS="-lcddgmp $SAVE_LIBS"] [CDDGMPLDFLAGS="-lcddgmp"]
22  [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
23  [AC_MSG_WARN([libcddgmp is not installed.])]
24  [PASSED_ALL_TESTS_FOR_GFANLIB="no"
25  ]
26)
27if test "$PASSED_ALL_TESTS_FOR_GFANLIB" != yes; then
28AC_LINK_IFELSE(
29  [AC_LANG_PROGRAM([#include <setoper.h>
30  #include "cdd.h"],
31    [dd_set_global_constants()])],
32  [LIBS="$SAVE_LIBS -lcddgmp"] [CDDGMPLDFLAGS="-lcddgmp"]
33  [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
34  [AC_MSG_WARN([libcddgmp is not installed.])]
35  [PASSED_ALL_TESTS_FOR_GFANLIB="no"
36  ]
37)
38fi
39if test "$PASSED_ALL_TESTS_FOR_GFANLIB" != yes; then
40AC_LINK_IFELSE(
41  [AC_LANG_PROGRAM([#include <cddlib/setoper.h>
42  #include "cddlib/cdd.h"],
43    [dd_set_global_constants()])],
44  [LIBS="$SAVE_LIBS -lcddgmp"] [CDDGMPLDFLAGS="-lcddgmp"]
45  [PASSED_ALL_TESTS_FOR_GFANLIB="yes"],
46  [AC_MSG_WARN([libcddgmp is not installed.])]
47  [PASSED_ALL_TESTS_FOR_GFANLIB="no"
48  ]
49)
50fi
51  AC_LANG_POP()
52else
53 AC_MSG_RESULT(no)
54 PASSED_ALL_TESTS_FOR_GFANLIB="no";
55fi
56
57AM_CONDITIONAL(HAVE_GFANLIB, test "x$PASSED_ALL_TESTS_FOR_GFANLIB" = xyes)
58
59])
Note: See TracBrowser for help on using the repository browser.