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