configure.ac: use non-deprecated form of AM_INIT_AUTOMAKE
[cloog.git] / configure.ac
blob809a734a59e29457c4e6ade59cd7b9806ab0d3e4
2 dnl /**-------------------------------------------------------------------**
3 dnl  **                              CLooG                                **
4 dnl  **-------------------------------------------------------------------**
5 dnl  **                           configure.ac                            **
6 dnl  **-------------------------------------------------------------------**
7 dnl  **                   First version: august 7th 2002                  **
8 dnl  **-------------------------------------------------------------------**/
9 dnl
10 dnl Input file for autoconf to build a configuration shellscript.
11 dnl To build the configure script from the CLooG's top-level directory, use
12 dnl autoconf -l autoconf autoconf/configure.in > configure
13 dnl if it doesn't work (invalid option -l) try -I instead
14 dnl autoconf -I autoconf autoconf/configure.in > configure
16 dnl /**************************************************************************
17 dnl *               CLooG : the Chunky Loop Generator (experimental)          *
18 dnl ***************************************************************************
19 dnl *                                                                         *
20 dnl * Copyright (C) 2001 Cedric Bastoul                                       *
21 dnl *                                                                         *
22 dnl * This library is free software; you can redistribute it and/or           *
23 dnl * modify it under the terms of the GNU Lesser General Public              *
24 dnl * License as published by the Free Software Foundation; either            *
25 dnl * version 2.1 of the License, or (at your option) any later version.      *
26 dnl *                                                                         *
27 dnl * This library is distributed in the hope that it will be useful,         *
28 dnl * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
29 dnl * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
30 dnl * Lesser General Public License for more details.                         *
31 dnl *                                                                         *
32 dnl * You should have received a copy of the GNU Lesser General Public        *
33 dnl * License along with this library; if not, write to the Free Software     *
34 dnl * Foundation, Inc., 51 Franklin Street, Fifth Floor,                      *
35 dnl * Boston, MA  02110-1301  USA                                             *
36 dnl *                                                                         *
37 dnl * CLooG, the Chunky Loop Generator                                        *
38 dnl * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                      *
39 dnl *                                                                         *
40 dnl ***************************************************************************/
42 m4_define([version_major], [0])
43 m4_define([version_minor], [16])
44 m4_define([version_revision], [2])
46 AC_PREREQ(2.53)
47 AC_INIT([cloog], [version_major.version_minor.version_revision],
48         [cloog-development@googlegroups.com])
49 AC_CONFIG_SRCDIR(source/cloog.c)
50 AC_CONFIG_AUX_DIR(autoconf)
51 AC_CONFIG_MACRO_DIR([m4])
53 VERSION_MAJOR=version_major
54 VERSION_MINOR=version_minor
55 VERSION_REVISION=version_revision
56 AC_SUBST(versioninfo)
57 versioninfo=1:2:0
59 AM_INIT_AUTOMAKE([foreign])
61 dnl /**************************************************************************
62 dnl  *                              Checking                                  *
63 dnl  **************************************************************************/
65 dnl Checks for programs.
66 AC_PROG_CC
67 AC_PROG_LN_S
68 AC_PROG_MAKE_SET
69 AC_CHECK_PROG(CD, cd)
70 dnl Configure needs an empty install.sh file with this, i HATE that...
71 AC_PROG_INSTALL
72 AC_PROG_LIBTOOL
73 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
74 AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")
76 AX_CC_MAXOPT
77 AC_SUBST(CFLAGS_WARN)
78 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
80 dnl Checks for typedefs, structures, and compiler characteristics.
81 AC_C_CONST
82 AC_TYPE_SIZE_T
86 dnl Checks for header files.
87 AC_HEADER_STDC
90 dnl Checks for library functions.
91 AC_CHECK_FUNCS(strtol)
94 dnl /**************************************************************************
95 dnl  *                             Option setting                             *
96 dnl  **************************************************************************/
98 AC_CHECK_HEADERS([sys/resource.h],
99         [AC_DEFINE([CLOOG_RUSAGE], [], [Print time required to generate code])])
101 AX_SUBMODULE(isl,no|system|build|bundled,bundled)
102 BITS="gmp"
104 dnl /**************************************************************************
105 dnl  *                            Where is GMP?                               *
106 dnl  **************************************************************************/
108 AX_SUBMODULE(gmp,system,system)
110 need_get_memory_functions=false
111 case "$with_gmp" in
112 system)
113     if test "x$with_gmp_prefix" != "x"; then
114         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
115     fi
116     
117     if test "$with_gmp_exec_prefix" != "yes" ; then
118         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
119     fi
120      
121     AC_CHECK_HEADER(gmp.h,
122                     [],
123                     [AC_MSG_ERROR(Can't find gmp headers.)])
124     AC_CHECK_LIB(gmp,
125                  __gmpz_init,
126                  [LIBS="$LIBS -lgmp"],
127                  [AC_MSG_ERROR(Can't find gmp library.)])
128     AC_CHECK_DECLS(mp_get_memory_functions,[],[
129             need_get_memory_functions=true
130     ],[#include <gmp.h>])
131     ;;
132 esac
133 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
134                 test x$need_get_memory_functions = xtrue)
136 dnl /**************************************************************************
137 dnl  *                          Where is isl?                                 *
138 dnl  **************************************************************************/
140 AC_SUBST(ISL_CPPFLAGS)
141 AC_SUBST(ISL_LDFLAGS)
142 AC_SUBST(ISL_LIBS)
143 case "$with_isl" in
144 bundled)
145         ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
146         ;;
147 build)
148         ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
149         ISL_LIBS="$with_isl_builddir/libisl.la"
150         ;;
151 system)
152         if test "x$with_isl_prefix" != "x"; then
153                 ISL_CPPFLAGS="-I$with_isl_prefix/include"
154         fi
155         if test "x$with_isl_exec_prefix" != "x"; then
156                 ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
157         fi
158         ISL_LIBS="-lisl"
159 esac
160 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
161 AM_CONDITIONAL(NO_ISL, test $with_isl = no)
164 AC_DEFINE([CLOOG_INT_GMP], 1, [Use arbitrary precision integers])
166 AC_SUBST(GIT_INDEX)
167 if test -f $srcdir/.git/HEAD; then
168         GIT_INDEX="\$(top_srcdir)/.git/index"
172 dnl /**************************************************************************
173 dnl  *                            Substitutions                               *
174 dnl  **************************************************************************/
177 dnl Substitutions to do in Makefile.in.
178 AC_SUBST(CC)
179 AC_SUBST(LN_S)
181 AC_SUBST(prefix)
182 AC_SUBST(exec_prefix)
183 AC_SUBST(INSTALL)
185 AC_SUBST(BITS)
187 AC_SUBST(VERSION_MAJOR)
188 AC_SUBST(VERSION_MINOR)
189 AC_SUBST(VERSION_REVISION)
191 PACKAGE_NAME="cloog-isl"
192 PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
193 AX_CREATE_PKGCONFIG_INFO
195 AC_CONFIG_FILES(Makefile test/Makefile)
196 AC_CONFIG_FILES(autoconf/Doxyfile)
197 AC_CONFIG_FILES(doc/Makefile)
198 AC_CONFIG_FILES(source/version.c)
199 AC_CONFIG_FILES(include/cloog/version.h)
200 AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
201 AC_CONFIG_COMMANDS([version.h],
202         [echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
203 AC_CONFIG_COMMANDS([doc/gitversion.texi],
204         [echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
205 if test $with_isl = bundled; then
206         AC_CONFIG_SUBDIRS(isl)
208 AC_CONFIG_COMMANDS_POST([
209         ac_configure_args="$ac_configure_args $cloog_configure_args"
211 AC_OUTPUT
214 echo "             /*-----------------------------------------------*"
215 echo "              *           CLooG configuration is OK           *"
216 echo "              *-----------------------------------------------*/"
217 echo "It appears that your system is OK to start CLooG compilation. You need"
218 echo "now to type \"make\". After compilation, you should check CLooG by typing"
219 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
220 echo "you are upgrading an old version. Lastly type \"make install\" to install"
221 echo "CLooG on your system (log as root if necessary)."