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 8154 2007-06-27 20:56:57Z ajordan $
27 dnl Process this file with autoconf to produce a configure script.
30 AC_INIT(cacao, 0.98+svn, cacao@cacaojvm.org)
31 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
34 AM_INIT_AUTOMAKE([1.9.0 dist-bzip2])
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([stdlib.h])
219 AC_CHECK_HEADERS([string.h])
220 AC_CHECK_HEADERS([time.h])
221 AC_CHECK_HEADERS([unistd.h])
222 AC_CHECK_HEADERS([sys/ioctl.h])
223 AC_CHECK_HEADERS([sys/mman.h])
224 AC_CHECK_HEADERS([sys/resource.h])
225 AC_CHECK_HEADERS([sys/select.h])
226 AC_CHECK_HEADERS([sys/socket.h])
227 AC_CHECK_HEADERS([sys/stat.h])
228 AC_CHECK_HEADERS([sys/time.h])
229 AC_CHECK_HEADERS([sys/types.h])
231 dnl this is for fdlibm
232 AC_CHECK_HEADERS([stdint.h])
233 AC_CHECK_HEADERS([inttypes.h])
234 AC_CHECK_HEADERS([sys/config.h])
235 AC_CHECK_HEADERS([sys/types.h])
236 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
237 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
238 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]))
239 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]))
241 dnl Checks for typedefs, structures, and compiler characteristics.
250 dnl Checks for library functions.
251 AC_PROG_GCC_TRADITIONAL
256 dnl keep them alpha-sorted!
257 AC_CHECK_FUNCS([accept])
258 AC_CHECK_FUNCS([atoi])
259 AC_CHECK_FUNCS([atol])
260 AC_CHECK_FUNCS([calloc])
261 AC_CHECK_FUNCS([close])
262 AC_CHECK_FUNCS([confstr])
263 AC_CHECK_FUNCS([connect])
264 AC_CHECK_FUNCS([fflush])
265 AC_CHECK_FUNCS([fopen])
266 AC_CHECK_FUNCS([fprintf])
267 AC_CHECK_FUNCS([free])
268 AC_CHECK_FUNCS([fstat])
269 AC_CHECK_FUNCS([getcwd])
270 AC_CHECK_FUNCS([gethostname])
271 AC_CHECK_FUNCS([getpagesize])
272 AC_CHECK_FUNCS([getrusage])
273 AC_CHECK_FUNCS([getsockname])
274 AC_CHECK_FUNCS([gettimeofday])
275 AC_CHECK_FUNCS([ioctl])
276 AC_CHECK_FUNCS([isnan])
277 AC_CHECK_FUNCS([listen])
278 AC_CHECK_FUNCS([localtime])
279 AC_CHECK_FUNCS([localtime_r])
280 AC_CHECK_FUNCS([lseek])
281 AC_CHECK_FUNCS([mmap])
282 AC_CHECK_FUNCS([mprotect])
283 AC_CHECK_FUNCS([open])
284 AC_CHECK_FUNCS([scandir])
285 AC_CHECK_FUNCS([select])
286 AC_CHECK_FUNCS([setsockopt])
287 AC_CHECK_FUNCS([shutdown])
288 AC_CHECK_FUNCS([socket])
289 AC_CHECK_FUNCS([strchr])
290 AC_CHECK_FUNCS([strdup])
291 AC_CHECK_FUNCS([strerror])
292 AC_CHECK_FUNCS([strncmp])
293 AC_CHECK_FUNCS([strstr])
294 AC_CHECK_FUNCS([time])
297 dnl Checks for libraries.
299 dnl Checking sizeof void *
300 AC_CHECK_SIZEOF(void *)
304 dnl define install prefix
305 if test "x$prefix" = "xNONE"; then
306 CACAO_PREFIX=$ac_default_prefix
310 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
311 AC_SUBST(CACAO_PREFIX)
313 dnl define libdir prefix
314 if test "x$libdir" = "xNONE"; then
315 CACAO_LIBDIR=$ac_default_libdir
319 dnl expand CACAO_LIBDIR to something that is usable in C code
320 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
321 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
322 AC_SUBST(CACAO_LIBDIR)
333 dnl check for stuff that should be done in software
335 AC_CHECK_SOFT_FLOAT_CMP
336 AC_CHECK_SOFT_DOUBLE_CMP
339 dnl check for interpreter
340 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
342 AC_MSG_CHECKING(whether interpreter should be compiled)
343 if test x"$enable_intrp" = "xyes"; then
345 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
346 AM_CONDITIONAL([ENABLE_INTRP], [true])
353 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
355 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
356 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
357 AC_DEFINE([WITH_FFI], 1, [use libffi])],
360 dnl check for libffcall
361 AC_ARG_WITH([ffcall],
362 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
364 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
365 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
366 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
369 dnl check for libffi or libffcall
370 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
371 AC_ERROR(Enable only libffi or libffcall.)
373 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
374 AC_ERROR(Enable one of libffi or libffcall.)
379 AM_CONDITIONAL([ENABLE_INTRP], [false])
383 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
384 AC_ERROR(You have to enable at least the JIT or the interpreter.)
388 dnl check for garbage collector usage
389 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
390 AC_MSG_CHECKING(whether GC should be enabled)
391 enable_gc=${enable_gc:-boehm}
394 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
400 AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
402 AC_MSG_RESULT(yes, boehm-gc)
406 AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
408 AC_MSG_RESULT(yes, cacao-gc)
412 AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
415 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
416 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
417 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
421 dnl check for dump memory usage
422 AC_MSG_CHECKING(whether dump memory should be disabled)
423 AC_ARG_ENABLE([dump],
424 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
425 [case "${enableval}" in
428 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
433 AC_MSG_RESULT(${DISABLE_DUMP})
437 AC_MSG_CHECKING(whether debug code generation should be enabled)
438 AC_ARG_ENABLE([debug],
439 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
440 [case "${enableval}" in
442 AC_DEFINE([NDEBUG], 1, [disable debug code])
448 if test x"${NDEBUG}" = "xno"; then
453 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
456 dnl check for memcheck support
457 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
458 AC_ARG_ENABLE([memcheck],
459 [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
460 [case "${enableval}" in
461 yes) ENABLE_MEMCHECK=yes;;
462 *) ENABLE_MEMCHECK=no;;
464 [ENABLE_MEMCHECK=no])
465 AC_MSG_RESULT(${ENABLE_MEMCHECK})
466 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
468 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
469 AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
473 dnl check for vmlog support
474 AC_MSG_CHECKING(whether vmlog tracing should be enabled)
475 AC_ARG_ENABLE([vmlog],
476 [AS_HELP_STRING(--enable-vmlog,enable vmlog tracing [[default=no]])],
477 [case "${enableval}" in
478 yes) ENABLE_VMLOG=yes;;
482 AC_MSG_RESULT(${ENABLE_VMLOG})
483 AM_CONDITIONAL([ENABLE_VMLOG], test x"${ENABLE_VMLOG}" = "xyes")
485 if test x"${ENABLE_VMLOG}" = "xyes"; then
486 AC_DEFINE([ENABLE_VMLOG], 1, [enable vmlog tracing code])
490 dnl check for disassembler support
491 AC_MSG_CHECKING(whether disassembler should be enabled)
492 AC_ARG_ENABLE([disassembler],
493 [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
494 [case "${enableval}" in
495 yes) ENABLE_DISASSEMBLER=yes;;
496 *) ENABLE_DISASSEMBLER=no;;
498 [ENABLE_DISASSEMBLER=no])
499 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
500 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
502 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
503 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
505 dnl check for binutils headers and libraries on some architectures for the
507 case "${ARCH_DIR}" in
508 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390 | m68k)
509 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
510 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
511 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
512 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
515 cygwin | darwin | netbsd | solaris)
516 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
517 AC_CHECK_LIB(rt, sem_init,, [AC_MSG_ERROR(cannot find librt)])
521 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
522 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
523 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
524 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
525 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
528 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
532 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
536 dnl check for statistics
537 AC_MSG_CHECKING(whether statistics generation should be enabled)
538 AC_ARG_ENABLE([statistics],
539 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
540 [case "${enableval}" in
541 yes) ENABLE_STATISTICS=yes;;
542 *) ENABLE_STATISTICS=no;;
544 [ENABLE_STATISTICS=no])
545 AC_MSG_RESULT(${ENABLE_STATISTICS})
546 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
548 if test x"${ENABLE_STATISTICS}" = "xyes"; then
549 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
553 dnl check for verifier
554 AC_MSG_CHECKING(whether classfile verification should be enabled)
555 AC_ARG_ENABLE([verifier],
556 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
557 [case "${enableval}" in
558 no) ENABLE_VERIFIER=no;;
559 *) ENABLE_VERIFIER=yes;;
561 [ENABLE_VERIFIER=yes])
562 AC_MSG_RESULT(${ENABLE_VERIFIER})
563 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
565 if test x"${ENABLE_VERIFIER}" = "xyes"; then
566 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
570 dnl check for compiler timing
571 AC_MSG_CHECKING(whether real-time timing should be enabled)
572 AC_ARG_ENABLE([rt-timing],
573 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
574 [case "${enableval}" in
575 yes) ENABLE_RT_TIMING=yes;;
576 *) ENABLE_RT_TIMING=no;;
578 [ENABLE_RT_TIMING=no])
579 AC_MSG_RESULT(${ENABLE_RT_TIMING})
580 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
582 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
583 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
587 dnl check for cycle count statistics
588 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
589 AC_ARG_ENABLE([cycles-stats],
590 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
591 [case "${enableval}" in
592 yes) ENABLE_CYCLES_STATS=yes;;
593 *) ENABLE_CYCLES_STATS=no;;
595 [ENABLE_CYCLES_STATS=no])
596 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
597 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
599 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
600 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
605 AC_MSG_CHECKING(whether to compile JVMTI support)
606 AC_ARG_ENABLE([jvmti],
607 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
608 [case "${enableval}" in
609 yes) ENABLE_JVMTI=yes;;
613 AC_MSG_RESULT(${ENABLE_JVMTI})
614 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
616 if test x"${ENABLE_JVMTI}" = "xyes"; then
617 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
621 AC_CHECK_ENABLE_THREADS
624 dnl check if if-conversion should be supported
625 AC_MSG_CHECKING(whether if-conversion should be supported)
626 AC_ARG_ENABLE([ifconv],
627 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
628 [case "${enableval}" in
629 no) ENABLE_IFCONV=no;;
630 *) ENABLE_IFCONV=yes;;
633 AC_MSG_RESULT(${ENABLE_IFCONV})
634 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
636 if test x"${ENABLE_IFCONV}" = "xyes"; then
637 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
641 dnl check for inlining
642 AC_MSG_CHECKING(whether method inlining should be supported)
643 AC_ARG_ENABLE([inlining],
644 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
645 [case "${enableval}" in
646 yes) ENABLE_INLINING=yes;;
647 *) ENABLE_INLINING=no;;
649 [ENABLE_INLINING=no])
650 AC_MSG_RESULT(${ENABLE_INLINING})
651 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
653 if test x"${ENABLE_INLINING}" = "xyes"; then
654 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
658 dnl check for inlining debug options
659 AC_MSG_CHECKING(whether method inlining debug options should be enabled)
660 AC_ARG_ENABLE([inlining-debug],
661 [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
662 [case "${enableval}" in
663 yes) ENABLE_INLINING_DEBUG=yes;;
664 *) ENABLE_INLINING_DEBUG=no;;
666 [ENABLE_INLINING_DEBUG=no])
667 AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
668 AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
670 if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
671 AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
675 dnl check for replacement
676 AC_MSG_CHECKING(whether on-stack replacement should be supported)
677 AC_ARG_ENABLE([replacement],
678 [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
679 [case "${enableval}" in
680 yes) ENABLE_REPLACEMENT=yes;;
681 *) ENABLE_REPLACEMENT=no;;
683 [ENABLE_REPLACEMENT=no])
684 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
685 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
687 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
688 AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
692 dnl check for loop optimization
693 AC_MSG_CHECKING(whether loop optimization should be supported)
694 AC_ARG_ENABLE([loop],
695 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
696 [case "${enableval}" in
697 yes) ENABLE_LOOP=yes;;
701 AC_MSG_RESULT(${ENABLE_LOOP})
702 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
704 if test x"${ENABLE_LOOP}" = "xyes"; then
705 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
709 dnl check if linear scan register allocator(lsra) with SSA should be used
710 AC_MSG_CHECKING(whether lsra with ssa should be supported)
712 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
713 [case "${enableval}" in
718 AC_MSG_RESULT(${ENABLE_SSA})
719 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
721 if test x"${ENABLE_SSA}" = "xyes"; then
722 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
727 dnl check if linear scan register allocator(lsra) should be used
728 AC_MSG_CHECKING(whether lsra should be supported)
729 AC_ARG_ENABLE([lsra],
730 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
731 [case "${enableval}" in
732 yes) ENABLE_LSRA=yes;;
737 if test x"${ENABLE_LSRA}" = "xyes"; then
738 if test x"${ENABLE_SSA}" = "xyes"; then
742 AC_MSG_RESULT(${ENABLE_LSRA})
743 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
745 if test x"${ENABLE_LSRA}" = "xyes"; then
746 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
750 dnl check if profiling should be supported
751 AC_MSG_CHECKING(whether profiling should be supported)
752 AC_ARG_ENABLE([profiling],
753 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
754 [case "${enableval}" in
755 yes) ENABLE_PROFILING=yes;;
756 *) ENABLE_PROFILING=no;;
758 [ENABLE_PROFILING=no])
759 AC_MSG_RESULT(${ENABLE_PROFILING})
760 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
762 if test x"${ENABLE_PROFILING}" = "xyes"; then
763 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
767 dnl check for instruction scheduler
768 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
770 AC_MSG_CHECKING(whether instruction scheduler should be supported)
771 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
772 case "${ARCH_DIR}" in
776 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
781 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
782 AM_CONDITIONAL([USE_SCHEDULER], [true])
785 AM_CONDITIONAL([USE_SCHEDULER], [false])
789 dnl check if zlib should be used
790 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
791 AC_ARG_ENABLE([zlib],
792 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
793 [case "${enableval}" in
798 AC_MSG_RESULT(${ENABLE_ZLIB})
800 if test x"${ENABLE_ZLIB}" = "xyes"; then
801 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
802 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
803 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
804 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
806 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
809 dnl check for stuff to be built
813 dnl check if a libjvm.so should be built
814 AC_MSG_CHECKING(whether to build a libjvm.so)
815 AC_ARG_ENABLE([libjvm],
816 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
817 [case "${enableval}" in
818 no) ENABLE_LIBJVM=no;;
819 *) ENABLE_LIBJVM=yes;;
822 AC_MSG_RESULT(${ENABLE_LIBJVM})
823 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
824 AC_SUBST(ENABLE_LIBJVM)
826 if test x"${ENABLE_LIBJVM}" = "xyes"; then
827 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
829 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
842 dnl check if CACAO should be linked statically
843 AC_MSG_CHECKING(whether to link CACAO statically)
844 AC_ARG_ENABLE([staticvm],
845 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
846 [case "${enableval}" in
847 yes) ENABLE_STATICVM=yes
848 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
850 *) ENABLE_STATICVM=no;;
852 [ENABLE_STATICVM=no])
853 AC_MSG_RESULT(${ENABLE_STATICVM})
854 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
855 AC_SUBST(ENABLE_STATICVM)
858 dnl where is CACAO's vm.zip
859 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
860 AC_ARG_WITH([vm-zip],
861 [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]])],
862 [CACAO_VM_ZIP=${withval}],
863 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
864 AC_MSG_RESULT(${CACAO_VM_ZIP})
865 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
866 AC_SUBST(CACAO_VM_ZIP)
869 AC_CHECK_WITH_CLASSPATH
870 AC_CHECK_WITH_CLASSPATH_PREFIX
871 AC_CHECK_WITH_CLASSPATH_CLASSES
872 AC_CHECK_WITH_CLASSPATH_LIBDIR
873 AC_CHECK_WITH_CLASSPATH_INCLUDEDIR
876 dnl if we compile for a JRE-style directory layout
877 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
878 AC_ARG_WITH([jre-layout],
879 [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
880 [case "${enableval}" in
881 yes) WITH_JRE_LAYOUT=yes
882 AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
884 *) WITH_JRE_LAYOUT=no;;
886 [WITH_JRE_LAYOUT=no])
887 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
890 dnl check if GNU Classpath should be linked statically into CACAO
891 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
892 AC_ARG_WITH([static-classpath],
893 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
894 [case "${enableval}" in
895 yes) WITH_STATIC_CLASSPATH=yes;;
896 *) WITH_STATIC_CLASSPATH=no;;
898 [WITH_STATIC_CLASSPATH=no])
899 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
901 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
902 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
904 dnl check for some classpath related stuff when we link statically
907 dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
908 if test x"${ENABLE_STATICVM}" = "xyes"; then
909 AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
912 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
913 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
915 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
916 AC_SUBST(WITH_STATIC_CLASSPATH)
919 dnl check for some programs we need
926 dnl If debug build and regex.h available, enable debug filter
927 if test x"${NDEBUG}" = "xno"; then
928 AC_DEFINE(ENABLE_DEBUG_FILTER, 1, [debug filter])
930 dnl If vmlog enambled and regex.h available, enable vmlogfilter
931 AM_CONDITIONAL([ENABLE_VMLOGFILTER], [test x"${ENABLE_VMLOG}" = "xyes"])
934 AM_CONDITIONAL([ENABLE_VMLOGFILTER], [false])
938 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
940 AM_CFLAGS=$ARCH_CFLAGS
944 AC_CONFIG_FILES([Makefile]
946 [contrib/setenvinstalled]
947 [contrib/setenvsource]
948 [contrib/vmlog/Makefile]
949 [contrib/vmlog/t/Makefile]
951 [doc/handbook/Makefile]
955 [src/cacaoh/Makefile]
956 [src/fdlibm/Makefile]
959 [src/mm/cacao-gc/Makefile]
960 [src/native/Makefile]
961 [src/native/include/Makefile]
962 [src/native/jvmti/Makefile]
963 [src/native/tools/Makefile]
964 [src/native/vm/Makefile]
965 [src/native/vm/cldc1.1/Makefile]
966 [src/native/vm/gnu/Makefile]
967 [src/native/vm/sun/Makefile]
968 [src/scripts/Makefile]
970 [src/threads/Makefile]
971 [src/threads/native/Makefile]
972 [src/threads/none/Makefile]
973 [src/toolbox/Makefile]
975 [src/vm/jit/Makefile]
976 [src/vm/jit/allocator/Makefile]
977 [src/vm/jit/alpha/Makefile]
978 [src/vm/jit/alpha/freebsd/Makefile]
979 [src/vm/jit/alpha/linux/Makefile]
980 [src/vm/jit/arm/Makefile]
981 [src/vm/jit/arm/linux/Makefile]
982 [src/vm/jit/i386/Makefile]
983 [src/vm/jit/i386/cygwin/Makefile]
984 [src/vm/jit/i386/darwin/Makefile]
985 [src/vm/jit/i386/freebsd/Makefile]
986 [src/vm/jit/i386/linux/Makefile]
987 [src/vm/jit/intrp/Makefile]
988 [src/vm/jit/inline/Makefile]
989 [src/vm/jit/loop/Makefile]
990 [src/vm/jit/m68k/Makefile]
991 [src/vm/jit/m68k/linux/Makefile]
992 [src/vm/jit/mips/Makefile]
993 [src/vm/jit/mips/irix/Makefile]
994 [src/vm/jit/mips/linux/Makefile]
995 [src/vm/jit/mips/uclinux/Makefile]
996 [src/vm/jit/optimizing/Makefile]
997 [src/vm/jit/parisc/Makefile]
998 [src/vm/jit/parisc/linux/Makefile]
999 [src/vm/jit/powerpc/Makefile]
1000 [src/vm/jit/powerpc/darwin/Makefile]
1001 [src/vm/jit/powerpc/linux/Makefile]
1002 [src/vm/jit/powerpc/netbsd/Makefile]
1003 [src/vm/jit/powerpc64/Makefile]
1004 [src/vm/jit/powerpc64/linux/Makefile]
1005 [src/vm/jit/s390/Makefile]
1006 [src/vm/jit/schedule/Makefile]
1007 [src/vm/jit/sparc64/Makefile]
1008 [src/vm/jit/sparc64/linux/Makefile]
1009 [src/vm/jit/sparc64/solaris/Makefile]
1010 [src/vm/jit/tools/Makefile]
1011 [src/vm/jit/verify/Makefile]
1012 [src/vm/jit/x86_64/Makefile]
1013 [src/vm/jit/x86_64/freebsd/Makefile]
1014 [src/vm/jit/x86_64/linux/Makefile]
1015 [src/vmcore/Makefile]
1017 [tests/regression/Makefile]
1018 [tests/regression/codepatching/Makefile]
1019 [tests/regression/jasmin/Makefile]
1020 [tests/regression/native/Makefile]
1021 [tests/regression/resolving/Makefile]
1022 [tests/regression/resolving/classes1/Makefile]
1023 [tests/regression/resolving/classes2/Makefile]
1024 [tests/regression/resolving/classes3/Makefile]
1028 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
1031 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
1039 ## indent-tabs-mode: t
1040 ## c-basic-offset: 4
1042 ## compile-command: "automake --add-missing"