1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(cacao, 0.96+svn, cacao@cacaojvm.org)
4 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
7 AM_INIT_AUTOMAKE([1.9.0])
10 AM_CONFIG_HEADER([config.h])
12 AC_PREFIX_DEFAULT(/usr/local/cacao)
15 dnl set optimization and debugging for all architectures and systems
16 if test x"$CFLAGS" = "x"; then
24 alpha | alphaev56 | alphapca56 )
26 ARCH_CFLAGS="-mieee -D__ALPHA__"
29 arm | armv4tl | armv5b | armv5l )
31 ARCH_CFLAGS="-D__ARM__"
34 i386 | i486 | i586 | i686 )
36 ARCH_CFLAGS="-D__I386__"
41 ARCH_CFLAGS="-D__MIPS__"
46 ARCH_CFLAGS="-D__POWERPC__"
51 ARCH_CFLAGS="-D__POWERPC64__"
56 ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
61 ARCH_CFLAGS="-D__X86_64__"
67 ARCH_CFLAGS="-D__XDSPCORE__"
72 AC_MSG_ERROR($host_cpu systems are not supported at this time)
80 INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
81 ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
86 INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
87 ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
92 INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
93 ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
98 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"
99 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"
104 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"
105 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"
113 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
114 dnl we set it properly at the end of this file
115 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
118 dnl define some stuff required for --fullversion
119 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
120 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
121 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS", [CFLAGS used])
124 dnl define and substitute some architecture specific variables
125 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
128 AC_SUBST(INTRP_CFLAGS)
129 AC_SUBST(USE_SCHEDULER)
132 dnl Checks for programs.
142 dnl Checks for header files.
145 AC_CHECK_HEADERS([fcntl.h])
146 AC_CHECK_HEADERS([sys/time.h])
147 AC_CHECK_HEADERS([unistd.h])
148 AC_CHECK_HEADERS([sys/ioctl.h])
150 dnl this is for fdlibm
151 AC_CHECK_HEADERS([stdint.h])
152 AC_CHECK_HEADERS([inttypes.h])
153 AC_CHECK_HEADERS([sys/config.h])
154 AC_CHECK_HEADERS([sys/types.h])
155 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
156 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
157 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]))
158 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]))
160 dnl Checks for typedefs, structures, and compiler characteristics.
169 dnl Checks for library functions.
170 AC_PROG_GCC_TRADITIONAL
174 AC_CHECK_FUNCS([calloc mmap getpagesize free])
175 AC_CHECK_FUNCS([getcwd gettimeofday])
176 AC_CHECK_FUNCS([scandir])
177 AC_CHECK_FUNCS([isnan])
179 dnl Checks for libraries.
181 dnl Checking sizeof void *
182 AC_CHECK_SIZEOF(void *)
186 dnl define install prefix
187 if test "x$prefix" = "xNONE"; then
188 CACAO_PREFIX=$ac_default_prefix
192 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
193 AC_SUBST(CACAO_PREFIX)
195 dnl define libdir prefix
196 if test "x$libdir" = "xNONE"; then
197 CACAO_LIBDIR=$ac_default_libdir
201 dnl expand CACAO_LIBDIR to something that is usable in C code
202 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
203 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
204 AC_SUBST(CACAO_LIBDIR)
211 dnl check for JIT compiler
212 AC_MSG_CHECKING(whether JIT compiler should be compiled)
214 [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
215 [case "${enableval}" in
220 AC_MSG_RESULT(${ENABLE_JIT})
221 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
223 if test x"${ENABLE_JIT}" = "xyes"; then
224 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
228 dnl check if softfloat should be used
229 AC_MSG_CHECKING(whether softfloat should be used)
230 AC_ARG_ENABLE([softfloat],
231 [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
232 [case "${enableval}" in
233 yes) ENABLE_SOFTFLOAT=yes;;
234 *) ENABLE_SOFTFLOAT=no;;
236 [ENABLE_SOFTFLOAT=no])
237 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
239 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
240 AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
244 dnl check for interpreter
245 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
247 AC_MSG_CHECKING(whether interpreter should be compiled)
248 if test x"$enable_intrp" = "xyes"; then
250 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
251 AM_CONDITIONAL([ENABLE_INTRP], [true])
258 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
260 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
261 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
262 AC_DEFINE([WITH_FFI], 1, [use libffi])],
265 dnl check for libffcall
266 AC_ARG_WITH([ffcall],
267 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
269 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
270 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
271 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
274 dnl check for libffi or libffcall
275 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
276 AC_ERROR(Enable only libffi or libffcall.)
278 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
279 AC_ERROR(Enable one of libffi or libffcall.)
284 AM_CONDITIONAL([ENABLE_INTRP], [false])
288 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
289 AC_ERROR(You have to enable at least the JIT or the interpreter.)
293 dnl check for garbage collector usage
294 AC_MSG_CHECKING(whether GC should be disabled)
296 [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])],
297 [case "${enableval}" in
299 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
304 AC_MSG_RESULT(${DISABLE_GC})
305 AM_CONDITIONAL([DISABLE_GC], test x"${DISABLE_GC}" = "xyes")
308 dnl check for dump memory usage
309 AC_MSG_CHECKING(whether dump memory should be disabled)
310 AC_ARG_ENABLE([dump],
311 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
312 [case "${enableval}" in
315 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
320 AC_MSG_RESULT(${DISABLE_DUMP})
324 AC_MSG_CHECKING(whether debug code generation should be enabled)
325 AC_ARG_ENABLE([debug],
326 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
327 [case "${enableval}" in
329 AC_DEFINE([NDEBUG], 1, [disable debug code])
335 if test x"${NDEBUG}" = "xno"; then
340 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
343 dnl check for disassembler support
344 AC_MSG_CHECKING(whether disassembler should be enabled)
345 AC_ARG_ENABLE([disassembler],
346 [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
347 [case "${enableval}" in
348 yes) ENABLE_DISASSEMBLER=yes;;
349 *) ENABLE_DISASSEMBLER=no;;
351 [ENABLE_DISASSEMBLER=no])
352 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
353 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
355 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
356 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
358 dnl check for binutils headers and libraries on some architectures for the
360 case "${ARCH_DIR}" in
361 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64)
362 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
363 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
364 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
365 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
368 cygwin | darwin | netbsd )
369 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
373 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
374 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
375 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
376 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
377 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
380 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
384 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
388 dnl check for statistics
389 AC_MSG_CHECKING(whether statistics generation should be enabled)
390 AC_ARG_ENABLE([statistics],
391 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
392 [case "${enableval}" in
393 yes) ENABLE_STATISTICS=yes;;
394 *) ENABLE_STATISTICS=no;;
396 [ENABLE_STATISTICS=no])
397 AC_MSG_RESULT(${ENABLE_STATISTICS})
398 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
400 if test x"${ENABLE_STATISTICS}" = "xyes"; then
401 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
405 dnl check for verifier
406 AC_MSG_CHECKING(whether classfile verification should be enabled)
407 AC_ARG_ENABLE([verifier],
408 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
409 [case "${enableval}" in
410 no) ENABLE_VERIFIER=no;;
411 *) ENABLE_VERIFIER=yes;;
413 [ENABLE_VERIFIER=yes])
414 AC_MSG_RESULT(${ENABLE_VERIFIER})
415 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
417 if test x"${ENABLE_VERIFIER}" = "xyes"; then
418 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
422 dnl check for compiler timing
423 AC_MSG_CHECKING(whether real-time timing should be enabled)
424 AC_ARG_ENABLE([rt-timing],
425 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
426 [case "${enableval}" in
427 yes) ENABLE_RT_TIMING=yes;;
428 *) ENABLE_RT_TIMING=no;;
430 [ENABLE_RT_TIMING=no])
431 AC_MSG_RESULT(${ENABLE_RT_TIMING})
432 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
434 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
435 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
439 dnl check for cycle count statistics
440 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
441 AC_ARG_ENABLE([cycles-stats],
442 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
443 [case "${enableval}" in
444 yes) ENABLE_CYCLES_STATS=yes;;
445 *) ENABLE_CYCLES_STATS=no;;
447 [ENABLE_CYCLES_STATS=no])
448 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
449 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
451 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
452 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
457 AC_MSG_CHECKING(whether to compile JVMTI support)
458 AC_ARG_ENABLE([jvmti],
459 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
460 [case "${enableval}" in
461 yes) ENABLE_JVMTI=yes;;
465 AC_MSG_RESULT(${ENABLE_JVMTI})
466 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
468 if test x"${ENABLE_JVMTI}" = "xyes"; then
469 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
474 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
475 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
477 AC_MSG_CHECKING(whether to include threads support)
478 enable_threads=${enable_threads:-native}
479 case "$enable_threads" in
482 dnl no threads for boehm
483 ac_configure_args="$ac_configure_args --disable-boehm-threads"
484 AM_CONDITIONAL([ENABLE_THREADS], [false])
487 native | posix | pthreads)
488 AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
490 AM_CONDITIONAL([ENABLE_THREADS], [true])
492 AC_MSG_RESULT(yes, native)
493 AC_CHECK_LIB(pthread, main)
495 ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
497 dnl we changed ARCH_CFLAGS, set CFLAGS again
498 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
500 dnl tell boehm to support threads as well
501 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
505 AC_MSG_ERROR($enable_threads is an unknown thread package)
510 dnl Check whether the compiler supports the __thread keyword.
511 if test "x$use__thread" != xno; then
512 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
513 [cat > conftest.c <<\EOF
516 if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
517 ac_cv_gcc___thread=yes
519 ac_cv_gcc___thread=no
522 if test "$ac_cv_gcc___thread" = yes; then
523 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
526 ac_cv_gcc___thread=no
530 dnl check if if-conversion should be supported
531 AC_MSG_CHECKING(whether if-conversion should be supported)
532 AC_ARG_ENABLE([ifconv],
533 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
534 [case "${enableval}" in
535 no) ENABLE_IFCONV=no;;
536 *) ENABLE_IFCONV=yes;;
539 AC_MSG_RESULT(${ENABLE_IFCONV})
540 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
542 if test x"${ENABLE_IFCONV}" = "xyes"; then
543 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
547 dnl check for inlining
548 AC_MSG_CHECKING(whether method inlining should be supported)
549 AC_ARG_ENABLE([inlining],
550 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
551 [case "${enableval}" in
552 yes) ENABLE_INLINING=yes;;
553 *) ENABLE_INLINING=no;;
555 [ENABLE_INLINING=no])
556 AC_MSG_RESULT(${ENABLE_INLINING})
557 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
559 if test x"${ENABLE_INLINING}" = "xyes"; then
560 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
564 dnl check for loop optimization
565 AC_MSG_CHECKING(whether loop optimization should be supported)
566 AC_ARG_ENABLE([loop],
567 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
568 [case "${enableval}" in
569 yes) ENABLE_LOOP=yes;;
573 AC_MSG_RESULT(${ENABLE_LOOP})
574 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
576 if test x"${ENABLE_LOOP}" = "xyes"; then
577 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
581 dnl check if linear scan register allocator(lsra) with SSA should be used
582 AC_MSG_CHECKING(whether lsra with ssa should be supported)
584 [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
585 [case "${enableval}" in
590 AC_MSG_RESULT(${ENABLE_SSA})
591 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
593 if test x"${ENABLE_SSA}" = "xyes"; then
594 AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
599 dnl check if linear scan register allocator(lsra) should be used
600 AC_MSG_CHECKING(whether lsra should be supported)
601 AC_ARG_ENABLE([lsra],
602 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
603 [case "${enableval}" in
604 yes) ENABLE_LSRA=yes;;
609 if test x"${ENABLE_LSRA}" = "xyes"; then
610 if test x"${ENABLE_SSA}" = "xyes"; then
614 AC_MSG_RESULT(${ENABLE_LSRA})
615 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
617 if test x"${ENABLE_LSRA}" = "xyes"; then
618 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
622 dnl check if profiling should be supported
623 AC_MSG_CHECKING(whether profiling should be supported)
624 AC_ARG_ENABLE([profiling],
625 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
626 [case "${enableval}" in
627 yes) ENABLE_PROFILING=yes;;
628 *) ENABLE_PROFILING=no;;
630 [ENABLE_PROFILING=no])
631 AC_MSG_RESULT(${ENABLE_PROFILING})
632 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
634 if test x"${ENABLE_PROFILING}" = "xyes"; then
635 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
639 dnl check for instruction scheduler
640 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
642 AC_MSG_CHECKING(whether instruction scheduler should be supported)
643 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
644 case "${ARCH_DIR}" in
648 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
653 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
654 AM_CONDITIONAL([USE_SCHEDULER], [true])
657 AM_CONDITIONAL([USE_SCHEDULER], [false])
661 dnl check if zlib should be used
662 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
663 AC_ARG_ENABLE([zlib],
664 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
665 [case "${enableval}" in
670 AC_MSG_RESULT(${ENABLE_ZLIB})
672 if test x"${ENABLE_ZLIB}" = "xyes"; then
673 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
674 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
675 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
676 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
678 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
681 dnl check if a libjvm.so should be built
682 AC_MSG_CHECKING(whether to build a libjvm.so)
683 AC_ARG_ENABLE([libjvm],
684 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
685 [case "${enableval}" in
686 no) ENABLE_LIBJVM=no;;
687 *) ENABLE_LIBJVM=yes;;
690 AC_MSG_RESULT(${ENABLE_LIBJVM})
691 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
692 AC_SUBST(ENABLE_LIBJVM)
694 if test x"${ENABLE_LIBJVM}" = "xyes"; then
695 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
697 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
710 dnl check if CACAO should be linked statically
711 AC_MSG_CHECKING(whether to link CACAO statically)
712 AC_ARG_ENABLE([staticvm],
713 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
714 [case "${enableval}" in
715 yes) ENABLE_STATICVM=yes
716 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
718 *) ENABLE_STATICVM=no;;
720 [ENABLE_STATICVM=no])
721 AC_MSG_RESULT(${ENABLE_STATICVM})
722 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
723 AC_SUBST(ENABLE_STATICVM)
726 dnl where is CACAO's vm.zip
727 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
728 AC_ARG_WITH([vm-zip],
729 [AS_HELP_STRING(--with-vm-zip,path to CACAO's vm.zip (includes the name of the file and may be flat) [[default=/usr/local/cacao/share/cacao/vm.zip]])],
730 [CACAO_VM_ZIP=${withval}],
731 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
732 AC_MSG_RESULT(${CACAO_VM_ZIP})
733 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
734 AC_SUBST(CACAO_VM_ZIP)
737 dnl is GNU classpath installed somewhere different
738 AC_MSG_CHECKING(where GNU Classpath is installed)
739 AC_ARG_WITH([classpath-prefix],
740 [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of GNU Classpath [[default=/usr/local/classpath]])],
741 [CLASSPATH_PREFIX=${withval}],
742 [CLASSPATH_PREFIX=/usr/local/classpath])
743 AC_MSG_RESULT(${CLASSPATH_PREFIX})
744 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [GNU Classpath installation directory])
745 AC_SUBST(CLASSPATH_PREFIX)
748 dnl where is GNU Classpath's glibj.zip
749 AC_MSG_CHECKING(where GNU Classpath's glibj.zip is installed)
750 AC_ARG_WITH([classpath-glibj-zip],
751 [AS_HELP_STRING(--with-classpath-glibj-zip,path to GNU Classpath's glibj.zip (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
752 [CLASSPATH_GLIBJ_ZIP=${withval}],
753 [CLASSPATH_GLIBJ_ZIP=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
754 AC_MSG_RESULT(${CLASSPATH_GLIBJ_ZIP})
755 AC_DEFINE_UNQUOTED([CLASSPATH_GLIBJ_ZIP], "${CLASSPATH_GLIBJ_ZIP}", [GNU Classpath's glibj.zip])
756 AC_SUBST(CLASSPATH_GLIBJ_ZIP)
759 dnl where are the GNU Classpath libraries installed
760 AC_MSG_CHECKING(where GNU Classpath libraries are installed)
761 AC_ARG_WITH([classpath-libdir],
762 [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of GNU Classpath libraries [[default=/usr/local/classpath/lib]])],
763 [CLASSPATH_LIBDIR=${withval}],
764 [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
765 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
767 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
768 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
769 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
770 AC_SUBST(CLASSPATH_LIBDIR)
773 dnl where are the GNU Classpath headers installed
774 AC_MSG_CHECKING(where GNU Classpath headers are installed)
775 AC_ARG_WITH([classpath-includedir],
776 [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of GNU Classpath headers [[default=/usr/local/classpath/include]])],
777 [CLASSPATH_INCLUDEDIR=${withval}],
778 [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
779 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
781 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
782 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [GNU Classpath jni.h header])],
783 [AC_MSG_ERROR(cannot find jni.h)])
786 dnl check if GNU Classpath should be linked statically into CACAO
787 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
788 AC_ARG_WITH([static-classpath],
789 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
790 [case "${enableval}" in
791 yes) WITH_STATIC_CLASSPATH=yes;;
792 *) WITH_STATIC_CLASSPATH=no;;
794 [WITH_STATIC_CLASSPATH=no])
795 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
797 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
798 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
800 dnl check for some classpath related stuff when we link statically
803 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
804 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
806 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
807 AC_SUBST(WITH_STATIC_CLASSPATH)
810 dnl check for some programs we need
815 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
817 AM_CFLAGS=$ARCH_CFLAGS
821 AC_CONFIG_FILES([Makefile]
823 [contrib/setenvinstalled]
824 [contrib/setenvsource]
826 [doc/handbook/Makefile]
830 [src/cacaoh/Makefile]
831 [src/fdlibm/Makefile]
834 [src/native/Makefile]
835 [src/native/include/Makefile]
836 [src/native/jvmti/Makefile]
837 [src/native/tools/Makefile]
838 [src/native/vm/Makefile]
839 [src/scripts/Makefile]
842 [src/scripts/rmiregistry]
843 [src/threads/Makefile]
844 [src/threads/native/Makefile]
845 [src/threads/none/Makefile]
846 [src/toolbox/Makefile]
848 [src/vm/jit/Makefile]
849 [src/vm/jit/allocator/Makefile]
850 [src/vm/jit/alpha/Makefile]
851 [src/vm/jit/alpha/freebsd/Makefile]
852 [src/vm/jit/alpha/linux/Makefile]
853 [src/vm/jit/i386/Makefile]
854 [src/vm/jit/i386/darwin/Makefile]
855 [src/vm/jit/i386/freebsd/Makefile]
856 [src/vm/jit/i386/linux/Makefile]
857 [src/vm/jit/ifconv/Makefile]
858 [src/vm/jit/intrp/Makefile]
859 [src/vm/jit/inline/Makefile]
860 [src/vm/jit/loop/Makefile]
861 [src/vm/jit/mips/Makefile]
862 [src/vm/jit/mips/irix/Makefile]
863 [src/vm/jit/mips/linux/Makefile]
864 [src/vm/jit/optimizing/Makefile]
865 [src/vm/jit/powerpc/Makefile]
866 [src/vm/jit/powerpc/darwin/Makefile]
867 [src/vm/jit/powerpc/linux/Makefile]
868 [src/vm/jit/powerpc/netbsd/Makefile]
869 [src/vm/jit/powerpc64/Makefile]
870 [src/vm/jit/powerpc64/linux/Makefile]
871 [src/vm/jit/profile/Makefile]
872 [src/vm/jit/schedule/Makefile]
873 [src/vm/jit/sparc64/Makefile]
874 [src/vm/jit/sparc64/linux/Makefile]
875 [src/vm/jit/tools/Makefile]
876 [src/vm/jit/verify/Makefile]
877 [src/vm/jit/x86_64/Makefile]
879 [tests/regression/Makefile]
880 [tests/regression/codepatching/Makefile]
881 [tests/regression/native/Makefile])
884 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
887 AC_CONFIG_SUBDIRS(src/boehm-gc)
895 ## indent-tabs-mode: t
898 ## compile-command: "automake --add-missing"