1 AC_INIT([isl], [0.18], [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
30 AC_CHECK_PROG(PERL, perl, perl, [])
31 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
32 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
34 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
36 AX_CREATE_STDINT_H(include/isl/stdint.h)
39 [AS_HELP_STRING([--with-int=gmp|imath|imath-32],
40 [Which package to use to represent
41 multi-precision integers [default=gmp]])],
48 [bad value ${withval} for --with-int (use gmp, imath or imath-32)])
62 if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then
63 MP_CPPFLAGS="-std=gnu99 $MP_CPPFLAGS"
66 AM_CONDITIONAL(IMATH_FOR_MP, test x$with_int = ximath -o x$with_int = ximath-32)
67 AM_CONDITIONAL(GMP_FOR_MP, test x$with_int = xgmp)
69 AM_CONDITIONAL(SMALL_INT_OPT, test "x$with_int" == "ximath-32")
70 AS_IF([test "x$with_int" == "ximath-32"], [
71 AC_DEFINE([USE_SMALL_INT_OPT], [], [Use small integer optimization])
74 AC_CHECK_DECLS(ffs,[],[],[#include <strings.h>])
75 AC_CHECK_DECLS(__builtin_ffs,[],[],[])
76 AC_CHECK_DECLS([_BitScanForward],[],[],[#include <intrin.h>])
77 if test "x$ac_cv_have_decl_ffs" = xno -a \
78 "x$ac_cv_have_decl___builtin_ffs" = xno -a \
79 "x$ac_cv_have_decl__BitScanForward" = xno; then
80 AC_MSG_ERROR([No ffs implementation found])
82 AC_CHECK_DECLS([strcasecmp,strncasecmp],[],[],[#include <strings.h>])
83 AC_CHECK_DECLS([_stricmp,_strnicmp],[],[],[#include <string.h>])
84 if test "x$ac_cv_have_decl_strcasecmp" = xno -a \
85 "x$ac_cv_have_decl__stricmp" = xno; then
86 AC_MSG_ERROR([No strcasecmp implementation found])
88 if test "x$ac_cv_have_decl_strncasecmp" = xno -a \
89 "x$ac_cv_have_decl__strnicmp" = xno; then
90 AC_MSG_ERROR([No strncasecmp implementation found])
92 AC_CHECK_DECLS([snprintf,_snprintf],[],[],[#include <stdio.h>])
93 if test "x$ac_cv_have_decl_snprintf" = xno -a \
94 "x$ac_cv_have_decl__snprintf" = xno; then
95 AC_MSG_ERROR([No snprintf implementation found])
98 AX_SUBMODULE(clang,system|no,no)
104 AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
108 AC_SUBST(WARNING_FLAGS)
110 PACKAGE_CFLAGS="$MP_CPPFLAGS"
111 PACKAGE_LDFLAGS="$MP_LDFLAGS"
112 PACKAGE_LIBS="-lisl $MP_LIBS"
113 AX_CREATE_PKGCONFIG_INFO
117 AH_BOTTOM([#include <isl_config_post.h>])
118 AC_CONFIG_HEADERS(isl_config.h)
119 AC_CONFIG_FILES(isl_srcdir.c)
120 AC_CONFIG_FILES(Makefile)
121 AC_CONFIG_FILES(doc/Makefile)
122 if test $with_clang = system; then
123 AC_CONFIG_FILES(interface/Makefile)
125 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
126 AC_CONFIG_FILES([codegen_test.sh], [chmod +x codegen_test.sh])
127 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
128 AC_CONFIG_COMMANDS_POST([
129 dnl pass on arguments to subdir configures, but don't
130 dnl add them to config.status
131 ac_configure_args="$ac_configure_args $isl_configure_args"