forked from daveshields/jikes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
480 lines (384 loc) · 14.5 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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# $Id: configure.in,v 1.44 2002/11/18 23:43:32 ericb Exp $
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run to configure the
dnl Makefile in this directory.
dnl Set up the name and version
AC_INIT([jikes], [1.18])
AM_INIT_AUTOMAKE([foreign check-news dist-bzip2 1.7.1])
AC_DEFINE(JIKES_VERSION_STRING, "Version 1.18 - 21 November 2002",
[A string to indicate the release of jikes: Version 1.17 - 27 Sept 2002])
AC_PREREQ(2.54)
dnl AC_CACHE_LOAD
AC_CONFIG_HEADERS([src/config.h])
AH_TOP([/* This software is subject to the terms of the IBM Jikes
Compiler License Agreement available at the following URL:
http://ibm.com/developerworks/opensource/jikes.
Copyright (C) 1996, 2002 International Business Machines Corporation
and others. All Rights Reserved.
You must accept the terms of that agreement to use this software. */])
dnl Do not autoupdate if configure.in and friends are changed
dnl unless the --enable-maintainer-mode flag is used.
AM_MAINTAINER_MODE()
dnl Set up host checks using config.sub and config.guess.
AC_CANONICAL_HOST()
dnl VC++ requires special flags:
dnl /TP : Treat input files as c++
dnl /GX : Enable C++ exceptions
dnl /GR : Enable rtti
dnl /MD : Link to msvcrt.lib
dnl /MDd : Link to msvcrtd.lib
dnl /Zi : Add debug info to .obj files
case "${host}" in
*windows32*)
jikes_vcpp=yes
;;
esac
dnl make it easy to turn on debug, like any other project
AC_ARG_ENABLE(debug, [ --enable-debug Turn on internal compiler debugging.],
[jikes_debug=$enableval], [jikes_debug=no])
if test "$jikes_debug" = "yes"; then
AC_DEFINE(JIKES_DEBUG, 1, [Enable internal compiler debugging])
dnl If the user did not set CXXFLAGS, set debug flags to
dnl keep the AC_PROG_CXX macro from defaulting to -g -O2.
if test "${CXXFLAGS+set}" != "set" ; then
if test "$jikes_vcpp" = "yes" ; then
CXXFLAGS="-Zi -MDd -GX -GR"
else
CXXFLAGS="-g"
fi
fi
else
dnl If the user did not set CXXFLAGS and we are using VC++, set
dnl default flags to keep AC_PROG_CXX from defaulting to -g -O2.
if test "${CXXFLAGS+set}" != "set" ; then
if test "$jikes_vcpp" = "yes" ; then
CXXFLAGS="-MD -GX -GR"
fi
fi
fi
dnl Tell the system that we are going to use the C++ language
AC_LANG([C++])
dnl Have the system search for and test out the C++ compiler
dnl We expect AC_PROG_CXX to automatically find a cross compiler
AC_PROG_CXX()
dnl Find the object file extension (like .o or .obj) and subst it
AC_OBJEXT()
dnl Find the executable file extension (like .exe or "") and subst it
AC_EXEEXT()
dnl See if this host uses DOS style path names
ACX_CHECK_PATHNAME_STYLE_DOS()
dnl FIXME: This is a quick hack to define UNIX_FILE_SYSTEM
dnl or WIN32_FILE_SYSTEM, we need to go back and fix this
dnl to do a feature test in each place this symbol is used
if test "$acx_cv_pathname_style_dos" = "yes"; then
AC_DEFINE(WIN32_FILE_SYSTEM,,[quick hack to use Win32 file system, fixme])
else
AC_DEFINE(UNIX_FILE_SYSTEM,,[quick hack to use UNIX file system, fixme])
fi
dnl Don't define classes in a Jikes namespace by default
dnl since most compilers do not support C++ namespaces properly.
AC_ARG_ENABLE(jikes-namespace,
[ --enable-jikes-namespace Define Jikes classes in a C++ namespace],
[ok=$enableval], [ok=no])
if test "$ok" = "yes"; then
AC_DEFINE(HAVE_JIKES_NAMESPACE, 1, [Define Jikes classes in a C++ namespace])
fi
dnl Check for standard c and c++ headers and libraries
AC_HEADER_STDC()
AC_CHECK_HEADERS(stdio.h assert.h limits.h ctype.h time.h float.h)
dnl Check for some headers which are not present on all supported platforms
AC_CHECK_HEADERS(windows.h direct.h dirent.h sys/cygwin.h locale.h)
dnl Check for math.h and see if we need to link to the math library
AC_CHECK_MATHLIB()
AC_CXX_HAVE_STD()
dnl Don't check for libstdc++, we should not need to do this.
dnl AC_CHECK_LIB(stdc++, main)
dnl see if "bool" is a builtin type
AC_CXX_BOOL()
dnl Check for <new> style include for the set_new_handler function
AC_CXX_CHECK_SET_NEW_HANDLER()
dnl Check for wide string functions
AC_CHECK_WCS_FUNCS()
dnl Check for busted ostream insertion problems
AC_CXX_CHECK_OSTREAM_CONST_UNSIGNED_CHAR_PTR()
dnl Check for iconv functions and library
AC_CHECK_ICONV()
dnl Check if "IBM Classes for UNICODE library" is present
AC_CHECK_LIB(icu-uc, u_getVersion)
if test "$ac_cv_header_iconv_h" = "yes" || \
test "$ac_cv_lib_icu_uc_u_getVersion" = "yes" ; then
AC_DEFINE(HAVE_ENCODING,1,
[Defined if Jikes supports -encoding for input files.])
fi
dnl Check for cygwin path conversion functions
AC_CHECK_FUNCS(cygwin_win32_to_posix_path_list)
dnl Check for the strip utility, we use it to remove debugging info
AC_CHECK_TOOL(STRIP, strip, :)
dnl Check to see if "static const FOO = 1" is allowed in a class
AC_CXX_MEMBER_CONSTANTS()
dnl Check to see if the explicit C++ keyword is supported
AC_CXX_EXPLICIT()
dnl Check to see if RTTI is implemented, it is needed
dnl to support dynamic casting and type queries. RTTI
dnl is known to be buggy so it is disabled by default,
dnl you can force testing for it by setting the cache
dnl variable to test, or set it directly to whatever
dnl you want (yes is the only other logical setting).
if test "x" = "x$ac_cv_cxx_rtti" ; then
ac_cv_cxx_rtti=no
elif test "xtest" = "x$ac_cv_cxx_rtti" ; then
unset ac_cv_cxx_rtti
fi
AC_CXX_RTTI()
dnl Check for newer C++ style cast support
AC_CXX_CONST_CAST()
AC_CXX_DYNAMIC_CAST()
AC_CXX_REINTERPRET_CAST()
AC_CXX_STATIC_CAST()
#FIXME : do we need to add the -funsigned-char option when compiling with
# g++? If we always use the u1 type (see platform.h), then I think not.
# It might also be better to use the following macro for these tests!
#AC_CHECK_SIZEOF (TYPE, [CROSS-SIZE], [INCLUDES])
AC_CACHE_CHECK(correct value for UINT_MAX,
jikes_cv_uint_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! (UINT_MAX == 0xFFFFFFFFUL)
# error "UINT_MAX"
#endif
],[return 0;],
jikes_cv_uint_max=yes,
AC_MSG_ERROR([unsigned int does not store values in the range
0..4294967295 on this system])))
AC_CACHE_CHECK(correct value for INT_MAX,
jikes_cv_int_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! ((INT_MAX == 2147483647) && (INT_MIN + 1 == -INT_MAX))
# error "INT_MAX"
#endif
],[return 0;],
jikes_cv_int_max=yes,
AC_MSG_ERROR([int does not store values in the range
-2147483648..+2147483647 on this system])))
dnl Check for broken USHRT_MAX (under Mingwin and maybe some other systems)
AC_CACHE_CHECK(for broken USHRT_MAX, jikes_cv_ushrt_max_is_broken,
AC_TRY_COMPILE([
#include <limits.h>
#if ! (USHRT_MAX == 0xFFFF)
int hi=0;
#endif
],[return 0;], jikes_cv_ushrt_max_is_broken=no ,
jikes_cv_ushrt_max_is_broken=yes)
)
if test "$jikes_cv_ushrt_max_is_broken" = "yes" ; then
AC_DEFINE(HAVE_BROKEN_USHRT_MAX, , [known to be broken on mingwin beta 20])
fi
AC_CACHE_CHECK(correct value for USHRT_MAX,
jikes_cv_ushrt_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! (USHRT_MAX == 0xFFFF)
# error "USHRT_MAX"
#endif
],[return 0;],
jikes_cv_ushrt_max=yes,
AC_MSG_ERROR([unsigned short does not store values in the range
0..65535 on this system])))
AC_CACHE_CHECK(correct value for SHRT_MAX,
jikes_cv_shrt_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! ((SHRT_MAX == 32767) && (SHRT_MIN + 1 == -SHRT_MAX))
# error "SHRT_MAX"
#endif
],[return 0;],
jikes_cv_shrt_max=yes,
AC_MSG_ERROR([short does not store values in the range
-32768..+32767 on this system])))
AC_CACHE_CHECK(correct value for UCHAR_MAX,
jikes_cv_uchar_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! (UCHAR_MAX == 0xFF)
# error "UCHAR_MAX"
#endif
],[return 0;],
jikes_cv_uchar_max=yes,
AC_MSG_ERROR([unsigned char does not store values in the range
0..255 on this system])))
AC_CACHE_CHECK(correct value for SCHAR_MAX,
jikes_cv_schar_max,
AC_TRY_COMPILE([
#include <limits.h>
#if ! ((SCHAR_MAX == 127) && (SCHAR_MIN + 1 == -SCHAR_MAX))
# error "SCHAR_MAX"
#endif
],[return 0;],
jikes_cv_schar_max=yes,
AC_MSG_ERROR([char does not store values in the range
-128..+127 on this system])))
dnl Check to see if build will use emulated floating point
AC_ARG_ENABLE(fp-emulation, [ --disable-fp-emulation Use native floating point operations instead of emulation],
[ok=$enableval], [ok=yes])
AC_MSG_CHECKING([for floating point support])
if test "$ok" = "yes"; then
# Do nothing, floating point emulation is used when HAVE_IEEE754 is not defined
AC_MSG_RESULT([emulated])
else
AC_DEFINE(HAVE_IEEE754, 1,
[Defined when Jikes is built with native floating support])
AC_MSG_RESULT([native])
fi
dnl Ensure that we have exact type sizes.
AC_DEFINE_INTEGER_BITS(int8_t, signed char, __int8, char)
AC_DEFINE_INTEGER_BITS(uint8_t, unsigned int8_t, unsigned char,
unsigned __int8, char)
AC_DEFINE_INTEGER_BITS(int16_t, signed short, signed int, __int16,
short, int)
AC_DEFINE_INTEGER_BITS(uint16_t, unsigned int16_t, unsigned short, unsigned,
unsigned __int16)
AC_DEFINE_INTEGER_BITS(int32_t, signed, signed long, __int32, int, long)
AC_DEFINE_INTEGER_BITS(uint32_t, unsigned int32_t, unsigned, unsigned long,
unsigned __int32)
AC_DEFINE_INTEGER_BITS(int64_t, signed long, signed long long,
__int64, long long)
AC_DEFINE_INTEGER_BITS(uint64_t, unsigned int64_t, unsigned long,
unsigned long long, unsigned __int64)
if test "$i8" = no; then
dnl Check for endianness
AC_C_BIGENDIAN()
else
AC_DEFINE(HAVE_64BIT_TYPES, ,
[Defined when the compiler supports 64 bit integer math])
fi
dnl Check the stat() system call to find out how many
dnl underscores are needed in front of S_IFDIR
AC_CACHE_CHECK(for __S_IFDIR symbol,
jikes_cv_stat_ifdir_2underscore,
AC_TRY_COMPILE([
#include <sys/stat.h>
],[int i = __S_IFDIR;],
jikes_cv_stat_ifdir_2underscore=yes,
jikes_cv_stat_ifdir_2underscore=no))
AC_CACHE_CHECK(for _S_IFDIR symbol,
jikes_cv_stat_ifdir_1underscore,
AC_TRY_COMPILE([
#include <sys/stat.h>
],[int i = _S_IFDIR;],
jikes_cv_stat_ifdir_1underscore=yes,
jikes_cv_stat_ifdir_1underscore=no))
AC_CACHE_CHECK(for S_IFDIR symbol,
jikes_cv_stat_ifdir_0underscore,
AC_TRY_COMPILE([
#include <sys/stat.h>
],[int i = S_IFDIR;],
jikes_cv_stat_ifdir_0underscore=yes,
jikes_cv_stat_ifdir_0underscore=no))
if test "$jikes_cv_stat_ifdir_2underscore" = "yes"; then
AC_DEFINE(JIKES_STAT_S_IFDIR, __S_IFDIR,
[Used to test results of stat call to see if it is a directory])
elif test "$jikes_cv_stat_ifdir_1underscore" = "yes"; then
AC_DEFINE(JIKES_STAT_S_IFDIR, _S_IFDIR,
[Used to test results of stat call to see if it is a directory])
elif test "$jikes_cv_stat_ifdir_0underscore" = "yes"; then
AC_DEFINE(JIKES_STAT_S_IFDIR, S_IFDIR,
[Used to test results of stat call to see if it is a directory])
else
AC_MSG_ERROR([Could not find stat S_IFDIR symbol])
fi
dnl We need to do some nasty checks here to make sure that
dnl we know what version of mkdir() to call.
dnl First, we just make sure mkdir() actually exists
AC_CHECK_FUNCS(mkdir, , AC_MSG_ERROR([No mkdir() function found]))
AC_CACHE_CHECK(for mac style mkdir, jikes_cv_mac_mkdir,
AC_TRY_LINK([
#include <sys/stat.h>
#include <stat.mac.h>
], [mkdir("foo.dir", 0);
], jikes_cv_mac_mkdir=yes,
jikes_cv_mac_mkdir=no)
)
AC_CACHE_CHECK(for glibc style mkdir, jikes_cv_glibc_mkdir,
AC_TRY_LINK([
#include <sys/stat.h>
#include <unistd.h>
], [mkdir("foo.dir", S_IRWXU | S_IRWXG | S_IRWXO);
], jikes_cv_glibc_mkdir=yes,
jikes_cv_glibc_mkdir=no)
)
AC_CACHE_CHECK(for libc5 style mkdir, jikes_cv_libc5_mkdir,
AC_TRY_LINK([
#include <sys/stat.h>
#include <unistd.h>
], [mkdir("foo.dir", S_IRWXU);
], jikes_cv_libc5_mkdir=yes,
jikes_cv_libc5_mkdir=no)
)
AC_CACHE_CHECK(for win32 style mkdir, jikes_cv_win32_mkdir,
AC_TRY_LINK([
#include <direct.h>
], [mkdir("foo.dir");
], jikes_cv_win32_mkdir=yes,
jikes_cv_win32_mkdir=no)
)
if test "$jikes_cv_glibc_mkdir" = "yes" ; then
AC_DEFINE(HAVE_GLIBC_MKDIR, ,
[use unix style mkdir(str, S_IRWXU | S_IRWXG | S_IRWXO)])
elif test "$jikes_cv_libc5_mkdir" = "yes" ; then
AC_DEFINE(HAVE_LIBC5_MKDIR, ,
[use unix style mkdir(str, S_IRWXU)])
elif test "$jikes_cv_win32_mkdir" = "yes" ; then
AC_DEFINE(HAVE_WIN32_MKDIR, ,
[use win32 style mkdir(str) from <direct.h>])
elif test "$jikes_cv_mac_mkdir" = "yes" ; then
AC_DEFINE(HAVE_MAC_MKDIR, ,
[use mac style mkdir(str,0) from <stat.mac.h>])
else
AC_MSG_ERROR([Could not locate a working mkdir() implementation])
fi
dnl xlC (AIX), ICC (Win*, OS/2) and vacpp (all) are all compilers from
dnl IBM, they are related in that there is a common code base. On the
dnl x86 platform when compiling with ICC we need to set control registers
dnl on the math co-proc inorder to work around floating point oddities.
dnl FIXME: need to limit to x86 architecture.
dnl FIXME: case sensitive string compare to compiler name is BAD.
dnl FIXME: need a better test than "does it compile"...
dnl need to acutally USE it. Ask Dave.
dnl old logic within the ICC/xlC shared config block (added by cabbey@home.net
dnl because it was setting this flag on PowerRS based AIX boxen)
dnl To really fix this, we need to find out what ${host_os} is set
dnl to when compiling on windows or OS2.
dnl Something like this ???
dnl case "${host_os}" in
dnl *86)
dnl jikes_cv_icc_fp_bugs=yes
dnl ;;
dnl esac
AC_CACHE_CHECK(floating point bug workaround for ICC compiler, jikes_cv_icc_fp_bugs,
if test "$CXX" = "ICC" || test "$CXX" = "vacpp" ; then
AC_TRY_COMPILE([#include <float.h>],
[ _control87(EM_UNDERFLOW, EM_UNDERFLOW); ],
jikes_cv_icc_fp_bugs=yes,
jikes_cv_icc_fp_bugs=no)
else
jikes_cv_icc_fp_bugs=no
fi)
if test "$jikes_cv_icc_fp_bugs" = "yes" ; then
AC_DEFINE(HAVE_ICC_FP_BUGS, , [known to be broken on Win and OS2 when compiled with ICC])
fi
dnl see if jikespg location is given on the command line
AC_ARG_WITH(jikespg, [ --with-jikespg=PROG location of jikes parser generator (optional)],
JIKESPG=$withval, JIKESPG=NONE)
if test "$JIKESPG" != "NONE"; then
if test ! -f "$JIKESPG" || test ! -x "$JIKESPG"; then
AC_MSG_ERROR([jikespg argument '$JIKESPG' is not a file or is not executable])
fi
else
JIKESPG=jikespg
fi
AC_SUBST(JIKESPG)
# Subst variables into Makefile.in to produce the Makefile
dnl AC_CACHE_SAVE
AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile])
AC_OUTPUT