CLooG 0.18.4
[cloog.git] / configure.ac
blobb3448f7ce57ae5a8ae78bed65df0745ec889bfc2
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], [18])
44 m4_define([version_revision], [4])
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=4:0:0
59 AM_INIT_AUTOMAKE([foreign])
60 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
62 dnl /**************************************************************************
63 dnl  *                              Checking                                  *
64 dnl  **************************************************************************/
66 dnl Checks for programs.
67 AC_PROG_CC
68 AC_PROG_LN_S
69 AC_PROG_MAKE_SET
70 AC_CHECK_PROG(CD, cd)
71 dnl Configure needs an empty install.sh file with this, i HATE that...
72 AC_PROG_INSTALL
73 AC_PROG_LIBTOOL
74 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
75 AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")
77 AX_CC_MAXOPT
78 AC_SUBST(CFLAGS_WARN)
79 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
81 dnl Checks for typedefs, structures, and compiler characteristics.
82 AC_C_CONST
83 AC_TYPE_SIZE_T
87 dnl Checks for header files.
88 AC_HEADER_STDC
91 dnl Checks for library functions.
92 AC_CHECK_FUNCS(strtol)
95 dnl /**************************************************************************
96 dnl  *                             Option setting                             *
97 dnl  **************************************************************************/
99 AC_CHECK_FUNCS([getrusage],
100         [AC_DEFINE([CLOOG_RUSAGE], [], [Print time required to generate code])])
102 AX_SUBMODULE(isl,no|system|build|bundled,bundled)
103 BITS="gmp"
105 dnl /**************************************************************************
106 dnl  *                            Where is GMP?                               *
107 dnl  **************************************************************************/
109 AX_SUBMODULE(gmp,system|build,system)
111 need_get_memory_functions=false
112 case "$with_gmp" in
113 build)
114     CPPFLAGS="-I$with_gmp_builddir $CPPFLAGS"
115     LDFLAGS="-L$with_gmp_builddir/$lt_cv_objdir $LDFLAGS"
116     ;;
117 system)
118     if test "x$with_gmp_prefix" != "x"; then
119         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
120     fi
121     
122     if test "$with_gmp_exec_prefix" != "yes" ; then
123         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
124     fi
125     ;;
126 esac
127 case "$with_gmp" in
128 build|system)
129     AC_CHECK_HEADER(gmp.h,
130                     [],
131                     [AC_MSG_ERROR(Can't find gmp headers.)])
132     AC_CHECK_LIB(gmp,
133                  __gmpz_init,
134                  [LIBS="$LIBS -lgmp"],
135                  [AC_MSG_ERROR(Can't find gmp library.)])
136     AC_CHECK_DECLS(mp_get_memory_functions,[],[
137             need_get_memory_functions=true
138     ],[#include <gmp.h>])
139     ;;
140 esac
141 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
142                 test x$need_get_memory_functions = xtrue)
144 dnl /**************************************************************************
145 dnl  *                          Where is isl?                                 *
146 dnl  **************************************************************************/
148 AC_SUBST(ISL_CPPFLAGS)
149 AC_SUBST(ISL_LDFLAGS)
150 AC_SUBST(ISL_LIBS)
151 case "$with_isl" in
152 bundled)
153         ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
154         ;;
155 build)
156         ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
157         ISL_LIBS="$with_isl_builddir/libisl.la"
158         ;;
159 system)
160         if test "x$with_isl_prefix" != "x"; then
161                 ISL_CPPFLAGS="-I$with_isl_prefix/include"
162         fi
163         if test "x$with_isl_exec_prefix" != "x"; then
164                 ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
165         fi
166         ISL_LIBS="-lisl"
167 esac
168 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
169 AM_CONDITIONAL(NO_ISL, test $with_isl = no)
172 dnl /**************************************************************************
173 dnl  *                   Where is the OpenScop Library?                       *
174 dnl  **************************************************************************/
176 AX_SUBMODULE(osl,no|system|build|bundled,no)
177 osl_flag="OSL_SUPPORT"
179 AC_SUBST(OSL_CPPFLAGS)
180 AC_SUBST(OSL_LDFLAGS)
181 AC_SUBST(OSL_LIBS)
182 case "$with_osl" in
183 bundled)
184         OSL_CPPFLAGS="-D$osl_flag -I$srcdir/osl/include -Iosl/include"
185         ;;
186 build)
187         OSL_CPPFLAGS="-D$osl_flag -I$osl_srcdir/include -I$with_osl_builddir/include"
188         OSL_LIBS="$with_osl_builddir/libosl.la"
189         ;;
190 system)
191         if test "x$with_osl_prefix" != "x"; then
192                 OSL_CPPFLAGS="-D$osl_flag -I$with_osl_prefix/include"
193         fi
194         if test "x$with_osl_exec_prefix" != "x"; then
195                 OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
196         fi
197         OSL_LIBS="-losl"
198 esac
199 AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
200 AM_CONDITIONAL(NO_OSL, test $with_osl = no)
203 AC_DEFINE([CLOOG_INT_GMP], 1, [Use arbitrary precision integers])
205 AC_SUBST(GIT_INDEX)
206 if test -f $srcdir/.git/HEAD; then
207         GIT_INDEX="\$(top_srcdir)/.git/index"
211 dnl /**************************************************************************
212 dnl  *                            Substitutions                               *
213 dnl  **************************************************************************/
216 dnl Substitutions to do in Makefile.in.
217 AC_SUBST(CC)
218 AC_SUBST(LN_S)
220 AC_SUBST(prefix)
221 AC_SUBST(exec_prefix)
222 AC_SUBST(INSTALL)
224 AC_SUBST(BITS)
226 AC_SUBST(VERSION_MAJOR)
227 AC_SUBST(VERSION_MINOR)
228 AC_SUBST(VERSION_REVISION)
230 PACKAGE_NAME="cloog-isl"
231 PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
232 AX_CREATE_PKGCONFIG_INFO
234 AC_CONFIG_FILES(Makefile test/Makefile)
235 AC_CONFIG_FILES(autoconf/Doxyfile)
236 AC_CONFIG_FILES(doc/Makefile)
237 AC_CONFIG_FILES(source/version.c)
238 AC_CONFIG_FILES(include/cloog/version.h)
239 AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
240 AC_CONFIG_COMMANDS([version.h],
241         [echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
242 AC_CONFIG_COMMANDS([doc/gitversion.texi],
243         [echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
244 if test $with_isl = bundled; then
245         AC_CONFIG_SUBDIRS(isl)
247 if test $with_osl = bundled; then
248         AC_CONFIG_SUBDIRS(osl)
250 AC_CONFIG_COMMANDS_POST([
251         ac_configure_args="$ac_configure_args $cloog_configure_args"
253 AC_OUTPUT
256 echo "             /*-----------------------------------------------*"
257 echo "              *           CLooG configuration is OK           *"
258 echo "              *-----------------------------------------------*/"
259 echo "It appears that your system is OK to start CLooG compilation. You need"
260 echo "now to type \"make\". After compilation, you should check CLooG by typing"
261 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
262 echo "you are upgrading an old version. Lastly type \"make install\" to install"
263 echo "CLooG on your system (log as root if necessary)."