Fix system isl include path
[cloog/uuh.git] / configure.in
blob65561f39118929631d5da51b9e71469eaf9408a7
2 dnl /**-------------------------------------------------------------------**
3 dnl  **                              CLooG                                **
4 dnl  **-------------------------------------------------------------------**
5 dnl  **                           configure.in                            **
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 AC_PREREQ(2.13)
43 AC_INIT(source/cloog.c)
44 AC_CONFIG_AUX_DIR(autoconf)
45 AC_CONFIG_MACRO_DIR([m4])
47 VERSION_MAJOR=0
48 VERSION_MINOR=14
49 VERSION_REVISION=0
51 AM_INIT_AUTOMAKE(cloog, "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
53 dnl /**************************************************************************
54 dnl  *                              Checking                                  *
55 dnl  **************************************************************************/
57 dnl Checks for programs.
58 AC_PROG_CC
59 AC_PROG_LN_S
60 AC_PROG_MAKE_SET
61 AC_CHECK_PROG(CD, cd)
62 dnl Configure needs an empty install.sh file with this, i HATE that...
63 AC_PROG_INSTALL
64 AC_PROG_LIBTOOL
65 AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
66 AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")
68 AX_CC_MAXOPT
69 AC_SUBST(CFLAGS_WARN)
70 AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
72 dnl Checks for typedefs, structures, and compiler characteristics.
73 AC_C_CONST
74 AC_TYPE_SIZE_T
78 dnl Checks for header files.
79 AC_HEADER_STDC
82 dnl Checks for library functions.
83 AC_CHECK_FUNCS(strtol)
86 dnl /**************************************************************************
87 dnl  *                             Option setting                             *
88 dnl  **************************************************************************/
90 AC_CHECK_HEADERS([sys/resource.h],
91         [AC_DEFINE([CLOOG_RUSAGE], [], [Print time required to generate code])])
93 AX_SUBMODULE(isl,no|system|build|bundled,bundled)
94 BITS="gmp"
96 dnl /**************************************************************************
97 dnl  *                            Where is GMP?                               *
98 dnl  **************************************************************************/
100 AX_SUBMODULE(gmp,system,system)
102 need_get_memory_functions=false
103 case "$with_gmp" in
104 system)
105     if test "x$with_gmp_prefix" != "x"; then
106         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
107     fi
108     
109     if test "$with_gmp_exec_prefix" != "yes" ; then
110         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
111     fi
112      
113     AC_CHECK_HEADER(gmp.h,
114                     [],
115                     [AC_MSG_ERROR(Can't find gmp headers.)])
116     AC_CHECK_LIB(gmp,
117                  __gmpz_init,
118                  [LIBS="$LIBS -lgmp"],
119                  [AC_MSG_ERROR(Can't find gmp library.)])
120     AC_CHECK_DECLS(mp_get_memory_functions,[],[
121             need_get_memory_functions=true
122     ],[#include <gmp.h>])
123     ;;
124 esac
125 AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
126                 test x$need_get_memory_functions = xtrue)
128 dnl /**************************************************************************
129 dnl  *                          Where is isl?                                 *
130 dnl  **************************************************************************/
132 AC_SUBST(ISL_CPPFLAGS)
133 AC_SUBST(ISL_LDFLAGS)
134 AC_SUBST(ISL_LIBS)
135 case "$with_isl" in
136 bundled)
137         ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
138         ;;
139 build)
140         ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
141         ISL_LIBS="$with_isl_builddir/libisl.la"
142         ;;
143 system)
144         if test "x$with_isl_prefix" != "x"; then
145                 ISL_CPPFLAGS="-I$with_isl_prefix/include/isl"
146         fi
147         if test "x$with_isl_exec_prefix" != "x"; then
148                 ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
149         fi
150         ISL_LIBS="-lisl"
151 esac
152 AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
153 AM_CONDITIONAL(NO_ISL, test $with_isl = no)
156 AC_DEFINE([CLOOG_INT_GMP], 1, [Use arbitrary precision integers])
158 AC_SUBST(GIT_INDEX)
159 if test -f $srcdir/.git/HEAD; then
160         GIT_INDEX="\$(top_srcdir)/.git/index"
164 dnl /**************************************************************************
165 dnl  *                            Substitutions                               *
166 dnl  **************************************************************************/
169 dnl Substitutions to do in Makefile.in.
170 AC_SUBST(CC)
171 AC_SUBST(LN_S)
173 AC_SUBST(prefix)
174 AC_SUBST(exec_prefix)
175 AC_SUBST(INSTALL)
177 AC_SUBST(BITS)
179 AC_SUBST(VERSION_MAJOR)
180 AC_SUBST(VERSION_MINOR)
181 AC_SUBST(VERSION_REVISION)
183 PACKAGE_NAME="cloog-isl"
184 PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
185 AX_CREATE_PKGCONFIG_INFO
187 AC_CONFIG_FILES(Makefile test/Makefile)
188 AC_CONFIG_FILES(autoconf/Doxyfile)
189 AC_CONFIG_FILES(doc/Makefile)
190 AC_CONFIG_FILES(source/version.c)
191 AC_CONFIG_FILES(include/cloog/version.h)
192 AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
193 AC_CONFIG_COMMANDS([version.h],
194         [echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
195 AC_CONFIG_COMMANDS([doc/gitversion.texi],
196         [echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
197 if test $with_isl = bundled; then
198         AC_CONFIG_SUBDIRS(isl)
200 AC_CONFIG_COMMANDS_POST([
201         ac_configure_args="$ac_configure_args $cloog_configure_args"
203 AC_OUTPUT
206 echo "             /*-----------------------------------------------*"
207 echo "              *           CLooG configuration is OK           *"
208 echo "              *-----------------------------------------------*/"
209 echo "It appears that your system is OK to start CLooG compilation. You need"
210 echo "now to type \"make\". After compilation, you should check CLooG by typing"
211 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
212 echo "you are upgrading an old version. Lastly type \"make install\" to install"
213 echo "CLooG on your system (log as root if necessary)."