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 Checks for typedefs, structures, and compiler characteristics.
133 dnl Checks for library functions.
134 AC_PROG_GCC_TRADITIONAL
138 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
140 dnl Checks for libraries.
142 dnl Checking sizeof void *
143 AC_COMPILE_CHECK_SIZEOF(void *)
146 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
147 if test $ac_cv_func_mmap_fixed_mapped = yes; then
148 AC_CACHE_CHECK(whether MAP_FAILED is defined,
151 [#include <sys/mman.h>
155 ac_cv_map_failed=yes,
156 ac_cv_map_failed=no))
158 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
161 [#include <sys/mman.h>
165 ac_cv_map_anonymous=yes,
166 ac_cv_map_anonymous=no))
168 AC_CACHE_CHECK(whether MAP_ANON is defined,
171 [#include <sys/mman.h>
178 if test $ac_cv_map_failed = yes; then
179 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
182 if test $ac_cv_map_anonymous = yes; then
183 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
186 if test $ac_cv_map_anon = yes; then
187 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
192 dnl check which ld flags are required to export symbols
193 if test x"$with_gnu_ld" = "xyes"; then
194 EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
196 EXPORT_SYMBOLS_FLAGS=""
198 AC_SUBST(EXPORT_SYMBOLS_FLAGS)
201 dnl define install prefix
202 if test "x$prefix" = "xNONE"; then
203 CACAO_INSTALL_PREFIX=$ac_default_prefix
205 CACAO_INSTALL_PREFIX=$prefix
207 AC_DEFINE_UNQUOTED([CACAO_INSTALL_PREFIX], "${CACAO_INSTALL_PREFIX}", [Installation prefix])
208 AC_SUBST(CACAO_INSTALL_PREFIX)
215 dnl check for JIT compiler
216 AC_ARG_ENABLE([jit], [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])])
218 AC_MSG_CHECKING(whether JIT compiled should be compiled)
219 if test x"$enable_jit" = "xno"; then
221 AM_CONDITIONAL([ENABLE_JIT], [false])
224 AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
225 AM_CONDITIONAL([ENABLE_JIT], [true])
228 dnl check for interpreter
229 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
231 AC_MSG_CHECKING(whether interpreter should be compiled)
232 if test x"$enable_intrp" = "xyes"; then
234 AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
235 AM_CONDITIONAL([ENABLE_INTRP], [true])
239 AM_CONDITIONAL([ENABLE_INTRP], [false])
243 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
244 AC_ERROR(You have to enable at least the JIT or the interpreter.)
246 if test x"${ENABLE_JIT}" = "xyes" -a x"${ENABLE_INTRP}" = "xyes"; then
247 AC_ERROR(This is currently not supported. Please disable the JIT or the interpreter.)
250 dnl check for garbage collector usage
251 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])])
253 AC_MSG_CHECKING(whether GC should be used)
254 if test x"$enable_gc" = "xno"; then
256 AM_CONDITIONAL([DISABLE_GC], [true])
260 AM_CONDITIONAL([DISABLE_GC], [false])
264 dnl check for dump memory usage
265 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])])
267 AC_MSG_CHECKING(whether dump memory should be used)
268 if test x"$enable_dump" = "xno"; then
270 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
275 dnl check for statistics
276 AC_ARG_ENABLE([statistics], [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])])
278 AC_MSG_CHECKING(whether statistics generation should be enabled)
279 if test x"$enable_statistics" = "xno"; then
281 AM_CONDITIONAL([STATISTICS], [false])
284 AC_DEFINE([STATISTICS], 1, [use statistics])
285 AM_CONDITIONAL([STATISTICS], [true])
289 AC_ARG_ENABLE([jvmti], [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])])
291 AC_MSG_CHECKING(whether to compile JVMTI support)
292 if test x"$enable_jvmti" = "xyes"; then
294 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
295 AM_CONDITIONAL([ENABLE_JVMTI], [true])
298 AM_CONDITIONAL([ENABLE_JVMTI], [false])
303 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
304 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
306 AC_MSG_CHECKING(whether to include threads support)
307 enable_threads=${enable_threads:-native}
308 case "$enable_threads" in
311 dnl no threads for boehm
312 ac_configure_args="$ac_configure_args --disable-boehm-threads"
313 AM_CONDITIONAL([USE_THREADS], [false])
314 AM_CONDITIONAL([NATIVE_THREADS], [false])
317 green | native | posix | pthreads)
318 AC_DEFINE([USE_THREADS], 1, [use threads])
319 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
320 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
322 AM_CONDITIONAL([USE_THREADS], [true])
324 if test x"$enable_threads" != "xgreen"; then
325 AC_MSG_RESULT(yes, native)
326 AC_CHECK_LIB(pthread, main)
327 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
329 CFLAGS="$CFLAGS -D_REENTRANT"
331 dnl tell boehm to support threads as well
332 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-boehm-threads=posix"
333 AM_CONDITIONAL([NATIVE_THREADS], [true])
336 AC_MSG_RESULT(yes, green)
338 dnl no threads for boehm
339 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-boehm-threads"
340 AM_CONDITIONAL([NATIVE_THREADS], [false])
344 AC_MSG_ERROR($enable_threads is an unknown thread package)
349 dnl Check whether the compiler supports the __thread keyword.
350 if test "x$use__thread" != xno; then
351 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
352 [cat > conftest.c <<\EOF
355 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
356 ac_cv_gcc___thread=yes
358 ac_cv_gcc___thread=no
361 if test "$ac_cv_gcc___thread" = yes; then
362 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
365 ac_cv_gcc___thread=no
369 dnl check if linear scan register allocator(lsra) should be used
370 AC_ARG_ENABLE([lsra], [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])])
372 AC_MSG_CHECKING(whether lsra should be supported)
373 if test x"$enable_lsra" = "xno"; then
377 AC_DEFINE([LSRA], 1, [use lsra])
381 dnl check for inlining
382 dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
384 dnl AC_MSG_CHECKING(whether method inlining should be disabled)
385 dnl if test x"$enable_inlining" = "xno"; then
386 dnl AC_MSG_RESULT(yes)
387 dnl AM_CONDITIONAL([USE_INLINING], [false])
389 dnl AC_MSG_RESULT(no)
390 AC_DEFINE([USE_INLINING], 1, [use method inlining])
391 AM_CONDITIONAL([USE_INLINING], [true])
395 dnl check for instruction scheduler
396 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
398 AC_MSG_CHECKING(whether instruction scheduler should be supported)
399 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
400 case "${ARCH_DIR}" in
404 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
409 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
410 AM_CONDITIONAL([USE_SCHEDULER], [true])
413 AM_CONDITIONAL([USE_SCHEDULER], [false])
417 dnl check if zlib should be used
418 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
420 AC_MSG_CHECKING(whether zip archives should be supported)
421 if test x"$enable_zlib" = "xno"; then
423 AM_CONDITIONAL([USE_ZLIB], [false])
426 AC_DEFINE([USE_ZLIB], 1, [use zlib])
427 AC_CHECK_HEADERS([zlib.h])
428 AC_CHECK_LIB(z, main)
429 AM_CONDITIONAL([USE_ZLIB], [true])
433 dnl check if CACAO should be linked statically
434 AC_ARG_ENABLE([staticvm], [AS_HELP_STRING(--enable-staticvm, link GNU classpath's native libraries statically into CACAO [[default=no]])])
436 AC_MSG_CHECKING(whether to link GNU classpath statically into CACAO)
437 if test x"$enable_staticvm" = "xyes"; then
438 ENABLE_STATICVM="yes"
443 if test x"${ENABLE_STATICVM}" = "xyes"; then
445 AM_CONDITIONAL([ENABLE_STATICVM], [true])
448 AM_CONDITIONAL([ENABLE_STATICVM], [false])
450 AC_SUBST(ENABLE_STATICVM)
453 dnl check if we build gtk peers
454 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers [[default=yes]])])
456 AC_MSG_CHECKING(whether to compile GTK awt peers)
457 if test x"$enable_gtk_peer" = "xno"; then
459 AM_CONDITIONAL([USE_GTK_PEER], [false])
460 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-gtk-peer"
464 AC_DEFINE([USE_GTK], 1, [use gtk])
465 AM_CONDITIONAL([USE_GTK_PEER], [true])
468 AC_SUBST(USE_GTK_PEER)
471 dnl pass configure options to classpath
472 if test x"${ENABLE_STATICVM}" = "xyes"; then
473 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
474 AM_CONDITIONAL([ENABLE_STATICVM], [true])
475 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-static --disable-shared"
477 dnl check for some classpath related stuff when we link statically
480 dnl taken from GNU classpath configure.ac
481 if test x"${USE_GTK_PEER}" = "xyes"; then
482 AC_ERROR(XXX this is not supported yet)
484 if test "$no_x" = yes; then
485 AC_MSG_ERROR([GTK+ peers requested but no X library available])
487 dnl We explicitly want the XTest Extension for Robot support.
488 AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
489 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
491 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 libart-2.0 gdk-pixbuf-2.0)
496 AC_SUBST(CAIRO_CFLAGS)
497 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
498 AC_SUBST(PANGOFT2_LIBS)
499 AC_SUBST(PANGOFT2_CFLAGS)
502 AM_CONDITIONAL([ENABLE_STATICVM], [false])
503 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-static --enable-shared"
507 dnl should we use an external classpath installation
508 AC_ARG_WITH([external-classpath], [AS_HELP_STRING(--with-external-classpath=<dir>,installation directory of external GNU classpath [[default=no]])])
510 AC_MSG_CHECKING(whether to use an external GNU classpath)
511 if test x"$with_external_classpath" != "x"; then
512 if test x"$with_external_classpath" = "xyes"; then
513 AC_MSG_ERROR(please specify the installation prefix)
515 AC_MSG_RESULT($with_external_classpath)
516 AC_DEFINE([WITH_EXTERNAL_CLASSPATH], 1, [external classpath])
517 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [true])
518 EXTERNAL_CLASSPATH_PREFIX="$with_external_classpath"
519 AC_DEFINE_UNQUOTED([EXTERNAL_CLASSPATH_PREFIX], "${EXTERNAL_CLASSPATH_PREFIX}", [external classpath directory])
520 AC_SUBST(EXTERNAL_CLASSPATH_PREFIX)
523 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [false])
527 dnl set some essential classpath options, even if their classpath default is
529 ac_configure_args="$ac_configure_args --libdir=${CACAO_INSTALL_PREFIX}/jre/lib/${ARCH_DIR} --enable-jni --disable-cni --disable-regen-headers ${CONFIGURE_ARGS}"
531 dnl now configure subpackages
532 dnl the export is not my favorite (is there another way?)
534 if test x"${DISABLE_GC}" = "xno"; then
535 AC_CONFIG_SUBDIRS(src/boehm-gc)
538 AC_CONFIG_SUBDIRS(src/classpath)
540 if test x"${ENABLE_STATICVM}" = "xno"; then
541 AC_CONFIG_SUBDIRS(src/libltdl)
543 if test x"${ENABLE_INTRP}" = "xyes"; then
544 AC_CONFIG_SUBDIRS(src/libffi)
548 AC_CONFIG_FILES([Makefile]
551 [doc/handbook/Makefile]
555 [src/cacaoh/Makefile]
558 [src/native/Makefile]
559 [src/native/include/Makefile]
560 [src/native/jvmti/Makefile]
561 [src/native/tools/Makefile]
562 [src/native/vm/Makefile]
563 [src/scripts/Makefile]
567 [src/scripts/rmiregistry]
568 [src/threads/Makefile]
569 [src/threads/green/Makefile]
570 [src/threads/native/Makefile]
571 [src/toolbox/Makefile]
573 [src/vm/jit/Makefile]
574 [src/vm/jit/alpha/Makefile]
575 [src/vm/jit/i386/Makefile]
576 [src/vm/jit/i386/linux/Makefile]
577 [src/vm/jit/i386/freebsd/Makefile]
578 [src/vm/jit/intrp/Makefile]
579 [src/vm/jit/inline/Makefile]
580 [src/vm/jit/loop/Makefile]
581 [src/vm/jit/mips/Makefile]
582 [src/vm/jit/mips/irix/Makefile]
583 [src/vm/jit/powerpc/Makefile]
584 [src/vm/jit/powerpc/darwin/Makefile]
585 [src/vm/jit/powerpc/linux/Makefile]
586 [src/vm/jit/schedule/Makefile]
587 [src/vm/jit/tools/Makefile]
588 [src/vm/jit/verify/Makefile]
589 [src/vm/jit/x86_64/Makefile]
591 [tests/codepatching/Makefile]
592 [tests/native/Makefile]
593 [tests/regression/Makefile])
600 ## indent-tabs-mode: t
603 ## compile-command: "automake --add-missing"