-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.ac
296 lines (246 loc) · 9.89 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
dnl /**-------------------------------------------------------------------**
dnl ** CAnDL **
dnl **-------------------------------------------------------------------**
dnl ** configure.in **
dnl **-------------------------------------------------------------------**
dnl ** First version: september 8th 2003 **
dnl **-------------------------------------------------------------------**/
dnl
dnl /**************************************************************************
dnl * CAnDL : the Chunky Analyser for Dependences in Loops (experimental) *
dnl ***************************************************************************
dnl * *
dnl * Copyright (C) 2003-2008 Cedric Bastoul *
dnl * *
dnl * This is free software; you can redistribute it and/or modify it under *
dnl * the terms of the GNU General Public License as published by the Free *
dnl * Software Foundation; either version 2 of the License, or (at your *
dnl * option) any later version. *
dnl * *
dnl * This software is distributed in the hope that it will be useful, but *
dnl * WITHOUT ANY WARRANTY; without even the implied warranty of *
dnl * MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
dnl * General Public License for more details. *
dnl * *
dnl * You should have received a copy of the GNU General Public License along *
dnl * with software; if not, write to the Free Software Foundation, Inc., *
dnl * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
dnl * *
dnl * CAnDL, the Chunky Dependence Analyser *
dnl * Written by Cedric Bastoul, [email protected] *
dnl * *
dnl ***************************************************************************/
m4_define([version_major], [0])
m4_define([version_minor], [6])
m4_define([version_revision], [3])
AC_PREREQ(2.53)
dnl Fill here the @bug email adress.
AC_INIT([candl], [version_major.version_minor.version_revision],
AC_CONFIG_SRCDIR([include/candl/candl.h])
dnl Put as most as possible configuration files to an auxialiry
dnl directory.
AC_CONFIG_AUX_DIR(autoconf)
AC_CONFIG_MACRO_DIR([m4])
dnl Initialize automake. Here, a special tar version that enables
dnl (very) long filenames.
#AM_INIT_AUTOMAKE([1.9 tar-ustar no-define foreign dist-bzip2])
AM_INIT_AUTOMAKE([foreign info-in-builddir subdir-objects])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
VERSION_MAJOR=version_major
VERSION_MINOR=version_minor
VERSION_REVISION=version_revision
dnl default version
BITS="MP"
CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP
dnl /**************************************************************************
dnl * Checking *
dnl **************************************************************************/
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG(CD, cd)
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_CHECK_PROGS(DOXYGEN,doxygen,doxygen)
AX_CC_MAXOPT
AC_SUBST(CFLAGS_WARN)
AX_CFLAGS_WARN_ALL(CFLAGS_WARN)
AC_CHECK_PROG(TEXINFO, makeinfo, yes)
AS_IF([test "x$TEXINFO" != "xyes"], [AC_MSG_ERROR([Please install texinfo.])])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h stddef.h stdlib.h string.h strings.h unistd.h])
dnl Checks for library functions.
AC_CHECK_FUNCS(strtol)
dnl /**************************************************************************
dnl * Option setting *
dnl **************************************************************************/
dnl /**************************************************************************
dnl * Where is the OpenScop Library? *
dnl **************************************************************************/
AX_SUBMODULE(osl,system|build|bundled,system)
AC_SUBST(OSL_CPPFLAGS)
AC_SUBST(OSL_LDFLAGS)
AC_SUBST(OSL_LIBS)
case "$with_osl" in
bundled)
OSL_CPPFLAGS="-I$srcdir/osl/include -Iosl/include"
OSL_LIBS="osl/libosl.la"
;;
build)
OSL_CPPFLAGS="-I$osl_srcdir/include -I$with_osl_builddir/include"
OSL_LIBS="$with_osl_builddir/libosl.la"
;;
system)
OSL_LIBS="-losl"
if test "x$with_osl_prefix" != "x"; then
OSL_CPPFLAGS="-I$with_osl_prefix/include"
OSL_LIBS="$with_osl_prefix/lib/libosl.la -losl"
fi
if test "x$with_osl_exec_prefix" != "x"; then
OSL_LDFLAGS="-L$with_osl_exec_prefix/lib"
fi
esac
AM_CONDITIONAL(BUNDLED_OSL, test $with_osl = bundled)
NEED_MP="no"
AC_ARG_ENABLE(int-version,
[ --enable-int-version 'int' (32 bits) version is built],
[ echo "Package int : $enableval" &&
BITS="32" &&
CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_LONG])
AC_ARG_ENABLE(llint-version,
[ --enable-llint-version 'long long int' (64 bits) version is built],
[ echo "Package long long int : $enableval" &&
BITS="64" &&
CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_LONGLONG])
AC_ARG_ENABLE(mp-version,
[ --enable-mp-version 'MP' (multiple precision) version is built],
[ echo "Package mp : $enableval" &&
BITS="MP" &&
CPPFLAGS=-DCANDL_LINEAR_VALUE_IS_MP &&
NEED_MP="yes"])
AC_ARG_ENABLE(piplib-hybrid,
[ --enable-piplib-hybrid Link with piplib-hybrid],
[ echo "Piplib-hybrid support : $enableval" &&
if test "x$enableval" = "xyes"; then
CPPFLAGS=-DCANDL_HAS_PIPLIB_HYBRID
fi])
dnl /**************************************************************************
dnl * Where is GMP and do we need it? *
dnl **************************************************************************/
AX_SUBMODULE(gmp,no|system|build,system)
case "$with_gmp" in
build)
CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir $CPPFLAGS"
LIBS="$with_gmp_builddir/libgmp.la $LIBS"
LDFLAGS="-L$with_gmp_builddir $LDFLAGS"
;;
system)
CPPFLAGS="$CPPFLAGS"
LIBS="-lgmp $LIBS"
if test "x$with_gmp_prefix" != "x"; then
CPPFLAGS="-I$with_gmp_prefix/include $CPPFLAGS"
LDFLAGS="-L$with_gmp_prefix/lib $LDFLAGS"
fi
dnl AC_CHECK_LIB doesn't use LDFLAGS --> not suitable for the build case.
AC_CHECK_LIB(gmp,
__gmpz_init,
[],
[AC_MSG_ERROR("Can't find gmp library.")])
;;
esac
case "$with_gmp" in
build|system)
AC_CHECK_HEADER(gmp.h,
[],
[AC_MSG_ERROR("Can't find gmp headers.")])
;;
no)
if test "x$NEED_MP" == "xyes"; then
AC_ERROR(["--with-gmp is set to no but multiprecision version is "
"requested, either by --disable-mp-version or by default"])
fi
esac
dnl /**************************************************************************
dnl * Where is the PipLib Library? *
dnl **************************************************************************/
AX_SUBMODULE(piplib,system|build|bundled,system)
AC_SUBST(PIPLIB_CPPFLAGS)
AC_SUBST(PIPLIB_LDFLAGS)
AC_SUBST(PIPLIB_LIBS)
AC_SUBST(PIPLIB_LA)
PIPLIB_LA="piplib_undefined"
case "$BITS" in
32)
PIPLIB_LA="piplib_sp"
;;
64)
PIPLIB_LA="piplib_dp"
;;
MP)
PIPLIB_LA="piplib_gmp"
;;
esac
case "$with_piplib" in
bundled)
PIPLIB_CPPFLAGS="-I$srcdir/piplib/include -Ipiplib/include"
PIPLIB_LIBS="piplib/lib$PIPLIB_LA.la"
;;
build)
PIPLIB_CPPFLAGS="-I$piplib_srcdir/include -I$with_piplib_builddir/include"
PIPLIB_LIBS="$with_piplib_builddir/lib$PIPLIB_LA.la"
;;
system)
PIPLIB_LIBS="-l$PIPLIB_LA"
if test "x$with_piplib_prefix" != "x"; then
PIPLIB_CPPFLAGS="-I$with_piplib_prefix/include"
PIPLIB_LIBS="$with_piplib_prefix/lib/lib$PIPLIB_LA.la -l$PIPLIB_LA"
fi
if test "x$with_piplib_exec_prefix" != "x"; then
PIPLIB_LDFLAGS="-L$with_piplib_exec_prefix/lib"
fi
esac
AM_CONDITIONAL(BUNDLED_PIPLIB, test $with_piplib = bundled)
dnl /**************************************************************************
dnl * Substitutions *
dnl **************************************************************************/
dnl Substitutions to do.
AC_SUBST(BITS)
AC_SUBST(DEFINE_HAS_ISL_LIB)
AC_SUBST(ac_aux_dir)
AC_SUBST(abs_top_srcdir)
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_REVISION)
dnl Configure Makefiles.
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/Doxyfile
include/candl/macros.h
include/candl/piplib.h
tests/Makefile
],
[test -z "$CONFIG_HEADERS" || echo timestamp > source/stamp-h.in])
if test $with_piplib = bundled; then
AC_CONFIG_SUBDIRS(piplib)
fi
if test $with_osl = bundled; then
AC_CONFIG_SUBDIRS(osl)
fi
dnl forcing candl to use local libcandl.la
dnl if --prefix is not specified
CANDL_LIBS="\$(top_builddir)/libcandl.la -lcandl"
AC_SUBST(CANDL_LIBS)
AC_OUTPUT
echo " /*-----------------------------------------------*"
echo " * Candl configuration is OK *"
echo " *-----------------------------------------------*/"
echo "It appears that your system is OK to start Candl compilation. You need"
echo "now to type \"make\". Lastly type \"make install\" to install Candl on"
echo "your system (log as root if necessary)."