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
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
173 AC_CHECK_FUNCS([calloc mprotect getpagesize free])
174 AC_CHECK_FUNCS([getcwd gettimeofday])
175 AC_CHECK_FUNCS([scandir])
176 AC_CHECK_FUNCS([mmap])
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)
200 dnl check for JIT compiler
201 AC_MSG_CHECKING(whether JIT compiler should be compiled)
203 [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
204 [case "${enableval}" in
209 AC_MSG_RESULT(${ENABLE_JIT})
210 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
212 if test x"${ENABLE_JIT}" = "xyes"; then
213 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
217 dnl check if softfloat should be used
218 AC_MSG_CHECKING(whether softfloat should be used)
219 AC_ARG_ENABLE([softfloat],
220 [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
221 [case "${enableval}" in
222 yes) ENABLE_SOFTFLOAT=yes;;
223 *) ENABLE_SOFTFLOAT=no;;
225 [ENABLE_SOFTFLOAT=no])
226 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
228 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
229 AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
233 dnl check for interpreter
234 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
236 AC_MSG_CHECKING(whether interpreter should be compiled)
237 if test x"$enable_intrp" = "xyes"; then
239 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
240 AM_CONDITIONAL([ENABLE_INTRP], [true])
247 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
249 AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
250 AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
251 AC_DEFINE([WITH_FFI], 1, [use libffi])],
254 dnl check for libffcall
255 AC_ARG_WITH([ffcall],
256 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
258 AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
259 AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
260 AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
263 dnl check for libffi or libffcall
264 if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
265 AC_ERROR(Enable only libffi or libffcall.)
267 if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
268 AC_ERROR(Enable one of libffi or libffcall.)
273 AM_CONDITIONAL([ENABLE_INTRP], [false])
277 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
278 AC_ERROR(You have to enable at least the JIT or the interpreter.)
282 dnl check for garbage collector usage
283 AC_MSG_CHECKING(whether GC should be disabled)
285 [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])],
286 [case "${enableval}" in
288 AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
293 AC_MSG_RESULT(${DISABLE_GC})
294 AM_CONDITIONAL([DISABLE_GC], test x"${DISABLE_GC}" = "xyes")
297 dnl check for dump memory usage
298 AC_MSG_CHECKING(whether dump memory should be disabled)
299 AC_ARG_ENABLE([dump],
300 [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
301 [case "${enableval}" in
304 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
309 AC_MSG_RESULT(${DISABLE_DUMP})
313 AC_MSG_CHECKING(whether debug code generation should be enabled)
314 AC_ARG_ENABLE([debug],
315 [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
316 [case "${enableval}" in
318 AC_DEFINE([NDEBUG], 1, [disable debug code])
324 if test x"${NDEBUG}" = "xno"; then
329 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
332 dnl check for disassembler support
333 AC_MSG_CHECKING(whether disassembler should be enabled)
334 AC_ARG_ENABLE([disassembler],
335 [AS_HELP_STRING(--disable-disassembler,disable disassembler [[default=yes]])],
336 [case "${enableval}" in
337 no) ENABLE_DISASSEMBLER=no;;
338 *) ENABLE_DISASSEMBLER=yes;;
340 [ENABLE_DISASSEMBLER=yes])
341 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
342 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
344 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
345 AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
347 dnl check for binutils headers and libraries on some architectures for the
349 case "${ARCH_DIR}" in
350 arm | i386 | powerpc | x86_64 | sparc64 | powerpc64)
351 AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
352 AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
353 AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
354 AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
357 cygwin | darwin | netbsd )
358 AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
362 AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
363 AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
364 AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
365 AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
366 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
369 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
373 AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
377 dnl check for statistics
378 AC_MSG_CHECKING(whether statistics generation should be enabled)
379 AC_ARG_ENABLE([statistics],
380 [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
381 [case "${enableval}" in
382 yes) ENABLE_STATISTICS=yes;;
383 *) ENABLE_STATISTICS=no;;
385 [ENABLE_STATISTICS=no])
386 AC_MSG_RESULT(${ENABLE_STATISTICS})
387 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
389 if test x"${ENABLE_STATISTICS}" = "xyes"; then
390 AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
394 dnl check for verifier
395 AC_MSG_CHECKING(whether classfile verification should be enabled)
396 AC_ARG_ENABLE([verifier],
397 [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
398 [case "${enableval}" in
399 no) ENABLE_VERIFIER=no;;
400 *) ENABLE_VERIFIER=yes;;
402 [ENABLE_VERIFIER=yes])
403 AC_MSG_RESULT(${ENABLE_VERIFIER})
404 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
406 if test x"${ENABLE_VERIFIER}" = "xyes"; then
407 AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
411 dnl check for compiler timing
412 AC_MSG_CHECKING(whether real-time timing should be enabled)
413 AC_ARG_ENABLE([rt-timing],
414 [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
415 [case "${enableval}" in
416 yes) ENABLE_RT_TIMING=yes;;
417 *) ENABLE_RT_TIMING=no;;
419 [ENABLE_RT_TIMING=no])
420 AC_MSG_RESULT(${ENABLE_RT_TIMING})
421 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
423 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
424 AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
428 dnl check for cycle count statistics
429 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
430 AC_ARG_ENABLE([cycles-stats],
431 [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
432 [case "${enableval}" in
433 yes) ENABLE_CYCLES_STATS=yes;;
434 *) ENABLE_CYCLES_STATS=no;;
436 [ENABLE_CYCLES_STATS=no])
437 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
438 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
440 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
441 AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
446 AC_MSG_CHECKING(whether to compile JVMTI support)
447 AC_ARG_ENABLE([jvmti],
448 [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
449 [case "${enableval}" in
450 yes) ENABLE_JVMTI=yes;;
454 AC_MSG_RESULT(${ENABLE_JVMTI})
455 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
457 if test x"${ENABLE_JVMTI}" = "xyes"; then
458 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
463 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
464 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
466 AC_MSG_CHECKING(whether to include threads support)
467 enable_threads=${enable_threads:-native}
468 case "$enable_threads" in
471 dnl no threads for boehm
472 ac_configure_args="$ac_configure_args --disable-boehm-threads"
473 AM_CONDITIONAL([ENABLE_THREADS], [false])
476 native | posix | pthreads)
477 AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
479 AM_CONDITIONAL([ENABLE_THREADS], [true])
481 AC_MSG_RESULT(yes, native)
482 AC_CHECK_LIB(pthread, main)
484 ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
486 dnl we changed ARCH_CFLAGS, set CFLAGS again
487 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
489 dnl tell boehm to support threads as well
490 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
494 AC_MSG_ERROR($enable_threads is an unknown thread package)
499 dnl Check whether the compiler supports the __thread keyword.
500 if test "x$use__thread" != xno; then
501 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
502 [cat > conftest.c <<\EOF
505 if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
506 ac_cv_gcc___thread=yes
508 ac_cv_gcc___thread=no
511 if test "$ac_cv_gcc___thread" = yes; then
512 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
515 ac_cv_gcc___thread=no
519 dnl check if if-conversion should be supported
520 AC_MSG_CHECKING(whether if-conversion should be supported)
521 AC_ARG_ENABLE([ifconv],
522 [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
523 [case "${enableval}" in
524 no) ENABLE_IFCONV=no;;
525 *) ENABLE_IFCONV=yes;;
528 AC_MSG_RESULT(${ENABLE_IFCONV})
529 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
531 if test x"${ENABLE_IFCONV}" = "xyes"; then
532 AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
536 dnl check for inlining
537 AC_MSG_CHECKING(whether method inlining should be supported)
538 AC_ARG_ENABLE([inlining],
539 [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
540 [case "${enableval}" in
541 yes) ENABLE_INLINING=yes;;
542 *) ENABLE_INLINING=no;;
544 [ENABLE_INLINING=no])
545 AC_MSG_RESULT(${ENABLE_INLINING})
546 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
548 if test x"${ENABLE_INLINING}" = "xyes"; then
549 AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
553 dnl check for loop optimization
554 AC_MSG_CHECKING(whether loop optimization should be supported)
555 AC_ARG_ENABLE([loop],
556 [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
557 [case "${enableval}" in
558 yes) ENABLE_LOOP=yes;;
562 AC_MSG_RESULT(${ENABLE_LOOP})
563 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
565 if test x"${ENABLE_LOOP}" = "xyes"; then
566 AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
570 dnl check if linear scan register allocator(lsra) should be used
571 AC_MSG_CHECKING(whether lsra should be supported)
572 AC_ARG_ENABLE([lsra],
573 [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
574 [case "${enableval}" in
575 yes) ENABLE_LSRA=yes;;
579 AC_MSG_RESULT(${ENABLE_LSRA})
580 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
582 if test x"${ENABLE_LSRA}" = "xyes"; then
583 AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
587 dnl check if profiling should be supported
588 AC_MSG_CHECKING(whether profiling should be supported)
589 AC_ARG_ENABLE([profiling],
590 [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
591 [case "${enableval}" in
592 yes) ENABLE_PROFILING=yes;;
593 *) ENABLE_PROFILING=no;;
595 [ENABLE_PROFILING=no])
596 AC_MSG_RESULT(${ENABLE_PROFILING})
597 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
599 if test x"${ENABLE_PROFILING}" = "xyes"; then
600 AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
604 dnl check for instruction scheduler
605 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
607 AC_MSG_CHECKING(whether instruction scheduler should be supported)
608 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
609 case "${ARCH_DIR}" in
613 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
618 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
619 AM_CONDITIONAL([USE_SCHEDULER], [true])
622 AM_CONDITIONAL([USE_SCHEDULER], [false])
626 dnl check if zlib should be used
627 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
628 AC_ARG_ENABLE([zlib],
629 [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
630 [case "${enableval}" in
635 AC_MSG_RESULT(${ENABLE_ZLIB})
637 if test x"${ENABLE_ZLIB}" = "xyes"; then
638 AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
639 AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
640 AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
641 AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
643 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
646 dnl check if a libjvm.so should be built
647 AC_MSG_CHECKING(whether to build a libjvm.so)
648 AC_ARG_ENABLE([libjvm],
649 [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
650 [case "${enableval}" in
651 no) ENABLE_LIBJVM=no;;
652 *) ENABLE_LIBJVM=yes;;
655 AC_MSG_RESULT(${ENABLE_LIBJVM})
656 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
657 AC_SUBST(ENABLE_LIBJVM)
659 if test x"${ENABLE_LIBJVM}" = "xyes"; then
660 AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
662 dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
675 dnl check if CACAO should be linked statically
676 AC_MSG_CHECKING(whether to link CACAO statically)
677 AC_ARG_ENABLE([staticvm],
678 [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
679 [case "${enableval}" in
680 yes) ENABLE_STATICVM=yes
681 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
683 *) ENABLE_STATICVM=no;;
685 [ENABLE_STATICVM=no])
686 AC_MSG_RESULT(${ENABLE_STATICVM})
687 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
688 AC_SUBST(ENABLE_STATICVM)
691 dnl where is CACAO's vm.zip
692 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
693 AC_ARG_WITH([vm-zip],
694 [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]])],
695 [CACAO_VM_ZIP=${withval}],
696 [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
697 AC_MSG_RESULT(${CACAO_VM_ZIP})
698 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
699 AC_SUBST(CACAO_VM_ZIP)
702 dnl is GNU classpath installed somewhere different
703 AC_MSG_CHECKING(where GNU Classpath is installed)
704 AC_ARG_WITH([classpath-prefix],
705 [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of GNU Classpath [[default=/usr/local/classpath]])],
706 [CLASSPATH_PREFIX=${withval}],
707 [CLASSPATH_PREFIX=/usr/local/classpath])
708 AC_MSG_RESULT(${CLASSPATH_PREFIX})
709 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [GNU Classpath installation directory])
710 AC_SUBST(CLASSPATH_PREFIX)
713 dnl where is GNU Classpath's glibj.zip
714 AC_MSG_CHECKING(where GNU Classpath's glibj.zip is installed)
715 AC_ARG_WITH([classpath-glibj-zip],
716 [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]])],
717 [CLASSPATH_GLIBJ_ZIP=${withval}],
718 [CLASSPATH_GLIBJ_ZIP=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
719 AC_MSG_RESULT(${CLASSPATH_GLIBJ_ZIP})
720 AC_DEFINE_UNQUOTED([CLASSPATH_GLIBJ_ZIP], "${CLASSPATH_GLIBJ_ZIP}", [GNU Classpath's glibj.zip])
721 AC_SUBST(CLASSPATH_GLIBJ_ZIP)
724 dnl where are the GNU Classpath libraries installed
725 AC_MSG_CHECKING(where GNU Classpath libraries are installed)
726 AC_ARG_WITH([classpath-libdir],
727 [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of GNU Classpath libraries [[default=/usr/local/classpath/lib]])],
728 [CLASSPATH_LIBDIR=${withval}],
729 [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
730 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
732 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
733 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
734 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
735 AC_SUBST(CLASSPATH_LIBDIR)
738 dnl where are the GNU Classpath headers installed
739 AC_MSG_CHECKING(where GNU Classpath headers are installed)
740 AC_ARG_WITH([classpath-includedir],
741 [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of GNU Classpath headers [[default=/usr/local/classpath/include]])],
742 [CLASSPATH_INCLUDEDIR=${withval}],
743 [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
744 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
746 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
747 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [GNU Classpath jni.h header])],
748 [AC_MSG_ERROR(cannot find jni.h)])
751 dnl check if GNU Classpath should be linked statically into CACAO
752 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
753 AC_ARG_WITH([static-classpath],
754 [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
755 [case "${enableval}" in
756 yes) WITH_STATIC_CLASSPATH=yes;;
757 *) WITH_STATIC_CLASSPATH=no;;
759 [WITH_STATIC_CLASSPATH=no])
760 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
762 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
763 AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
765 dnl check for some classpath related stuff when we link statically
768 AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
769 AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
771 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
772 AC_SUBST(WITH_STATIC_CLASSPATH)
775 dnl check for some programs we need
780 dnl now configure subpackages
781 dnl the export is not my favorite (is there another way?)
783 AC_CONFIG_SUBDIRS(src/boehm-gc)
786 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
788 AM_CFLAGS=$ARCH_CFLAGS
792 AC_CONFIG_FILES([Makefile]
794 [contrib/setenvinstalled]
795 [contrib/setenvsource]
797 [doc/handbook/Makefile]
801 [src/cacaoh/Makefile]
802 [src/fdlibm/Makefile]
805 [src/native/Makefile]
806 [src/native/include/Makefile]
807 [src/native/jvmti/Makefile]
808 [src/native/tools/Makefile]
809 [src/native/vm/Makefile]
810 [src/scripts/Makefile]
813 [src/scripts/rmiregistry]
814 [src/threads/Makefile]
815 [src/threads/native/Makefile]
816 [src/toolbox/Makefile]
818 [src/vm/jit/Makefile]
819 [src/vm/jit/allocator/Makefile]
820 [src/vm/jit/alpha/Makefile]
821 [src/vm/jit/alpha/freebsd/Makefile]
822 [src/vm/jit/alpha/linux/Makefile]
823 [src/vm/jit/i386/Makefile]
824 [src/vm/jit/i386/freebsd/Makefile]
825 [src/vm/jit/i386/linux/Makefile]
826 [src/vm/jit/ifconv/Makefile]
827 [src/vm/jit/intrp/Makefile]
828 [src/vm/jit/inline/Makefile]
829 [src/vm/jit/loop/Makefile]
830 [src/vm/jit/mips/Makefile]
831 [src/vm/jit/mips/irix/Makefile]
832 [src/vm/jit/mips/linux/Makefile]
833 [src/vm/jit/powerpc/Makefile]
834 [src/vm/jit/powerpc/darwin/Makefile]
835 [src/vm/jit/powerpc/linux/Makefile]
836 [src/vm/jit/powerpc/netbsd/Makefile]
837 [src/vm/jit/powerpc64/Makefile]
838 [src/vm/jit/powerpc64/linux/Makefile]
839 [src/vm/jit/profile/Makefile]
840 [src/vm/jit/schedule/Makefile]
841 [src/vm/jit/sparc64/Makefile]
842 [src/vm/jit/sparc64/linux/Makefile]
843 [src/vm/jit/tools/Makefile]
844 [src/vm/jit/verify/Makefile]
845 [src/vm/jit/x86_64/Makefile]
847 [tests/regression/Makefile]
848 [tests/regression/codepatching/Makefile]
849 [tests/regression/native/Makefile])
856 ## indent-tabs-mode: t
859 ## compile-command: "automake --add-missing"