add isl_multi_aff_from_aff_mat
[isl.git] / configure.ac
blob7e870159feacfb3b5500ffe8a235346f71b96cea
1 AC_INIT([isl], [0.18], [isl-development@googlegroups.com])
2 AC_CONFIG_AUX_DIR([.])
3 AC_CONFIG_MACRO_DIR([m4])
4 AM_INIT_AUTOMAKE([foreign])
5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
6 AC_SUBST(versioninfo)
7 versioninfo=18:0:3
9 if test "x$prefix" != "xNONE"; then
10         prefix_wd=`cd $prefix && pwd`
11         srcdir_wd=`cd $srcdir && pwd`
12         wd=`pwd`
13         if test "x$prefix_wd" = "x$srcdir_wd"; then
14                 AC_MSG_ERROR(Installation in source directory not supported)
15         fi
16         if test "x$prefix_wd" = "x$wd"; then
17                 AC_MSG_ERROR(Installation in build directory not supported)
18         fi
21 AC_PROG_CC
22 AC_PROG_CXX
24 AX_CC_MAXOPT
25 AX_GCC_WARN_UNUSED_RESULT
26 AX_C___ATTRIBUTE__
28 # CXX11FLAGS contains the flags (if any) added by AX_CXX_COMPILE_STDCXX_11
29 # Original state of CXX and CXXCPP is preserved because CXX11FLAGS
30 # is only needed for compiling interface/isl_test_cpp
31 AC_SUBST(CXX11FLAGS)
32 ac_save_CXX="$CXX"
33 ac_save_CXXCPP="$CXXCPP"
34 AX_CXX_COMPILE_STDCXX_11([noext], [optional])
35 CXX11FLAGS=${CXX#$ac_save_CXX}
36 CXX="$ac_save_CXX"
37 CXXCPP="$ac_save_CXXCPP"
39 AC_PROG_LIBTOOL
41 AC_CHECK_PROG(PERL, perl, perl, [])
42 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, [])
43 AC_CHECK_PROG(POD2HTML, pod2html, pod2html, [])
45 AM_CONDITIONAL(GENERATE_DOC, test -n "$PERL" -a -n "$PDFLATEX" -a -n "$POD2HTML")
47 AX_CREATE_STDINT_H(include/isl/stdint.h)
49 AC_ARG_WITH([int],
50             [AS_HELP_STRING([--with-int=gmp|imath|imath-32],
51                             [Which package to use to represent
52                                 multi-precision integers [default=gmp]])],
53             [], [with_int=gmp])
54 case "$with_int" in
55 gmp|imath|imath-32)
56         ;;
58         AC_MSG_ERROR(
59             [bad value ${withval} for --with-int (use gmp, imath or imath-32)])
60 esac
62 AC_SUBST(MP_CPPFLAGS)
63 AC_SUBST(MP_LDFLAGS)
64 AC_SUBST(MP_LIBS)
65 case "$with_int" in
66 gmp)
67         AX_DETECT_GMP
68         ;;
69 imath|imath-32)
70         AX_DETECT_IMATH
71         ;;
72 esac
73 if test "x$with_int" = "ximath-32" -a "x$GCC" = "xyes"; then
74         MP_CPPFLAGS="-std=gnu99 $MP_CPPFLAGS"
77 AM_CONDITIONAL(IMATH_FOR_MP, test x$with_int = ximath -o x$with_int = ximath-32)
78 AM_CONDITIONAL(GMP_FOR_MP, test x$with_int = xgmp)
80 AM_CONDITIONAL(HAVE_CXX11, test "x$HAVE_CXX11" = "x1")
81 AM_CONDITIONAL(SMALL_INT_OPT, test "x$with_int" == "ximath-32")
82 AS_IF([test "x$with_int" == "ximath-32"], [
83         AC_DEFINE([USE_SMALL_INT_OPT], [], [Use small integer optimization])
86 AC_CHECK_DECLS(ffs,[],[],[#include <strings.h>])
87 AC_CHECK_DECLS(__builtin_ffs,[],[],[])
88 AC_CHECK_DECLS([_BitScanForward],[],[],[#include <intrin.h>])
89 if test "x$ac_cv_have_decl_ffs" = xno -a \
90                 "x$ac_cv_have_decl___builtin_ffs" = xno -a \
91                 "x$ac_cv_have_decl__BitScanForward" = xno; then
92         AC_MSG_ERROR([No ffs implementation found])
94 AC_CHECK_DECLS([strcasecmp,strncasecmp],[],[],[#include <strings.h>])
95 AC_CHECK_DECLS([_stricmp,_strnicmp],[],[],[#include <string.h>])
96 if test "x$ac_cv_have_decl_strcasecmp" = xno -a \
97                 "x$ac_cv_have_decl__stricmp" = xno; then
98         AC_MSG_ERROR([No strcasecmp implementation found])
100 if test "x$ac_cv_have_decl_strncasecmp" = xno -a \
101                 "x$ac_cv_have_decl__strnicmp" = xno; then
102         AC_MSG_ERROR([No strncasecmp implementation found])
104 AC_CHECK_DECLS([snprintf,_snprintf],[],[],[#include <stdio.h>])
105 if test "x$ac_cv_have_decl_snprintf" = xno -a \
106                 "x$ac_cv_have_decl__snprintf" = xno; then
107         AC_MSG_ERROR([No snprintf implementation found])
110 AX_SUBMODULE(clang,system|no,no)
111 case "$with_clang" in
112 system)
113         AX_DETECT_CLANG
114         ;;
115 esac
116 AM_CONDITIONAL(HAVE_CLANG, test $with_clang = system)
118 AX_SET_WARNING_FLAGS
120 AC_SUBST(WARNING_FLAGS)
122 PACKAGE_CFLAGS="$MP_CPPFLAGS"
123 PACKAGE_LDFLAGS="$MP_LDFLAGS"
124 PACKAGE_LIBS="-lisl $MP_LIBS"
125 AX_CREATE_PKGCONFIG_INFO
127 AX_DETECT_GIT_HEAD
129 AH_BOTTOM([#include <isl_config_post.h>])
130 AC_CONFIG_HEADERS(isl_config.h)
131 AC_CONFIG_FILES(isl_srcdir.c)
132 AC_CONFIG_FILES(Makefile)
133 AC_CONFIG_FILES(doc/Makefile)
134 if test $with_clang = system; then
135         AC_CONFIG_FILES(interface/Makefile)
137 AC_CONFIG_FILES([bound_test.sh], [chmod +x bound_test.sh])
138 AC_CONFIG_FILES([codegen_test.sh], [chmod +x codegen_test.sh])
139 AC_CONFIG_FILES([pip_test.sh], [chmod +x pip_test.sh])
140 AC_CONFIG_COMMANDS_POST([
141         dnl pass on arguments to subdir configures, but don't
142         dnl add them to config.status
143         ac_configure_args="$ac_configure_args $isl_configure_args"
145 AC_OUTPUT