sample.c: Polyhedron_RemoveFixedColumns: correctly set NbEq in new polyhedron
[barvinok.git] / bernstein / configure.in
blobbed7c25e2a6958224c70865198dcc1c8a013e229
1 AC_INIT
2 AC_CONFIG_AUX_DIR(.)
3 AM_INIT_AUTOMAKE(bernstein, 0.02)
4 AC_SUBST(versioninfo)
5 versioninfo=1:0:0
7 AC_CANONICAL_HOST
8 AC_PROG_LIBTOOL
10 AC_ARG_WITH(default-prefix,
11         AS_HELP_STRING([--with-default-prefix=DIR],
12             [Default installation prefix of optional packages]))
13 if test "${with_default_prefix+set}" = set; then
14         if test "${with_libgmp+set}" != set -a \
15            -f "$with_default_prefix/include/gmp.h"; then
16                 with_libgmp=$with_default_prefix
17         fi
18         if test "${with_polylib+set}" != set -a \
19            -f "$with_default_prefix/include/polylib/polylibgmp.h"; then
20                 with_polylib=$with_default_prefix
21         fi
24 dnl Check for GMP library
25 AC_MSG_CHECKING(whether to use GMP)
26 AC_ARG_WITH(libgmp, 
27         [  --with-libgmp           DIR Location of the GMP Distribution], 
28         gmp_package=$withval, gmp_package=yes)
29 if test "x$gmp_package" = "xno"; then
30         AC_MSG_RESULT(no)
31         AC_MSG_ERROR(Need gmp)
32 else
33         AC_MSG_RESULT(yes)
34         if test "x$gmp_package" != "xyes"; then
35             GMP_DIR=$gmp_package
36             if test ! -d "$GMP_DIR"; then
37                 AC_ERROR(Directory given for GMP Distribution is not a directory)
38             fi
39             CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
40             LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
41         fi
42         poly_cv_gmpfatal="no"
43         AC_CHECK_HEADER(gmp.h,
44                 [AC_CHECK_LIB(gmp,main,
45                     [],
46                     [poly_cv_gmpfatal="yes"])],
47                 [poly_cv_gmpfatal="yes"])
48         if test "$poly_cv_gmpfatal" = "yes"; then
49                 AC_MSG_ERROR([GMP not found])
50         fi
53 AC_ARG_WITH(polylib,
54             [  --with-polylib=DIR      DIR Location of PolyLib],
55             [ echo "Package polylib : $withval" && polylib_package=$withval],  
56             [ polylib_package=yes ])
58 if test "$polylib_package" = "no"; then
59     AC_MSG_ERROR(Need polylib)
62 if test "$polylib_package" != "yes"; then
63     CPPFLAGS="-I$polylib_package/include $CPPFLAGS"
64     LDFLAGS="-L$polylib_package/lib $LDFLAGS"
65     LD_LIBRARY_PATH="$polylib_package/lib:$LD_LIBRARY_PATH"
66     export LD_LIBRARY_PATH
69 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[],[
70     AC_MSG_ERROR(Need polylib)
73 AC_LANG_PUSH(C++)
74 AM_PATH_GINAC(1.3.3, [], [
75     AC_MSG_ERROR(Need GiNaC)
77 AC_LANG_POP
79 AC_CONFIG_HEADERS(config.h)
80 AC_OUTPUT(Makefile)