isl_dim_tuple_match: handle NULL input
[isl.git] / configure.ac
blob6b59807d82fad60eeb1796e436d2abbd30e922fb
1 AC_INIT([isl], [0.07], [isl-development@googlegroups.com])
2 AC_CONFIG_AUX_DIR([.])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE([foreign])
5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
6 AC_SUBST(versioninfo)
7 versioninfo=7:0:0
9 AC_PROG_CC
11 AX_CC_MAXOPT
12 AX_GCC_WARN_UNUSED_RESULT
13 AX_C___ATTRIBUTE__
15 AC_PROG_LIBTOOL
17 AC_CHECK_PROG(PERL, perl, perl, [])
18 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
19 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
21 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
23 AX_CREATE_STDINT_H(include/isl/stdint.h)
25 AX_SUBMODULE(gmp,system,system)
27 AC_SUBST(GMP_CPPFLAGS)
28 AC_SUBST(GMP_LDFLAGS)
29 if test "x$with_gmp_prefix" != "x"; then
30         isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
31         GMP_CPPFLAGS="-I$with_gmp_prefix/include"
32         GMP_LDFLAGS="-L$with_gmp_prefix/lib"
34 SAVE_CPPFLAGS="$CPPFLAGS"
35 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
36 need_get_memory_functions=false
37 AC_CHECK_DECLS(mp_get_memory_functions,[],[
38         need_get_memory_functions=true
39 ],[#include <gmp.h>])
40 CPPFLAGS="$SAVE_CPPFLAGS"
41 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
43 AX_SUBMODULE(piplib,no|system|build,no)
45 have_piplib=false
46 AC_SUBST(PIPLIB_CPPFLAGS)
47 AC_SUBST(PIPLIB_LDFLAGS)
48 AC_SUBST(PIPLIB_LIBS)
49 case "$with_piplib" in
50         build)
51                 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
52                 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
53         ;;
54         system)
55                 PIPLIB_LIBS="-lpiplibMP"
56                 if test "x$with_piplib_prefix" != "x"; then
57                         PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
58                         PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
59                 fi
60                 SAVE_CPPFLAGS="$CPPFLAGS"
61                 SAVE_LDFLAGS="$LDFLAGS"
62                 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
63                 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
64                 AC_CHECK_LIB(piplibMP, pip_solve,[
65                         AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
66                                 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
67                         ],[#include <piplib/piplibMP.h>])
68                 ],[
69                         AC_MSG_ERROR([Piplib not found])
70                 ])
71                 CPPFLAGS="$SAVE_CPPFLAGS"
72                 LDFLAGS="$SAVE_LDFLAGS"
73         ;;
74         no)
75         ;;
76         *)
77                 AC_MSG_ERROR(unsupported)
78         ;;
79 esac
80 if test "$with_piplib" != "no"; then
81         AC_DEFINE(ISL_PIPLIB,,piplib is available)
82         have_piplib=true
84 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
86 AX_SET_WARNING_FLAGS
88 AC_SUBST(WARNING_FLAGS)
90 PACKAGE_CFLAGS="$GMP_CPPFLAGS"
91 PACKAGE_LDFLAGS="$GMP_LDFLAGS"
92 PACKAGE_LIBS="-lisl -lgmp"
93 AX_CREATE_PKGCONFIG_INFO
95 AX_DETECT_GIT_HEAD
96 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
98 AH_BOTTOM([#include <isl_config_post.h>])
99 AC_CONFIG_HEADERS(isl_config.h)
100 AC_CONFIG_HEADERS(include/isl/config.h)
101 AC_CONFIG_FILES(Makefile)
102 AC_CONFIG_FILES(doc/Makefile)
103 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
104 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
105 AC_CONFIG_COMMANDS_POST([
106         dnl pass on arguments to subdir configures, but don't
107         dnl add them to config.status
108         ac_configure_args="$ac_configure_args $isl_configure_args"
110 AC_OUTPUT