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 7887 2007-05-08 13:03:07Z twisti $
27 dnl Process this file with autoconf to produce a configure script.
30 AC_INIT(cacao, 0.98rc, 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 | armv4 | 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="-D__S390__"
98 ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
103 ARCH_CFLAGS="-D__X86_64__"
108 ENABLE_STATICVM="yes"
109 ARCH_CFLAGS="-D__XDSPCORE__"
114 AC_MSG_ERROR($host_cpu systems are not supported at this time)
122 INTRP_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -Wall -Wno-long-long"
123 ARCH_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -ansi -pedantic -Wall -Wno-long-long"
128 INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
129 ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
134 INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
135 ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
140 INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
141 ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
146 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"
147 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"
150 dnl must be before *linux*
153 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"
154 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"
159 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"
160 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"
165 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"
166 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"
171 dnl on solaris the architecture defines 'sparc','sun','unix' are not set when cpp is called with -ansi
172 dnl therefore we add them here
173 INTRP_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
174 ARCH_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
182 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
183 dnl we set it properly at the end of this file
184 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
186 dnl set interpreter flags
187 AC_SUBST(INTRP_CFLAGS)
189 dnl define some stuff required for --fullversion
190 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
191 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
192 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS", [CFLAGS used])
195 dnl define and substitute some architecture specific variables
196 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
199 AC_SUBST(USE_SCHEDULER)
202 dnl Checks for programs.
212 dnl Checks for header files.
216 dnl keep them alpha-sorted!
217 AC_CHECK_HEADERS([fcntl.h])
218 AC_CHECK_HEADERS([string.h])
219 AC_CHECK_HEADERS([unistd.h])
220 AC_CHECK_HEADERS([sys/ioctl.h])
221 AC_CHECK_HEADERS([sys/mman.h])
222 AC_CHECK_HEADERS([sys/resource.h])
223 AC_CHECK_HEADERS([sys/time.h])
225 dnl this is for fdlibm
226 AC_CHECK_HEADERS([stdint.h])
227 AC_CHECK_HEADERS([inttypes.h])
228 AC_CHECK_HEADERS([sys/config.h])
229 AC_CHECK_HEADERS([sys/types.h])
230 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
231 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
232 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]))
233 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]))
235 dnl Checks for typedefs, structures, and compiler characteristics.
244 dnl Checks for library functions.
245 AC_PROG_GCC_TRADITIONAL
250 dnl keep them alpha-sorted!
251 AC_CHECK_FUNCS([calloc])
252 AC_CHECK_FUNCS([getpagesize])
253 AC_CHECK_FUNCS([free])
254 AC_CHECK_FUNCS([getcwd])
255 AC_CHECK_FUNCS([gettimeofday])
256 AC_CHECK_FUNCS([getrusage])
257 AC_CHECK_FUNCS([isnan])
258 AC_CHECK_FUNCS([mmap])
259 AC_CHECK_FUNCS([mprotect])
260 AC_CHECK_FUNCS([scandir])
261 AC_CHECK_FUNCS([strdup])
264 dnl Checks for libraries.
266 dnl Checking sizeof void *
267 AC_CHECK_SIZEOF(void *)
271 dnl define install prefix
272 if test "x$prefix" = "xNONE"; then
273 CACAO_PREFIX=$ac_default_prefix
277 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
278 AC_SUBST(CACAO_PREFIX)
280 dnl define libdir prefix
281 if test "x$libdir" = "xNONE"; then
282 CACAO_LIBDIR=$ac_default_libdir
286 dnl expand CACAO_LIBDIR to something that is usable in C code
287 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
288 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
289 AC_SUBST(CACAO_LIBDIR)
300 dnl check for stuff that should be done in software
302 AC_CHECK_SOFT_FLOAT_CMP
303 AC_CHECK_SOFT_DOUBLE_CMP
306 dnl check for interpreter
307 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
309 AC_MSG_CHECKING(whether interpreter should be compiled)
310 if test x"$enable_intrp" = "xyes"; then
312 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
313 AM_CONDITIONAL([ENABLE_INTRP], [true])
320 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
322 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
323 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
324 AC_DEFINE([WITH_FFI], 1, [use libffi])],
327 dnl check for libffcall
328 AC_ARG_WITH([ffcall],
329 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
331 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
332 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
333 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
336 dnl check for libffi or libffcall
337 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
338 AC_ERROR(Enable only libffi or libffcall.)
340 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
341 AC_ERROR(Enable one of libffi or libffcall.)
346 AM_CONDITIONAL([ENABLE_INTRP], [false])
350 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
351 AC_ERROR(You have to enable at least the JIT or the interpreter.)
355 dnl check for garbage collector usage
356 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
357 AC_MSG_CHECKING(whether GC should be enabled)
358 enable_gc=${enable_gc:-boehm}
361 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
367 AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
369 AC_MSG_RESULT(yes, boehm-gc)
373 AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
375 AC_MSG_RESULT(yes, cacao-gc)
379 AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
382 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
383 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
384 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
388 dnl check for dump memory usage
389 AC_MSG_CHECKING(whether dump memory should be disabled)
390 AC_ARG_ENABLE([dump],
391 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
392 [case "${enableval}" in
395 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
400 AC_MSG_RESULT(${DISABLE_DUMP})
404 AC_MSG_CHECKING(whether debug code generation should be enabled)
405 AC_ARG_ENABLE([debug],
406 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
407 [case "${enableval}" in
409 AC_DEFINE([NDEBUG], 1, [disable debug code])
415 if test x"${NDEBUG}" = "xno"; then
420 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
423 dnl check for memcheck support
424 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
425 AC_ARG_ENABLE([memcheck],
426 [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
427 [case "${enableval}" in
428 yes) ENABLE_MEMCHECK=yes;;
429 *) ENABLE_MEMCHECK=no;;
431 [ENABLE_MEMCHECK=no])
432 AC_MSG_RESULT(${ENABLE_MEMCHECK})
433 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
435 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
436 AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
440 dnl check for vmlog support
441 AC_MSG_CHECKING(whether vmlog tracing should be enabled)
442 AC_ARG_ENABLE([vmlog],
443 [AS_HELP_STRING(--enable-vmlog,enable vmlog tracing [[default=no]])],
444 [case "${enableval}" in
445 yes) ENABLE_VMLOG=yes;;
449 AC_MSG_RESULT(${ENABLE_VMLOG})
450 AM_CONDITIONAL([ENABLE_VMLOG], test x"${ENABLE_VMLOG}" = "xyes")
452 if test x"${ENABLE_VMLOG}" = "xyes"; then
453 AC_DEFINE([ENABLE_VMLOG], 1, [enable vmlog tracing code])
457 dnl check for disassembler support
458 AC_MSG_CHECKING(whether disassembler should be enabled)
459 AC_ARG_ENABLE([disassembler],
460 [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
461 [case "${enableval}" in
462 yes) ENABLE_DISASSEMBLER=yes;;
463 *) ENABLE_DISASSEMBLER=no;;
465 [ENABLE_DISASSEMBLER=no])
466 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
467 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
469 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
470 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
472 dnl check for binutils headers and libraries on some architectures for the
474 case "${ARCH_DIR}" in
475 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390 | m68k)
476 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
477 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
478 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
479 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
482 cygwin | darwin | netbsd | solaris)
483 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
487 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
488 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
489 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
490 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
491 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
494 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
498 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
502 dnl check for statistics
503 AC_MSG_CHECKING(whether statistics generation should be enabled)
504 AC_ARG_ENABLE([statistics],
505 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
506 [case "${enableval}" in
507 yes) ENABLE_STATISTICS=yes;;
508 *) ENABLE_STATISTICS=no;;
510 [ENABLE_STATISTICS=no])
511 AC_MSG_RESULT(${ENABLE_STATISTICS})
512 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
514 if test x"${ENABLE_STATISTICS}" = "xyes"; then
515 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
519 dnl check for verifier
520 AC_MSG_CHECKING(whether classfile verification should be enabled)
521 AC_ARG_ENABLE([verifier],
522 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
523 [case "${enableval}" in
524 no) ENABLE_VERIFIER=no;;
525 *) ENABLE_VERIFIER=yes;;
527 [ENABLE_VERIFIER=yes])
528 AC_MSG_RESULT(${ENABLE_VERIFIER})
529 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
531 if test x"${ENABLE_VERIFIER}" = "xyes"; then
532 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
536 dnl check for compiler timing
537 AC_MSG_CHECKING(whether real-time timing should be enabled)
538 AC_ARG_ENABLE([rt-timing],
539 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
540 [case "${enableval}" in
541 yes) ENABLE_RT_TIMING=yes;;
542 *) ENABLE_RT_TIMING=no;;
544 [ENABLE_RT_TIMING=no])
545 AC_MSG_RESULT(${ENABLE_RT_TIMING})
546 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
548 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
549 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
553 dnl check for cycle count statistics
554 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
555 AC_ARG_ENABLE([cycles-stats],
556 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
557 [case "${enableval}" in
558 yes) ENABLE_CYCLES_STATS=yes;;
559 *) ENABLE_CYCLES_STATS=no;;
561 [ENABLE_CYCLES_STATS=no])
562 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
563 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
565 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
566 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
571 AC_MSG_CHECKING(whether to compile JVMTI support)
572 AC_ARG_ENABLE([jvmti],
573 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
574 [case "${enableval}" in
575 yes) ENABLE_JVMTI=yes;;
579 AC_MSG_RESULT(${ENABLE_JVMTI})
580 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
582 if test x"${ENABLE_JVMTI}" = "xyes"; then
583 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
587 AC_CHECK_ENABLE_THREADS
590 dnl check if if-conversion should be supported
591 AC_MSG_CHECKING(whether if-conversion should be supported)
592 AC_ARG_ENABLE([ifconv],
593 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
594 [case "${enableval}" in
595 no) ENABLE_IFCONV=no;;
596 *) ENABLE_IFCONV=yes;;
599 AC_MSG_RESULT(${ENABLE_IFCONV})
600 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
602 if test x"${ENABLE_IFCONV}" = "xyes"; then
603 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
607 dnl check for inlining
608 AC_MSG_CHECKING(whether method inlining should be supported)
609 AC_ARG_ENABLE([inlining],
610 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
611 [case "${enableval}" in
612 yes) ENABLE_INLINING=yes;;
613 *) ENABLE_INLINING=no;;
615 [ENABLE_INLINING=no])
616 AC_MSG_RESULT(${ENABLE_INLINING})
617 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
619 if test x"${ENABLE_INLINING}" = "xyes"; then
620 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
624 dnl check for inlining debug options
625 AC_MSG_CHECKING(whether method inlining debug options should be enabled)
626 AC_ARG_ENABLE([inlining-debug],
627 [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
628 [case "${enableval}" in
629 yes) ENABLE_INLINING_DEBUG=yes;;
630 *) ENABLE_INLINING_DEBUG=no;;
632 [ENABLE_INLINING_DEBUG=no])
633 AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
634 AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
636 if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
637 AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
641 dnl check for replacement
642 AC_MSG_CHECKING(whether on-stack replacement should be supported)
643 AC_ARG_ENABLE([replacement],
644 [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
645 [case "${enableval}" in
646 yes) ENABLE_REPLACEMENT=yes;;
647 *) ENABLE_REPLACEMENT=no;;
649 [ENABLE_REPLACEMENT=no])
650 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
651 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
653 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
654 AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
658 dnl check for loop optimization
659 AC_MSG_CHECKING(whether loop optimization should be supported)
660 AC_ARG_ENABLE([loop],
661 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
662 [case "${enableval}" in
663 yes) ENABLE_LOOP=yes;;
667 AC_MSG_RESULT(${ENABLE_LOOP})
668 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
670 if test x"${ENABLE_LOOP}" = "xyes"; then
671 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
675 dnl check if linear scan register allocator(lsra) with SSA should be used
676 AC_MSG_CHECKING(whether lsra with ssa should be supported)
678 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
679 [case "${enableval}" in
684 AC_MSG_RESULT(${ENABLE_SSA})
685 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
687 if test x"${ENABLE_SSA}" = "xyes"; then
688 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
693 dnl check if linear scan register allocator(lsra) should be used
694 AC_MSG_CHECKING(whether lsra should be supported)
695 AC_ARG_ENABLE([lsra],
696 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
697 [case "${enableval}" in
698 yes) ENABLE_LSRA=yes;;
703 if test x"${ENABLE_LSRA}" = "xyes"; then
704 if test x"${ENABLE_SSA}" = "xyes"; then
708 AC_MSG_RESULT(${ENABLE_LSRA})
709 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
711 if test x"${ENABLE_LSRA}" = "xyes"; then
712 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
716 dnl check if profiling should be supported
717 AC_MSG_CHECKING(whether profiling should be supported)
718 AC_ARG_ENABLE([profiling],
719 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
720 [case "${enableval}" in
721 yes) ENABLE_PROFILING=yes;;
722 *) ENABLE_PROFILING=no;;
724 [ENABLE_PROFILING=no])
725 AC_MSG_RESULT(${ENABLE_PROFILING})
726 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
728 if test x"${ENABLE_PROFILING}" = "xyes"; then
729 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
733 dnl check for instruction scheduler
734 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
736 AC_MSG_CHECKING(whether instruction scheduler should be supported)
737 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
738 case "${ARCH_DIR}" in
742 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
747 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
748 AM_CONDITIONAL([USE_SCHEDULER], [true])
751 AM_CONDITIONAL([USE_SCHEDULER], [false])
755 dnl check if zlib should be used
756 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
757 AC_ARG_ENABLE([zlib],
758 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
759 [case "${enableval}" in
764 AC_MSG_RESULT(${ENABLE_ZLIB})
766 if test x"${ENABLE_ZLIB}" = "xyes"; then
767 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
768 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
769 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
770 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
772 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
775 dnl check for stuff to be built
779 dnl check if a libjvm.so should be built
780 AC_MSG_CHECKING(whether to build a libjvm.so)
781 AC_ARG_ENABLE([libjvm],
782 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
783 [case "${enableval}" in
784 no) ENABLE_LIBJVM=no;;
785 *) ENABLE_LIBJVM=yes;;
788 AC_MSG_RESULT(${ENABLE_LIBJVM})
789 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
790 AC_SUBST(ENABLE_LIBJVM)
792 if test x"${ENABLE_LIBJVM}" = "xyes"; then
793 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
795 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
808 dnl check if CACAO should be linked statically
809 AC_MSG_CHECKING(whether to link CACAO statically)
810 AC_ARG_ENABLE([staticvm],
811 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
812 [case "${enableval}" in
813 yes) ENABLE_STATICVM=yes
814 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
816 *) ENABLE_STATICVM=no;;
818 [ENABLE_STATICVM=no])
819 AC_MSG_RESULT(${ENABLE_STATICVM})
820 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
821 AC_SUBST(ENABLE_STATICVM)
824 dnl where is CACAO's vm.zip
825 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
826 AC_ARG_WITH([vm-zip],
827 [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]])],
828 [CACAO_VM_ZIP=${withval}],
829 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
830 AC_MSG_RESULT(${CACAO_VM_ZIP})
831 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
832 AC_SUBST(CACAO_VM_ZIP)
835 AC_CHECK_WITH_CLASSPATH
836 AC_CHECK_WITH_CLASSPATH_PREFIX
837 AC_CHECK_WITH_CLASSPATH_CLASSES
838 AC_CHECK_WITH_CLASSPATH_LIBDIR
839 AC_CHECK_WITH_CLASSPATH_INCLUDEDIR
842 dnl if we compile for a JRE-style directory layout
843 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
844 AC_ARG_WITH([jre-layout],
845 [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
846 [case "${enableval}" in
847 yes) WITH_JRE_LAYOUT=yes
848 AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
850 *) WITH_JRE_LAYOUT=no;;
852 [WITH_JRE_LAYOUT=no])
853 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
856 dnl check if GNU Classpath should be linked statically into CACAO
857 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
858 AC_ARG_WITH([static-classpath],
859 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
860 [case "${enableval}" in
861 yes) WITH_STATIC_CLASSPATH=yes;;
862 *) WITH_STATIC_CLASSPATH=no;;
864 [WITH_STATIC_CLASSPATH=no])
865 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
867 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
868 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
870 dnl check for some classpath related stuff when we link statically
873 dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
874 if test x"${ENABLE_STATICVM}" = "xyes"; then
875 AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
878 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
879 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
881 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
882 AC_SUBST(WITH_STATIC_CLASSPATH)
885 dnl check for some programs we need
890 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
892 AM_CFLAGS=$ARCH_CFLAGS
896 AC_CONFIG_FILES([Makefile]
898 [contrib/setenvinstalled]
899 [contrib/setenvsource]
900 [contrib/vmlog/Makefile]
901 [contrib/vmlog/t/Makefile]
903 [doc/handbook/Makefile]
907 [src/cacaoh/Makefile]
908 [src/fdlibm/Makefile]
911 [src/mm/cacao-gc/Makefile]
912 [src/native/Makefile]
913 [src/native/include/Makefile]
914 [src/native/jvmti/Makefile]
915 [src/native/tools/Makefile]
916 [src/native/vm/Makefile]
917 [src/native/vm/cldc1.1/Makefile]
918 [src/native/vm/gnu/Makefile]
919 [src/scripts/Makefile]
921 [src/threads/Makefile]
922 [src/threads/native/Makefile]
923 [src/threads/none/Makefile]
924 [src/toolbox/Makefile]
926 [src/vm/jit/Makefile]
927 [src/vm/jit/allocator/Makefile]
928 [src/vm/jit/alpha/Makefile]
929 [src/vm/jit/alpha/freebsd/Makefile]
930 [src/vm/jit/alpha/linux/Makefile]
931 [src/vm/jit/arm/Makefile]
932 [src/vm/jit/arm/linux/Makefile]
933 [src/vm/jit/i386/Makefile]
934 [src/vm/jit/i386/cygwin/Makefile]
935 [src/vm/jit/i386/darwin/Makefile]
936 [src/vm/jit/i386/freebsd/Makefile]
937 [src/vm/jit/i386/linux/Makefile]
938 [src/vm/jit/intrp/Makefile]
939 [src/vm/jit/inline/Makefile]
940 [src/vm/jit/loop/Makefile]
941 [src/vm/jit/m68k/Makefile]
942 [src/vm/jit/m68k/linux/Makefile]
943 [src/vm/jit/mips/Makefile]
944 [src/vm/jit/mips/irix/Makefile]
945 [src/vm/jit/mips/linux/Makefile]
946 [src/vm/jit/mips/uclinux/Makefile]
947 [src/vm/jit/optimizing/Makefile]
948 [src/vm/jit/parisc/Makefile]
949 [src/vm/jit/parisc/linux/Makefile]
950 [src/vm/jit/powerpc/Makefile]
951 [src/vm/jit/powerpc/darwin/Makefile]
952 [src/vm/jit/powerpc/linux/Makefile]
953 [src/vm/jit/powerpc/netbsd/Makefile]
954 [src/vm/jit/powerpc64/Makefile]
955 [src/vm/jit/powerpc64/linux/Makefile]
956 [src/vm/jit/s390/Makefile]
957 [src/vm/jit/schedule/Makefile]
958 [src/vm/jit/sparc64/Makefile]
959 [src/vm/jit/sparc64/linux/Makefile]
960 [src/vm/jit/sparc64/solaris/Makefile]
961 [src/vm/jit/tools/Makefile]
962 [src/vm/jit/verify/Makefile]
963 [src/vm/jit/x86_64/Makefile]
964 [src/vm/jit/x86_64/freebsd/Makefile]
965 [src/vm/jit/x86_64/linux/Makefile]
966 [src/vmcore/Makefile]
968 [tests/regression/Makefile]
969 [tests/regression/codepatching/Makefile]
970 [tests/regression/jasmin/Makefile]
971 [tests/regression/native/Makefile]
972 [tests/regression/resolving/Makefile]
973 [tests/regression/resolving/classes1/Makefile]
974 [tests/regression/resolving/classes2/Makefile]
975 [tests/regression/resolving/classes3/Makefile]
979 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
982 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
990 ## indent-tabs-mode: t
993 ## compile-command: "automake --add-missing"