2 AM_INIT_AUTOMAKE(isl, 0.00)
8 AX_CREATE_STDINT_H(include/isl_stdint.h)
10 AC_ARG_WITH(gmp_prefix,
11 [AS_HELP_STRING([--with-gmp-prefix=DIR],
12 [Location of GMP installation])])
14 AC_SUBST(GMP_CPPFLAGS)
16 if test "x$with_gmp_prefix" != "x"; then
17 isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
18 GMP_CPPFLAGS="-I$with_gmp_prefix/include"
19 GMP_LDFLAGS="-L$with_gmp_prefix/lib"
21 SAVE_CPPFLAGS="$CPPFLAGS"
22 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
23 need_get_memory_functions=false
24 AC_CHECK_DECLS(mp_get_memory_functions,[],[
25 need_get_memory_functions=true
27 CPPFLAGS="$SAVE_CPPFLAGS"
28 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
30 AC_DEFUN([ISL_SUBMODULE],[
31 AC_ARG_WITH($1_prefix,
32 [AS_HELP_STRING([--with-$1-prefix=DIR],
33 [Location of system $1])])
34 AC_ARG_WITH($1_builddir,
35 [AS_HELP_STRING([--with-$1-builddir=DIR],
36 [Location of $1 builddir])])
37 if test "x$with_$1_prefix" != "x"; then
38 if test "x$with_$1" != "x" -a "x$with_$1" != "xsystem"; then
39 AC_MSG_ERROR([Setting $with_$1_prefix implies use of system $1])
43 if test "x$with_$1_builddir" != "x"; then
44 if test "x$with_$1" != "x" -a "x$with_$1" != "xbuild"; then
45 AC_MSG_ERROR([Setting $with_$1_builddir implies use of build $1])
48 $1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-`
49 AC_MSG_NOTICE($1 sources in $$1_srcdir)
52 no|bundled|system|build)
55 if test -d $srcdir/.git -a \
57 ! -d $srcdir/$1/.git; then
59 [git repo detected, but submodule $1 not initialized])
60 AC_MSG_WARN([You may want to run])
61 AC_MSG_WARN([ git submodule init])
62 AC_MSG_WARN([ git submodule update])
63 AC_MSG_WARN([ sh autogen.sh])
65 if test -f $srcdir/$1/configure; then
73 [AS_HELP_STRING([--with-polylib=build|system|no],
74 [Which PolyLib to use])])
75 ISL_SUBMODULE(polylib)
76 if test "x$with_polylib" = "x"; then
79 AC_MSG_CHECKING([which polylib to use])
80 AC_MSG_RESULT($with_polylib)
83 AC_SUBST(POLYLIB_CPPFLAGS)
84 AC_SUBST(POLYLIB_LDFLAGS)
85 AC_SUBST(POLYLIB_LIBS)
86 case "$with_polylib" in
88 polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
89 AC_MSG_NOTICE(Configured polylibs: $polylibs)
90 isl_cv_polylib=missing
91 for bits in $polylibs; do
92 if test "$bits" = "libpolylibgmp.la"; then
96 if test "$isl_cv_polylib" = "missing"; then
97 AC_MSG_ERROR(no gmp polylib configured)
99 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
100 POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
103 POLYLIB_LIBS="-lpolylibgmp"
104 if test "x$with_polylib_prefix" != "x"; then
105 POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
106 POLYLIB_LDFLAGS="-L$with_polylib_prefix/lib"
108 SAVE_CPPFLAGS="$CPPFLAGS"
109 SAVE_LDFLAGS="$LDFLAGS"
110 CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
111 LDFLAGS="$POLYLIB_LDFLAGS $LDFLAGS"
112 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[ true ],[
113 AC_MSG_ERROR(Need polylib)
115 CPPFLAGS="$SAVE_CPPFLAGS"
116 LDFLAGS="$SAVE_LDFLAGS"
121 AC_MSG_ERROR(unsupported)
124 if test "$with_polylib" != "no"; then
125 AC_DEFINE(ISL_POLYLIB,,polylib is available)
128 AM_CONDITIONAL(HAVE_POLYLIB, test x$have_polylib = xtrue)
131 [AS_HELP_STRING([--with-piplib=build|bundled|system|no],
132 [Which piplib to use])])
133 ISL_SUBMODULE(piplib)
134 if test "x$with_piplib" = "x"; then
137 AC_MSG_CHECKING([which piplib to use])
138 AC_MSG_RESULT($with_piplib)
141 AC_SUBST(PIPLIB_CPPFLAGS)
142 AC_SUBST(PIPLIB_LDFLAGS)
143 AC_SUBST(PIPLIB_LIBS)
144 case "$with_piplib" in
146 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include"
147 isl_configure_args="$isl_configure_args --enable-mp-version"
150 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
151 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
154 PIPLIB_LIBS="-lpiplibMP"
155 if test "x$with_piplib_prefix" != "x"; then
156 PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
157 PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
159 SAVE_CPPFLAGS="$CPPFLAGS"
160 SAVE_LDFLAGS="$LDFLAGS"
161 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
162 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
163 AC_CHECK_LIB(piplibMP, pip_solve,[
164 AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
165 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
166 ],[#include <piplib/piplibMP.h>])
168 AC_MSG_ERROR([Piplib not found])
170 CPPFLAGS="$SAVE_CPPFLAGS"
171 LDFLAGS="$SAVE_LDFLAGS"
176 AC_MSG_ERROR(unsupported)
179 if test "$with_piplib" != "no"; then
180 AC_DEFINE(ISL_PIPLIB,,piplib is available)
183 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
184 AM_CONDITIONAL(BUNDLED_PIPLIB, test $with_piplib = bundled)
186 AC_CONFIG_HEADERS(config.h)
187 AC_CONFIG_HEADERS(include/isl_ctx.h)
188 AC_CONFIG_FILES(Makefile)
189 if test $with_piplib = bundled; then
190 AC_CONFIG_SUBDIRS(piplib)
192 AC_CONFIG_COMMANDS_POST([
193 dnl pass on arguments to subdir configures, but don't
194 ac_configure_args="$ac_configure_args $isl_configure_args"
195 ac_configure_args="$ac_configure_args $isl_configure_args"