-AC_INIT
+AC_INIT([isl], [0.10], [isl-development@googlegroups.com])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(isl, 0.02)
+AM_INIT_AUTOMAKE([foreign])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_SUBST(versioninfo)
-versioninfo=2:0:0
+versioninfo=10:0:0
AC_PROG_CC
+AC_PROG_CXX
AX_CC_MAXOPT
AX_GCC_WARN_UNUSED_RESULT
+AX_C___ATTRIBUTE__
AC_PROG_LIBTOOL
AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
-AX_CREATE_STDINT_H(include/isl_stdint.h)
+AX_CREATE_STDINT_H(include/isl/stdint.h)
-AX_SUBMODULE(gmp,system,system)
+AX_SUBMODULE(gmp,system|build,system)
AC_SUBST(GMP_CPPFLAGS)
AC_SUBST(GMP_LDFLAGS)
-if test "x$with_gmp_prefix" != "x"; then
- isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
- GMP_CPPFLAGS="-I$with_gmp_prefix/include"
- GMP_LDFLAGS="-L$with_gmp_prefix/lib"
-fi
+AC_SUBST(GMP_LIBS)
+case "$with_gmp" in
+system)
+ if test "x$with_gmp_prefix" != "x"; then
+ isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
+ GMP_CPPFLAGS="-I$with_gmp_prefix/include"
+ GMP_LDFLAGS="-L$with_gmp_prefix/lib"
+ fi
+ GMP_LIBS=-lgmp
+ ;;
+build)
+ GMP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir"
+ GMP_LIBS="$with_gmp_builddir/libgmp.la"
+ ;;
+esac
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
need_get_memory_functions=false
fi
AM_CONDITIONAL(HAVE_PIPLIB, test x$have_piplib = xtrue)
-PACKAGE_CFLAGS="-I$prefix/include/isl"
+AC_SUBST(CLANG_CXXFLAGS)
+AC_SUBST(CLANG_LDFLAGS)
+AC_SUBST(CLANG_LIBS)
+AX_SUBMODULE(clang,system|no,no)
+case "$with_clang" in
+system)
+ llvm_config="llvm-config"
+ AC_CHECK_PROG([llvm_config_found], ["$llvm_config"], [yes])
+ if test "x$with_clang_prefix" != "x"; then
+ llvm_config="$with_clang_prefix/bin/llvm-config"
+ if test -x "$llvm_config"; then
+ llvm_config_found=yes
+ fi
+ fi
+ if test "$llvm_config_found" != yes; then
+ AC_MSG_ERROR([llvm-config not found])
+ fi
+ CLANG_CXXFLAGS=`$llvm_config --cxxflags`
+ CLANG_LDFLAGS=`$llvm_config --ldflags`
+ CLANG_LIBS=`$llvm_config --libs analysis`
+ CLANG_PREFIX=`$llvm_config --prefix`
+ AC_DEFINE_UNQUOTED(CLANG_PREFIX, ["$CLANG_PREFIX"],
+ [Clang installation prefix])
+
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CLANG_CXXFLAGS $CPPFLAGS"
+ AC_LANG_PUSH(C++)
+ AC_CHECK_HEADER([clang/Basic/SourceLocation.h], [],
+ [AC_ERROR([clang header file not found])])
+ AC_EGREP_HEADER([getDefaultTargetTriple], [llvm/Support/Host.h], [],
+ [AC_DEFINE([getDefaultTargetTriple], [getHostTriple],
+ [Define to getHostTriple for older versions of clang])])
+ AC_EGREP_HEADER([getExpansionLineNumber],
+ [clang/Basic/SourceLocation.h], [],
+ [AC_DEFINE([getExpansionLineNumber],
+ [getInstantiationLineNumber],
+ [Define to getInstantiationLineNumber for older versions of clang])])
+ AC_EGREP_HEADER([DiagnosticsEngine],
+ [clang/Basic/Diagnostic.h], [],
+ [AC_DEFINE([DiagnosticsEngine],
+ [Diagnostic],
+ [Define to Diagnostic for older versions of clang])])
+ AC_EGREP_HEADER([ArrayRef], [clang/Driver/Driver.h],
+ [AC_DEFINE([USE_ARRAYREF], [],
+ [Define if Driver::BuildCompilation takes ArrayRef])])
+ AC_EGREP_HEADER([CXXIsProduction], [clang/Driver/Driver.h],
+ [AC_DEFINE([HAVE_CXXISPRODUCTION], [],
+ [Define if Driver constructor takes CXXIsProduction argument])])
+ AC_EGREP_HEADER([void HandleTopLevelDecl\(], [clang/AST/ASTConsumer.h],
+ [AC_DEFINE([HandleTopLevelDeclReturn], [void],
+ [Return type of HandleTopLevelDeclReturn])
+ AC_DEFINE([HandleTopLevelDeclContinue], [],
+ [Return type of HandleTopLevelDeclReturn])],
+ [AC_DEFINE([HandleTopLevelDeclReturn], [bool],
+ [Return type of HandleTopLevelDeclReturn])
+ AC_DEFINE([HandleTopLevelDeclContinue], [true],
+ [Return type of HandleTopLevelDeclReturn])])
+ AC_LANG_POP
+ CPPFLAGS="$SAVE_CPPFLAGS"
+
+ SAVE_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$CLANG_LDFLAGS $LDFLAGS"
+ AC_SUBST(LIB_CLANG_EDIT)
+ AC_CHECK_LIB([clangEdit], [main], [LIB_CLANG_EDIT=-lclangEdit], [])
+ LDFLAGS="$SAVE_LDFLAGS"
+ ;;
+esac
+AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
+
+AX_SET_WARNING_FLAGS
+
+AC_SUBST(WARNING_FLAGS)
+
+PACKAGE_CFLAGS="$GMP_CPPFLAGS"
+PACKAGE_LDFLAGS="$GMP_LDFLAGS"
+PACKAGE_LIBS="-lisl -lgmp"
AX_CREATE_PKGCONFIG_INFO
AX_DETECT_GIT_HEAD
echo '#define GIT_HEAD_ID "'$GIT_HEAD_ID'"' > gitversion.h
-AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_HEADERS(include/isl_config.h)
+AH_BOTTOM([#include <isl_config_post.h>])
+AC_CONFIG_HEADERS(isl_config.h)
+AC_CONFIG_HEADERS(include/isl/config.h)
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(doc/Makefile)
+if test $with_clang = system; then
+ AC_CONFIG_FILES(interface/Makefile)
+fi
+AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
+AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
AC_CONFIG_COMMANDS_POST([
dnl pass on arguments to subdir configures, but don't
dnl add them to config.status