1 AC_INIT([isl], [0.07], [isl-development@googlegroups.com])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE([foreign])
5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
13 AX_GCC_WARN_UNUSED_RESULT
18 AC_CHECK_PROG(PERL, perl, perl, [])
19 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
20 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
22 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
24 AX_CREATE_STDINT_H(include/isl/stdint.h)
26 AX_SUBMODULE(gmp,system,system)
28 AC_SUBST(GMP_CPPFLAGS)
30 if test "x$with_gmp_prefix" != "x"; then
31 isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
32 GMP_CPPFLAGS="-I$with_gmp_prefix/include"
33 GMP_LDFLAGS="-L$with_gmp_prefix/lib"
35 SAVE_CPPFLAGS="$CPPFLAGS"
36 CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
37 need_get_memory_functions=false
38 AC_CHECK_DECLS(mp_get_memory_functions,[],[
39 need_get_memory_functions=true
41 CPPFLAGS="$SAVE_CPPFLAGS"
42 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS, test x$need_get_memory_functions = xtrue)
44 AX_SUBMODULE(piplib,no|system|build,no)
47 AC_SUBST(PIPLIB_CPPFLAGS)
48 AC_SUBST(PIPLIB_LDFLAGS)
50 case "$with_piplib" in
52 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include"
53 PIPLIB_LIBS="$with_piplib_builddir/libpiplibMP.la"
56 PIPLIB_LIBS="-lpiplibMP"
57 if test "x$with_piplib_prefix" != "x"; then
58 PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
59 PIPLIB_LDFLAGS="-L$with_piplib_prefix/lib"
61 SAVE_CPPFLAGS="$CPPFLAGS"
62 SAVE_LDFLAGS="$LDFLAGS"
63 CPPFLAGS="$PIPLIB_CPPFLAGS $CPPFLAGS"
64 LDFLAGS="$PIPLIB_LDFLAGS $LDFLAGS"
65 AC_CHECK_LIB(piplibMP, pip_solve,[
66 AC_CHECK_MEMBER(PipOptions.Urs_parms, [], [
67 AC_MSG_ERROR([Piplib too old; please install version 1.3.6 or newer])
68 ],[#include <piplib/piplibMP.h>])
70 AC_MSG_ERROR([Piplib not found])
72 CPPFLAGS="$SAVE_CPPFLAGS"
73 LDFLAGS="$SAVE_LDFLAGS"
78 AC_MSG_ERROR(unsupported)
81 if test "$with_piplib" != "no"; then
82 AC_DEFINE(ISL_PIPLIB,,piplib is available)
85 AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
87 AC_SUBST(CLANG_CXXFLAGS)
88 AC_SUBST(CLANG_LDFLAGS)
90 AX_SUBMODULE(clang,system|no,no)
93 llvm_config="llvm-config"
94 AC_CHECK_PROG([llvm_config_found], ["$llvm_config"], [yes])
95 if test "x$with_clang_prefix" != "x"; then
96 llvm_config="$with_clang_prefix/bin/llvm-config"
97 if test -x "$llvm_config"; then
101 if test "$llvm_config_found" != yes; then
102 AC_MSG_ERROR([llvm-config not found])
104 CLANG_CXXFLAGS=`$llvm_config --cxxflags`
105 CLANG_LDFLAGS=`$llvm_config --ldflags`
106 CLANG_LIBS=`$llvm_config --libs`
107 CLANG_PREFIX=`$llvm_config --prefix`
108 AC_DEFINE_UNQUOTED(CLANG_PREFIX, ["$CLANG_PREFIX"],
109 [Clang installation prefix])
111 SAVE_CPPFLAGS="$CPPFLAGS"
112 CPPFLAGS="$CLANG_CXXFLAGS $CPPFLAGS"
114 AC_CHECK_HEADER([clang/Basic/SourceLocation.h], [],
115 [AC_ERROR([clang header file not found])])
116 AC_EGREP_HEADER([getExpansionLineNumber],
117 [clang/Basic/SourceLocation.h], [],
118 [AC_DEFINE([getExpansionLineNumber],
119 [getInstantiationLineNumber],
120 [Define to getInstantiationLineNumber for older versions of clang])])
121 AC_EGREP_HEADER([DiagnosticsEngine],
122 [clang/Basic/Diagnostic.h], [],
123 [AC_DEFINE([DiagnosticsEngine],
125 [Define to Diagnostic for older versions of clang])])
127 CPPFLAGS="$SAVE_CPPFLAGS"
130 AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
134 AC_SUBST(WARNING_FLAGS)
136 PACKAGE_CFLAGS="$GMP_CPPFLAGS"
137 PACKAGE_LDFLAGS="$GMP_LDFLAGS"
138 PACKAGE_LIBS="-lisl -lgmp"
139 AX_CREATE_PKGCONFIG_INFO
142 echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
144 AH_BOTTOM([#include <isl_config_post.h>])
145 AC_CONFIG_HEADERS(isl_config.h)
146 AC_CONFIG_HEADERS(include/isl/config.h)
147 AC_CONFIG_FILES(Makefile)
148 AC_CONFIG_FILES(doc/Makefile)
149 AC_CONFIG_FILES(interface/Makefile)
150 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
151 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
152 AC_CONFIG_COMMANDS_POST([
153 dnl pass on arguments to subdir configures, but don't
154 dnl add them to config.status
155 ac_configure_args="$ac_configure_args $isl_configure_args"