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
8 dnl This file is part of CACAO.
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.
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.
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
25 dnl $Id: configure.ac 6595 2007-01-11 14:19:48Z twisti $
27 dnl Process this file with autoconf to produce a configure script.
30 AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
31 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
34 AM_INIT_AUTOMAKE([1.9.0])
37 AM_CONFIG_HEADER([config.h])
39 AC_PREFIX_DEFAULT(/usr/local/cacao)
42 dnl set optimization and debugging for all architectures and systems
43 if test x"$CFLAGS" = "x"; then
51 alpha | alphaev56 | alphapca56 )
53 ARCH_CFLAGS="-mieee -D__ALPHA__"
56 arm | armv4tl | armv5b | armv5l )
58 ARCH_CFLAGS="-D__ARM__"
63 ARCH_CFLAGS="-D__PARISC__"
66 i386 | i486 | i586 | i686 )
68 ARCH_CFLAGS="-D__I386__"
73 ARCH_CFLAGS="-D__M68K__"
78 ARCH_CFLAGS="-D__MIPS__"
83 ARCH_CFLAGS="-D__POWERPC__"
88 ARCH_CFLAGS="-D__POWERPC64__"
93 ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
98 ARCH_CFLAGS="-D__X86_64__"
103 ENABLE_STATICVM="yes"
104 ARCH_CFLAGS="-D__XDSPCORE__"
109 AC_MSG_ERROR($host_cpu systems are not supported at this time)
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"
123 INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
124 ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
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"
135 INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
136 ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
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"
145 dnl must be before *linux*
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"
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"
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"
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"
173 dnl set interpreter flags
174 AC_SUBST(INTRP_CFLAGS)
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])
182 dnl define and substitute some architecture specific variables
183 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
186 AC_SUBST(USE_SCHEDULER)
189 dnl Checks for programs.
199 dnl Checks for header files.
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])
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]))
217 dnl Checks for typedefs, structures, and compiler characteristics.
226 dnl Checks for library functions.
227 AC_PROG_GCC_TRADITIONAL
231 AC_CHECK_FUNCS([calloc mmap getpagesize free])
232 AC_CHECK_FUNCS([getcwd gettimeofday])
233 AC_CHECK_FUNCS([scandir])
234 AC_CHECK_FUNCS([isnan])
236 dnl Checks for libraries.
238 dnl Checking sizeof void *
239 AC_CHECK_SIZEOF(void *)
243 dnl define install prefix
244 if test "x$prefix" = "xNONE"; then
245 CACAO_PREFIX=$ac_default_prefix
249 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
250 AC_SUBST(CACAO_PREFIX)
252 dnl define libdir prefix
253 if test "x$libdir" = "xNONE"; then
254 CACAO_LIBDIR=$ac_default_libdir
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)
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
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)
280 AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
281 AC_MSG_RESULT(javase)
284 AC_MSG_ERROR(${enableval} is an unknown configuration)
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")
294 dnl check for JIT compiler
295 AC_MSG_CHECKING(whether JIT compiler should be compiled)
297 [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
298 [case "${enableval}" in
303 AC_MSG_RESULT(${ENABLE_JIT})
304 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
306 if test x"${ENABLE_JIT}" = "xyes"; then
307 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
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;;
319 [ENABLE_SOFTFLOAT=no])
320 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
322 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
323 AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
327 dnl check for interpreter
328 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
330 AC_MSG_CHECKING(whether interpreter should be compiled)
331 if test x"$enable_intrp" = "xyes"; then
333 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
334 AM_CONDITIONAL([ENABLE_INTRP], [true])
341 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
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])],
348 dnl check for libffcall
349 AC_ARG_WITH([ffcall],
350 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
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])],
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.)
361 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
362 AC_ERROR(Enable one of libffi or libffcall.)
367 AM_CONDITIONAL([ENABLE_INTRP], [false])
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.)
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}
382 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
388 AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
390 AC_MSG_RESULT(yes, boehm-gc)
394 AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
396 AC_MSG_RESULT(yes, cacao-gc)
400 AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
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")
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
415 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
420 AC_MSG_RESULT(${DISABLE_DUMP})
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
429 AC_DEFINE([NDEBUG], 1, [disable debug code])
435 if test x"${NDEBUG}" = "xno"; then
440 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
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;;
451 [ENABLE_MEMCHECK=no])
452 AC_MSG_RESULT(${ENABLE_MEMCHECK})
453 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
455 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
456 AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
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;;
468 [ENABLE_DISASSEMBLER=no])
469 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
470 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
472 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
473 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
475 dnl check for binutils headers and libraries on some architectures for the
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)])
485 cygwin | darwin | netbsd )
486 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
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])
497 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
501 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
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;;
513 [ENABLE_STATISTICS=no])
514 AC_MSG_RESULT(${ENABLE_STATISTICS})
515 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
517 if test x"${ENABLE_STATISTICS}" = "xyes"; then
518 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
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;;
530 [ENABLE_VERIFIER=yes])
531 AC_MSG_RESULT(${ENABLE_VERIFIER})
532 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
534 if test x"${ENABLE_VERIFIER}" = "xyes"; then
535 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
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;;
547 [ENABLE_RT_TIMING=no])
548 AC_MSG_RESULT(${ENABLE_RT_TIMING})
549 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
551 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
552 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
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;;
564 [ENABLE_CYCLES_STATS=no])
565 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
566 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
568 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
569 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
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;;
582 AC_MSG_RESULT(${ENABLE_JVMTI})
583 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
585 if test x"${ENABLE_JVMTI}" = "xyes"; then
586 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
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])
594 AC_MSG_CHECKING(whether to include threads support)
595 enable_threads=${enable_threads:-native}
596 case "$enable_threads" in
599 dnl no threads for boehm
600 ac_configure_args="$ac_configure_args --disable-boehm-threads"
601 AM_CONDITIONAL([ENABLE_THREADS], [false])
604 native | posix | pthreads)
605 AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
607 AM_CONDITIONAL([ENABLE_THREADS], [true])
609 AC_MSG_RESULT(yes, native)
610 AC_CHECK_LIB(pthread, main)
612 ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
614 dnl we changed ARCH_CFLAGS, set CFLAGS again
615 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
617 dnl tell boehm to support threads as well
618 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
622 AC_MSG_ERROR($enable_threads is an unknown thread package)
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
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
636 ac_cv_gcc___thread=no
639 if test "$ac_cv_gcc___thread" = yes; then
640 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
643 ac_cv_gcc___thread=no
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;;
656 AC_MSG_RESULT(${ENABLE_IFCONV})
657 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
659 if test x"${ENABLE_IFCONV}" = "xyes"; then
660 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
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;;
672 [ENABLE_INLINING=no])
673 AC_MSG_RESULT(${ENABLE_INLINING})
674 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
676 if test x"${ENABLE_INLINING}" = "xyes"; then
677 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
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;;
689 [ENABLE_REPLACEMENT=no])
690 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
691 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
693 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
694 AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
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;;
707 AC_MSG_RESULT(${ENABLE_LOOP})
708 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
710 if test x"${ENABLE_LOOP}" = "xyes"; then
711 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
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)
718 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
719 [case "${enableval}" in
724 AC_MSG_RESULT(${ENABLE_SSA})
725 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
727 if test x"${ENABLE_SSA}" = "xyes"; then
728 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
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;;
743 if test x"${ENABLE_LSRA}" = "xyes"; then
744 if test x"${ENABLE_SSA}" = "xyes"; then
748 AC_MSG_RESULT(${ENABLE_LSRA})
749 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
751 if test x"${ENABLE_LSRA}" = "xyes"; then
752 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
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;;
764 [ENABLE_PROFILING=no])
765 AC_MSG_RESULT(${ENABLE_PROFILING})
766 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
768 if test x"${ENABLE_PROFILING}" = "xyes"; then
769 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
773 dnl check for instruction scheduler
774 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
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
782 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
787 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
788 AM_CONDITIONAL([USE_SCHEDULER], [true])
791 AM_CONDITIONAL([USE_SCHEDULER], [false])
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
804 AC_MSG_RESULT(${ENABLE_ZLIB})
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])
812 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
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;;
824 AC_MSG_RESULT(${ENABLE_LIBJVM})
825 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
826 AC_SUBST(ENABLE_LIBJVM)
828 if test x"${ENABLE_LIBJVM}" = "xyes"; then
829 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
831 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
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])
852 *) ENABLE_STATICVM=no;;
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)
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)
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
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)
883 AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
884 AC_SUBST(WITH_CLASSPATH_GNU)
887 AC_MSG_ERROR(unknown classpath ${withval})
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")
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)
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)
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})
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)
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})
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)])
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])
955 *) WITH_JRE_LAYOUT=no;;
957 [WITH_JRE_LAYOUT=no])
958 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
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;;
969 [WITH_STATIC_CLASSPATH=no])
970 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
972 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
973 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
975 dnl check for some classpath related stuff when we link statically
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)])
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)])
986 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
987 AC_SUBST(WITH_STATIC_CLASSPATH)
990 dnl check for some programs we need
995 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
997 AM_CFLAGS=$ARCH_CFLAGS
1001 AC_CONFIG_FILES([Makefile]
1003 [contrib/setenvinstalled]
1004 [contrib/setenvsource]
1006 [doc/handbook/Makefile]
1009 [src/cacao/Makefile]
1010 [src/cacaoh/Makefile]
1011 [src/fdlibm/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]
1024 [src/threads/Makefile]
1025 [src/threads/native/Makefile]
1026 [src/threads/none/Makefile]
1027 [src/toolbox/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]
1063 [tests/regression/Makefile]
1064 [tests/regression/codepatching/Makefile]
1065 [tests/regression/jasmin/Makefile]
1066 [tests/regression/native/Makefile])
1069 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
1072 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
1080 ## indent-tabs-mode: t
1081 ## c-basic-offset: 4
1083 ## compile-command: "automake --add-missing"