1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(cacao, 0.95+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
22 alpha | alphaev56 | alphapca56 )
24 CFLAGS="$CFLAGS -mieee -D__ALPHA__"
27 arm | armv4tl | armv5b | armv5l )
29 CFLAGS="$CFLAGS -D__ARM__"
32 i386 | i486 | i586 | i686 )
34 CFLAGS="$CFLAGS -D__I386__"
39 CFLAGS="$CFLAGS -D__MIPS__"
44 CFLAGS="$CFLAGS -D__POWERPC__"
49 CFLAGS="$CFLAGS -D__POWERPC64__"
54 CFLAGS="$CFLAGS -D__X86_64__"
60 CFLAGS="$CFLAGS -D__XDSPCORE__"
65 AC_MSG_ERROR($host_cpu systems are not supported at this time)
73 CFLAGS="$CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
78 CFLAGS="$CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
83 CFLAGS="$CFLAGS -D__IRIX__"
88 CFLAGS="$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"
93 CFLAGS="$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"
101 dnl define some stuff required for --fullversion
102 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
103 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
104 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$CFLAGS", [CFLAGS used])
107 dnl define and substitute some architecture specific variables
108 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
111 AC_SUBST(USE_SCHEDULER)
114 dnl Checks for programs.
124 dnl Checks for header files.
127 AC_CHECK_HEADERS([fcntl.h])
128 AC_CHECK_HEADERS([sys/time.h])
129 AC_CHECK_HEADERS([unistd.h])
130 AC_CHECK_HEADERS([sys/ioctl.h])
132 dnl this is for fdlibm
133 AC_CHECK_HEADERS([stdint.h])
134 AC_CHECK_HEADERS([inttypes.h])
135 AC_CHECK_HEADERS([sys/config.h])
136 AC_CHECK_HEADERS([sys/types.h])
137 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
138 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
139 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]))
140 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]))
142 dnl Checks for typedefs, structures, and compiler characteristics.
151 dnl Checks for library functions.
152 AC_PROG_GCC_TRADITIONAL
155 AC_CHECK_FUNCS([calloc mprotect getpagesize free])
156 AC_CHECK_FUNCS([getcwd gettimeofday])
157 AC_CHECK_FUNCS([scandir])
158 AC_CHECK_FUNCS([mmap])
159 AC_CHECK_FUNCS([isnan])
161 dnl Checks for libraries.
163 dnl Checking sizeof void *
164 AC_CHECK_SIZEOF(void *)
168 dnl define install prefix
169 if test "x$prefix" = "xNONE"; then
170 CACAO_PREFIX=$ac_default_prefix
174 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
175 AC_SUBST(CACAO_PREFIX)
182 dnl check for JIT compiler
183 AC_MSG_CHECKING(whether JIT compiler should be compiled)
185 [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
186 [case "${enableval}" in
191 AC_MSG_RESULT(${ENABLE_JIT})
192 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
194 if test x"${ENABLE_JIT}" = "xyes"; then
195 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
199 dnl check if softfloat should be used
200 AC_MSG_CHECKING(whether softfloat should be used)
201 AC_ARG_ENABLE([softfloat],
202 [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
203 [case "${enableval}" in
204 yes) ENABLE_SOFTFLOAT=yes;;
205 *) ENABLE_SOFTFLOAT=no;;
207 [ENABLE_SOFTFLOAT=no])
208 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
210 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
211 AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
215 dnl check for interpreter
216 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
218 AC_MSG_CHECKING(whether interpreter should be compiled)
219 if test x"$enable_intrp" = "xyes"; then
221 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
222 AM_CONDITIONAL([ENABLE_INTRP], [true])
229 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
231 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
232 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
233 AC_DEFINE([WITH_FFI], 1, [use libffi])],
236 dnl check for libffcall
237 AC_ARG_WITH([ffcall],
238 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
240 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
241 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
242 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
245 dnl check for libffi or libffcall
246 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
247 AC_ERROR(Enable only libffi or libffcall.)
249 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
250 AC_ERROR(Enable one of libffi or libffcall.)
255 AM_CONDITIONAL([ENABLE_INTRP], [false])
259 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
260 AC_ERROR(You have to enable at least the JIT or the interpreter.)
264 dnl check for garbage collector usage
265 AC_MSG_CHECKING(whether GC should be disabled)
267 [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])],
268 [case "${enableval}" in
270 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
275 AC_MSG_RESULT(${DISABLE_GC})
276 AM_CONDITIONAL([DISABLE_GC], test x"${DISABLE_GC}" = "xyes")
279 dnl check for dump memory usage
280 AC_MSG_CHECKING(whether dump memory should be disabled)
281 AC_ARG_ENABLE([dump],
282 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
283 [case "${enableval}" in
286 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
291 AC_MSG_RESULT(${DISABLE_DUMP})
295 AC_MSG_CHECKING(whether debug code generation should be enabled)
296 AC_ARG_ENABLE([debug],
297 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
298 [case "${enableval}" in
300 AC_DEFINE([NDEBUG], 1, [disable debug code])
306 if test x"${NDEBUG}" = "xno"; then
311 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
314 dnl check for disassembler support
315 AC_MSG_CHECKING(whether disassembler should be enabled)
316 AC_ARG_ENABLE([disassembler],
317 [AS_HELP_STRING(--disable-disassembler,disable disassembler [[default=yes]])],
318 [case "${enableval}" in
319 no) ENABLE_DISASSEMBLER=no;;
320 *) ENABLE_DISASSEMBLER=yes;;
322 [ENABLE_DISASSEMBLER=yes])
323 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
324 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
326 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
327 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
329 dnl check for binutils headers and libraries on some architectures for the
331 case "${ARCH_DIR}" in
332 arm | i386 | powerpc | x86_64 )
333 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
334 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
335 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
336 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
339 cygwin | darwin | netbsd )
340 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
344 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
345 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
346 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
347 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
348 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
351 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
355 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
359 dnl check for statistics
360 AC_MSG_CHECKING(whether statistics generation should be enabled)
361 AC_ARG_ENABLE([statistics],
362 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
363 [case "${enableval}" in
364 yes) ENABLE_STATISTICS=yes;;
365 *) ENABLE_STATISTICS=no;;
367 [ENABLE_STATISTICS=no])
368 AC_MSG_RESULT(${ENABLE_STATISTICS})
369 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
371 if test x"${ENABLE_STATISTICS}" = "xyes"; then
372 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
376 dnl check for verifier
377 AC_MSG_CHECKING(whether classfile verification should be enabled)
378 AC_ARG_ENABLE([verifier],
379 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
380 [case "${enableval}" in
381 no) ENABLE_VERIFIER=no;;
382 *) ENABLE_VERIFIER=yes;;
384 [ENABLE_VERIFIER=yes])
385 AC_MSG_RESULT(${ENABLE_VERIFIER})
386 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
388 if test x"${ENABLE_VERIFIER}" = "xyes"; then
389 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
393 dnl check for compiler timing
394 AC_MSG_CHECKING(whether real-time timing should be enabled)
395 AC_ARG_ENABLE([rt-timing],
396 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
397 [case "${enableval}" in
398 yes) ENABLE_RT_TIMING=yes;;
399 *) ENABLE_RT_TIMING=no;;
401 [ENABLE_RT_TIMING=no])
402 AC_MSG_RESULT(${ENABLE_RT_TIMING})
403 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
405 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
406 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
410 dnl check for cycle count statistics
411 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
412 AC_ARG_ENABLE([cycles-stats],
413 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
414 [case "${enableval}" in
415 yes) ENABLE_CYCLES_STATS=yes;;
416 *) ENABLE_CYCLES_STATS=no;;
418 [ENABLE_CYCLES_STATS=no])
419 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
420 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
422 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
423 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
428 AC_MSG_CHECKING(whether to compile JVMTI support)
429 AC_ARG_ENABLE([jvmti],
430 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
431 [case "${enableval}" in
432 yes) ENABLE_JVMTI=yes;;
436 AC_MSG_RESULT(${ENABLE_JVMTI})
437 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
439 if test x"${ENABLE_JVMTI}" = "xyes"; then
440 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
445 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
446 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
448 AC_MSG_CHECKING(whether to include threads support)
449 enable_threads=${enable_threads:-native}
450 case "$enable_threads" in
453 dnl no threads for boehm
454 ac_configure_args="$ac_configure_args --disable-boehm-threads"
455 AM_CONDITIONAL([USE_THREADS], [false])
456 AM_CONDITIONAL([NATIVE_THREADS], [false])
459 green | native | posix | pthreads)
460 AC_DEFINE([USE_THREADS], 1, [use threads])
462 AM_CONDITIONAL([USE_THREADS], [true])
464 if test x"$enable_threads" != "xgreen"; then
465 AC_MSG_RESULT(yes, native)
466 AC_CHECK_LIB(pthread, main)
467 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
469 CFLAGS="$CFLAGS -D_REENTRANT"
471 dnl tell boehm to support threads as well
472 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
473 AM_CONDITIONAL([NATIVE_THREADS], [true])
476 AC_MSG_RESULT(yes, green)
478 dnl no threads for boehm
479 ac_configure_args="$ac_configure_args --disable-boehm-threads"
480 AM_CONDITIONAL([NATIVE_THREADS], [false])
484 AC_MSG_ERROR($enable_threads is an unknown thread package)
489 dnl Check whether the compiler supports the __thread keyword.
490 if test "x$use__thread" != xno; then
491 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
492 [cat > conftest.c <<\EOF
495 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
496 ac_cv_gcc___thread=yes
498 ac_cv_gcc___thread=no
501 if test "$ac_cv_gcc___thread" = yes; then
502 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
505 ac_cv_gcc___thread=no
509 dnl check if if-conversion should be supported
510 AC_MSG_CHECKING(whether if-conversion should be supported)
511 AC_ARG_ENABLE([ifconv],
512 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
513 [case "${enableval}" in
514 no) ENABLE_IFCONV=no;;
515 *) ENABLE_IFCONV=yes;;
518 AC_MSG_RESULT(${ENABLE_IFCONV})
519 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
521 if test x"${ENABLE_IFCONV}" = "xyes"; then
522 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
526 dnl check for inlining
527 AC_MSG_CHECKING(whether method inlining should be supported)
528 AC_ARG_ENABLE([inlining],
529 [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])],
530 [case "${enableval}" in
531 no) ENABLE_INLINING=no;;
532 *) ENABLE_INLINING=yes;;
534 [ENABLE_INLINING=yes])
535 AC_MSG_RESULT(${ENABLE_INLINING})
536 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
538 if test x"${ENABLE_INLINING}" = "xyes"; then
539 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
543 dnl check for loop optimization
544 AC_MSG_CHECKING(whether loop optimization should be supported)
545 AC_ARG_ENABLE([loop],
546 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
547 [case "${enableval}" in
548 yes) ENABLE_LOOP=yes;;
552 AC_MSG_RESULT(${ENABLE_LOOP})
553 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
555 if test x"${ENABLE_LOOP}" = "xyes"; then
556 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
560 dnl check if linear scan register allocator(lsra) should be used
561 AC_MSG_CHECKING(whether lsra should be supported)
562 AC_ARG_ENABLE([lsra],
563 [AS_HELP_STRING(--disable-lsra,disable linear scan register allocator [[default=yes]])],
564 [case "${enableval}" in
569 AC_MSG_RESULT(${ENABLE_LSRA})
570 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
572 if test x"${ENABLE_LSRA}" = "xyes"; then
573 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
577 dnl check if profiling should be supported
578 AC_MSG_CHECKING(whether profiling should be supported)
579 AC_ARG_ENABLE([profiling],
580 [AS_HELP_STRING(--disable-profiling,disable profiling [[default=yes]])],
581 [case "${enableval}" in
582 no) ENABLE_PROFILING=no;;
583 *) ENABLE_PROFILING=yes;;
585 [ENABLE_PROFILING=yes])
586 AC_MSG_RESULT(${ENABLE_PROFILING})
587 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
589 if test x"${ENABLE_PROFILING}" = "xyes"; then
590 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
594 dnl check for instruction scheduler
595 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
597 AC_MSG_CHECKING(whether instruction scheduler should be supported)
598 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
599 case "${ARCH_DIR}" in
603 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
608 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
609 AM_CONDITIONAL([USE_SCHEDULER], [true])
612 AM_CONDITIONAL([USE_SCHEDULER], [false])
616 dnl check if zlib should be used
617 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
618 AC_ARG_ENABLE([zlib],
619 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
620 [case "${enableval}" in
625 AC_MSG_RESULT(${ENABLE_ZLIB})
627 if test x"${ENABLE_ZLIB}" = "xyes"; then
628 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
629 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
630 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
631 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
634 VM_ZIP_STRING=classes/
636 AC_DEFINE_UNQUOTED(VM_ZIP_STRING, "${VM_ZIP_STRING}", [define to the string base name of the VM zip file])
637 AC_SUBST(VM_ZIP_STRING)
638 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
641 dnl check if a libjvm.so should be built
642 AC_MSG_CHECKING(whether to build a libjvm.so)
643 AC_ARG_ENABLE([libjvm],
644 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
645 [case "${enableval}" in
646 no) ENABLE_LIBJVM=no;;
647 *) ENABLE_LIBJVM=yes;;
650 AC_MSG_RESULT(${ENABLE_LIBJVM})
651 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
652 AC_SUBST(ENABLE_LIBJVM)
654 if test x"${ENABLE_LIBJVM}" = "xyes"; then
655 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
657 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
670 dnl check if CACAO should be linked statically
671 AC_MSG_CHECKING(whether to link CACAO statically)
672 AC_ARG_ENABLE([staticvm],
673 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
674 [case "${enableval}" in
675 yes) ENABLE_STATICVM=yes
676 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
678 *) ENABLE_STATICVM=no;;
680 [ENABLE_STATICVM=no])
681 AC_MSG_RESULT(${ENABLE_STATICVM})
682 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
683 AC_SUBST(ENABLE_STATICVM)
686 dnl is GNU classpath installed somewhere different
687 AC_MSG_CHECKING(where GNU Classpath is installed)
688 AC_ARG_WITH([classpath-prefix],
689 [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of GNU Classpath [[default=/usr/local/classpath]])],
690 [CLASSPATH_PREFIX=${withval}],
691 [CLASSPATH_PREFIX=/usr/local/classpath])
692 AC_MSG_RESULT(${CLASSPATH_PREFIX})
693 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [GNU Classpath installation directory])
694 AC_SUBST(CLASSPATH_PREFIX)
696 AC_MSG_CHECKING(where GNU Classpath libraries are installed)
697 AC_ARG_WITH([classpath-libdir],
698 [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of GNU Classpath libraries [[default=/usr/local/classpath/lib]])],
699 [CLASSPATH_LIBDIR=${withval}],
700 [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
701 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
703 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
704 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
705 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
706 AC_SUBST(CLASSPATH_LIBDIR)
708 AC_CHECK_HEADER([${CLASSPATH_PREFIX}/include/jni.h],
709 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_PREFIX}/include/jni.h", [GNU Classpath jni.h header])],
710 [AC_MSG_ERROR(cannot find jni.h)])
713 dnl check if GNU Classpath should be linked statically into CACAO
714 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
715 AC_ARG_WITH([static-classpath],
716 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
717 [case "${enableval}" in
718 yes) WITH_STATIC_CLASSPATH=yes;;
719 *) WITH_STATIC_CLASSPATH=no;;
721 [WITH_STATIC_CLASSPATH=no])
722 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
724 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
725 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
727 dnl check for some classpath related stuff when we link statically
730 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
731 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
733 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
734 AC_SUBST(WITH_STATIC_CLASSPATH)
737 dnl Maybe the user has Classpath installed 'flat'.
738 AC_ARG_WITH([flat-classpath],
739 [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
741 if test x"$with_flat_classpath" = "x"; then
742 GLIBJ_ZIP_STRING=glibj.zip
746 AC_SUBST(GLIBJ_ZIP_STRING)
747 AC_DEFINE_UNQUOTED(GLIBJ_ZIP_STRING, "$GLIBJ_ZIP_STRING", [define to the string base name of the classpath zip file])
750 dnl check for some programs we need
755 dnl now configure subpackages
756 dnl the export is not my favorite (is there another way?)
758 AC_CONFIG_SUBDIRS(src/boehm-gc)
761 AC_CONFIG_FILES([Makefile]
763 [contrib/setenvinstalled]
764 [contrib/setenvsource]
766 [doc/handbook/Makefile]
770 [src/cacaoh/Makefile]
771 [src/fdlibm/Makefile]
774 [src/native/Makefile]
775 [src/native/include/Makefile]
776 [src/native/jvmti/Makefile]
777 [src/native/tools/Makefile]
778 [src/native/vm/Makefile]
779 [src/scripts/Makefile]
780 [src/scripts/jarsigner]
782 [src/scripts/keytool]
784 [src/scripts/rmiregistry]
785 [src/threads/Makefile]
786 [src/threads/green/Makefile]
787 [src/threads/native/Makefile]
788 [src/toolbox/Makefile]
790 [src/vm/jit/Makefile]
791 [src/vm/jit/allocator/Makefile]
792 [src/vm/jit/alpha/Makefile]
793 [src/vm/jit/alpha/freebsd/Makefile]
794 [src/vm/jit/alpha/linux/Makefile]
795 [src/vm/jit/i386/Makefile]
796 [src/vm/jit/i386/freebsd/Makefile]
797 [src/vm/jit/i386/linux/Makefile]
798 [src/vm/jit/ifconv/Makefile]
799 [src/vm/jit/intrp/Makefile]
800 [src/vm/jit/inline/Makefile]
801 [src/vm/jit/loop/Makefile]
802 [src/vm/jit/mips/Makefile]
803 [src/vm/jit/mips/irix/Makefile]
804 [src/vm/jit/mips/linux/Makefile]
805 [src/vm/jit/powerpc/Makefile]
806 [src/vm/jit/powerpc/darwin/Makefile]
807 [src/vm/jit/powerpc/linux/Makefile]
808 [src/vm/jit/powerpc/netbsd/Makefile]
809 [src/vm/jit/profile/Makefile]
810 [src/vm/jit/schedule/Makefile]
811 [src/vm/jit/tools/Makefile]
812 [src/vm/jit/verify/Makefile]
813 [src/vm/jit/x86_64/Makefile]
815 [tests/regression/Makefile]
816 [tests/regression/codepatching/Makefile]
817 [tests/regression/native/Makefile])
824 ## indent-tabs-mode: t
827 ## compile-command: "automake --add-missing"