isl_tab_pip.c: add_lexmin_eq: return int instead of isl_tab *
[platform/upstream/isl.git] / configure.ac
1 AC_INIT
2 AC_CONFIG_AUX_DIR([.])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE(isl, 0.06)
5 AM_SILENT_RULES([yes])
6 AC_SUBST(versioninfo)
7 versioninfo=6:0:0
8
9 AC_PROG_CC
10
11 AX_CC_MAXOPT
12 AX_GCC_WARN_UNUSED_RESULT
13
14 AC_PROG_LIBTOOL
15
16 AC_CHECK_PROG(PERL, perl, perl, [])
17 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
18 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
19
20 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
21
22 AX_CREATE_STDINT_H(include/isl/stdint.h)
23
24 AX_SUBMODULE(gmp,system,system)
25
26 AC_SUBST(GMP_CPPFLAGS)
27 AC_SUBST(GMP_LDFLAGS)
28 if test "x$with_gmp_prefix" != "x"; then
29         isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
30         GMP_CPPFLAGS="-I$with_gmp_prefix/include"
31         GMP_LDFLAGS="-L$with_gmp_prefix/lib"
32 fi
33 SAVE_CPPFLAGS="$CPPFLAGS"
34 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
35 need_get_memory_functions=false
36 AC_CHECK_DECLS(mp_get_memory_functions,[],[
37         need_get_memory_functions=true
38 ],[#include <gmp.h>])
39 CPPFLAGS="$SAVE_CPPFLAGS"
40 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
41
42 AX_SUBMODULE(piplib,no|system|build,no)
43
44 have_piplib=false
45 AC_SUBST(PIPLIB_CPPFLAGS)
46 AC_SUBST(PIPLIB_LDFLAGS)
47 AC_SUBST(PIPLIB_LIBS)
48 case "$with_piplib" in
49         build)
50                 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
51                 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
52         ;;
53         system)
54                 PIPLIB_LIBS="-lpiplibMP"
55                 if test "x$with_piplib_prefix" != "x"; then
56                         PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
57                         PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
58                 fi
59                 SAVE_CPPFLAGS="$CPPFLAGS"
60                 SAVE_LDFLAGS="$LDFLAGS"
61                 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
62                 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
63                 AC_CHECK_LIB(piplibMP, pip_solve,[
64                         AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
65                                 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
66                         ],[#include <piplib/piplibMP.h>])
67                 ],[
68                         AC_MSG_ERROR([Piplib not found])
69                 ])
70                 CPPFLAGS="$SAVE_CPPFLAGS"
71                 LDFLAGS="$SAVE_LDFLAGS"
72         ;;
73         no)
74         ;;
75         *)
76                 AC_MSG_ERROR(unsupported)
77         ;;
78 esac
79 if test "$with_piplib" != "no"; then
80         AC_DEFINE(ISL_PIPLIB,,piplib is available)
81         have_piplib=true
82 fi
83 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
84
85 AX_CREATE_PKGCONFIG_INFO
86
87 AX_DETECT_GIT_HEAD
88 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
89
90 AC_CONFIG_HEADERS(isl_config.h)
91 AC_CONFIG_HEADERS(include/isl/config.h)
92 AC_CONFIG_FILES(Makefile)
93 AC_CONFIG_FILES(doc/Makefile)
94 AC_CONFIG_COMMANDS_POST([
95         dnl pass on arguments to subdir configures, but don't
96         dnl add them to config.status
97         ac_configure_args="$ac_configure_args $isl_configure_args"
98 ])
99 AC_OUTPUT