2 dnl /**-------------------------------------------------------------------**
4 dnl **-------------------------------------------------------------------**
6 dnl **-------------------------------------------------------------------**
7 dnl ** First version: august 7th 2002 **
8 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 ***************************************************************************
20 dnl * Copyright (C) 2001 Cedric Bastoul *
22 dnl * This is free software; you can redistribute it and/or modify it under *
23 dnl * the terms of the GNU General Public License as published by the Free *
24 dnl * Software Foundation; either version 2 of the License, or (at your *
25 dnl * option) any later version. *
27 dnl * This software is distributed in the hope that it will be useful, but *
28 dnl * WITHOUT ANY WARRANTY; without even the implied warranty of *
29 dnl * MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
30 dnl * General Public License for more details. *
32 dnl * You should have received a copy of the GNU General Public License along *
33 dnl * with software; if not, write to the Free Software Foundation, Inc., *
34 dnl * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
36 dnl * CLooG, the Chunky Loop Generator *
37 dnl * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
39 dnl ***************************************************************************/
42 AC_INIT(source/cloog.c)
43 AC_CONFIG_AUX_DIR(autoconf)
44 AM_INIT_AUTOMAKE(cloog, 0.14.0)
48 dnl /**************************************************************************
50 dnl **************************************************************************/
52 dnl Checks for programs.
57 dnl Configure needs an empty install.sh file with this, i HATE that...
60 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
61 AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")
63 CFLAGS="-fomit-frame-pointer"
65 dnl Checks for typedefs, structures, and compiler characteristics.
71 dnl Checks for header files.
75 dnl Checks for library functions.
76 AC_CHECK_FUNCS(strtol)
79 dnl /**************************************************************************
80 dnl * Option setting *
81 dnl **************************************************************************/
84 MP_DFLAGS=-DLINEAR_VALUE_IS_MP
87 [AS_HELP_STRING([--with-bits=32|64|gmp],
88 [integer type to use])],
91 AX_SUBMODULE(isl,no|system|build|bundled,no)
92 if test "$with_isl" != "no"; then
96 dnl /**************************************************************************
98 dnl **************************************************************************/
100 gmp_module_default=no
101 if test "$BITS" = "gmp"; then
102 gmp_module_default=system
104 AX_SUBMODULE(gmp,no|system,$gmp_module_default)
108 if test "x$with_gmp_prefix" != "x"; then
109 CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
112 if test "$with_gmp_exec_prefix" != "yes" ; then
113 LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
116 AC_CHECK_HEADER(gmp.h,
118 [AC_MSG_ERROR(Can't find gmp headers.)])
121 [LIBS="$LIBS -lgmp"],
122 [AC_MSG_ERROR(Can't find gmp library.)])
126 # all compiled libraries
128 AC_SUBST(CLOOG_LIBRARIES)
129 # backend used by executables
133 dnl /**************************************************************************
134 dnl * Where is PolyLib? *
135 dnl **************************************************************************/
137 AX_SUBMODULE(polylib,no|system|build,system)
146 dnl Checking for PolyLib
147 AC_SUBST(cl_cv_polylib)
148 AC_SUBST(POLYLIB_CPPFLAGS)
149 AC_SUBST(POLYLIB_LDFLAGS)
150 AC_SUBST(POLYLIB_LIBS)
152 AC_MSG_CHECKING(for location of PolyLib)
153 if test "x$with_polylib_builddir" != "x"; then
154 with_polylib_builddir=`cd $with_polylib_builddir; pwd`
155 AC_MSG_RESULT(built in $with_polylib_builddir)
156 polylib_polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
157 AC_MSG_NOTICE(Configured polylibs: $polylib_polylibs)
158 POLYLIB_CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include"
159 for BITS in $polylibs; do
160 cl_cv_polylib=missing
161 for PL in $polylib_polylibs; do
162 if test "libpolylib$BITS.la" = $PL; then
163 cl_cv_polylib="polylib$BITS"
167 if test "$cl_cv_polylib" != "missing"; then
168 POLYLIB_LIBS="$with_polylib_builddir/lib$cl_cv_polylib.la"
173 if test "x$with_polylib_prefix" != "x"; then
174 with_polylib_prefix=`cd $with_polylib_prefix; pwd`
175 AC_MSG_RESULT(installed in $with_polylib_exec_prefix)
176 POLYLIB_CPPFLAGS="-I$with_polylib_prefix/include"
177 POLYLIB_LDFLAGS="-L$with_polylib_exec_prefix/lib"
178 LD_LIBRARY_PATH="$with_polylib_exec_prefix/lib:$LD_LIBRARY_PATH"
179 export LD_LIBRARY_PATH
181 AC_MSG_RESULT(installed in standard location)
183 SAVE_CPPFLAGS="$CPPFLAGS"
184 SAVE_LDFLAGS="$LDFLAGS"
185 CPPFLAGS="$POLYLIB_CPPFLAGS $CPPFLAGS"
186 LDFLAGS="$POLYLIB_LDFLAGS $LDFLAGS"
187 for BITS in $polylibs; do
188 cl_cv_polylib="polylib$BITS"
189 AC_CHECK_HEADER(polylib/$cl_cv_polylib.h,[
190 AC_CHECK_LIB($cl_cv_polylib,PolyhedronTSort,[
191 POLYLIB_LIBS="-l$cl_cv_polylib"
195 cl_cv_polylib=missing
197 CPPFLAGS="$SAVE_CPPFLAGS"
198 LDFLAGS="$SAVE_LDFLAGS"
200 if test "$cl_cv_polylib" = "missing"; then
201 AC_MSG_WARN(Can't find PolyLib.)
203 CLOOG_LIBRARIES="$CLOOG_LIBRARIES libcloog-polylib.la"
207 dnl /**************************************************************************
208 dnl * Where is isl? *
209 dnl **************************************************************************/
211 AC_SUBST(ISL_CPPFLAGS)
212 AC_SUBST(ISL_LDFLAGS)
216 ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
219 ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
220 ISL_LIBS="$with_isl_builddir/libisl.la"
223 if test "x$with_isl_prefix" != "x"; then
224 ISL_CPPFLAGS="-I$with_isl_prefix/include"
226 if test "x$with_isl_exec_prefix" != "x"; then
227 ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
231 if test "$with_isl" != "no"; then
232 CLOOG_LIBRARIES="$CLOOG_LIBRARIES libcloog-isl.la"
235 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
237 if test -z "$BACKEND"; then
238 AC_MSG_ERROR(No backend specified or found.)
247 AC_CHECK_SIZEOF(int,1)
248 AC_CHECK_SIZEOF(long,1)
249 AC_CHECK_SIZEOF(long long,1)
250 for cl_cv_int_type in int long long_long; do
251 eval "bits=\`expr \$ac_cv_sizeof_$cl_cv_int_type \* 8\`"
252 if test "$bits" = "$BITS"; then
258 AC_DEFINE_UNQUOTED(AS_TR_CPP(CLOOG_INT_$cl_cv_int_type))
261 if test -f $srcdir/.git/HEAD; then
262 GIT_INDEX="\$(top_srcdir)/.git/index"
266 dnl /**************************************************************************
267 dnl * Substitutions *
268 dnl **************************************************************************/
271 dnl Substitutions to do in Makefile.in.
278 AC_SUBST(exec_prefix)
283 AC_CONFIG_HEADERS(config.h)
284 AC_CONFIG_HEADERS(include/cloog/int.h)
285 AC_CONFIG_FILES(Makefile test/Makefile include/cloog/polylib/backend.h)
286 AC_CONFIG_FILES(autoconf/Doxyfile)
287 AC_CONFIG_FILES(doc/Makefile)
288 AC_CONFIG_FILES(source/version.c)
289 AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
290 AC_CONFIG_COMMANDS([version.h],
291 [echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
292 AC_CONFIG_COMMANDS([doc/gitversion.texi],
293 [echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
294 if test $with_isl = bundled; then
295 AC_CONFIG_SUBDIRS(isl)
297 AC_CONFIG_COMMANDS_POST([
299 for arg in $ac_configure_args; do
304 old_args="$old_args $arg"
308 ac_configure_args="$old_args $cloog_configure_args"
313 echo " /*-----------------------------------------------*"
314 echo " * CLooG configuration is OK *"
315 echo " *-----------------------------------------------*/"
316 echo "It appears that your system is OK to start CLooG compilation. You need"
317 echo "now to type \"make\". After compilation, you should check CLooG by typing"
318 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
319 echo "you are upgrading an old version. Lastly type \"make install\" to install"
320 echo "CLooG on your system (log as root if necessary)."