3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE(isl, 0.00)
10 AX_CREATE_STDINT_H(include/isl_stdint.h)
12 AC_ARG_WITH(gmp_prefix,
13 [AS_HELP_STRING([--with-gmp-prefix=DIR],
14 [Location of GMP installation])])
16 AC_SUBST(GMP_CPPFLAGS)
18 if test "x$with_gmp_prefix" != "x"; then
19 isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
20 GMP_CPPFLAGS="-I$with_gmp_prefix/include"
21 GMP_LDFLAGS="-L$with_gmp_prefix/lib"
23 SAVE_CPPFLAGS="$CPPFLAGS"
24 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
25 need_get_memory_functions=false
26 AC_CHECK_DECLS(mp_get_memory_functions,[],[
27 need_get_memory_functions=true
29 CPPFLAGS="$SAVE_CPPFLAGS"
30 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
32 AX_SUBMODULE(polylib,no|system|build,no)
35 AC_SUBST(POLYLIB_CPPFLAGS)
36 AC_SUBST(POLYLIB_LDFLAGS)
37 AC_SUBST(POLYLIB_LIBS)
38 case "$with_polylib" in
40 polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
41 AC_MSG_NOTICE(Configured polylibs: $polylibs)
42 isl_cv_polylib=missing
43 for bits in $polylibs; do
44 if test "$bits" = "libpolylibgmp.la"; then
48 if test "$isl_cv_polylib" = "missing"; then
49 AC_MSG_ERROR(no gmp polylib configured)
51 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
52 POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
55 POLYLIB_LIBS="-lpolylibgmp"
56 if test "x$with_polylib_prefix" != "x"; then
57 POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
58 POLYLIB_LDFLAGS="-L$with_polylib_prefix/lib"
60 SAVE_CPPFLAGS="$CPPFLAGS"
61 SAVE_LDFLAGS="$LDFLAGS"
62 CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
63 LDFLAGS="$POLYLIB_LDFLAGS $LDFLAGS"
64 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[ true ],[
65 AC_MSG_ERROR(Need polylib)
67 CPPFLAGS="$SAVE_CPPFLAGS"
68 LDFLAGS="$SAVE_LDFLAGS"
73 AC_MSG_ERROR(unsupported)
76 if test "$with_polylib" != "no"; then
77 AC_DEFINE(ISL_POLYLIB,,polylib is available)
80 AM_CONDITIONAL(HAVE_POLYLIB, test x$have_polylib = xtrue)
82 AX_SUBMODULE(piplib,no|system|build|bundled,no)
85 AC_SUBST(PIPLIB_CPPFLAGS)
86 AC_SUBST(PIPLIB_LDFLAGS)
88 case "$with_piplib" in
90 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include"
91 isl_configure_args="$isl_configure_args --with-bits=gmp"
94 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
95 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
98 PIPLIB_LIBS="-lpiplibMP"
99 if test "x$with_piplib_prefix" != "x"; then
100 PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
101 PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
103 SAVE_CPPFLAGS="$CPPFLAGS"
104 SAVE_LDFLAGS="$LDFLAGS"
105 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
106 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
107 AC_CHECK_LIB(piplibMP, pip_solve,[
108 AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
109 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
110 ],[#include <piplib/piplibMP.h>])
112 AC_MSG_ERROR([Piplib not found])
114 CPPFLAGS="$SAVE_CPPFLAGS"
115 LDFLAGS="$SAVE_LDFLAGS"
120 AC_MSG_ERROR(unsupported)
123 if test "$with_piplib" != "no"; then
124 AC_DEFINE(ISL_PIPLIB,,piplib is available)
127 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
128 AM_CONDITIONAL(BUNDLED_PIPLIB, test $with_piplib = bundled)
130 AC_CONFIG_HEADERS(config.h)
131 AC_CONFIG_HEADERS(include/isl_ctx.h)
132 AC_CONFIG_FILES(Makefile)
133 if test $with_piplib = bundled; then
134 AC_CONFIG_SUBDIRS(piplib)
136 AC_CONFIG_COMMANDS_POST([
137 dnl pass on arguments to subdir configures, but don't
138 ac_configure_args="$ac_configure_args $isl_configure_args"
139 ac_configure_args="$ac_configure_args $isl_configure_args"