-
Notifications
You must be signed in to change notification settings - Fork 25
/
configure.ac
310 lines (265 loc) · 10.5 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
dnl /**-------------------------------------------------------------------**
dnl ** CLooG **
dnl **-------------------------------------------------------------------**
dnl ** configure.ac **
dnl **-------------------------------------------------------------------**
dnl ** First version: august 7th 2002 **
dnl **-------------------------------------------------------------------**/
dnl
dnl Input file for autoconf to build a configuration shellscript.
dnl To build the configure script from the CLooG's top-level directory, use
dnl autoconf -l autoconf autoconf/configure.in > configure
dnl if it doesn't work (invalid option -l) try -I instead
dnl autoconf -I autoconf autoconf/configure.in > configure
dnl /**************************************************************************
dnl * CLooG : the Chunky Loop Generator (experimental) *
dnl ***************************************************************************
dnl * *
dnl * Copyright (C) 2001 Cedric Bastoul *
dnl * *
dnl * This library is free software; you can redistribute it and/or *
dnl * modify it under the terms of the GNU Lesser General Public *
dnl * License as published by the Free Software Foundation; either *
dnl * version 2.1 of the License, or (at your option) any later version. *
dnl * *
dnl * This library is distributed in the hope that it will be useful, *
dnl * but WITHOUT ANY WARRANTY; without even the implied warranty of *
dnl * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
dnl * Lesser General Public License for more details. *
dnl * *
dnl * You should have received a copy of the GNU Lesser General Public *
dnl * License along with this library; if not, write to the Free Software *
dnl * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
dnl * Boston, MA 02110-1301 USA *
dnl * *
dnl * CLooG, the Chunky Loop Generator *
dnl * Written by Cedric Bastoul, [email protected] *
dnl * *
dnl ***************************************************************************/
m4_define([version_major], [0])
m4_define([version_minor], [21])
m4_define([version_revision], [1])
AC_PREREQ(2.53)
AC_INIT([cloog], [version_major.version_minor.version_revision],
AC_CONFIG_SRCDIR(source/cloog.c)
AC_CONFIG_AUX_DIR(autoconf)
AC_CONFIG_MACRO_DIR([m4])
VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=version_revision
AC_SUBST(versioninfo)
versioninfo=4:0:0
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
dnl /**************************************************************************
dnl * Checking *
dnl **************************************************************************/
dnl Checks for programs.
AC_PROG_CC
AM_PROG_AR
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG(CD, cd)
dnl Configure needs an empty install.sh file with this, i HATE that...
AC_PROG_INSTALL
LT_INIT
AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, [])
AM_CONDITIONAL(HAVE_TEXI2DVI, test -n "$TEXI2DVI")
AX_CC_MAXOPT
AC_SUBST(CFLAGS_WARN)
AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)
dnl /**************************************************************************
dnl * Option setting *
dnl **************************************************************************/
AC_CHECK_FUNCS([getrusage],
[AC_DEFINE([CLOOG_RUSAGE], [], [Print time required to generate code])])
AX_SUBMODULE(isl,no|system|build|bundled,bundled)
dnl /**************************************************************************
dnl * Where is GMP? *
dnl **************************************************************************/
AC_ARG_WITH(cloog-int,
[AS_HELP_STRING(
[--with-cloog-int=gmp|int|long|longlong],
[Integer precision to use (default gmp)])])
if test "x$with_cloog_int" = "x"; then
with_cloog_int="gmp"
fi
AX_SUBMODULE(gmp,system|build,system)
need_get_memory_functions=false
case "$with_cloog_int" in
gmp)
BITS="gmp"
CLOOG_INT_CONFIGURE="CLOOG_INT_GMP"
case "$with_gmp" in
build)
CPPFLAGS="-I$with_gmp_builddir $CPPFLAGS"
LDFLAGS="-L$with_gmp_builddir/$lt_cv_objdir $LDFLAGS"
;;
system)
if test "x$with_gmp_prefix" != "x"; then
CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
fi
if test "$with_gmp_exec_prefix" != "yes" ; then
LDFLAGS="-L$with_gmp_exec_prefix/lib $LDFLAGS"
fi
;;
esac
case "$with_gmp" in
build|system)
AC_CHECK_HEADER(gmp.h,
[],
[AC_MSG_ERROR(Can't find gmp headers.)])
AC_CHECK_LIB(gmp,
__gmpz_init,
[LIBS="$LIBS -lgmp"],
[AC_MSG_ERROR(Can't find gmp library.)])
AC_CHECK_DECLS(mp_get_memory_functions,[],[
need_get_memory_functions=true
],[#include <gmp.h>])
;;
esac
;;
int)
BITS="int"
CLOOG_INT_CONFIGURE="CLOOG_INT_INT"
;;
long)
BITS="long"
CLOOG_INT_CONFIGURE="CLOOG_INT_LONG"
;;
longlong)
BITS="longlong"
CLOOG_INT_CONFIGURE="CLOOG_INT_LONG_LONG"
;;
*)
AC_MSG_ERROR([Unknown integer type: $with_cloog_int])
;;
esac
AM_CONDITIONAL(NEED_GET_MEMORY_FUNCTIONS,
test x$need_get_memory_functions = xtrue)
dnl /**************************************************************************
dnl * Where is isl? *
dnl **************************************************************************/
AC_SUBST(ISL_CPPFLAGS)
AC_SUBST(ISL_LDFLAGS)
AC_SUBST(ISL_LIBS)
case "$with_isl" in
bundled)
ISL_CPPFLAGS="-I$srcdir/isl/include -Iisl/include"
CPPFLAGS="-DISL_USING_GMP_VAL=1 $CPPFLAGS"
;;
build)
TMPCPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include $CPPFLAGS"
AC_CHECK_HEADER([isl/val_gmp.h])
CPPFLAGS="$TMPCPPFLAGS"
if test "$ac_cv_header_isl_val_gmp_h" = "yes"; then
CPPFLAGS="-DISL_USING_GMP_VAL=1 $CPPFLAGS"
else
CPPFLAGS="-DISL_USING_GMP_VAL=0 $CPPFLAGS"
fi
ISL_CPPFLAGS="-I$isl_srcdir/include -I$with_isl_builddir/include"
ISL_LIBS="$with_isl_builddir/libisl.la"
;;
system)
TMPCPPFLAGS="$CPPFLAGS"
CPPFLAGS="-I$with_isl_prefix/include $CPPFLAGS"
AC_CHECK_HEADER([isl/val_gmp.h])
CPPFLAGS="$TMPCPPFLAGS"
if test "$ac_cv_header_isl_val_gmp_h" = "yes"; then
CPPFLAGS="-DISL_USING_GMP_VAL=1 $CPPFLAGS"
else
CPPFLAGS="-DISL_USING_GMP_VAL=0 $CPPFLAGS"
fi
if test "x$with_isl_prefix" != "x"; then
ISL_CPPFLAGS="-I$with_isl_prefix/include"
fi
if test "x$with_isl_exec_prefix" != "x"; then
ISL_LDFLAGS="-L$with_isl_exec_prefix/lib"
fi
ISL_LIBS="-lisl"
esac
AM_CONDITIONAL(BUNDLED_ISL, test $with_isl = bundled)
AM_CONDITIONAL(NO_ISL, test $with_isl = no)
dnl /**************************************************************************
dnl * Where is the OpenScop Library? *
dnl **************************************************************************/
AX_SUBMODULE(osl,no|system|build|bundled,bundled)
osl_flag="OSL_SUPPORT"
AC_SUBST(OSL_CPPFLAGS)
AC_SUBST(OSL_LDFLAGS)
AC_SUBST(OSL_LIBS)
case "$with_osl" in
bundled)
OSL_CPPFLAGS="-D$osl_flag -I$srcdir/osl/include -Iosl/include"
;;
build)
OSL_CPPFLAGS="-D$osl_flag -I$osl_srcdir/include -I$with_osl_builddir/include"
OSL_LIBS="$with_osl_builddir/libosl.la"
;;
system)
if test "x$with_osl_prefix" != "x"; then
OSL_CPPFLAGS="-I$with_osl_prefix/include"
fi
if test "x$with_osl_exec_prefix" != "x"; then
OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
fi
OSL_LIBS="-losl"
OSL_CPPFLAGS+=" -D$osl_flag"
esac
AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
AM_CONDITIONAL(NO_OSL, test $with_osl = no)
AC_SUBST(GIT_INDEX)
if test -f $srcdir/.git/HEAD; then
GIT_INDEX="\$(top_srcdir)/.git/index"
fi
dnl /**************************************************************************
dnl * Substitutions *
dnl **************************************************************************/
dnl Substitutions to do in Makefile.in.
AC_SUBST(CC)
AC_SUBST(LN_S)
AC_SUBST(prefix)
AC_SUBST(exec_prefix)
AC_SUBST(INSTALL)
AC_SUBST(BITS)
AC_SUBST(CLOOG_INT_CONFIGURE)
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
PACKAGE_NAME="cloog-isl"
AX_CREATE_PKGCONFIG_INFO
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(autoconf/Doxyfile)
AC_CONFIG_FILES(source/version.c)
AC_CONFIG_FILES(include/cloog/int.h)
AC_CONFIG_FILES(include/cloog/version.h)
AC_CONFIG_FILES([genversion.sh], [chmod +x genversion.sh])
AC_CONFIG_COMMANDS([version.h],
[echo '#define CLOOG_HEAD "'`./genversion.sh`'"' > version.h])
AC_CONFIG_COMMANDS([doc/gitversion.texi],
[echo '@set VERSION '`./genversion.sh`'' > doc/gitversion.texi])
if test $with_isl = bundled; then
AC_CONFIG_SUBDIRS(isl)
fi
if test $with_osl = bundled; then
AC_CONFIG_SUBDIRS(osl)
fi
AC_CONFIG_COMMANDS_POST([
ac_configure_args="$ac_configure_args $cloog_configure_args"
])
AC_OUTPUT
echo " /*-----------------------------------------------*"
echo " * CLooG configuration is OK *"
echo " *-----------------------------------------------*/"
echo "It appears that your system is OK to start CLooG compilation. You need"
echo "now to type \"make\". After compilation, you should check CLooG by typing"
echo "\"make check\". If no problem occur, you can type \"make uninstall\" if"
echo "you are upgrading an old version. Lastly type \"make install\" to install"
echo "CLooG on your system (log as root if necessary)."