* src/vm/jit/alpha/asmpart.S (asm_compare_and_swap): Changed comment.
[cacao.git] / configure.ac
1 dnl configure.ac
2 dnl
3 dnl Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 dnl J. Wenninger, Institut f. Computersprachen - TU Wien
7 dnl 
8 dnl This file is part of CACAO.
9 dnl 
10 dnl This program is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU General Public License as
12 dnl published by the Free Software Foundation; either version 2, or (at
13 dnl your option) any later version.
14 dnl 
15 dnl This program is distributed in the hope that it will be useful, but
16 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 dnl General Public License for more details.
19 dnl 
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 dnl 02110-1301, USA.
24 dnl 
25 dnl $Id: configure.ac 7246 2007-01-29 18:49:05Z twisti $
26
27 dnl Process this file with autoconf to produce a configure script.
28
29
30 AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
31 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
32 AC_CANONICAL_HOST
33 AC_PREREQ(2.59)
34 AM_INIT_AUTOMAKE([1.9.0])
35 AM_MAINTAINER_MODE
36
37 AM_CONFIG_HEADER([config.h])
38
39 AC_PREFIX_DEFAULT(/usr/local/cacao)
40
41
42 dnl set optimization and debugging for all architectures and systems
43 if test x"$CFLAGS" = "x"; then
44     OPT_CFLAGS="-O0 -g3"
45 else
46     OPT_CFLAGS=$CFLAGS
47 fi
48
49 dnl system type
50 case "$host_cpu" in
51 alpha | alphaev56 | alphapca56 )
52     ARCH_DIR="alpha"
53     ARCH_CFLAGS="-mieee -D__ALPHA__"
54     ;;
55
56 arm | armv4tl | armv5b | armv5l )
57     ARCH_DIR="arm"
58     ARCH_CFLAGS="-D__ARM__"
59     ;;
60
61 hppa2.0 )
62     ARCH_DIR="parisc"
63     ARCH_CFLAGS="-D__PARISC__"
64     ;;
65
66 i386 | i486 | i586 | i686 )
67     ARCH_DIR="i386"
68     ARCH_CFLAGS="-D__I386__"
69     ;;
70
71 m68k )
72     ARCH_DIR="m68k"
73     ARCH_CFLAGS="-D__M68K__"
74     ;;
75
76 mips | mipsel )
77     ARCH_DIR="mips"
78     ARCH_CFLAGS="-D__MIPS__"
79     ;;
80
81 powerpc )
82     ARCH_DIR="powerpc"
83     ARCH_CFLAGS="-D__POWERPC__"
84     ;;
85
86 powerpc64 )
87     ARCH_DIR="powerpc64"
88     ARCH_CFLAGS="-D__POWERPC64__"
89     ;;
90
91 sparc64 )
92     ARCH_DIR="sparc64"
93     ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
94     ;;
95
96 x86_64 )
97     ARCH_DIR="x86_64"
98     ARCH_CFLAGS="-D__X86_64__"
99     ;;
100
101 xdspcore )
102     ARCH_DIR="xdspcore"
103     ENABLE_STATICVM="yes"
104     ARCH_CFLAGS="-D__XDSPCORE__"
105     USE_SCHEDULER="1"
106     ;;
107
108 s390 )
109     ARCH_DIR="s390"
110     ARCH_CFLAGS="-D__S390__"
111     ;;
112
113
114 * )
115     AC_MSG_ERROR($host_cpu systems are not supported at this time)
116     ;;
117 esac
118
119 dnl host type
120 case "$host_os" in
121 *cygwin* )
122     OS_DIR="cygwin"
123     INTRP_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -Wall -Wno-long-long"
124     ARCH_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -ansi -pedantic -Wall -Wno-long-long"
125     ;;
126
127 *darwin* )
128     OS_DIR="darwin"
129     INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
130     ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
131     ;;
132
133 *freebsd* )
134     OS_DIR="freebsd"
135     INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
136     ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
137     ;;
138
139 *irix* )
140     OS_DIR="irix"
141     INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
142     ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
143     ;;
144
145 *kfreebsd*-gnu)
146     OS_DIR="freebsd"
147     INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
148     ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
149     ;;
150
151 dnl must be before *linux*
152 *uclinux | *elf )
153     OS_DIR="uclinux"
154     INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
155     ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
156     ;;
157
158 *linux* | *Linux* )
159     OS_DIR="linux"
160     INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
161     ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
162     ;;
163
164 *netbsd* )
165     OS_DIR="netbsd"
166     INTRP_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
167     ARCH_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
168     ;;
169
170 * )
171     ;;
172 esac
173
174
175 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
176 dnl we set it properly at the end of this file
177 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
178
179 dnl set interpreter flags
180 AC_SUBST(INTRP_CFLAGS)
181
182 dnl define some stuff required for --fullversion
183 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
184 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
185 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS", [CFLAGS used])
186
187
188 dnl define and substitute some architecture specific variables
189 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
190 AC_SUBST(ARCH_DIR)
191 AC_SUBST(OS_DIR)
192 AC_SUBST(USE_SCHEDULER)
193
194
195 dnl Checks for programs.
196 AC_PROG_CC
197 AM_PROG_AS
198 AC_PROG_LD
199 AC_PROG_LD_GNU
200 AC_PROG_RANLIB
201 AC_PROG_LN_S
202 AC_PROG_MAKE_SET
203 AM_PROG_MKDIR_P
204
205 dnl Checks for header files.
206 AC_HEADER_DIRENT
207 AC_HEADER_STDC
208 AC_CHECK_HEADERS([fcntl.h])
209 AC_CHECK_HEADERS([sys/time.h])
210 AC_CHECK_HEADERS([unistd.h])
211 AC_CHECK_HEADERS([sys/ioctl.h])
212
213 dnl this is for fdlibm
214 AC_CHECK_HEADERS([stdint.h])
215 AC_CHECK_HEADERS([inttypes.h])
216 AC_CHECK_HEADERS([sys/config.h])
217 AC_CHECK_HEADERS([sys/types.h])
218 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
219 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
220 AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
221 AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
222
223 dnl Checks for typedefs, structures, and compiler characteristics.
224 AC_C_CONST
225 AC_C_INLINE
226 AC_C_ATTRIBUTE
227 AC_TYPE_OFF_T
228 AC_TYPE_SIZE_T
229 AC_HEADER_TIME
230 AC_STRUCT_TM
231
232 dnl Checks for library functions.
233 AC_PROG_GCC_TRADITIONAL
234 AC_TYPE_SIGNAL
235 AC_FUNC_MEMCMP
236 AC_FUNC_MMAP
237 AC_CHECK_FUNCS([calloc mmap getpagesize free])
238 AC_CHECK_FUNCS([getcwd gettimeofday])
239 AC_CHECK_FUNCS([scandir])
240 AC_CHECK_FUNCS([isnan])
241
242 dnl Checks for libraries.
243
244 dnl Checking sizeof void *
245 AC_CHECK_SIZEOF(void *)
246 AC_C_BIGENDIAN
247
248
249 dnl define install prefix
250 if test "x$prefix" = "xNONE"; then
251     CACAO_PREFIX=$ac_default_prefix
252 else
253     CACAO_PREFIX=$prefix
254 fi
255 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
256 AC_SUBST(CACAO_PREFIX)
257
258 dnl define libdir prefix
259 if test "x$libdir" = "xNONE"; then
260     CACAO_LIBDIR=$ac_default_libdir
261 else
262     CACAO_LIBDIR=$libdir
263 fi
264 dnl expand CACAO_LIBDIR to something that is usable in C code
265 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
266 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
267 AC_SUBST(CACAO_LIBDIR)
268
269
270 dnl Features
271
272 dnl check arguments
273
274 dnl check which Java configuration to use
275 AC_MSG_CHECKING(which Java configuration to use)
276 AC_ARG_ENABLE([java],
277               [AS_HELP_STRING(--enable-java,enable specific Java configuration (cldc1.1,javase) [[default=javase]])],
278               [case "${enableval}" in
279                    cldc1.1)
280                        ENABLE_JAVAME_CLDC1_1=yes
281                        AC_DEFINE([ENABLE_JAVAME_CLDC1_1], 1, [compile for Java ME CLDC1.1])
282                        AC_MSG_RESULT(cldc1.1)
283                        ;;
284                    javase)
285                        ENABLE_JAVASE=yes
286                        AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
287                        AC_MSG_RESULT(javase)
288                        ;;
289                    *)
290                        AC_MSG_ERROR(${enableval} is an unknown configuration)
291                        ;;
292                esac],
293                [ENABLE_JAVASE=yes
294                 AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
295                 AC_MSG_RESULT(j2se)])
296 AM_CONDITIONAL([ENABLE_JAVAME_CLDC1_1], test x"${ENABLE_JAVAME_CLDC1_1}" = "xyes")
297 AM_CONDITIONAL([ENABLE_JAVASE], test x"${ENABLE_JAVASE}" = "xyes")
298
299
300 dnl check for JIT compiler
301 AC_MSG_CHECKING(whether JIT compiler should be compiled)
302 AC_ARG_ENABLE([jit],
303               [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
304               [case "${enableval}" in
305                    no) ENABLE_JIT=no;;
306                    *) ENABLE_JIT=yes;;
307                esac],
308               [ENABLE_JIT=yes])
309 AC_MSG_RESULT(${ENABLE_JIT})
310 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
311
312 if test x"${ENABLE_JIT}" = "xyes"; then
313     AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
314 fi
315
316
317 dnl check for stuff that should be done in software
318 AC_CHECK_SOFTFLOAT
319 AC_CHECK_SOFT_FLOAT_CMP
320 AC_CHECK_SOFT_DOUBLE_CMP
321
322
323 dnl check for interpreter
324 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
325
326 AC_MSG_CHECKING(whether interpreter should be compiled)
327 if test x"$enable_intrp" = "xyes"; then
328     AC_MSG_RESULT(yes)
329     AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
330     AM_CONDITIONAL([ENABLE_INTRP], [true])
331     ENABLE_INTRP=yes
332
333     AC_ASM_SKIP16
334
335     dnl check for libffi
336     AC_ARG_WITH([ffi],
337                 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
338                 [WITH_FFI=yes
339                  AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
340                  AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
341                  AC_DEFINE([WITH_FFI], 1, [use libffi])],
342                 [WITH_FFI=no])
343
344     dnl check for libffcall
345     AC_ARG_WITH([ffcall],
346                 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
347                 [WITH_FFCALL=yes
348                  AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
349                  AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
350                  AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
351                 [WITH_FFCALL=no])
352
353     dnl check for libffi or libffcall
354     if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
355         AC_ERROR(Enable only libffi or libffcall.)
356     fi
357     if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
358         AC_ERROR(Enable one of libffi or libffcall.)
359     fi
360
361 else
362     AC_MSG_RESULT(no)
363     AM_CONDITIONAL([ENABLE_INTRP], [false])
364     ENABLE_INTRP="no"
365 fi
366
367 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
368     AC_ERROR(You have to enable at least the JIT or the interpreter.)
369 fi
370
371
372 dnl check for garbage collector usage
373 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
374 AC_MSG_CHECKING(whether GC should be enabled)
375 enable_gc=${enable_gc:-boehm}
376 case "$enable_gc" in
377 no | none)
378     AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
379     ENABLE_GC=none
380     AC_MSG_RESULT(no)
381     ;;
382
383 boehm)
384     AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
385     ENABLE_GC=boehm
386     AC_MSG_RESULT(yes, boehm-gc)
387     ;;
388
389 cacao)
390     AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
391     ENABLE_GC=cacao
392     AC_MSG_RESULT(yes, cacao-gc)
393     ;;
394
395 *)
396     AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
397     ;;
398 esac
399 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
400 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
401 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
402
403
404 dnl check for dump memory usage
405 AC_MSG_CHECKING(whether dump memory should be disabled)
406 AC_ARG_ENABLE([dump],
407               [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
408               [case "${enableval}" in
409                    no)
410                        DISABLE_DUMP=yes
411                        AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
412                        ;;
413                    *) DISABLE_DUMP=no;;
414                esac],
415                [DISABLE_DUMP=no])
416 AC_MSG_RESULT(${DISABLE_DUMP})
417
418
419 dnl check for debug
420 AC_MSG_CHECKING(whether debug code generation should be enabled)
421 AC_ARG_ENABLE([debug],
422               [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
423               [case "${enableval}" in
424                    no) NDEBUG=yes
425                        AC_DEFINE([NDEBUG], 1, [disable debug code])
426                        ;;
427                    *) NDEBUG=no;;
428                esac],
429               [NDEBUG=no])
430
431 if test x"${NDEBUG}" = "xno"; then
432     AC_MSG_RESULT(yes)
433 else
434     AC_MSG_RESULT(no)
435 fi
436 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
437
438
439 dnl check for memcheck support
440 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
441 AC_ARG_ENABLE([memcheck],
442               [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
443               [case "${enableval}" in
444                    yes) ENABLE_MEMCHECK=yes;;
445                    *) ENABLE_MEMCHECK=no;;
446                esac],
447               [ENABLE_MEMCHECK=no])
448 AC_MSG_RESULT(${ENABLE_MEMCHECK})
449 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
450
451 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
452     AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
453 fi
454
455
456 dnl check for disassembler support
457 AC_MSG_CHECKING(whether disassembler should be enabled)
458 AC_ARG_ENABLE([disassembler],
459               [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
460               [case "${enableval}" in
461                    yes) ENABLE_DISASSEMBLER=yes;;
462                    *) ENABLE_DISASSEMBLER=no;;
463                esac],
464               [ENABLE_DISASSEMBLER=no])
465 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
466 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
467
468 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
469     AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
470
471     dnl check for binutils headers and libraries on some architectures for the
472     dnl disassembler
473     case "${ARCH_DIR}" in
474         arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390)
475             AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
476             AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
477             AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
478             AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
479
480             case "${OS_DIR}" in
481                 cygwin | darwin | netbsd )
482                      AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
483                      ;;
484             esac
485
486             AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
487             AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
488             AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
489             AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
490             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
491             ;;
492         * )
493             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
494             ;;
495     esac
496 else
497     AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
498 fi
499
500
501 dnl check for statistics
502 AC_MSG_CHECKING(whether statistics generation should be enabled)
503 AC_ARG_ENABLE([statistics],
504               [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
505               [case "${enableval}" in
506                    yes) ENABLE_STATISTICS=yes;;
507                    *) ENABLE_STATISTICS=no;;
508                esac],
509               [ENABLE_STATISTICS=no])
510 AC_MSG_RESULT(${ENABLE_STATISTICS})
511 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
512
513 if test x"${ENABLE_STATISTICS}" = "xyes"; then
514     AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
515 fi
516
517
518 dnl check for verifier
519 AC_MSG_CHECKING(whether classfile verification should be enabled)
520 AC_ARG_ENABLE([verifier],
521               [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
522               [case "${enableval}" in
523                    no) ENABLE_VERIFIER=no;;
524                    *) ENABLE_VERIFIER=yes;;
525                esac],
526               [ENABLE_VERIFIER=yes])
527 AC_MSG_RESULT(${ENABLE_VERIFIER})
528 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
529
530 if test x"${ENABLE_VERIFIER}" = "xyes"; then
531     AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
532 fi
533
534
535 dnl check for compiler timing
536 AC_MSG_CHECKING(whether real-time timing should be enabled)
537 AC_ARG_ENABLE([rt-timing],
538               [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
539               [case "${enableval}" in
540                    yes) ENABLE_RT_TIMING=yes;;
541                    *) ENABLE_RT_TIMING=no;;
542                esac],
543               [ENABLE_RT_TIMING=no])
544 AC_MSG_RESULT(${ENABLE_RT_TIMING})
545 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
546
547 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
548     AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
549 fi
550
551
552 dnl check for cycle count statistics
553 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
554 AC_ARG_ENABLE([cycles-stats],
555               [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
556               [case "${enableval}" in
557                    yes) ENABLE_CYCLES_STATS=yes;;
558                    *) ENABLE_CYCLES_STATS=no;;
559                esac],
560               [ENABLE_CYCLES_STATS=no])
561 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
562 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
563
564 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
565     AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
566 fi
567
568
569 dnl check for JVMTI
570 AC_MSG_CHECKING(whether to compile JVMTI support)
571 AC_ARG_ENABLE([jvmti],
572               [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
573               [case "${enableval}" in
574                    yes) ENABLE_JVMTI=yes;;
575                    *) ENABLE_JVMTI=no;;
576                esac],
577               [ENABLE_JVMTI=no])
578 AC_MSG_RESULT(${ENABLE_JVMTI})
579 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
580
581 if test x"${ENABLE_JVMTI}" = "xyes"; then
582     AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
583 fi
584
585
586 dnl threads
587 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,native) [[default=native]])])
588 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
589
590 AC_MSG_CHECKING(whether to include threads support)
591 enable_threads=${enable_threads:-native}
592 case "$enable_threads" in
593 no | none | single)
594     AC_MSG_RESULT(no)
595     dnl no threads for boehm
596     ac_configure_args="$ac_configure_args --disable-boehm-threads"
597     AM_CONDITIONAL([ENABLE_THREADS], [false])
598     ;;
599
600 native | posix | pthreads)
601     AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
602     
603     AM_CONDITIONAL([ENABLE_THREADS], [true])
604     
605     AC_MSG_RESULT(yes, native)
606     AC_CHECK_LIB(pthread, main)
607
608     ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
609
610     dnl we changed ARCH_CFLAGS, set CFLAGS again
611     CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
612
613     dnl tell boehm to support threads as well
614     ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
615     ;;
616
617 *)
618     AC_MSG_ERROR($enable_threads is an unknown thread package)
619     ;;
620 esac
621
622
623 dnl Check whether the compiler supports the __thread keyword.
624 if test "x$use__thread" != xno; then
625   AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
626   [cat > conftest.c <<\EOF
627 __thread int a = 42;
628 EOF
629   if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
630     ac_cv_gcc___thread=yes 
631   else
632     ac_cv_gcc___thread=no
633   fi
634   rm -f conftest*])
635   if test "$ac_cv_gcc___thread" = yes; then
636     AC_DEFINE([HAVE___THREAD], 1, [have __thread])
637   fi
638 else
639   ac_cv_gcc___thread=no
640 fi
641
642
643 dnl check if if-conversion should be supported
644 AC_MSG_CHECKING(whether if-conversion should be supported)
645 AC_ARG_ENABLE([ifconv],
646               [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
647               [case "${enableval}" in
648                    no) ENABLE_IFCONV=no;;
649                    *) ENABLE_IFCONV=yes;;
650                esac],
651               [ENABLE_IFCONV=yes])
652 AC_MSG_RESULT(${ENABLE_IFCONV})
653 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
654    
655 if test x"${ENABLE_IFCONV}" = "xyes"; then
656     AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
657 fi
658
659
660 dnl check for inlining
661 AC_MSG_CHECKING(whether method inlining should be supported)
662 AC_ARG_ENABLE([inlining],
663               [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
664               [case "${enableval}" in
665                    yes) ENABLE_INLINING=yes;;
666                    *) ENABLE_INLINING=no;;
667                esac],
668               [ENABLE_INLINING=no])
669 AC_MSG_RESULT(${ENABLE_INLINING})
670 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
671
672 if test x"${ENABLE_INLINING}" = "xyes"; then
673     AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
674 fi
675
676
677 dnl check for inlining debug options
678 AC_MSG_CHECKING(whether method inlining debug options should be enabled)
679 AC_ARG_ENABLE([inlining-debug],
680               [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
681               [case "${enableval}" in
682                    yes) ENABLE_INLINING_DEBUG=yes;;
683                    *) ENABLE_INLINING_DEBUG=no;;
684                esac],
685               [ENABLE_INLINING_DEBUG=no])
686 AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
687 AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
688
689 if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
690     AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
691 fi
692
693
694 dnl check for replacement
695 AC_MSG_CHECKING(whether on-stack replacement should be supported)
696 AC_ARG_ENABLE([replacement],
697               [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
698               [case "${enableval}" in
699                    yes) ENABLE_REPLACEMENT=yes;;
700                    *) ENABLE_REPLACEMENT=no;;
701                esac],
702               [ENABLE_REPLACEMENT=no])
703 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
704 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
705
706 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
707     AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
708 fi
709
710
711 dnl check for loop optimization
712 AC_MSG_CHECKING(whether loop optimization should be supported)
713 AC_ARG_ENABLE([loop],
714               [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
715               [case "${enableval}" in
716                    yes) ENABLE_LOOP=yes;;
717                    *) ENABLE_LOOP=no;;
718                esac],
719               [ENABLE_LOOP=no])
720 AC_MSG_RESULT(${ENABLE_LOOP})
721 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
722
723 if test x"${ENABLE_LOOP}" = "xyes"; then
724     AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
725 fi
726
727
728 dnl check if linear scan register allocator(lsra) with SSA should be used
729 AC_MSG_CHECKING(whether lsra with ssa should be supported)
730 AC_ARG_ENABLE([ssa],
731               [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
732               [case "${enableval}" in
733                    no) ENABLE_SSA=no;;
734                    *) ENABLE_SSA=yes;;
735                esac],
736               [ENABLE_SSA=no])
737 AC_MSG_RESULT(${ENABLE_SSA})
738 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
739
740 if test x"${ENABLE_SSA}" = "xyes"; then
741     AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
742     ENABLE_LSRA="no"
743 fi
744
745
746 dnl check if linear scan register allocator(lsra) should be used
747 AC_MSG_CHECKING(whether lsra should be supported)
748 AC_ARG_ENABLE([lsra],
749               [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
750               [case "${enableval}" in
751                    yes) ENABLE_LSRA=yes;;
752                    *) ENABLE_LSRA=no;;
753                esac],
754               [ENABLE_LSRA=no])
755    
756 if test x"${ENABLE_LSRA}" = "xyes"; then
757     if test x"${ENABLE_SSA}" = "xyes"; then
758         ENABLE_LSRA="no"
759     fi
760 fi
761 AC_MSG_RESULT(${ENABLE_LSRA})
762 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
763  
764 if test x"${ENABLE_LSRA}" = "xyes"; then
765     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
766 fi
767
768
769 dnl check if profiling should be supported
770 AC_MSG_CHECKING(whether profiling should be supported)
771 AC_ARG_ENABLE([profiling],
772               [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
773               [case "${enableval}" in
774                    yes) ENABLE_PROFILING=yes;;
775                    *) ENABLE_PROFILING=no;;
776                esac],
777               [ENABLE_PROFILING=no])
778 AC_MSG_RESULT(${ENABLE_PROFILING})
779 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
780    
781 if test x"${ENABLE_PROFILING}" = "xyes"; then
782     AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
783 fi
784
785
786 dnl check for instruction scheduler
787 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
788
789 AC_MSG_CHECKING(whether instruction scheduler should be supported)
790 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
791         case "${ARCH_DIR}" in
792                 xdspcore )
793                         ;;
794                 * )
795                         AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
796                         ;;
797         esac
798
799         AC_MSG_RESULT(yes)
800         AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
801         AM_CONDITIONAL([USE_SCHEDULER], [true])
802 else
803         AC_MSG_RESULT(no)
804         AM_CONDITIONAL([USE_SCHEDULER], [false])
805 fi
806
807
808 dnl check if zlib should be used
809 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
810 AC_ARG_ENABLE([zlib],
811               [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
812               [case "${enableval}" in
813                   no) ENABLE_ZLIB=no;;
814                   *) ENABLE_ZLIB=yes;;
815                esac],
816               [ENABLE_ZLIB=yes])
817 AC_MSG_RESULT(${ENABLE_ZLIB})
818
819 if test x"${ENABLE_ZLIB}" = "xyes"; then
820     AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
821     AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
822     AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
823     AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
824 fi
825 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
826
827
828 dnl check if a libjvm.so should be built
829 AC_MSG_CHECKING(whether to build a libjvm.so)
830 AC_ARG_ENABLE([libjvm],
831               [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
832               [case "${enableval}" in
833                   no) ENABLE_LIBJVM=no;;
834                   *) ENABLE_LIBJVM=yes;;
835                esac],
836               [ENABLE_LIBJVM=yes])
837 AC_MSG_RESULT(${ENABLE_LIBJVM})
838 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
839 AC_SUBST(ENABLE_LIBJVM)
840
841 if test x"${ENABLE_LIBJVM}" = "xyes"; then
842     AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
843
844     dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
845     enable_shared=yes
846     enable_static=no
847 else
848     enable_shared=no
849     enable_static=yes
850 fi
851
852 dnl libtool stuff
853 AC_LIBTOOL_DLOPEN
854 AC_PROG_LIBTOOL
855
856
857 dnl check if CACAO should be linked statically
858 AC_MSG_CHECKING(whether to link CACAO statically)
859 AC_ARG_ENABLE([staticvm],
860               [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
861               [case "${enableval}" in
862                   yes) ENABLE_STATICVM=yes
863                        AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
864                        ;;
865                   *) ENABLE_STATICVM=no;;
866                esac],
867               [ENABLE_STATICVM=no])
868 AC_MSG_RESULT(${ENABLE_STATICVM})
869 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
870 AC_SUBST(ENABLE_STATICVM)
871
872
873 dnl where is CACAO's vm.zip
874 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
875 AC_ARG_WITH([vm-zip],
876             [AS_HELP_STRING(--with-vm-zip=<path>,path to CACAO's vm.zip (includes the name of the file and may be flat) [[default=/usr/local/cacao/share/cacao/vm.zip]])],
877             [CACAO_VM_ZIP=${withval}],
878             [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
879 AC_MSG_RESULT(${CACAO_VM_ZIP})
880 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
881 AC_SUBST(CACAO_VM_ZIP)
882
883
884 dnl which Java core library are we using?
885 AC_MSG_CHECKING(which Java core library to use)
886 AC_ARG_WITH([classpath],
887             [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (gnu) [[default=gnu]])],
888             [case "${withval}" in
889                 cldc1.1)
890                     WITH_CLASSPATH=cldc1.1
891                     AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
892                     AC_SUBST(WITH_CLASSPATH_CLDC1_1)
893                     ;;
894                 gnu)
895                     WITH_CLASSPATH=gnu
896                     AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
897                     AC_SUBST(WITH_CLASSPATH_GNU)
898                     ;;
899                 *)
900                     AC_MSG_ERROR(unknown classpath ${withval})
901                     ;;
902              esac],
903             [WITH_CLASSPATH=gnu
904              AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
905              AC_SUBST(WITH_CLASSPATH_GNU)])
906 AC_MSG_RESULT(${WITH_CLASSPATH})
907 AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
908 AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
909
910
911 dnl where is Java core library installed?
912 AC_MSG_CHECKING(where Java core library is installed)
913 AC_ARG_WITH([classpath-prefix],
914             [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
915             [CLASSPATH_PREFIX=${withval}],
916             [CLASSPATH_PREFIX=/usr/local/classpath])
917 AC_MSG_RESULT(${CLASSPATH_PREFIX})
918 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
919 AC_SUBST(CLASSPATH_PREFIX)
920
921
922 dnl where are Java core library classes installed?
923 AC_MSG_CHECKING(where Java core library classes are installed)
924 AC_ARG_WITH([classpath-classes],
925             [AS_HELP_STRING(--with-classpath-classes=<path>,path to Java core library classes (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
926             [CLASSPATH_CLASSES=${withval}],
927             [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
928 AC_MSG_RESULT(${CLASSPATH_CLASSES})
929 AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
930 AC_SUBST(CLASSPATH_CLASSES)
931
932
933 dnl where are Java core library native libraries installed?
934 AC_MSG_CHECKING(where Java core library native libraries are installed)
935 AC_ARG_WITH([classpath-libdir],
936             [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
937             [CLASSPATH_LIBDIR=${withval}],
938             [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
939 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
940
941 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
942 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
943 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [Java core library native libraries installation directory])
944 AC_SUBST(CLASSPATH_LIBDIR)
945
946
947 dnl where are Java core library headers installed?
948 AC_MSG_CHECKING(where Java core library headers are installed)
949 AC_ARG_WITH([classpath-includedir],
950             [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library headers [[default=/usr/local/classpath/include]])],
951             [CLASSPATH_INCLUDEDIR=${withval}],
952             [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
953 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
954
955 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
956                 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [Java core library jni.h header])],
957                 [AC_MSG_ERROR(cannot find jni.h)])
958
959
960 dnl if we compile for a JRE-style directory layout
961 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
962 AC_ARG_WITH([jre-layout],
963             [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
964             [case "${enableval}" in
965                 yes) WITH_JRE_LAYOUT=yes
966                      AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
967                      ;;
968                 *) WITH_JRE_LAYOUT=no;;
969              esac],
970             [WITH_JRE_LAYOUT=no])
971 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
972
973
974 dnl check if GNU Classpath should be linked statically into CACAO
975 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
976 AC_ARG_WITH([static-classpath],
977             [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
978             [case "${enableval}" in
979                 yes) WITH_STATIC_CLASSPATH=yes;;
980                 *) WITH_STATIC_CLASSPATH=no;;
981              esac],
982             [WITH_STATIC_CLASSPATH=no])
983 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
984
985 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
986     AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
987
988     dnl check for some classpath related stuff when we link statically
989     AM_ICONV_LINK
990 else
991     dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
992     if test x"${ENABLE_STATICVM}" = "xyes"; then
993         AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
994     fi
995
996     AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
997     AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
998 fi
999 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
1000 AC_SUBST(WITH_STATIC_CLASSPATH)
1001
1002
1003 dnl check for some programs we need
1004 AC_PROG_JAVAC
1005 AC_PROG_JAR
1006
1007
1008 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
1009 CFLAGS=$OPT_CFLAGS
1010 AM_CFLAGS=$ARCH_CFLAGS
1011 AC_SUBST(AM_CFLAGS)
1012
1013
1014 AC_CONFIG_FILES([Makefile]
1015                 [contrib/Makefile]
1016                 [contrib/setenvinstalled]
1017                 [contrib/setenvsource]
1018                 [doc/Makefile]
1019                 [doc/handbook/Makefile]
1020                 [man/Makefile]
1021                 [src/Makefile]
1022                 [src/cacao/Makefile]
1023                 [src/cacaoh/Makefile]
1024                 [src/fdlibm/Makefile]
1025                 [src/lib/Makefile]
1026                 [src/mm/Makefile]
1027                 [src/mm/cacao-gc/Makefile]
1028                 [src/native/Makefile]
1029                 [src/native/include/Makefile]
1030                 [src/native/jvmti/Makefile]
1031                 [src/native/tools/Makefile]
1032                 [src/native/vm/Makefile]
1033                 [src/native/vm/cldc1.1/Makefile]
1034                 [src/native/vm/gnu/Makefile]
1035                 [src/scripts/Makefile]
1036                 [src/scripts/java]
1037                 [src/threads/Makefile]
1038                 [src/threads/native/Makefile]
1039                 [src/threads/none/Makefile]
1040                 [src/toolbox/Makefile]
1041                 [src/vm/Makefile]
1042                 [src/vm/jit/Makefile]
1043                 [src/vm/jit/allocator/Makefile]
1044                 [src/vm/jit/alpha/Makefile]
1045                 [src/vm/jit/alpha/freebsd/Makefile]
1046                 [src/vm/jit/alpha/linux/Makefile]
1047                 [src/vm/jit/arm/Makefile]
1048                 [src/vm/jit/arm/linux/Makefile]
1049                 [src/vm/jit/i386/Makefile]
1050                 [src/vm/jit/i386/cygwin/Makefile]
1051                 [src/vm/jit/i386/darwin/Makefile]
1052                 [src/vm/jit/i386/freebsd/Makefile]
1053                 [src/vm/jit/i386/linux/Makefile]
1054                 [src/vm/jit/intrp/Makefile]
1055                 [src/vm/jit/inline/Makefile]
1056                 [src/vm/jit/loop/Makefile]
1057                 [src/vm/jit/mips/Makefile]
1058                 [src/vm/jit/mips/irix/Makefile]
1059                 [src/vm/jit/mips/linux/Makefile]
1060                 [src/vm/jit/optimizing/Makefile]
1061                 [src/vm/jit/parisc/Makefile]
1062                 [src/vm/jit/parisc/linux/Makefile]
1063                 [src/vm/jit/powerpc/Makefile]
1064                 [src/vm/jit/powerpc/darwin/Makefile]
1065                 [src/vm/jit/powerpc/linux/Makefile]
1066                 [src/vm/jit/powerpc/netbsd/Makefile]
1067                 [src/vm/jit/powerpc64/Makefile]
1068                 [src/vm/jit/powerpc64/linux/Makefile]
1069                 [src/vm/jit/s390/Makefile]
1070                 [src/vm/jit/schedule/Makefile]
1071                 [src/vm/jit/sparc64/Makefile]
1072                 [src/vm/jit/sparc64/linux/Makefile]
1073                 [src/vm/jit/tools/Makefile]
1074                 [src/vm/jit/verify/Makefile]
1075                 [src/vm/jit/x86_64/Makefile]
1076                 [src/vmcore/Makefile]
1077                 [tests/Makefile]
1078                 [tests/regression/Makefile]
1079                 [tests/regression/codepatching/Makefile]
1080                 [tests/regression/jasmin/Makefile]
1081                 [tests/regression/native/Makefile])
1082
1083
1084 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
1085 export OPT_CFLAGS
1086 export ARCH_CFLAGS
1087 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
1088
1089
1090 AC_OUTPUT
1091
1092
1093 ## Local variables:
1094 ## mode: m4
1095 ## indent-tabs-mode: t
1096 ## c-basic-offset: 4
1097 ## tab-width: 8
1098 ## compile-command: "automake --add-missing"
1099 ## End: