-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
349 lines (300 loc) · 10.7 KB
/
configure.in
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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
dnl
dnl configure.in
dnl
dnl PLUTO - parallelism and locality transformer (experimental)
dnl
dnl Copyright (C) 2007-2008 Uday Bondhugula
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License
dnl as published by the Free Software Foundation; either version 2
dnl of the License, or (at your option) any later version.
dnl
dnl The complete GNU General Public Licence Notice can be found as the
dnl `COPYING' file in the top-level directory.
dnl
AC_PREREQ(2.13)
AC_INIT(pluto, 0.9.0, [udayreddy@gmail.com])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE()
AM_CONFIG_HEADER(config.h)
dnl clan, candl, cloog are all configured with 64-bit data type support
dnl NOTE: configuring these 64-bit data type support has nothing to do with arch
dnl being 32-bit/64-bit
CFLAGS="$CLAGS -Wall"
if test CC = icc; then
LDFLAGS="$LDFLAGS -lirc -limf"
fi
debug="false"
dnl debugging flag
AC_ARG_ENABLE(debug,
[ --enable-debug enable compilation with debugging info ],
debug="true")
if test $debug = "true"; then
CFLAGS="$CFLAGS -g -DDEBUG"
fi
dnl check for programs
AC_CHECK_PROG(CC,gcc,gcc)
AC_PROG_CXX
dnl AC_CHECK_PROG(CXX,g++,g++)
AC_CHECK_PROG(LD,ld,ld)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
dnl check for some compiler characteristics
dnl MC_CHECK_GUIDING_DECLS
AC_SUBST(GUIDING_DECLS)
dnl check for typedefs, structures, compiler features
AC_C_CONST
AC_CHECK_HEADERS(math.h stdlib.h stdio.h assert.h string.h)
dnl set SOURCE_DIR to current directory
SOURCE_DIR=`pwd`
AC_SUBST(SOURCE_DIR)
AC_CHECK_PROG(CP,cp,cp)
AC_CHECK_PROG(RM,rm,rm -f)
AC_CHECK_PROG(MV,mv,mv)
AC_CHECK_PROG(CAT,cat,cat)
AC_CHECK_PROG(AR,ar,ar)
AC_CHECK_PROG(STRIP,strip,strip)
AC_CHECK_PROG(SED,sed,sed)
dnl Offer --with-gmp-prefix.
AC_ARG_WITH(gmp-prefix,
AC_HELP_STRING([--with-gmp-prefix=DIR],
[DIR Location of GMP package]),
[CPPFLAGS="${CPPFLAGS} -I$withval/include";
LDFLAGS="${LDFLAGS} -L$withval/lib";
LIBS="-lgmp $LIBS";
GMP_PREFIX="$withval";
])
AC_CHECK_HEADER(gmp.h,
[AC_CHECK_LIB(gmp,main,
[poly_cv_gmpfatal="no"],
[poly_cv_gmpfatal="yes"])],
[poly_cv_gmpfatal="yes"])
if test "$poly_cv_gmpfatal" = "yes"; then
AC_MSG_ERROR([GMP not found])
else
AC_CHECK_DECLS(mp_get_memory_functions,[],[
AC_LIBOBJ(mp_get_memory_functions)
],[#include <gmp.h>
])
fi
AC_SUBST(PIPLIB_INCLUDE)
AC_SUBST(PIPLIB_LDFLAGS)
AC_SUBST(PIPLIB_LIBADD)
dnl Provide --with-piplib-prefix
AC_ARG_WITH(piplib-prefix,
AC_HELP_STRING([--with-piplib-prefix=DIR],
[DIR location where piplib is installed]),
[piplib_prefix=$withval;
PIPLIB_INCLUDE="-I$withval/include";
PIPLIB_LDFLAGS="-L$withval/lib";
PIPLIB_LIBADD="$withval/lib/libpiplibMP.la";
external_piplib=true
],
[PIPLIB_INCLUDE="-I../piplib/include";
PIPLIB_LDFLAGS="-L../piplib";
PIPLIB_LIBADD="../piplib/libpiplibMP.la";
external_piplib=false])
AM_CONDITIONAL(EXTERNAL_PIPLIB, test x$external_piplib = xtrue)
if test x$external_piplib = xfalse; then
dnl Configuring PipLib (long long int is 64 bits)
echo -e "\n=========================="
echo "Configuring PipLib"
echo "=========================="
configureopts="--with-bits=64 --prefix=$prefix"
(cd piplib/
$RM config.cache;
./configure ${configureopts}
)
fi
AC_SUBST(OSL_INCLUDE)
AC_SUBST(OSL_LDFLAGS)
AC_SUBST(OSL_LIBADD)
dnl Provide --with-osl-prefix
AC_ARG_WITH(osl-prefix,
AC_HELP_STRING([--with-osl-prefix=DIR],
[DIR location where osl is installed]),
[osl_prefix=$withval;
OSL_INCLUDE="-I$withval/include";
OSL_LDFLAGS="-L$withval/lib";
OSL_LIBADD="$withval/lib/libosl.la";
external_osl=true
],
[OSL_INCLUDE="-I../openscop/include";
OSL_LDFLAGS="-L../openscop";
OSL_LIBADD="../openscop/libosl.la";
external_osl=false])
AM_CONDITIONAL(EXTERNAL_OSL, test x$external_osl = xtrue)
if test x$external_osl = xfalse; then
dnl Configuring Openscop
echo -e "\n=========================="
echo "Configuring Openscop"
echo "=========================="
configureopts="--enable-llint-version --prefix=$prefix"
(cd openscop/
./configure ${configureopts}
)
fi
AC_SUBST(CLAN_INCLUDE)
AC_SUBST(CLAN_LDFLAGS)
AC_SUBST(CLAN_LIBADD)
dnl Provide --with-clan-prefix
AC_ARG_WITH(clan-prefix,
AC_HELP_STRING([--with-clan-prefix=DIR],
[DIR location where clan is installed]),
[clan_prefix=$withval;
CLAN_INCLUDE="-I$withval/include";
CLAN_LDFLAGS="-L$withval/lib";
CLAN_LIBADD="$withval/lib/libclan.la";
external_clan=true
],
[CLAN_INCLUDE="-I../clan/include";
CLAN_LDFLAGS="-L../clan";
CLAN_LIBADD="../clan/libclan.la";
external_clan=false])
AM_CONDITIONAL(EXTERNAL_CLAN, test x$external_clan = xtrue)
if test x$external_clan = xfalse; then
dnl Configuring Clan-osl
echo -e "\n=========================="
echo "Configuring Clan"
echo "=========================="
configureopts="--enable-llint-version --prefix=$prefix \
--with-osl=build --with-osl-builddir=$SOURCE_DIR/openscop"
(cd clan/
./configure ${configureopts}
)
fi
AC_SUBST(CANDL_INCLUDE)
AC_SUBST(CANDL_LDFLAGS)
AC_SUBST(CANDL_LIBADD)
dnl Provide --with-candl-prefix
AC_ARG_WITH(candl-prefix,
AC_HELP_STRING([--with-candl-prefix=DIR],
[DIR location where candl is installed]),
[candl_prefix=$withval;
CANDL_INCLUDE="-I$withval/include";
CANDL_LDFLAGS="-L$withval/lib";
CANDL_LIBADD="$withval/lib/libcandl.la";
external_candl=true
],
[CANDL_INCLUDE="-I../candl/include";
CANDL_LDFLAGS="-L../candl";
CANDL_LIBADD="../candl/libcandl.la";
external_candl=false])
AM_CONDITIONAL(EXTERNAL_CANDL, test x$external_candl = xtrue)
if test x$external_candl = xfalse; then
dnl Configuring Candl-osl
echo -e "\n=========================="
echo "Configuring Candl"
echo "=========================="
configureopts="--enable-llint-version --prefix=$prefix \
--with-piplib=build --with-piplib-builddir=$SOURCE_DIR/piplib \
--with-osl=build --with-osl-builddir=$SOURCE_DIR/openscop"
(cd candl/
./configure ${configureopts}
)
fi
AC_SUBST(POLYLIB_INCLUDE)
AC_SUBST(POLYLIB_LDFLAGS)
AC_SUBST(POLYLIB_LIBADD)
dnl Provide --with-polylib-prefix
AC_ARG_WITH(polylib-prefix,
AC_HELP_STRING([--with-polylib-prefix=DIR],
[DIR location where polylib is installed]),
[polylib_prefix=$withval;
POLYLIB_INCLUDE="-I$withval/include";
POLYLIB_LDFLAGS="-L$withval/lib";
POLYLIB_LIBADD="$withval/lib/libpolylib64.la";
external_polylib=true
],
[POLYLIB_INCLUDE="-I../polylib/include";
POLYLIB_LDFLAGS="-L../polylib";
POLYLIB_LIBADD="../polylib/libpolylib64.la";
external_polylib=false])
AM_CONDITIONAL(EXTERNAL_POLYLIB, test x$external_polylib = xtrue)
if test x$external_polylib = xfalse; then
dnl Configuring polylib
echo -e "\n======================"
echo "Configuring polylib"
echo "======================"
configureopts="--enable-longlongint-lib --prefix=$prefix"
(cd polylib/
./configure ${configureopts}
)
fi
AC_SUBST(ISL_INCLUDE)
AC_SUBST(ISL_LDFLAGS)
AC_SUBST(ISL_LIBADD)
dnl Provide --with-isl-prefix
AC_ARG_WITH(isl-prefix,
AC_HELP_STRING([--with-isl-prefix=DIR],
[DIR location where isl is installed]),
[isl_prefix=$withval;
ISL_INCLUDE="-I$withval/include";
ISL_LDFLAGS="-L$withval/lib";
ISL_LIBADD="$withval/lib/libisl.la";
external_isl=true
],
[external_isl=false])
AM_CONDITIONAL(EXTERNAL_ISL, test x$external_isl = xtrue)
if test x$external_isl = xfalse; then
dnl Configuring isl
echo -e "\n======================"
echo "Configuring isl"
echo "======================"
configureopts="--with-gmp-prefix=$GMP_PREFIX --with-gmp-exec-prefix=$GMP_PREFIX --prefix=$prefix"
(cd isl/
./configure ${configureopts}
)
fi
AC_SUBST(CLOOGISL_INCLUDE)
AC_SUBST(CLOOGISL_LDFLAGS)
AC_SUBST(CLOOGISL_LIBADD)
dnl Provide --with-cloog-prefix
AC_ARG_WITH(cloog-prefix,
AC_HELP_STRING([--with-cloog-prefix=DIR],
[DIR location where cloog is installed]),
[cloog_prefix=$withval;
CLOOGISL_INCLUDE="-I$withval/include";
CLOOGISL_LDFLAGS="-L$withval/lib";
CLOOGISL_LIBADD="$withval/lib/libcloog-isl.la";
external_cloogisl=true
],
[CLOOGISL_INCLUDE="-I../cloog-isl/include";
CLOOGISL_LDFLAGS="-L../cloog-isl";
CLOOGISL_LIBADD="../cloog-isl/libcloog-isl.la";
external_cloogisl=false])
AM_CONDITIONAL(EXTERNAL_CLOOGISL, test x$external_cloogisl = xtrue)
if test x$external_cloogisl = xfalse; then
dnl Configuring Cloog 0.14.1 (long long int)
echo -e "\n=========================="
echo "Configuring Cloog-isl"
echo "=========================="
if test x$external_isl = xfalse; then
configureopts="--with-isl-builddir=../isl --with-gmp-prefix=$GMP_PREFIX --with-gmp-exec-prefix=$GMP_PREFIX
--prefix=$prefix"
else
configureopts="--with-isl=system --with-isl-prefix=$isl_prefix --with-gmp-prefix=$GMP_PREFIX --with-gmp-exec-prefix=$GMP_PREFIX
--prefix=$prefix"
fi
(cd cloog-isl/
./configure ${configureopts}
)
fi
AC_PATH_PROGS(BASH, bash)
AC_CONFIG_FILES([getversion.sh], [chmod +x ./getversion.sh])
AC_CONFIG_COMMANDS([version.h],
[echo '#define PLUTO_VERSION "'`./getversion.sh`'"' > src/version.h])
AC_OUTPUT(Makefile \
src/Makefile \
polycc.sh
)
echo " /*-----------------------------------------------*"
echo " * PLUTO configuration is OK *"
echo " *-----------------------------------------------*/"
echo "Your system is ready to compile PLUTO"
echo "Run 'make' next to compile"
echo "Then, run 'make test' to check if everything is working correctly"
echo -e "Use polycc (see README)\n"