3 dnl Copyright (C) 1996-2005, 2006, 2007, 2008
4 dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 dnl This file is part of CACAO.
8 dnl This program is free software; you can redistribute it and/or
9 dnl modify it under the terms of the GNU General Public License as
10 dnl published by the Free Software Foundation; either version 2, or (at
11 dnl your option) any later version.
13 dnl This program is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 dnl General Public License for more details.
18 dnl You should have received a copy of the GNU General Public License
19 dnl along with this program; if not, write to the Free Software
20 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 dnl Process this file with autoconf to produce a configure script.
26 AC_INIT(cacao, 1.1.0pre, cacao@cacaojvm.org)
27 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
30 AM_INIT_AUTOMAKE([1.9.0 dist-bzip2 tar-ustar])
33 AM_CONFIG_HEADER([config.h])
35 AC_PREFIX_DEFAULT(/usr/local/cacao)
38 dnl set optimization and debugging for all architectures and systems
39 if test x"$CFLAGS" = "x"; then
47 alpha | alphaev56 | alphapca56 )
49 ARCH_CFLAGS="-mieee -D__ALPHA__"
53 arm | armv4 | armv4tl | armv5b | armv5l )
55 ARCH_CFLAGS="-D__ARM__"
61 ARCH_CFLAGS="-D__PARISC__"
65 i386 | i486 | i586 | i686 )
67 ARCH_CFLAGS="-D__I386__"
73 ARCH_CFLAGS="-D__M68K__"
79 ARCH_CFLAGS="-D__MIPS__"
80 dnl Is this correct for mipsel?
86 ARCH_CFLAGS="-D__POWERPC__"
92 ARCH_CFLAGS="-D__POWERPC64__"
98 ARCH_CFLAGS="-D__S390__"
104 ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
105 dnl Is this correct for 64-bits?
111 ARCH_CFLAGS="-D__X86_64__"
117 ENABLE_STATICVM="yes"
118 ARCH_CFLAGS="-D__XDSPCORE__"
123 AC_MSG_ERROR($host_cpu systems are not supported at this time)
131 INTRP_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -Wall -Wno-long-long"
132 ARCH_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -std=c99 -pedantic -Wall -Wno-long-long"
137 INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
138 ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -std=c99 -pedantic -Wall -Wno-long-long"
143 INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
144 ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -std=c99 -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
149 INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
150 ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
155 INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
156 ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -std=c99 -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
159 dnl must be before *linux*
162 INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
163 ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -std=c99 -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
168 INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
169 ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -std=c99 -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
174 INTRP_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
175 ARCH_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -std=c99 -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
180 dnl On solaris the architecture defines 'sparc', 'sun', 'unix' are
181 dnl not set when cpp is called with -std=c99, therefore we add them
183 INTRP_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
184 ARCH_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -std=c99 -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -D_BSD_SOURCE -Dsparc -Dsun -Dunix"
192 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
193 dnl we set it properly at the end of this file
194 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
196 dnl set interpreter flags
197 AC_SUBST(INTRP_CFLAGS)
199 dnl define and substitute some architecture specific variables
200 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
201 AC_DEFINE_UNQUOTED([JAVA_ARCH], "${JAVA_ARCH}", [Java architecture name])
205 AC_SUBST(USE_SCHEDULER)
208 dnl Checks for programs.
218 dnl Checks for header files.
222 dnl Crucial header files.
223 AC_CHECK_HEADERS([stdbool.h],, [AC_MSG_ERROR(cannot find stdbool.h)])
224 AC_CHECK_HEADERS([stdint.h],, [AC_MSG_ERROR(cannot find stdint.h)])
226 dnl keep them alpha-sorted!
227 AC_CHECK_HEADERS([assert.h])
228 AC_CHECK_HEADERS([errno.h])
229 AC_CHECK_HEADERS([fcntl.h])
230 AC_CHECK_HEADERS([libgen.h])
231 AC_CHECK_HEADERS([netdb.h])
232 AC_CHECK_HEADERS([stdint.h])
233 AC_CHECK_HEADERS([stdio.h])
234 AC_CHECK_HEADERS([stdlib.h])
235 AC_CHECK_HEADERS([string.h])
236 AC_CHECK_HEADERS([time.h])
237 AC_CHECK_HEADERS([ucontext.h])
238 AC_CHECK_HEADERS([unistd.h])
239 AC_CHECK_HEADERS([sys/ioctl.h])
240 AC_CHECK_HEADERS([sys/mman.h])
241 AC_CHECK_HEADERS([sys/resource.h])
242 AC_CHECK_HEADERS([sys/select.h])
243 AC_CHECK_HEADERS([sys/socket.h])
244 AC_CHECK_HEADERS([sys/stat.h])
245 AC_CHECK_HEADERS([sys/time.h])
246 AC_CHECK_HEADERS([sys/types.h])
248 dnl this is for fdlibm
249 AC_CHECK_HEADERS([inttypes.h])
250 AC_CHECK_HEADERS([sys/config.h])
251 AC_CHECK_HEADERS([sys/types.h])
252 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
253 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
254 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]))
255 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]))
257 dnl Checks for typedefs, structures, and compiler characteristics.
266 dnl Checks for libraries (NOTE: Should be done before function checks,
267 dnl as some functions may be in libraries we check for).
269 dnl Checks for library functions.
270 AC_PROG_GCC_TRADITIONAL
275 dnl keep them alpha-sorted!
276 AC_CHECK_FUNCS([abort])
277 AC_CHECK_FUNCS([accept])
278 AC_CHECK_FUNCS([access])
279 AC_CHECK_FUNCS([atoi])
280 AC_CHECK_FUNCS([atol])
281 AC_CHECK_FUNCS([calloc])
282 AC_CHECK_FUNCS([close])
283 AC_CHECK_FUNCS([confstr])
284 AC_CHECK_FUNCS([connect])
285 AC_CHECK_FUNCS([dirname])
286 AC_CHECK_FUNCS([fclose])
287 AC_CHECK_FUNCS([fflush])
288 AC_CHECK_FUNCS([fopen])
289 AC_CHECK_FUNCS([fprintf])
290 AC_CHECK_FUNCS([fread])
291 AC_CHECK_FUNCS([free])
292 AC_CHECK_FUNCS([fstat])
293 AC_CHECK_FUNCS([fsync])
294 AC_CHECK_FUNCS([ftruncate])
295 AC_CHECK_FUNCS([getcwd])
296 AC_CHECK_FUNCS([gethostbyname])
297 AC_CHECK_FUNCS([gethostname])
298 AC_CHECK_FUNCS([getpagesize])
299 AC_CHECK_FUNCS([getrusage])
300 AC_CHECK_FUNCS([getsockname])
301 AC_CHECK_FUNCS([getsockopt])
302 AC_CHECK_FUNCS([gettimeofday])
303 AC_CHECK_FUNCS([htons])
304 AC_CHECK_FUNCS([ioctl])
305 AC_CHECK_FUNCS([isnan])
306 AC_CHECK_FUNCS([listen])
307 AC_CHECK_FUNCS([localtime])
308 AC_CHECK_FUNCS([localtime_r])
309 AC_CHECK_FUNCS([lseek])
310 AC_CHECK_FUNCS([malloc])
311 AC_CHECK_FUNCS([memcpy])
312 AC_CHECK_FUNCS([memset])
313 AC_CHECK_FUNCS([mmap])
314 AC_CHECK_FUNCS([mprotect])
315 AC_CHECK_FUNCS([open])
316 AC_CHECK_FUNCS([read])
317 AC_CHECK_FUNCS([readlink])
318 AC_CHECK_FUNCS([realloc])
319 AC_CHECK_FUNCS([recv])
320 AC_CHECK_FUNCS([scandir])
321 AC_CHECK_FUNCS([select])
322 AC_CHECK_FUNCS([send])
323 AC_CHECK_FUNCS([setsockopt])
324 AC_CHECK_FUNCS([shutdown])
325 AC_CHECK_FUNCS([socket])
326 AC_CHECK_FUNCS([stat])
327 AC_CHECK_FUNCS([strcat])
328 AC_CHECK_FUNCS([strchr])
329 AC_CHECK_FUNCS([strcpy])
330 AC_CHECK_FUNCS([strdup])
331 AC_CHECK_FUNCS([strerror])
332 AC_CHECK_FUNCS([strlen])
333 AC_CHECK_FUNCS([strncmp])
334 AC_CHECK_FUNCS([strstr])
335 AC_CHECK_FUNCS([time])
336 AC_CHECK_FUNCS([write])
339 dnl Checks for libraries.
341 dnl Checking sizeof void *
342 AC_CHECK_SIZEOF(void *)
346 dnl define install prefix
347 if test "x$prefix" = "xNONE"; then
348 CACAO_PREFIX=$ac_default_prefix
352 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
353 AC_SUBST(CACAO_PREFIX)
355 dnl define libdir prefix
356 if test "x$libdir" = "xNONE"; then
357 CACAO_LIBDIR=$ac_default_libdir
361 dnl expand CACAO_LIBDIR to something that is usable in C code
362 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
363 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
364 AC_SUBST(CACAO_LIBDIR)
371 AC_CHECK_ENABLE_INTRP
373 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
374 AC_ERROR(You have to enable at least the JIT or the interpreter.)
378 AC_CHECK_SOFT_FLOAT_CMP
379 AC_CHECK_SOFT_DOUBLE_CMP
382 AC_CHECK_ENABLE_DEBUG
386 dnl check for memcheck support
387 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
388 AC_ARG_ENABLE([memcheck],
389 [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
390 [case "${enableval}" in
391 yes) ENABLE_MEMCHECK=yes;;
392 *) ENABLE_MEMCHECK=no;;
394 [ENABLE_MEMCHECK=no])
395 AC_MSG_RESULT(${ENABLE_MEMCHECK})
396 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
398 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
399 AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
403 dnl check for handles (indirection cells) support
404 AC_MSG_CHECKING(whether handles (indirection cells) should be enabled)
405 AC_ARG_ENABLE([handles],
406 [AS_HELP_STRING(--enable-handles,enable handles (indirection cells) [[default=no]])],
407 [case "${enableval}" in
408 yes) ENABLE_HANDLES=yes;;
409 *) ENABLE_HANDLES=no;;
412 AC_MSG_RESULT(${ENABLE_HANDLES})
413 AM_CONDITIONAL([ENABLE_HANDLES], test x"${ENABLE_HANDLES}" = "xyes")
415 if test x"${ENABLE_HANDLES}" = "xyes"; then
416 AC_DEFINE([ENABLE_HANDLES], 1, [enable handles (indirection cells)])
420 dnl check for vmlog support
421 AC_MSG_CHECKING(whether vmlog tracing should be enabled)
422 AC_ARG_ENABLE([vmlog],
423 [AS_HELP_STRING(--enable-vmlog,enable vmlog tracing [[default=no]])],
424 [case "${enableval}" in
425 yes) ENABLE_VMLOG=yes;;
429 AC_MSG_RESULT(${ENABLE_VMLOG})
430 AM_CONDITIONAL([ENABLE_VMLOG], test x"${ENABLE_VMLOG}" = "xyes")
432 if test x"${ENABLE_VMLOG}" = "xyes"; then
433 AC_DEFINE([ENABLE_VMLOG], 1, [enable vmlog tracing code])
437 dnl check for disassembler support
438 AC_MSG_CHECKING(whether disassembler should be enabled)
439 AC_ARG_ENABLE([disassembler],
440 [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
441 [case "${enableval}" in
442 yes) ENABLE_DISASSEMBLER=yes;;
443 *) ENABLE_DISASSEMBLER=no;;
445 [ENABLE_DISASSEMBLER=no])
446 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
447 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
449 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
450 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
452 dnl check for binutils headers and libraries on some architectures for the
454 case "${ARCH_DIR}" in
455 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390 | m68k)
456 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
457 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
458 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
459 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
462 cygwin | darwin | netbsd | solaris)
463 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
469 AC_CHECK_LIB(rt, sem_init,, [AC_MSG_ERROR(cannot find librt)])
474 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
475 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
476 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
477 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
478 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
481 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
485 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
489 dnl check for statistics
490 AC_MSG_CHECKING(whether statistics generation should be enabled)
491 AC_ARG_ENABLE([statistics],
492 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
493 [case "${enableval}" in
494 yes) ENABLE_STATISTICS=yes;;
495 *) ENABLE_STATISTICS=no;;
497 [ENABLE_STATISTICS=no])
498 AC_MSG_RESULT(${ENABLE_STATISTICS})
499 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
501 if test x"${ENABLE_STATISTICS}" = "xyes"; then
502 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
506 dnl check for verifier
507 AC_MSG_CHECKING(whether classfile verification should be enabled)
508 AC_ARG_ENABLE([verifier],
509 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=enabled]])],
510 [case "${enableval}" in
511 no) ENABLE_VERIFIER=no;;
512 *) ENABLE_VERIFIER=yes;;
514 [ENABLE_VERIFIER=yes])
515 AC_MSG_RESULT(${ENABLE_VERIFIER})
516 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
518 if test x"${ENABLE_VERIFIER}" = "xyes"; then
519 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
523 dnl check for compiler timing
524 AC_MSG_CHECKING(whether real-time timing should be enabled)
525 AC_ARG_ENABLE([rt-timing],
526 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
527 [case "${enableval}" in
528 yes) ENABLE_RT_TIMING=yes;;
529 *) ENABLE_RT_TIMING=no;;
531 [ENABLE_RT_TIMING=no])
532 AC_MSG_RESULT(${ENABLE_RT_TIMING})
533 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
535 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
536 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
540 dnl check for cycle count statistics
541 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
542 AC_ARG_ENABLE([cycles-stats],
543 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
544 [case "${enableval}" in
545 yes) ENABLE_CYCLES_STATS=yes;;
546 *) ENABLE_CYCLES_STATS=no;;
548 [ENABLE_CYCLES_STATS=no])
549 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
550 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
552 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
553 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
558 AC_MSG_CHECKING(whether to compile JVMTI support)
559 AC_ARG_ENABLE([jvmti],
560 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
561 [case "${enableval}" in
562 yes) ENABLE_JVMTI=yes;;
566 AC_MSG_RESULT(${ENABLE_JVMTI})
567 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
569 if test x"${ENABLE_JVMTI}" = "xyes"; then
570 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
574 AC_CHECK_ENABLE_THREADS
577 dnl check if if-conversion should be supported
578 AC_MSG_CHECKING(whether if-conversion should be supported)
579 AC_ARG_ENABLE([ifconv],
580 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=enabled]])],
581 [case "${enableval}" in
582 no) ENABLE_IFCONV=no;;
583 *) ENABLE_IFCONV=yes;;
586 AC_MSG_RESULT(${ENABLE_IFCONV})
587 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
589 if test x"${ENABLE_IFCONV}" = "xyes"; then
590 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
594 dnl check for inlining
595 AC_MSG_CHECKING(whether method inlining should be supported)
596 AC_ARG_ENABLE([inlining],
597 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
598 [case "${enableval}" in
599 yes) ENABLE_INLINING=yes;;
600 *) ENABLE_INLINING=no;;
602 [ENABLE_INLINING=no])
603 AC_MSG_RESULT(${ENABLE_INLINING})
604 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
606 if test x"${ENABLE_INLINING}" = "xyes"; then
607 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
611 dnl check for inlining debug options
612 AC_MSG_CHECKING(whether method inlining debug options should be enabled)
613 AC_ARG_ENABLE([inlining-debug],
614 [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
615 [case "${enableval}" in
616 yes) ENABLE_INLINING_DEBUG=yes;;
617 *) ENABLE_INLINING_DEBUG=no;;
619 [ENABLE_INLINING_DEBUG=no])
620 AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
621 AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
623 if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
624 AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
628 dnl check for replacement
629 AC_MSG_CHECKING(whether on-stack replacement should be supported)
630 AC_ARG_ENABLE([replacement],
631 [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
632 [case "${enableval}" in
633 yes) ENABLE_REPLACEMENT=yes;;
634 *) ENABLE_REPLACEMENT=no;;
636 [ENABLE_REPLACEMENT=no])
637 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
638 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
640 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
641 AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
645 dnl check for loop optimization
646 AC_MSG_CHECKING(whether loop optimization should be supported)
647 AC_ARG_ENABLE([loop],
648 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
649 [case "${enableval}" in
650 yes) ENABLE_LOOP=yes;;
654 AC_MSG_RESULT(${ENABLE_LOOP})
655 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
657 if test x"${ENABLE_LOOP}" = "xyes"; then
658 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
662 dnl check if linear scan register allocator(lsra) with SSA should be used
663 AC_MSG_CHECKING(whether lsra with ssa should be supported)
665 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=disabled]])],
666 [case "${enableval}" in
671 AC_MSG_RESULT(${ENABLE_SSA})
672 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
673 AM_CONDITIONAL([ENABLE_ESCAPE], test x"${ENABLE_SSA}" = "xyes")
674 AM_CONDITIONAL([ENABLE_ESCAPE_CHECK], test x"${ENABLE_SSA}" = "xyes")
676 if test x"${ENABLE_SSA}" = "xyes"; then
677 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
678 AC_DEFINE([ENABLE_ESCAPE], 1, [enable escape analysis with ssa])
679 AC_DEFINE([ENABLE_ESCAPE_CHECK], 1, [enable generating code to validate escape analysis results])
684 dnl check if linear scan register allocator(lsra) should be used
685 AC_MSG_CHECKING(whether lsra should be supported)
686 AC_ARG_ENABLE([lsra],
687 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
688 [case "${enableval}" in
689 yes) ENABLE_LSRA=yes;;
694 if test x"${ENABLE_LSRA}" = "xyes"; then
695 if test x"${ENABLE_SSA}" = "xyes"; then
699 AC_MSG_RESULT(${ENABLE_LSRA})
700 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
702 if test x"${ENABLE_LSRA}" = "xyes"; then
703 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
706 dnl check if profiling should be supported
707 AC_MSG_CHECKING(whether profiling should be supported)
708 AC_ARG_ENABLE([profiling],
709 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
710 [case "${enableval}" in
711 yes) ENABLE_PROFILING=yes;;
712 *) ENABLE_PROFILING=no;;
714 [ENABLE_PROFILING=no])
715 AC_MSG_RESULT(${ENABLE_PROFILING})
716 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
718 if test x"${ENABLE_PROFILING}" = "xyes"; then
719 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
723 dnl check for instruction scheduler
724 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
726 AC_MSG_CHECKING(whether instruction scheduler should be supported)
727 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
728 case "${ARCH_DIR}" in
732 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
737 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
738 AM_CONDITIONAL([USE_SCHEDULER], [true])
741 AM_CONDITIONAL([USE_SCHEDULER], [false])
747 dnl check for stuff to be built
749 AC_CHECK_ENABLE_LIBJVM
751 dnl ATTENTION: These check must be after setting
752 dnl enable_shared/enable_static (happens in AC_CHECK_ENABLE_LIBJVM),
753 dnl because libtool uses them to build the correct libraries.
757 AC_CHECK_ENABLE_STATICVM
758 AC_CHECK_ENABLE_ANNOTATIONS
759 AC_CHECK_ENABLE_ASSERTION
762 dnl where is CACAO's vm.zip
763 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
764 AC_ARG_WITH([vm-zip],
765 [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]])],
766 [CACAO_VM_ZIP=${withval}],
767 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
768 AC_MSG_RESULT(${CACAO_VM_ZIP})
769 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
770 AC_SUBST(CACAO_VM_ZIP)
774 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY
776 dnl Now we check for jre-layout so we can skip some checks that are
778 AC_CHECK_ENABLE_JRE_LAYOUT
780 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_PREFIX
781 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_CLASSES
783 if test x"${ENABLE_JRE_LAYOUT}" = "xno"; then
784 AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY_LIBDIR
787 dnl The check for jni_md.h must be before jni.h.
788 AC_CHECK_WITH_JNI_MD_H
791 dnl HPI is only required for OpenJDK
792 case "${WITH_JAVA_RUNTIME_LIBRARY}" in
794 AC_CHECK_WITH_HPI_MD_H
801 dnl check for some programs we need
803 case "${WITH_JAVA_RUNTIME_LIBRARY}" in
804 cldc1.1 | gnuclasspath)
811 AC_MSG_ERROR(unknown classpath configuration ${WITH_JAVA_RUNTIME_LIBRARY})
819 dnl If debug build and regex.h available, enable debug filter
820 if test x"${NDEBUG}" = "xno"; then
821 AC_DEFINE(ENABLE_DEBUG_FILTER, 1, [debug filter])
823 dnl If vmlog enambled and regex.h available, enable vmlogfilter
824 AM_CONDITIONAL([ENABLE_VMLOGFILTER], [test x"${ENABLE_VMLOG}" = "xyes"])
827 AM_CONDITIONAL([ENABLE_VMLOGFILTER], [false])
836 AZ_PYTHON_VERSION_ENSURE( [2.4] )
841 dnl define some stuff required for --fullversion
842 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
843 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
844 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS $CPPFLAGS", [CFLAGS used])
847 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
849 AM_CFLAGS=$ARCH_CFLAGS
850 AM_CPPFLAGS="$CPPFLAGS"
852 AC_SUBST(AM_CPPFLAGS)
855 AC_CONFIG_FILES([Makefile]
857 [contrib/setenvinstalled]
858 [contrib/setenvsource]
859 [contrib/vmlog/Makefile]
860 [contrib/vmlog/t/Makefile]
862 [doc/doxygen/Makefile]
863 [doc/handbook/Makefile]
867 [src/cacaoh/Makefile]
868 [src/classes/Makefile]
869 [src/fdlibm/Makefile]
871 [src/mm/cacao-gc/Makefile]
872 [src/native/Makefile]
873 [src/native/include/Makefile]
874 [src/native/jvmti/Makefile]
875 [src/native/vm/Makefile]
876 [src/native/vm/cldc1.1/Makefile]
877 [src/native/vm/gnuclasspath/Makefile]
878 [src/native/vm/openjdk/Makefile]
879 [src/scripts/Makefile]
881 [src/threads/Makefile]
882 [src/threads/none/Makefile]
883 [src/threads/posix/Makefile]
884 [src/toolbox/Makefile]
886 [src/vm/jit/Makefile]
887 [src/vm/jit/allocator/Makefile]
888 [src/vm/jit/alpha/Makefile]
889 [src/vm/jit/alpha/freebsd/Makefile]
890 [src/vm/jit/alpha/linux/Makefile]
891 [src/vm/jit/arm/Makefile]
892 [src/vm/jit/arm/linux/Makefile]
893 [src/vm/jit/i386/Makefile]
894 [src/vm/jit/i386/cygwin/Makefile]
895 [src/vm/jit/i386/darwin/Makefile]
896 [src/vm/jit/i386/freebsd/Makefile]
897 [src/vm/jit/i386/linux/Makefile]
898 [src/vm/jit/intrp/Makefile]
899 [src/vm/jit/inline/Makefile]
900 [src/vm/jit/ir/Makefile]
901 [src/vm/jit/loop/Makefile]
902 [src/vm/jit/m68k/Makefile]
903 [src/vm/jit/m68k/linux/Makefile]
904 [src/vm/jit/mips/Makefile]
905 [src/vm/jit/mips/irix/Makefile]
906 [src/vm/jit/mips/linux/Makefile]
907 [src/vm/jit/mips/uclinux/Makefile]
908 [src/vm/jit/optimizing/Makefile]
909 [src/vm/jit/parisc/Makefile]
910 [src/vm/jit/parisc/linux/Makefile]
911 [src/vm/jit/powerpc/Makefile]
912 [src/vm/jit/powerpc/darwin/Makefile]
913 [src/vm/jit/powerpc/linux/Makefile]
914 [src/vm/jit/powerpc/netbsd/Makefile]
915 [src/vm/jit/powerpc64/Makefile]
916 [src/vm/jit/powerpc64/linux/Makefile]
917 [src/vm/jit/s390/Makefile]
918 [src/vm/jit/schedule/Makefile]
919 [src/vm/jit/sparc64/Makefile]
920 [src/vm/jit/sparc64/linux/Makefile]
921 [src/vm/jit/sparc64/solaris/Makefile]
922 [src/vm/jit/verify/Makefile]
923 [src/vm/jit/x86_64/Makefile]
924 [src/vm/jit/x86_64/freebsd/Makefile]
925 [src/vm/jit/x86_64/linux/Makefile]
926 [src/vmcore/Makefile]
928 [tests/regression/Makefile]
929 [tests/regression/assertion/Makefile]
930 [tests/regression/base/Makefile]
931 [tests/regression/bugzilla/Makefile]
932 [tests/regression/jasmin/Makefile]
933 [tests/regression/native/Makefile]
934 [tests/regression/resolving/Makefile]
935 [tests/regression/resolving/classes1/Makefile]
936 [tests/regression/resolving/classes2/Makefile]
937 [tests/regression/resolving/classes3/Makefile]
941 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
944 dnl We only build the shared library objects but we use it as
945 dnl noinst_LTLIBRARIES
946 ac_configure_args="$ac_configure_args --disable-static"
947 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
955 ## indent-tabs-mode: t
958 ## compile-command: "automake --add-missing"