update cloog-core to version 0.16.1
[cloog-parma.git] / configure.ac
blob00e1a5471226090e9935a0067ecc5d0942777467
1 AC_PREREQ(2.13)
2 AC_INIT(source/backend.c)
3 AC_CONFIG_AUX_DIR(autoconf)
4 AC_CONFIG_MACRO_DIR([m4])
5 AM_INIT_AUTOMAKE(cloog-parma, 0.16.1)
6 AC_SUBST(versioninfo)
7 versioninfo=1:1:0
9 AC_PROG_CC
10 AC_PROG_LN_S
11 AC_PROG_MAKE_SET
12 AC_CHECK_PROG(CD, cd)
13 AC_PROG_INSTALL
14 AC_PROG_LIBTOOL
16 AX_CC_MAXOPT
17 AC_SUBST(CFLAGS_WARN)
18 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
20 dnl Checks for typedefs, structures, and compiler characteristics.
21 AC_C_CONST
22 AC_TYPE_SIZE_T
24 dnl Checks for header files.
25 AC_HEADER_STDC
27 dnl /**************************************************************************
28 dnl  *                            Where is GMP?                               *
29 dnl  **************************************************************************/
31 AX_SUBMODULE(gmp,system,system)
33 case "$with_gmp" in
34 system)
35     if test "x$with_gmp_prefix" != "x"; then
36         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
37     fi
38     
39     if test "$with_gmp_exec_prefix" != "yes" ; then
40         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
41     fi
42      
43     AC_CHECK_HEADER(gmp.h,
44                     [],
45                     [AC_MSG_ERROR(Can't find gmp headers.)])
46     AC_CHECK_LIB(gmp,
47                  __gmpz_init,
48                  [LIBS="$LIBS -lgmp"],
49                  [AC_MSG_ERROR(Can't find gmp library.)])
50     AC_CHECK_DECLS(mp_get_memory_functions,[],[
51             need_get_memory_functions=true
52     ],[#include <gmp.h>])
53     ;;
54 esac
55 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
56                 test x$need_get_memory_functions = xtrue)
58 dnl /**************************************************************************
59 dnl  *                          Where is PPL?                                 *
60 dnl  **************************************************************************/
62 AX_SUBMODULE(ppl,system,system)
64 AC_SUBST(PPL_CPPFLAGS)
65 AC_SUBST(PPL_LDFLAGS)
66 AC_SUBST(PPL_LIBS)
67 case "$with_ppl" in
68 system)
69         if test "x$with_ppl_prefix" != "x"; then
70                 PPL_CPPFLAGS="-I$with_ppl_prefix/include"
71         fi
72         if test "x$with_ppl_exec_prefix" != "x"; then
73                 PPL_LDFLAGS="-L$with_ppl_exec_prefix/lib"
74         fi
75         PPL_LIBS="-lppl_c -lppl -lgmpxx"
76         SAVE_CPPFLAGS="$CPPFLAGS"
77         CPPFLAGS="$PPL_CPPFLAGS $CPPFLAGS"
78         AC_CHECK_HEADER(ppl_c.h,
79                         [],
80                         [AC_MSG_ERROR(Can't find PPL headers.)])
81         CPPFLAGS="$SAVE_CPPFLAGS"
82 esac
84 dnl /**************************************************************************
85 dnl  *                          Where is CLooG?                               *
86 dnl  **************************************************************************/
88 AX_SUBMODULE(cloog,build|bundled,bundled)
90 AC_SUBST(CLOOG_SRCDIR)
91 AC_SUBST(CLOOG_BUILDDIR)
92 AC_SUBST(CLOOG_CPPFLAGS)
93 case "$with_cloog" in
94 bundled)
95         CLOOG_SRCDIR="\$(top_srcdir)/cloog-core"
96         CLOOG_BUILDDIR="\$(top_builddir)/cloog-core"
98         ;;
99 build)
100         case "$cloog_srcdir" in
101         /*)
102                 CLOOG_SRCDIR=$cloog_srcdir
103                 ;;
104         *)
105                 CLOOG_SRCDIR="\$(top_srcdir)/$cloog_srcdir"
106         esac
107         case "$with_cloog_builddir" in
108         /*)
109                 CLOOG_BUILDDIR=$with_cloog_builddir
110                 ;;
111         *)
112                 CLOOG_BUILDDIR="\$(top_builddir)/$with_cloog_builddir"
113         esac
114         ;;
115 esac
116 CLOOG_CPPFLAGS="-I$CLOOG_SRCDIR/include -I$CLOOG_BUILDDIR -I$CLOOG_BUILDDIR/include"
117 AM_CONDITIONAL(BUNDLED_CLOOG, test $with_cloog = bundled)
120 AC_DEFINE([CLOOG_INT_GMP], 1, [Use arbitrary precision integers])
121 BITS="gmp"
124 dnl /**************************************************************************
125 dnl  *                            Substitutions                               *
126 dnl  **************************************************************************/
129 dnl Substitutions to do in Makefile.in.
130 AC_SUBST(CC)
131 AC_SUBST(LN_S)
133 AC_SUBST(prefix)
134 AC_SUBST(exec_prefix)
135 AC_SUBST(INSTALL)
137 AC_SUBST(BITS)
139 PACKAGE_NAME="cloog-ppl"
140 PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
141 AX_CREATE_PKGCONFIG_INFO
143 AC_CONFIG_FILES(Makefile test/Makefile)
144 if test $with_cloog = bundled; then
145         AC_CONFIG_SUBDIRS(cloog-core)
147 AC_CONFIG_COMMANDS_POST([
148         old_args=""
149         for arg in $ac_configure_args; do
150                 case arg in
151                 --with-ppl*)
152                         ;;
153                 *)
154                         old_args="$old_args $arg"
155                         ;;
156                 esac
157         done
158         ac_configure_args="$old_args --without-isl $cloog_ppl_configure_args"
160 AC_OUTPUT
163 echo "             /*-----------------------------------------------*"
164 echo "              *           CLooG configuration is OK           *"
165 echo "              *-----------------------------------------------*/"
166 echo "It appears that your system is OK to start CLooG compilation. You need"
167 echo "now to type \"make\". After compilation, you should check CLooG by typing"
168 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
169 echo "you are upgrading an old version. Lastly type \"make install\" to install"
170 echo "CLooG on your system (log as root if necessary)."