mark some functions as requiring use of return value
[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.01)
5 AC_SUBST(versioninfo)
6 versioninfo=1:0:0
7
8 AC_PROG_CC
9
10 AX_CC_MAXOPT
11 AX_GCC_WARN_UNUSED_RESULT
12
13 AC_PROG_LIBTOOL
14
15 AC_CHECK_PROG(PERL, perl, perl, [])
16 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
17 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
18
19 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
20
21 AX_CREATE_STDINT_H(include/isl_stdint.h)
22
23 AX_SUBMODULE(gmp,system,system)
24
25 AC_SUBST(GMP_CPPFLAGS)
26 AC_SUBST(GMP_LDFLAGS)
27 if test "x$with_gmp_prefix" != "x"; then
28         isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
29         GMP_CPPFLAGS="-I$with_gmp_prefix/include"
30         GMP_LDFLAGS="-L$with_gmp_prefix/lib"
31 fi
32 SAVE_CPPFLAGS="$CPPFLAGS"
33 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
34 need_get_memory_functions=false
35 AC_CHECK_DECLS(mp_get_memory_functions,[],[
36         need_get_memory_functions=true
37 ],[#include <gmp.h>])
38 CPPFLAGS="$SAVE_CPPFLAGS"
39 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
40
41 AX_SUBMODULE(polylib,no|system|build,no)
42
43 have_polylib=false
44 AC_SUBST(POLYLIB_CPPFLAGS)
45 AC_SUBST(POLYLIB_LDFLAGS)
46 AC_SUBST(POLYLIB_LIBS)
47 case "$with_polylib" in
48         build)
49                 polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
50                 AC_MSG_NOTICE(Configured polylibs: $polylibs)
51                 isl_cv_polylib=missing
52                 for bits in $polylibs; do
53                         if test "$bits" = "libpolylibgmp.la"; then
54                                 isl_cv_polylib=ok
55                         fi
56                 done
57                 if test "$isl_cv_polylib" = "missing"; then
58                         AC_MSG_ERROR(no gmp polylib configured)
59                 fi
60                 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
61                 POLYLIB_LIBS="$with_polylib_builddir/libpolylibgmp.la"
62         ;;
63         system)
64                 POLYLIB_LIBS="-lpolylibgmp"
65                 if test "x$with_polylib_prefix" != "x"; then
66                         POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
67                         POLYLIB_LDFLAGS="-L$with_polylib_prefix/lib"
68                 fi
69                 SAVE_CPPFLAGS="$CPPFLAGS"
70                 SAVE_LDFLAGS="$LDFLAGS"
71                 CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
72                 LDFLAGS="$POLYLIB_LDFLAGS $LDFLAGS"
73                 AC_CHECK_LIB(polylibgmp, PolyhedronTSort,[ true ],[
74                         AC_MSG_ERROR(Need polylib)
75                 ])
76                 CPPFLAGS="$SAVE_CPPFLAGS"
77                 LDFLAGS="$SAVE_LDFLAGS"
78         ;;
79         no)
80         ;;
81         *)
82                 AC_MSG_ERROR(unsupported)
83         ;;
84 esac
85 if test "$with_polylib" != "no"; then
86         AC_DEFINE(ISL_POLYLIB,,polylib is available)
87         have_polylib=true
88 fi
89 AM_CONDITIONAL(HAVE_POLYLIB, test x$have_polylib = xtrue)
90
91 AX_SUBMODULE(piplib,no|system|build|bundled,no)
92
93 have_piplib=false
94 AC_SUBST(PIPLIB_CPPFLAGS)
95 AC_SUBST(PIPLIB_LDFLAGS)
96 AC_SUBST(PIPLIB_LIBS)
97 case "$with_piplib" in
98         bundled)
99                 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include"
100                 isl_configure_args="$isl_configure_args --with-bits=gmp"
101         ;;
102         build)
103                 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
104                 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
105         ;;
106         system)
107                 PIPLIB_LIBS="-lpiplibMP"
108                 if test "x$with_piplib_prefix" != "x"; then
109                         PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
110                         PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
111                 fi
112                 SAVE_CPPFLAGS="$CPPFLAGS"
113                 SAVE_LDFLAGS="$LDFLAGS"
114                 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
115                 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
116                 AC_CHECK_LIB(piplibMP, pip_solve,[
117                         AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
118                                 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
119                         ],[#include <piplib/piplibMP.h>])
120                 ],[
121                         AC_MSG_ERROR([Piplib not found])
122                 ])
123                 CPPFLAGS="$SAVE_CPPFLAGS"
124                 LDFLAGS="$SAVE_LDFLAGS"
125         ;;
126         no)
127         ;;
128         *)
129                 AC_MSG_ERROR(unsupported)
130         ;;
131 esac
132 if test "$with_piplib" != "no"; then
133         AC_DEFINE(ISL_PIPLIB,,piplib is available)
134         have_piplib=true
135 fi
136 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
137 AM_CONDITIONAL(BUNDLED_PIPLIB, test $with_piplib = bundled)
138
139 PACKAGE_CFLAGS="-I$prefix/include/isl"
140 AX_CREATE_PKGCONFIG_INFO
141
142 AC_CONFIG_HEADERS(config.h)
143 AC_CONFIG_HEADERS(include/isl_config.h)
144 AC_CONFIG_FILES(Makefile)
145 AC_CONFIG_FILES(doc/Makefile)
146 if test $with_piplib = bundled; then
147         AC_CONFIG_SUBDIRS(piplib)
148 fi
149 AC_CONFIG_COMMANDS_POST([
150         dnl pass on arguments to subdir configures, but don't
151         dnl add them to config.status
152         ac_configure_args="$ac_configure_args $isl_configure_args"
153 ])
154 AC_OUTPUT