1 AC_INIT([isl], [0.21], [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])])
9 if test "x$prefix" != "xNONE"; then
10 prefix_wd=`cd $prefix && pwd`
11 srcdir_wd=`cd $srcdir && pwd`
13 if test "x$prefix_wd" = "x$srcdir_wd"; then
14 AC_MSG_ERROR(Installation in source directory not supported)
16 if test "x$prefix_wd" = "x$wd"; then
17 AC_MSG_ERROR(Installation in build directory not supported)
25 AX_GCC_WARN_UNUSED_RESULT
28 AX_CXX_COMPILE_STDCXX_11([noext], [optional])
33 AM_PATH_PYTHON([2.5], [], [:])
34 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
36 AC_CHECK_PROG(CYGPATH, cygpath, cygpath, [])
37 AC_CHECK_PROG(PERL, perl, perl, [])
38 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
39 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
42 if test "$host_os" = "mingw32" -a -n "$CYGPATH"; then
43 OS_SRCDIR=`$CYGPATH -m "$srcdir"`
48 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
50 AX_CREATE_STDINT_H(include/isl/stdint.h)
53 [AS_HELP_STRING([--with-int=gmp|imath|imath-32],
54 [Which package to use to represent
55 multi-precision integers [default=gmp]])],
62 [bad value ${withval} for --with-int (use gmp, imath or imath-32)])
77 if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then
78 MP_CFLAGS="-std=gnu99 $MP_CFLAGS"
81 AM_CONDITIONAL(IMATH_FOR_MP, test x$with_int = ximath -o x$with_int = ximath-32)
82 AM_CONDITIONAL(GMP_FOR_MP, test x$with_int = xgmp)
84 AM_CONDITIONAL(HAVE_CXX11, test "x$HAVE_CXX11" = "x1")
85 AM_CONDITIONAL(SMALL_INT_OPT, test "x$with_int" == "ximath-32")
86 AS_IF([test "x$with_int" == "ximath-32"], [
87 AC_DEFINE([USE_SMALL_INT_OPT], [], [Use small integer optimization])
90 AC_CHECK_DECLS(ffs,[],[],[#include <strings.h>])
91 AC_CHECK_DECLS(__builtin_ffs,[],[],[])
92 AC_CHECK_DECLS([_BitScanForward],[],[],[#include <intrin.h>])
93 if test "x$ac_cv_have_decl_ffs" = xno -a \
94 "x$ac_cv_have_decl___builtin_ffs" = xno -a \
95 "x$ac_cv_have_decl__BitScanForward" = xno; then
96 AC_MSG_ERROR([No ffs implementation found])
98 AC_CHECK_DECLS([strcasecmp,strncasecmp],[],[],[#include <strings.h>])
99 AC_CHECK_DECLS([_stricmp,_strnicmp],[],[],[#include <string.h>])
100 if test "x$ac_cv_have_decl_strcasecmp" = xno -a \
101 "x$ac_cv_have_decl__stricmp" = xno; then
102 AC_MSG_ERROR([No strcasecmp implementation found])
104 if test "x$ac_cv_have_decl_strncasecmp" = xno -a \
105 "x$ac_cv_have_decl__strnicmp" = xno; then
106 AC_MSG_ERROR([No strncasecmp implementation found])
108 AC_CHECK_DECLS([snprintf,_snprintf],[],[],[#include <stdio.h>])
109 if test "x$ac_cv_have_decl_snprintf" = xno -a \
110 "x$ac_cv_have_decl__snprintf" = xno; then
111 AC_MSG_ERROR([No snprintf implementation found])
114 AX_SUBMODULE(clang,system|no,no)
115 case "$with_clang" in
120 AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
121 AM_CONDITIONAL(HAVE_CPP_ISL_H,
122 [test $with_clang = system -o -f $srcdir/include/isl/cpp.h])
126 AC_SUBST(WARNING_FLAGS)
128 PACKAGE_CFLAGS="$MP_CPPFLAGS"
129 PACKAGE_LDFLAGS="$MP_LDFLAGS"
130 PACKAGE_LIBS="-lisl $MP_LIBS"
131 AX_CREATE_PKGCONFIG_INFO
135 AH_BOTTOM([#include <isl_config_post.h>])
136 AC_CONFIG_HEADERS(isl_config.h)
137 AC_CONFIG_FILES(isl_srcdir.c)
138 AC_CONFIG_FILES(Makefile)
139 AC_CONFIG_FILES(doc/Makefile)
140 if test $with_clang = system; then
141 AC_CONFIG_FILES(interface/Makefile)
143 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
144 AC_CONFIG_FILES([codegen_test.sh], [chmod +x codegen_test.sh])
145 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
146 AC_CONFIG_FILES([flow_test.sh], [chmod +x flow_test.sh])
147 AC_CONFIG_FILES([schedule_test.sh], [chmod +x schedule_test.sh])
148 AC_CONFIG_COMMANDS_POST([
149 dnl pass on arguments to subdir configures, but don't
150 dnl add them to config.status
151 ac_configure_args="$ac_configure_args $isl_configure_args"