isl_seq_normalize: use pre-allocated temporary variable in isl_ctx
[isl.git] / configure.ac
blobc1fbe28cc6f9f9aab9856694fe072e8ed5b30b03
1 AC_INIT
2 AC_CONFIG_AUX_DIR([.])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE(isl, 0.00)
6 AC_PROG_CC
8 AC_PROG_LIBTOOL
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)
17 AC_SUBST(GMP_LDFLAGS)
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
28 ],[#include <gmp.h>])
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)
34 have_polylib=false
35 AC_SUBST(POLYLIB_CPPFLAGS)
36 AC_SUBST(POLYLIB_LDFLAGS)
37 AC_SUBST(POLYLIB_LIBS)
38 case "$with_polylib" in
39         build)
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
45                                 isl_cv_polylib=ok
46                         fi
47                 done
48                 if test "$isl_cv_polylib" = "missing"; then
49                         AC_MSG_ERROR(no gmp polylib configured)
50                 fi
51                 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
52                 POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
53         ;;
54         system)
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"
59                 fi
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)
66                 ])
67                 CPPFLAGS="$SAVE_CPPFLAGS"
68                 LDFLAGS="$SAVE_LDFLAGS"
69         ;;
70         no)
71         ;;
72         *)
73                 AC_MSG_ERROR(unsupported)
74         ;;
75 esac
76 if test "$with_polylib" != "no"; then
77         AC_DEFINE(ISL_POLYLIB,,polylib is available)
78         have_polylib=true
80 AM_CONDITIONAL(HAVE_POLYLIB, test x$have_polylib = xtrue)
82 AX_SUBMODULE(piplib,no|system|build|bundled,no)
84 have_piplib=false
85 AC_SUBST(PIPLIB_CPPFLAGS)
86 AC_SUBST(PIPLIB_LDFLAGS)
87 AC_SUBST(PIPLIB_LIBS)
88 case "$with_piplib" in
89         bundled)
90                 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include"
91                 isl_configure_args="$isl_configure_args --with-bits=gmp"
92         ;;
93         build)
94                 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
95                 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
96         ;;
97         system)
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"
102                 fi
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>])
111                 ],[
112                         AC_MSG_ERROR([Piplib not found])
113                 ])
114                 CPPFLAGS="$SAVE_CPPFLAGS"
115                 LDFLAGS="$SAVE_LDFLAGS"
116         ;;
117         no)
118         ;;
119         *)
120                 AC_MSG_ERROR(unsupported)
121         ;;
122 esac
123 if test "$with_piplib" != "no"; then
124         AC_DEFINE(ISL_PIPLIB,,piplib is available)
125         have_piplib=true
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"
141 AC_OUTPUT