Change semantics of cloog_domain_cut_first
[cloog/uuh.git] / configure.in
blob597953537fd256a29b8ee364cdb1912556e15094
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 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.                                              *
26 dnl *                                                                         *
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.                                *
31 dnl *                                                                         *
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                  *
35 dnl *                                                                         *
36 dnl * CLooG, the Chunky Loop Generator                                        *
37 dnl * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr                      *
38 dnl *                                                                         *
39 dnl ***************************************************************************/
41 AC_PREREQ(2.13)
42 AC_INIT(source/cloog.c)
43 AC_CONFIG_AUX_DIR(autoconf)
44 AM_INIT_AUTOMAKE(cloog, 0.14.0)
45 dnl default version
46 BITS="64"
48 dnl /**************************************************************************
49 dnl  *                              Checking                                  *
50 dnl  **************************************************************************/
52 dnl Checks for programs.
53 AC_PROG_CC
54 AC_PROG_LN_S
55 AC_PROG_MAKE_SET
56 AC_CHECK_PROG(CD, cd)
57 dnl Configure needs an empty install.sh file with this, i HATE that...
58 AC_PROG_INSTALL
59 AC_PROG_LIBTOOL
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.
66 AC_C_CONST
67 AC_TYPE_SIZE_T
71 dnl Checks for header files.
72 AC_HEADER_STDC
75 dnl Checks for library functions.
76 AC_CHECK_FUNCS(strtol)
79 dnl /**************************************************************************
80 dnl  *                             Option setting                             *
81 dnl  **************************************************************************/
83 MP_BITS="MP"
84 MP_DFLAGS=-DLINEAR_VALUE_IS_MP
86 AC_ARG_WITH(bits,
87             [AS_HELP_STRING([--with-bits=32|64|gmp],
88                             [integer type to use])],
89             [ BITS=$withval ])
92 dnl /**************************************************************************
93 dnl  *                            Where is GMP?                               *
94 dnl  **************************************************************************/
96 gmp_module_default=no
97 if test "$BITS" = "gmp"; then
98         gmp_module_default=system
100 AX_SUBMODULE(gmp,no|system,$gmp_module_default)
102 case "$with_gmp" in
103 system)
104     if test "x$with_gmp_prefix" != "x"; then
105         CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
106     fi
107     
108     if test "$with_gmp_exec_prefix" != "yes" ; then
109         LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
110     fi
111      
112     AC_CHECK_HEADER(gmp.h,
113                     [],
114                     [AC_MSG_ERROR(Can't find gmp headers.)])
115     AC_CHECK_LIB(gmp,
116                  __gmpz_init,
117                  [LIBS="$LIBS -lgmp"],
118                  [AC_MSG_ERROR(Can't find gmp library.)])
119     ;;
120 esac
122 # all compiled libraries
123 CLOOG_LIBRARIES=""
124 AC_SUBST(CLOOG_LIBRARIES)
125 # backend used by executables
126 BACKEND=""
127 AC_SUBST(BACKEND)
129 dnl /**************************************************************************
130 dnl  *                          Where is PolyLib?                             *
131 dnl  **************************************************************************/
133 AX_SUBMODULE(polylib,no|system|build,system)
135 polylibs="64 32"
136 case "$BITS" in
137     32|64|gmp)
138         polylibs=$BITS
139     ;;
140 esac
142 dnl Checking for PolyLib
143 AC_SUBST(cl_cv_polylib)
144 AC_SUBST(POLYLIB_CPPFLAGS)
145 AC_SUBST(POLYLIB_LDFLAGS)
146 AC_SUBST(POLYLIB_LIBS)
148 AC_MSG_CHECKING(for location of PolyLib)
149 if test "x$with_polylib_builddir" != "x"; then
150         AC_MSG_RESULT(built in $with_polylib_builddir)
151         polylib_polylibs=`echo @polylibs@ | $with_polylib_builddir/config.status --file=-`
152         AC_MSG_NOTICE(Configured polylibs: $polylib_polylibs)
153         CPPFLAGS="-I$with_polylib_builddir/include -I$polylib_srcdir/include $CPPFLAGS"
154         for BITS in $polylibs; do
155                 cl_cv_polylib=missing
156                 for PL in $polylib_polylibs; do
157                         if test "libpolylib$BITS.la" = $PL; then
158                                 cl_cv_polylib="polylib$BITS"
159                                 break;
160                         fi
161                 done
162                 if test "$cl_cv_polylib" != "missing"; then
163                         LIBS="$with_polylib_builddir/lib$cl_cv_polylib.la $LIBS"
164                         break;
165                 fi
166         done
167 else
168         if test "x$with_polylib_prefix" != "x"; then
169                 AC_MSG_RESULT(installed in $with_polylib_exec_prefix)
170                 CPPFLAGS="-I$with_polylib_prefix/include $CPPFLAGS"
171                 LDFLAGS="-L$with_polylib_exec_prefix/lib $LDFLAGS"
172                 LD_LIBRARY_PATH="$with_polylib_exec_prefix/lib:$LD_LIBRARY_PATH"
173                 export LD_LIBRARY_PATH
174         else
175                 AC_MSG_RESULT(installed in standard location)
176         fi
177         for BITS in $polylibs; do
178                 cl_cv_polylib="polylib$BITS"
179                 AC_CHECK_HEADER(polylib/$cl_cv_polylib.h,[
180                         AC_CHECK_LIB($cl_cv_polylib,PolyhedronTSort,[
181                                 LIBS="-l$cl_cv_polylib $LIBS"
182                                 break
183                         ])
184                 ])
185                 cl_cv_polylib=missing
186         done
188 if test "$cl_cv_polylib" = "missing"; then
189         AC_MSG_ERROR(Can't find PolyLib.)
190 else
191         CLOOG_LIBRARIES="$CLOOG_LIBRARIES libcloog-polylib.la"
192         BACKEND="polylib"
194 case "$BITS" in
195         gmp)
196                 cl_cv_int_type=gmp
197                 ;;
198         32|64)
199                 AC_CHECK_SIZEOF(int,1)
200                 AC_CHECK_SIZEOF(long,1)
201                 AC_CHECK_SIZEOF(long long,1)
202                 for cl_cv_int_type in int long long_long; do
203                         eval "bits=\`expr \$ac_cv_sizeof_$cl_cv_int_type \* 8\`"
204                         if test "$bits" = "$BITS"; then
205                                 break
206                         fi
207                 done
208                 ;;
209 esac
210 AC_DEFINE_UNQUOTED(AS_TR_CPP(CLOOG_INT_$cl_cv_int_type))
212 AC_SUBST(GIT_INDEX)
213 if test -f $srcdir/.git/HEAD; then
214         GIT_INDEX="\$(top_srcdir)/.git/index"
218 dnl /**************************************************************************
219 dnl  *                            Substitutions                               *
220 dnl  **************************************************************************/
223 dnl Substitutions to do in Makefile.in.
224 AC_SUBST(target)
225 AC_SUBST(CC)
226 AC_SUBST(LN_S)
227 AC_SUBST(SHEXT)
229 AC_SUBST(prefix)
230 AC_SUBST(exec_prefix)
231 AC_SUBST(INSTALL)
233 AC_SUBST(BITS)
235 AC_CONFIG_HEADERS(config.h)
236 AC_CONFIG_HEADERS(include/cloog/int.h)
237 AC_CONFIG_FILES(Makefile test/Makefile include/cloog/polylib/cloog.h)
238 AC_CONFIG_FILES(autoconf/Doxyfile)
239 AC_CONFIG_FILES(doc/Makefile)
240 AC_CONFIG_FILES(source/version.c)
241 AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
242 AC_CONFIG_COMMANDS([version.h],
243         [echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
244 AC_CONFIG_COMMANDS([doc/gitversion.texi],
245         [echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
246 AC_OUTPUT
249 echo "             /*-----------------------------------------------*"
250 echo "              *           CLooG configuration is OK           *"
251 echo "              *-----------------------------------------------*/"
252 echo "It appears that your system is OK to start CLooG compilation. You need"
253 echo "now to type \"make\". After compilation, you should check CLooG by typing"
254 echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
255 echo "you are upgrading an old version. Lastly type \"make install\" to install"
256 echo "CLooG on your system (log as root if necessary)."