isl_map_intersect_{domain,range}: allow intersection with parameter constraints
[isl.git] / configure.ac
blobe084a75b37da7101f9d29904d6c96d4afc9f0934
1 AC_INIT
2 AM_INIT_AUTOMAKE(isl, 0.00)
4 AC_PROG_CC
6 AC_PROG_LIBTOOL
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)
15 AC_SUBST(GMP_LDFLAGS)
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
26 ],[#include <gmp.h>])
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])
40                 fi
41                 with_$1="system"
42         fi
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])
46                 fi
47                 with_$1="build"
48                 $1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-`
49                 AC_MSG_NOTICE($1 sources in $$1_srcdir)
50         fi
51         case "$with_$1" in
52         no|bundled|system|build)
53                 ;;
54         *)
55                 if test -d $srcdir/.git -a \
56                         -d $srcdir/$1 -a \
57                         ! -d $srcdir/$1/.git; then
58                         AC_MSG_WARN(
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])
64                 fi
65                 if test -f $srcdir/$1/configure; then
66                         with_$1="bundled"
67                 fi
68                 ;;
69         esac
72 AC_ARG_WITH(polylib,
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
77         with_polylib="no"
79 AC_MSG_CHECKING([which polylib to use])
80 AC_MSG_RESULT($with_polylib)
82 have_polylib=false
83 AC_SUBST(POLYLIB_CPPFLAGS)
84 AC_SUBST(POLYLIB_LDFLAGS)
85 AC_SUBST(POLYLIB_LIBS)
86 case "$with_polylib" in
87         build)
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
93                                 isl_cv_polylib=ok
94                         fi
95                 done
96                 if test "$isl_cv_polylib" = "missing"; then
97                         AC_MSG_ERROR(no gmp polylib configured)
98                 fi
99                 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
100                 POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
101         ;;
102         system)
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"
107                 fi
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)
114                 ])
115                 CPPFLAGS="$SAVE_CPPFLAGS"
116                 LDFLAGS="$SAVE_LDFLAGS"
117         ;;
118         no)
119         ;;
120         *)
121                 AC_MSG_ERROR(unsupported)
122         ;;
123 esac
124 if test "$with_polylib" != "no"; then
125         AC_DEFINE(ISL_POLYLIB,,polylib is available)
126         have_polylib=true
128 AM_CONDITIONAL(HAVE_POLYLIB, test x$have_polylib = xtrue)
130 AC_ARG_WITH(piplib,
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
135         with_piplib="system"
137 AC_MSG_CHECKING([which piplib to use])
138 AC_MSG_RESULT($with_piplib)
140 have_piplib=false
141 AC_SUBST(PIPLIB_CPPFLAGS)
142 AC_SUBST(PIPLIB_LDFLAGS)
143 AC_SUBST(PIPLIB_LIBS)
144 case "$with_piplib" in
145         bundled)
146                 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include"
147                 isl_configure_args="$isl_configure_args --enable-mp-version"
148         ;;
149         build)
150                 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
151                 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
152         ;;
153         system)
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"
158                 fi
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>])
167                 ],[
168                         AC_MSG_ERROR([Piplib not found])
169                 ])
170                 CPPFLAGS="$SAVE_CPPFLAGS"
171                 LDFLAGS="$SAVE_LDFLAGS"
172         ;;
173         no)
174         ;;
175         *)
176                 AC_MSG_ERROR(unsupported)
177         ;;
178 esac
179 if test "$with_piplib" != "no"; then
180         AC_DEFINE(ISL_PIPLIB,,piplib is available)
181         have_piplib=true
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"
197 AC_OUTPUT