1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(cacao, 0.92+cvs, 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)
17 alpha | alphaev56 | alphapca56 )
19 CFLAGS="-mieee -D__ALPHA__"
22 arm | armv4tl | armv5b )
27 i386 | i486 | i586 | i686 )
35 dnl for MIPSPro Compiler
36 dnl CFLAGS="-64 -OPT:Olimit=0 -woff 1110,1164,1515 -D__MIPS__ -D__MIPSEB__"
37 CFLAGS="-64 -OPT:Olimit=0 -D__MIPS__ -D__MIPSEB__"
38 dnl CFLAGS="-D__MIPS__ -D__MIPSEB__"
41 dnl CFLAGS="-mabi=64 -D__MIPS__ -D__MIPSEB__"
42 dnl LDFLAGS="-mabi=64"
47 CFLAGS="-D__POWERPC__"
58 CFLAGS="-D__XDSPCORE__"
62 AC_MSG_ERROR($host_cpu systems are not supported at this time)
67 dnl set optimization and debugging for all architectures and systems
68 CFLAGS="-O0 -g3 $CFLAGS"
74 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__LINUX__ -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
78 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__DARWIN__"
82 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED"
86 CFLAGS="$CFLAGS -D__IRIX__"
93 dnl define and substitute some architecture specific variables
94 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [Architecture directory])
97 AC_SUBST(USE_SCHEDULER)
100 dnl Checks for programs.
112 AC_LIBLTDL_CONVENIENCE
116 dnl Checks for header files.
119 AC_CHECK_HEADERS([fcntl.h])
120 AC_CHECK_HEADERS([sys/time.h])
121 AC_CHECK_HEADERS([unistd.h])
122 AC_CHECK_HEADERS([sys/ioctl.h])
124 dnl this is for fdlibm
125 AC_CHECK_HEADERS([stdint.h])
126 AC_CHECK_HEADERS([inttypes.h])
127 AC_CHECK_HEADERS([sys/config.h])
128 AC_CHECK_HEADERS([sys/types.h])
129 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
130 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
131 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]))
132 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]))
134 dnl Checks for typedefs, structures, and compiler characteristics.
143 dnl Checks for library functions.
144 AC_PROG_GCC_TRADITIONAL
148 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
150 dnl Checks for libraries.
152 dnl Checking sizeof void *
153 AC_COMPILE_CHECK_SIZEOF(void *)
156 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
157 if test $ac_cv_func_mmap_fixed_mapped = yes; then
158 AC_CACHE_CHECK(whether MAP_FAILED is defined,
161 [#include <sys/mman.h>
165 ac_cv_map_failed=yes,
166 ac_cv_map_failed=no))
168 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
171 [#include <sys/mman.h>
175 ac_cv_map_anonymous=yes,
176 ac_cv_map_anonymous=no))
178 AC_CACHE_CHECK(whether MAP_ANON is defined,
181 [#include <sys/mman.h>
188 if test $ac_cv_map_failed = yes; then
189 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
192 if test $ac_cv_map_anonymous = yes; then
193 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
196 if test $ac_cv_map_anon = yes; then
197 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
202 dnl check which ld flags are required to export symbols
203 if test x"$with_gnu_ld" = "xyes"; then
204 EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
206 EXPORT_SYMBOLS_FLAGS=""
208 AC_SUBST(EXPORT_SYMBOLS_FLAGS)
211 dnl define install prefix
212 if test "x$prefix" = "xNONE"; then
213 CACAO_INSTALL_PREFIX=$ac_default_prefix
215 CACAO_INSTALL_PREFIX=$prefix
217 AC_DEFINE_UNQUOTED([CACAO_INSTALL_PREFIX], "${CACAO_INSTALL_PREFIX}", [Installation prefix])
218 AC_SUBST(CACAO_INSTALL_PREFIX)
225 dnl check for JIT compiler
226 AC_ARG_ENABLE([jit], [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])])
228 AC_MSG_CHECKING(whether JIT compiled should be compiled)
229 if test x"$enable_jit" = "xno"; then
231 AM_CONDITIONAL([ENABLE_JIT], [false])
234 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
235 AM_CONDITIONAL([ENABLE_JIT], [true])
238 dnl check for interpreter
239 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
241 AC_MSG_CHECKING(whether interpreter should be compiled)
242 if test x"$enable_intrp" = "xyes"; then
244 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
245 AM_CONDITIONAL([ENABLE_INTRP], [true])
249 AM_CONDITIONAL([ENABLE_INTRP], [false])
253 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
254 AC_ERROR(You have to enable at least the JIT or the interpreter.)
256 if test x"${ENABLE_JIT}" = "xyes" -a x"${ENABLE_INTRP}" = "xyes"; then
257 AC_ERROR(This is currently not supported. Please disable the JIT or the interpreter.)
260 dnl check for garbage collector usage
261 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])])
263 AC_MSG_CHECKING(whether GC should be used)
264 if test x"$enable_gc" = "xno"; then
266 AM_CONDITIONAL([DISABLE_GC], [true])
270 AM_CONDITIONAL([DISABLE_GC], [false])
274 dnl check for dump memory usage
275 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])])
277 AC_MSG_CHECKING(whether dump memory should be used)
278 if test x"$enable_dump" = "xno"; then
280 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
285 dnl check for statistics
286 AC_ARG_ENABLE([statistics], [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])])
288 AC_MSG_CHECKING(whether statistics generation should be enabled)
289 if test x"$enable_statistics" = "xno"; then
291 AM_CONDITIONAL([STATISTICS], [false])
294 AC_DEFINE([STATISTICS], 1, [use statistics])
295 AM_CONDITIONAL([STATISTICS], [true])
299 AC_ARG_ENABLE([jvmti], [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])])
301 AC_MSG_CHECKING(whether to compile JVMTI support)
302 if test x"$enable_jvmti" = "xyes"; then
304 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
305 AM_CONDITIONAL([ENABLE_JVMTI], [true])
308 AM_CONDITIONAL([ENABLE_JVMTI], [false])
313 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
314 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
316 AC_MSG_CHECKING(whether to include threads support)
317 enable_threads=${enable_threads:-native}
318 case "$enable_threads" in
321 dnl no threads for boehm
322 ac_configure_args="$ac_configure_args --disable-boehm-threads"
323 AM_CONDITIONAL([USE_THREADS], [false])
324 AM_CONDITIONAL([NATIVE_THREADS], [false])
327 green | native | posix | pthreads)
328 AC_DEFINE([USE_THREADS], 1, [use threads])
329 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
330 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
332 AM_CONDITIONAL([USE_THREADS], [true])
334 if test x"$enable_threads" != "xgreen"; then
335 AC_MSG_RESULT(yes, native)
336 AC_CHECK_LIB(pthread, main)
337 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
339 CFLAGS="$CFLAGS -D_REENTRANT"
341 dnl tell boehm to support threads as well
342 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
343 AM_CONDITIONAL([NATIVE_THREADS], [true])
346 AC_MSG_RESULT(yes, green)
348 dnl no threads for boehm
349 ac_configure_args="$ac_configure_args --disable-boehm-threads"
350 AM_CONDITIONAL([NATIVE_THREADS], [false])
354 AC_MSG_ERROR($enable_threads is an unknown thread package)
359 dnl Check whether the compiler supports the __thread keyword.
360 if test "x$use__thread" != xno; then
361 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
362 [cat > conftest.c <<\EOF
365 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
366 ac_cv_gcc___thread=yes
368 ac_cv_gcc___thread=no
371 if test "$ac_cv_gcc___thread" = yes; then
372 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
375 ac_cv_gcc___thread=no
379 dnl check if linear scan register allocator(lsra) should be used
380 AC_ARG_ENABLE([lsra], [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])])
382 AC_MSG_CHECKING(whether lsra should be supported)
383 if test x"$enable_lsra" = "xno"; then
387 AC_DEFINE([LSRA], 1, [use lsra])
391 dnl check for inlining
392 dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
394 dnl AC_MSG_CHECKING(whether method inlining should be disabled)
395 dnl if test x"$enable_inlining" = "xno"; then
396 dnl AC_MSG_RESULT(yes)
397 dnl AM_CONDITIONAL([USE_INLINING], [false])
399 dnl AC_MSG_RESULT(no)
400 AC_DEFINE([USE_INLINING], 1, [use method inlining])
401 AM_CONDITIONAL([USE_INLINING], [true])
405 dnl check for instruction scheduler
406 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
408 AC_MSG_CHECKING(whether instruction scheduler should be supported)
409 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
410 case "${ARCH_DIR}" in
414 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
419 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
420 AM_CONDITIONAL([USE_SCHEDULER], [true])
423 AM_CONDITIONAL([USE_SCHEDULER], [false])
427 dnl check if zlib should be used
428 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
430 AC_MSG_CHECKING(whether zip archives should be supported)
431 if test x"$enable_zlib" = "xno"; then
433 AM_CONDITIONAL([USE_ZLIB], [false])
436 AC_DEFINE([USE_ZLIB], 1, [use zlib])
437 AC_CHECK_HEADERS([zlib.h])
438 AC_CHECK_LIB(z, main)
439 AM_CONDITIONAL([USE_ZLIB], [true])
443 dnl check if CACAO should be linked statically
444 AC_ARG_ENABLE([staticvm], [AS_HELP_STRING(--enable-staticvm, link GNU classpath's native libraries statically into CACAO [[default=no]])])
446 AC_MSG_CHECKING(whether to link GNU classpath statically into CACAO)
447 if test x"$enable_staticvm" = "xyes"; then
448 ENABLE_STATICVM="yes"
453 if test x"${ENABLE_STATICVM}" = "xyes"; then
455 AM_CONDITIONAL([ENABLE_STATICVM], [true])
458 AM_CONDITIONAL([ENABLE_STATICVM], [false])
460 AC_SUBST(ENABLE_STATICVM)
463 dnl pass configure options to classpath
464 if test x"${ENABLE_STATICVM}" = "xyes"; then
465 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
466 AM_CONDITIONAL([ENABLE_STATICVM], [true])
468 dnl check for some classpath related stuff when we link statically
471 AM_CONDITIONAL([ENABLE_STATICVM], [false])
475 dnl is GNU classpath installed somewhere different
476 AC_ARG_WITH([classpath-install-dir], [AS_HELP_STRING(--with-classpath-install-dir=<dir>,installation directory of GNU classpath [[default=/usr/local/classpath]])])
478 AC_MSG_CHECKING(where GNU classpath is installed)
479 if test x"$with_classpath_install_dir" != "x"; then
480 if test x"$with_classpath_install_dir" = "xyes"; then
481 AC_MSG_ERROR(please specify the installation prefix)
483 CLASSPATH_INSTALL_DIR="$with_classpath_install_dir"
485 CLASSPATH_INSTALL_DIR="/usr/local/classpath"
487 AC_MSG_RESULT(${CLASSPATH_INSTALL_DIR})
488 AC_DEFINE_UNQUOTED([CLASSPATH_INSTALL_DIR], "${CLASSPATH_INSTALL_DIR}", [GNU classpath installation directory])
489 AC_SUBST(CLASSPATH_INSTALL_DIR)
492 dnl now configure subpackages
493 dnl the export is not my favorite (is there another way?)
495 if test x"${DISABLE_GC}" = "xno"; then
496 AC_CONFIG_SUBDIRS(src/boehm-gc)
499 if test x"${ENABLE_STATICVM}" = "xno"; then
500 AC_CONFIG_SUBDIRS(src/libltdl)
503 if test x"${ENABLE_INTRP}" = "xyes"; then
504 AC_CONFIG_SUBDIRS(src/libffi)
508 AC_CONFIG_FILES([Makefile]
510 [contrib/setenvinstalled]
511 [contrib/setenvsource]
513 [doc/handbook/Makefile]
517 [src/cacaoh/Makefile]
518 [src/fdlibm/Makefile]
521 [src/native/Makefile]
522 [src/native/include/Makefile]
523 [src/native/jvmti/Makefile]
524 [src/native/tools/Makefile]
525 [src/native/vm/Makefile]
526 [src/scripts/Makefile]
530 [src/scripts/rmiregistry]
531 [src/threads/Makefile]
532 [src/threads/green/Makefile]
533 [src/threads/native/Makefile]
534 [src/toolbox/Makefile]
536 [src/vm/jit/Makefile]
537 [src/vm/jit/alpha/Makefile]
538 [src/vm/jit/i386/Makefile]
539 [src/vm/jit/i386/linux/Makefile]
540 [src/vm/jit/i386/freebsd/Makefile]
541 [src/vm/jit/intrp/Makefile]
542 [src/vm/jit/inline/Makefile]
543 [src/vm/jit/loop/Makefile]
544 [src/vm/jit/mips/Makefile]
545 [src/vm/jit/mips/irix/Makefile]
546 [src/vm/jit/powerpc/Makefile]
547 [src/vm/jit/powerpc/darwin/Makefile]
548 [src/vm/jit/powerpc/linux/Makefile]
549 [src/vm/jit/schedule/Makefile]
550 [src/vm/jit/tools/Makefile]
551 [src/vm/jit/verify/Makefile]
552 [src/vm/jit/x86_64/Makefile]
554 [tests/codepatching/Makefile]
555 [tests/native/Makefile]
556 [tests/regression/Makefile])
563 ## indent-tabs-mode: t
566 ## compile-command: "automake --add-missing"