1 dnl /**-------------------------------------------------------------------**
3 dnl **-------------------------------------------------------------------**
5 dnl **-------------------------------------------------------------------**
6 dnl ** First version: september 8th 2003 **
7 dnl **-------------------------------------------------------------------**/
9 dnl /**************************************************************************
10 dnl * CAnDL : the Chunky Analyser for Dependences in Loops (experimental) *
11 dnl ***************************************************************************
13 dnl * Copyright (C) 2003-2008 Cedric Bastoul *
15 dnl * This is free software; you can redistribute it and/or modify it under *
16 dnl * the terms of the GNU General Public License as published by the Free *
17 dnl * Software Foundation; either version 2 of the License, or (at your *
18 dnl * option) any later version. *
20 dnl * This software is distributed in the hope that it will be useful, but *
21 dnl * WITHOUT ANY WARRANTY; without even the implied warranty of *
22 dnl * MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
23 dnl * General Public License for more details. *
25 dnl * You should have received a copy of the GNU General Public License along *
26 dnl * with software; if not, write to the Free Software Foundation, Inc., *
27 dnl * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
29 dnl * CAnDL, the Chunky Dependence Analyser *
30 dnl * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
32 dnl ***************************************************************************/
34 m4_define([version_major], [0])
35 m4_define([version_minor], [0])
36 m4_define([version_revision], [1])
40 dnl Fill here the @bug email adress.
41 AC_INIT([candl], [0.6.2], [cedric.bastoul@inria.fr,pouchet@cse.ohio-state.edu])
43 AC_CONFIG_SRCDIR([include/candl/candl.h])
45 dnl Put as most as possible configuration files to an auxialiry
47 AC_CONFIG_AUX_DIR(autoconf)
48 AC_CONFIG_MACRO_DIR([m4])
50 dnl Initialize automake. Here, a special tar version that enables
51 dnl (very) long filenames.
52 #AM_INIT_AUTOMAKE([1.9 tar-ustar no-define foreign dist-bzip2])
53 AM_INIT_AUTOMAKE([foreign])
54 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
58 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP
61 dnl /**************************************************************************
63 dnl **************************************************************************/
66 dnl Checks for programs.
73 AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
77 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
79 dnl Checks for typedefs, structures, and compiler characteristics.
83 dnl Checks for header files.
85 AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
87 dnl Checks for library functions.
88 AC_CHECK_FUNCS(strtol)
91 dnl /**************************************************************************
92 dnl * Option setting *
93 dnl **************************************************************************/
95 dnl /**************************************************************************
96 dnl * Where is the OpenScop Library? *
97 dnl **************************************************************************/
99 AX_SUBMODULE(osl,system|build|bundled,system)
101 AC_SUBST(OSL_CPPFLAGS)
102 AC_SUBST(OSL_LDFLAGS)
106 OSL_CPPFLAGS="-I$srcdir/osl/include -Iosl/include"
107 OSL_LIBS="$srcdir/osl/libosl.la"
110 OSL_CPPFLAGS="-I$osl_srcdir/include -I$with_osl_builddir/include"
111 OSL_LIBS="$with_osl_builddir/libosl.la"
114 if test "x$with_osl_prefix" != "x"; then
115 OSL_CPPFLAGS="-I$with_osl_prefix/include"
117 if test "x$with_osl_exec_prefix" != "x"; then
118 OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
120 OSL_LIBS="$with_osl_prefix/lib/libosl.la -losl"
122 AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
128 dnl Some default values cause I'm not sure whether autoconf set them, while
129 dnl documentation says it does...
131 gmp_include_package="yes"
132 gmp_library_package="yes"
136 dnl --with-gmp=gmp-path
138 [ --with-gmp=DIR DIR where the gmp package is installed],
139 [ echo "Package gmp : $withval" &&
140 gmp_package=$withval &&
141 GMP_INC=$gmp_package/include &&
142 GMP_LIB=$gmp_package/lib &&
143 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP &&
146 AC_ARG_WITH(gmp-include,
147 [ --with-gmp-include=DIR DIR where gmp.h is installed],
148 [ echo "Package gmp-include : $withval" &&
149 gmp_include_package=$withval &&
150 GMP_INC=$gmp_include_package &&
151 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP &&
154 AC_ARG_WITH(gmp-library,
155 [ --with-gmp-library=DIR DIR where the gmp library is installed],
156 [ echo "Package gmp-library : $withval" &&
157 gmp_library_package=$withval &&
158 GMP_LIB=$gmp_library_package &&
159 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP &&
162 AC_ARG_ENABLE(int-version,
163 [ --enable-int-version 'int' (32 bits) version is built],
164 [ echo "Package int : $enableval" &&
166 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_LONG])
168 AC_ARG_ENABLE(llint-version,
169 [ --enable-llint-version 'long long int' (64 bits) version is built],
170 [ echo "Package long long int : $enableval" &&
172 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_LONGLONG])
174 AC_ARG_ENABLE(mp-version,
175 [ --enable-mp-version 'MP' (multiple precision) version is built],
176 [ echo "Package mp : $enableval" &&
178 CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP &&
181 AC_ARG_ENABLE(piplib-hybrid,
182 [ --enable-piplib-hybrid Link with piplib-hybrid],
183 [ echo "Piplib-hybrid support : $enableval" &&
184 if test "x$enableval" = "xyes"; then
185 CPPFLAGS=-DCANDL_HAS_PIPLIB_HYBRID
189 dnl /**************************************************************************
190 dnl * Where is the PipLib Library? *
191 dnl **************************************************************************/
193 AX_SUBMODULE(piplib,system|build|bundled,system)
195 AC_SUBST(PIPLIB_CPPFLAGS)
196 AC_SUBST(PIPLIB_LDFLAGS)
197 AC_SUBST(PIPLIB_LIBS)
198 case "$with_piplib" in
200 PIPLIB_CPPFLAGS="-I$srcdir/piplib/include -Ipiplib/include"
201 PIPLIB_LIBS="$srcdir/piplib/libpiplib$BITS.la"
204 PIPLIB_CPPFLAGS="-I$piplib_srcdir/include -I$with_piplib_builddir/include"
205 PIPLIB_LIBS="$with_piplib_builddir/libpiplib$BITS.la"
208 if test "x$with_piplib_prefix" != "x"; then
209 PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
211 if test "x$with_piplib_exec_prefix" != "x"; then
212 PIPLIB_LDFLAGS="-L$with_piplib_exec_prefix/lib"
214 PIPLIB_LIBS="$with_piplib_prefix/lib/libpiplib$BITS.la -lpiplib$BITS"
216 AM_CONDITIONAL(BUNDLED_PIPLIB, test $with_piplib = bundled)
220 dnl /**************************************************************************
221 dnl * Where is GMP? *
222 dnl **************************************************************************/
226 AC_MSG_CHECKING(whether gmp works)
227 if test "$gmp_package" = "no"; then
228 echo "GMP package not defined"
232 if test "$NEED_MP" = "no"; then
233 echo "Mode normal GMP"
234 TO_BUILD="$TO_BUILD MP"
235 AC_CHECK_HEADER(gmp.h,
236 [AC_SEARCH_LIBS([__gmpz_init], [gmp],
237 [LIBS="$LIBS -lgmp"],
238 [echo "Can't find gmp library." &&
239 echo "MP version will not be built." &&
241 [echo "Can't find gmp headers." &&
242 echo "MP version will not be built." &&
245 dnl Default given by --with-X is "yes", --without-X is "no". We also
246 dnl initialized manually all gmp_package* variables to "yes" (thus they are
247 dnl supposed to be "yes" except if the user set them himself).
248 if test "$gmp_package" != "yes" ; then
249 echo "(GMP path has been set by user)"
251 dnl Useful for AC_CHECK_X to find what we want.
252 CPPFLAGS="-I$GMP_DIR/include $CPPFLAGS"
253 LDFLAGS="-L$GMP_DIR/lib $LDFLAGS"
256 if test "$gmp_include_package" != "yes" ; then
257 CPPFLAGS="-I$GMP_INC $CPPFLAGS"
260 if test "$gmp_library_package" != "yes" ; then
261 LDFLAGS="-L$GMP_LIB $LDFLAGS"
264 AC_CHECK_HEADER(gmp.h,
266 [AC_MSG_ERROR(Can't find gmp headers.)])
267 AC_SEARCH_LIBS([__gmpz_init], [gmp],
268 [LIBS="$LIBS -lgmp"],
269 [AC_MSG_ERROR(Can't find gmp library.)])
275 dnl /**************************************************************************
276 dnl * Substitutions *
277 dnl **************************************************************************/
280 dnl Substitutions to do.
282 AC_SUBST(DEFINE_HAS_ISL_LIB)
284 AC_SUBST(abs_top_srcdir)
287 dnl Configure Makefiles.
292 include/candl/macros.h
293 include/candl/piplib.h
296 [test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
298 #if test $with_piplib = system; then
299 # AC_CONFIG_SUBDIRS(piplib)
301 if test $with_osl = bundled; then
302 AC_CONFIG_SUBDIRS(osl)
305 dnl forcing candl to use local libcandl.la
306 dnl if --prefix is not specified
307 CANDL_LIBS="$srcdir/libcandl.la -lcandl"
314 echo " /*-----------------------------------------------*"
315 echo " * Candl configuration is OK *"
316 echo " *-----------------------------------------------*/"
317 echo "It appears that your system is OK to start Candl compilation. You need"
318 echo "now to type \"make\". Lastly type \"make install\" to install Candl on"
319 echo "your system (log as root if necessary)."