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 7219 2007-01-16 22:18:57Z pm $
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__"
110 ARCH_CFLAGS="-D__S390__"
115 AC_MSG_ERROR($host_cpu systems are not supported at this time)
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"
129 INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
130 ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
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"
141 INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
142 ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
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"
151 dnl must be before *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"
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"
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"
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"
179 dnl set interpreter flags
180 AC_SUBST(INTRP_CFLAGS)
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])
188 dnl define and substitute some architecture specific variables
189 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
192 AC_SUBST(USE_SCHEDULER)
195 dnl Checks for programs.
205 dnl Checks for header files.
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])
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]))
223 dnl Checks for typedefs, structures, and compiler characteristics.
232 dnl Checks for library functions.
233 AC_PROG_GCC_TRADITIONAL
237 AC_CHECK_FUNCS([calloc mmap getpagesize free])
238 AC_CHECK_FUNCS([getcwd gettimeofday])
239 AC_CHECK_FUNCS([scandir])
240 AC_CHECK_FUNCS([isnan])
242 dnl Checks for libraries.
244 dnl Checking sizeof void *
245 AC_CHECK_SIZEOF(void *)
249 dnl define install prefix
250 if test "x$prefix" = "xNONE"; then
251 CACAO_PREFIX=$ac_default_prefix
255 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
256 AC_SUBST(CACAO_PREFIX)
258 dnl define libdir prefix
259 if test "x$libdir" = "xNONE"; then
260 CACAO_LIBDIR=$ac_default_libdir
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)
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
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)
286 AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
287 AC_MSG_RESULT(javase)
290 AC_MSG_ERROR(${enableval} is an unknown configuration)
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")
300 dnl check for JIT compiler
301 AC_MSG_CHECKING(whether JIT compiler should be compiled)
303 [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
304 [case "${enableval}" in
309 AC_MSG_RESULT(${ENABLE_JIT})
310 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
312 if test x"${ENABLE_JIT}" = "xyes"; then
313 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
317 dnl check if softfloat should be used
318 AC_MSG_CHECKING(whether softfloat should be used)
319 AC_ARG_ENABLE([softfloat],
320 [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
321 [case "${enableval}" in
322 yes) ENABLE_SOFTFLOAT=yes;;
323 *) ENABLE_SOFTFLOAT=no;;
325 [ENABLE_SOFTFLOAT=no])
326 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
328 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
329 AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
333 dnl check for interpreter
334 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
336 AC_MSG_CHECKING(whether interpreter should be compiled)
337 if test x"$enable_intrp" = "xyes"; then
339 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
340 AM_CONDITIONAL([ENABLE_INTRP], [true])
347 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
349 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
350 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
351 AC_DEFINE([WITH_FFI], 1, [use libffi])],
354 dnl check for libffcall
355 AC_ARG_WITH([ffcall],
356 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
358 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
359 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
360 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
363 dnl check for libffi or libffcall
364 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
365 AC_ERROR(Enable only libffi or libffcall.)
367 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
368 AC_ERROR(Enable one of libffi or libffcall.)
373 AM_CONDITIONAL([ENABLE_INTRP], [false])
377 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
378 AC_ERROR(You have to enable at least the JIT or the interpreter.)
382 dnl check for garbage collector usage
383 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
384 AC_MSG_CHECKING(whether GC should be enabled)
385 enable_gc=${enable_gc:-boehm}
388 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
394 AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
396 AC_MSG_RESULT(yes, boehm-gc)
400 AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
402 AC_MSG_RESULT(yes, cacao-gc)
406 AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
409 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
410 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
411 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
414 dnl check for dump memory usage
415 AC_MSG_CHECKING(whether dump memory should be disabled)
416 AC_ARG_ENABLE([dump],
417 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
418 [case "${enableval}" in
421 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
426 AC_MSG_RESULT(${DISABLE_DUMP})
430 AC_MSG_CHECKING(whether debug code generation should be enabled)
431 AC_ARG_ENABLE([debug],
432 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
433 [case "${enableval}" in
435 AC_DEFINE([NDEBUG], 1, [disable debug code])
441 if test x"${NDEBUG}" = "xno"; then
446 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
449 dnl check for memcheck support
450 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
451 AC_ARG_ENABLE([memcheck],
452 [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
453 [case "${enableval}" in
454 yes) ENABLE_MEMCHECK=yes;;
455 *) ENABLE_MEMCHECK=no;;
457 [ENABLE_MEMCHECK=no])
458 AC_MSG_RESULT(${ENABLE_MEMCHECK})
459 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
461 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
462 AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
466 dnl check for disassembler support
467 AC_MSG_CHECKING(whether disassembler should be enabled)
468 AC_ARG_ENABLE([disassembler],
469 [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
470 [case "${enableval}" in
471 yes) ENABLE_DISASSEMBLER=yes;;
472 *) ENABLE_DISASSEMBLER=no;;
474 [ENABLE_DISASSEMBLER=no])
475 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
476 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
478 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
479 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
481 dnl check for binutils headers and libraries on some architectures for the
483 case "${ARCH_DIR}" in
484 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390)
485 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
486 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
487 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
488 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
491 cygwin | darwin | netbsd )
492 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
496 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
497 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
498 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
499 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
500 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
503 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
507 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
511 dnl check for statistics
512 AC_MSG_CHECKING(whether statistics generation should be enabled)
513 AC_ARG_ENABLE([statistics],
514 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
515 [case "${enableval}" in
516 yes) ENABLE_STATISTICS=yes;;
517 *) ENABLE_STATISTICS=no;;
519 [ENABLE_STATISTICS=no])
520 AC_MSG_RESULT(${ENABLE_STATISTICS})
521 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
523 if test x"${ENABLE_STATISTICS}" = "xyes"; then
524 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
528 dnl check for verifier
529 AC_MSG_CHECKING(whether classfile verification should be enabled)
530 AC_ARG_ENABLE([verifier],
531 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
532 [case "${enableval}" in
533 no) ENABLE_VERIFIER=no;;
534 *) ENABLE_VERIFIER=yes;;
536 [ENABLE_VERIFIER=yes])
537 AC_MSG_RESULT(${ENABLE_VERIFIER})
538 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
540 if test x"${ENABLE_VERIFIER}" = "xyes"; then
541 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
545 dnl check for compiler timing
546 AC_MSG_CHECKING(whether real-time timing should be enabled)
547 AC_ARG_ENABLE([rt-timing],
548 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
549 [case "${enableval}" in
550 yes) ENABLE_RT_TIMING=yes;;
551 *) ENABLE_RT_TIMING=no;;
553 [ENABLE_RT_TIMING=no])
554 AC_MSG_RESULT(${ENABLE_RT_TIMING})
555 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
557 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
558 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
562 dnl check for cycle count statistics
563 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
564 AC_ARG_ENABLE([cycles-stats],
565 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
566 [case "${enableval}" in
567 yes) ENABLE_CYCLES_STATS=yes;;
568 *) ENABLE_CYCLES_STATS=no;;
570 [ENABLE_CYCLES_STATS=no])
571 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
572 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
574 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
575 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
580 AC_MSG_CHECKING(whether to compile JVMTI support)
581 AC_ARG_ENABLE([jvmti],
582 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
583 [case "${enableval}" in
584 yes) ENABLE_JVMTI=yes;;
588 AC_MSG_RESULT(${ENABLE_JVMTI})
589 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
591 if test x"${ENABLE_JVMTI}" = "xyes"; then
592 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
597 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,native) [[default=native]])])
598 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
600 AC_MSG_CHECKING(whether to include threads support)
601 enable_threads=${enable_threads:-native}
602 case "$enable_threads" in
605 dnl no threads for boehm
606 ac_configure_args="$ac_configure_args --disable-boehm-threads"
607 AM_CONDITIONAL([ENABLE_THREADS], [false])
610 native | posix | pthreads)
611 AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
613 AM_CONDITIONAL([ENABLE_THREADS], [true])
615 AC_MSG_RESULT(yes, native)
616 AC_CHECK_LIB(pthread, main)
618 ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
620 dnl we changed ARCH_CFLAGS, set CFLAGS again
621 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
623 dnl tell boehm to support threads as well
624 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
628 AC_MSG_ERROR($enable_threads is an unknown thread package)
633 dnl Check whether the compiler supports the __thread keyword.
634 if test "x$use__thread" != xno; then
635 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
636 [cat > conftest.c <<\EOF
639 if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
640 ac_cv_gcc___thread=yes
642 ac_cv_gcc___thread=no
645 if test "$ac_cv_gcc___thread" = yes; then
646 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
649 ac_cv_gcc___thread=no
653 dnl check if if-conversion should be supported
654 AC_MSG_CHECKING(whether if-conversion should be supported)
655 AC_ARG_ENABLE([ifconv],
656 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
657 [case "${enableval}" in
658 no) ENABLE_IFCONV=no;;
659 *) ENABLE_IFCONV=yes;;
662 AC_MSG_RESULT(${ENABLE_IFCONV})
663 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
665 if test x"${ENABLE_IFCONV}" = "xyes"; then
666 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
670 dnl check for inlining
671 AC_MSG_CHECKING(whether method inlining should be supported)
672 AC_ARG_ENABLE([inlining],
673 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
674 [case "${enableval}" in
675 yes) ENABLE_INLINING=yes;;
676 *) ENABLE_INLINING=no;;
678 [ENABLE_INLINING=no])
679 AC_MSG_RESULT(${ENABLE_INLINING})
680 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
682 if test x"${ENABLE_INLINING}" = "xyes"; then
683 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
687 dnl check for replacement
688 AC_MSG_CHECKING(whether on-stack replacement should be supported)
689 AC_ARG_ENABLE([replacement],
690 [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
691 [case "${enableval}" in
692 yes) ENABLE_REPLACEMENT=yes;;
693 *) ENABLE_REPLACEMENT=no;;
695 [ENABLE_REPLACEMENT=no])
696 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
697 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
699 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
700 AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
704 dnl check for loop optimization
705 AC_MSG_CHECKING(whether loop optimization should be supported)
706 AC_ARG_ENABLE([loop],
707 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
708 [case "${enableval}" in
709 yes) ENABLE_LOOP=yes;;
713 AC_MSG_RESULT(${ENABLE_LOOP})
714 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
716 if test x"${ENABLE_LOOP}" = "xyes"; then
717 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
721 dnl check if linear scan register allocator(lsra) with SSA should be used
722 AC_MSG_CHECKING(whether lsra with ssa should be supported)
724 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
725 [case "${enableval}" in
730 AC_MSG_RESULT(${ENABLE_SSA})
731 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
733 if test x"${ENABLE_SSA}" = "xyes"; then
734 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
739 dnl check if linear scan register allocator(lsra) should be used
740 AC_MSG_CHECKING(whether lsra should be supported)
741 AC_ARG_ENABLE([lsra],
742 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
743 [case "${enableval}" in
744 yes) ENABLE_LSRA=yes;;
749 if test x"${ENABLE_LSRA}" = "xyes"; then
750 if test x"${ENABLE_SSA}" = "xyes"; then
754 AC_MSG_RESULT(${ENABLE_LSRA})
755 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
757 if test x"${ENABLE_LSRA}" = "xyes"; then
758 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
762 dnl check if profiling should be supported
763 AC_MSG_CHECKING(whether profiling should be supported)
764 AC_ARG_ENABLE([profiling],
765 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
766 [case "${enableval}" in
767 yes) ENABLE_PROFILING=yes;;
768 *) ENABLE_PROFILING=no;;
770 [ENABLE_PROFILING=no])
771 AC_MSG_RESULT(${ENABLE_PROFILING})
772 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
774 if test x"${ENABLE_PROFILING}" = "xyes"; then
775 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
779 dnl check for instruction scheduler
780 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
782 AC_MSG_CHECKING(whether instruction scheduler should be supported)
783 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
784 case "${ARCH_DIR}" in
788 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
793 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
794 AM_CONDITIONAL([USE_SCHEDULER], [true])
797 AM_CONDITIONAL([USE_SCHEDULER], [false])
801 dnl check if zlib should be used
802 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
803 AC_ARG_ENABLE([zlib],
804 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
805 [case "${enableval}" in
810 AC_MSG_RESULT(${ENABLE_ZLIB})
812 if test x"${ENABLE_ZLIB}" = "xyes"; then
813 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
814 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
815 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
816 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
818 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
821 dnl check if a libjvm.so should be built
822 AC_MSG_CHECKING(whether to build a libjvm.so)
823 AC_ARG_ENABLE([libjvm],
824 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
825 [case "${enableval}" in
826 no) ENABLE_LIBJVM=no;;
827 *) ENABLE_LIBJVM=yes;;
830 AC_MSG_RESULT(${ENABLE_LIBJVM})
831 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
832 AC_SUBST(ENABLE_LIBJVM)
834 if test x"${ENABLE_LIBJVM}" = "xyes"; then
835 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
837 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
850 dnl check if CACAO should be linked statically
851 AC_MSG_CHECKING(whether to link CACAO statically)
852 AC_ARG_ENABLE([staticvm],
853 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
854 [case "${enableval}" in
855 yes) ENABLE_STATICVM=yes
856 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
858 *) ENABLE_STATICVM=no;;
860 [ENABLE_STATICVM=no])
861 AC_MSG_RESULT(${ENABLE_STATICVM})
862 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
863 AC_SUBST(ENABLE_STATICVM)
866 dnl where is CACAO's vm.zip
867 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
868 AC_ARG_WITH([vm-zip],
869 [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]])],
870 [CACAO_VM_ZIP=${withval}],
871 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
872 AC_MSG_RESULT(${CACAO_VM_ZIP})
873 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
874 AC_SUBST(CACAO_VM_ZIP)
877 dnl which Java core library are we using?
878 AC_MSG_CHECKING(which Java core library to use)
879 AC_ARG_WITH([classpath],
880 [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (gnu) [[default=gnu]])],
881 [case "${withval}" in
883 WITH_CLASSPATH=cldc1.1
884 AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
885 AC_SUBST(WITH_CLASSPATH_CLDC1_1)
889 AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
890 AC_SUBST(WITH_CLASSPATH_GNU)
893 AC_MSG_ERROR(unknown classpath ${withval})
897 AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
898 AC_SUBST(WITH_CLASSPATH_GNU)])
899 AC_MSG_RESULT(${WITH_CLASSPATH})
900 AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
901 AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
904 dnl where is Java core library installed?
905 AC_MSG_CHECKING(where Java core library is installed)
906 AC_ARG_WITH([classpath-prefix],
907 [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
908 [CLASSPATH_PREFIX=${withval}],
909 [CLASSPATH_PREFIX=/usr/local/classpath])
910 AC_MSG_RESULT(${CLASSPATH_PREFIX})
911 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
912 AC_SUBST(CLASSPATH_PREFIX)
915 dnl where are Java core library classes installed?
916 AC_MSG_CHECKING(where Java core library classes are installed)
917 AC_ARG_WITH([classpath-classes],
918 [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]])],
919 [CLASSPATH_CLASSES=${withval}],
920 [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
921 AC_MSG_RESULT(${CLASSPATH_CLASSES})
922 AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
923 AC_SUBST(CLASSPATH_CLASSES)
926 dnl where are Java core library native libraries installed?
927 AC_MSG_CHECKING(where Java core library native libraries are installed)
928 AC_ARG_WITH([classpath-libdir],
929 [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
930 [CLASSPATH_LIBDIR=${withval}],
931 [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
932 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
934 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
935 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
936 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [Java core library native libraries installation directory])
937 AC_SUBST(CLASSPATH_LIBDIR)
940 dnl where are Java core library headers installed?
941 AC_MSG_CHECKING(where Java core library headers are installed)
942 AC_ARG_WITH([classpath-includedir],
943 [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library headers [[default=/usr/local/classpath/include]])],
944 [CLASSPATH_INCLUDEDIR=${withval}],
945 [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
946 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
948 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
949 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [Java core library jni.h header])],
950 [AC_MSG_ERROR(cannot find jni.h)])
953 dnl if we compile for a JRE-style directory layout
954 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
955 AC_ARG_WITH([jre-layout],
956 [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
957 [case "${enableval}" in
958 yes) WITH_JRE_LAYOUT=yes
959 AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
961 *) WITH_JRE_LAYOUT=no;;
963 [WITH_JRE_LAYOUT=no])
964 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
967 dnl check if GNU Classpath should be linked statically into CACAO
968 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
969 AC_ARG_WITH([static-classpath],
970 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
971 [case "${enableval}" in
972 yes) WITH_STATIC_CLASSPATH=yes;;
973 *) WITH_STATIC_CLASSPATH=no;;
975 [WITH_STATIC_CLASSPATH=no])
976 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
978 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
979 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
981 dnl check for some classpath related stuff when we link statically
984 dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
985 if test x"${ENABLE_STATICVM}" = "xyes"; then
986 AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
989 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
990 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
992 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
993 AC_SUBST(WITH_STATIC_CLASSPATH)
996 dnl check for some programs we need
1001 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
1003 AM_CFLAGS=$ARCH_CFLAGS
1007 AC_CONFIG_FILES([Makefile]
1009 [contrib/setenvinstalled]
1010 [contrib/setenvsource]
1012 [doc/handbook/Makefile]
1015 [src/cacao/Makefile]
1016 [src/cacaoh/Makefile]
1017 [src/fdlibm/Makefile]
1020 [src/mm/cacao-gc/Makefile]
1021 [src/native/Makefile]
1022 [src/native/include/Makefile]
1023 [src/native/jvmti/Makefile]
1024 [src/native/tools/Makefile]
1025 [src/native/vm/Makefile]
1026 [src/native/vm/cldc1.1/Makefile]
1027 [src/native/vm/gnu/Makefile]
1028 [src/scripts/Makefile]
1030 [src/threads/Makefile]
1031 [src/threads/native/Makefile]
1032 [src/threads/none/Makefile]
1033 [src/toolbox/Makefile]
1035 [src/vm/jit/Makefile]
1036 [src/vm/jit/allocator/Makefile]
1037 [src/vm/jit/alpha/Makefile]
1038 [src/vm/jit/alpha/freebsd/Makefile]
1039 [src/vm/jit/alpha/linux/Makefile]
1040 [src/vm/jit/arm/Makefile]
1041 [src/vm/jit/arm/linux/Makefile]
1042 [src/vm/jit/i386/Makefile]
1043 [src/vm/jit/i386/cygwin/Makefile]
1044 [src/vm/jit/i386/darwin/Makefile]
1045 [src/vm/jit/i386/freebsd/Makefile]
1046 [src/vm/jit/i386/linux/Makefile]
1047 [src/vm/jit/intrp/Makefile]
1048 [src/vm/jit/inline/Makefile]
1049 [src/vm/jit/loop/Makefile]
1050 [src/vm/jit/mips/Makefile]
1051 [src/vm/jit/mips/irix/Makefile]
1052 [src/vm/jit/mips/linux/Makefile]
1053 [src/vm/jit/optimizing/Makefile]
1054 [src/vm/jit/parisc/Makefile]
1055 [src/vm/jit/parisc/linux/Makefile]
1056 [src/vm/jit/powerpc/Makefile]
1057 [src/vm/jit/powerpc/darwin/Makefile]
1058 [src/vm/jit/powerpc/linux/Makefile]
1059 [src/vm/jit/powerpc/netbsd/Makefile]
1060 [src/vm/jit/powerpc64/Makefile]
1061 [src/vm/jit/powerpc64/linux/Makefile]
1062 [src/vm/jit/schedule/Makefile]
1063 [src/vm/jit/sparc64/Makefile]
1064 [src/vm/jit/sparc64/linux/Makefile]
1065 [src/vm/jit/tools/Makefile]
1066 [src/vm/jit/verify/Makefile]
1067 [src/vm/jit/x86_64/Makefile]
1068 [src/vm/jit/s390/Makefile]
1070 [tests/regression/Makefile]
1071 [tests/regression/codepatching/Makefile]
1072 [tests/regression/jasmin/Makefile]
1073 [tests/regression/native/Makefile])
1076 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
1079 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
1087 ## indent-tabs-mode: t
1088 ## c-basic-offset: 4
1090 ## compile-command: "automake --add-missing"