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__"
28 i386 | i486 | i586 | i686 )
36 dnl for MIPSPro Compiler
37 dnl CFLAGS="-64 -OPT:Olimit=0 -woff 1110,1164,1515 -D__MIPS__ -D__MIPSEB__"
38 CFLAGS="-64 -OPT:Olimit=0 -D__MIPS__ -D__MIPSEB__"
39 dnl CFLAGS="-D__MIPS__ -D__MIPSEB__"
42 dnl CFLAGS="-mabi=64 -D__MIPS__ -D__MIPSEB__"
43 dnl LDFLAGS="-mabi=64"
48 CFLAGS="-D__POWERPC__"
59 CFLAGS="-D__XDSPCORE__"
63 AC_MSG_ERROR($host_cpu systems are not supported at this time)
68 dnl set optimization and debugging for all architectures and systems
69 CFLAGS="-O0 -g3 $CFLAGS"
75 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"
79 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__DARWIN__"
83 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__FREEBSD__ -D_XOPEN_SOURCE_EXTENDED"
87 CFLAGS="$CFLAGS -D__IRIX__"
94 dnl define and substitute some architecture specific variables
95 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [Architecture directory])
98 AC_SUBST(USE_SCHEDULER)
101 dnl Checks for programs.
113 AC_LIBLTDL_CONVENIENCE
117 dnl Checks for header files.
120 AC_CHECK_HEADERS([fcntl.h])
121 AC_CHECK_HEADERS([sys/time.h])
122 AC_CHECK_HEADERS([unistd.h])
123 AC_CHECK_HEADERS([sys/ioctl.h])
125 dnl Checks for typedefs, structures, and compiler characteristics.
134 dnl Checks for library functions.
135 AC_PROG_GCC_TRADITIONAL
139 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
141 dnl Checks for libraries.
143 dnl Checking sizeof void *
144 AC_COMPILE_CHECK_SIZEOF(void *)
147 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
148 if test $ac_cv_func_mmap_fixed_mapped = yes; then
149 AC_CACHE_CHECK(whether MAP_FAILED is defined,
152 [#include <sys/mman.h>
156 ac_cv_map_failed=yes,
157 ac_cv_map_failed=no))
159 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
162 [#include <sys/mman.h>
166 ac_cv_map_anonymous=yes,
167 ac_cv_map_anonymous=no))
169 AC_CACHE_CHECK(whether MAP_ANON is defined,
172 [#include <sys/mman.h>
179 if test $ac_cv_map_failed = yes; then
180 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
183 if test $ac_cv_map_anonymous = yes; then
184 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
187 if test $ac_cv_map_anon = yes; then
188 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
193 dnl check which ld flags are required to export symbols
194 if test x"$with_gnu_ld" = "xyes"; then
195 EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
197 EXPORT_SYMBOLS_FLAGS=""
199 AC_SUBST(EXPORT_SYMBOLS_FLAGS)
202 dnl define install prefix
203 if test "x$prefix" = "xNONE"; then
204 CACAO_INSTALL_PREFIX=$ac_default_prefix
206 CACAO_INSTALL_PREFIX=$prefix
208 AC_DEFINE_UNQUOTED([CACAO_INSTALL_PREFIX], "${CACAO_INSTALL_PREFIX}", [Installation prefix])
209 AC_SUBST(CACAO_INSTALL_PREFIX)
216 dnl check for garbage collector usage
217 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])])
219 AC_MSG_CHECKING(whether GC should be used)
220 if test x"$enable_gc" = "xno"; then
222 AM_CONDITIONAL([DISABLE_GC], [true])
225 AM_CONDITIONAL([DISABLE_GC], [false])
228 dnl check for dump memory usage
229 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])])
231 AC_MSG_CHECKING(whether dump memory should be used)
232 if test x"$enable_dump" = "xno"; then
234 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
239 dnl check for statistics
240 AC_ARG_ENABLE([statistics], [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])])
242 AC_MSG_CHECKING(whether statistics generation should be enabled)
243 if test x"$enable_statistics" = "xno"; then
245 AM_CONDITIONAL([STATISTICS], [false])
248 AC_DEFINE([STATISTICS], 1, [use statistics])
249 AM_CONDITIONAL([STATISTICS], [true])
253 AC_ARG_ENABLE([jvmti], [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])])
255 AC_MSG_CHECKING(whether to compile JVMTI support)
256 if test x"$enable_jvmti" = "xyes"; then
258 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
259 AM_CONDITIONAL([ENABLE_JVMTI], [true])
262 AM_CONDITIONAL([ENABLE_JVMTI], [false])
267 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
268 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
270 AC_MSG_CHECKING(whether to include threads support)
271 enable_threads=${enable_threads:-native}
272 case "$enable_threads" in
275 dnl no threads for boehm
276 ac_configure_args="$ac_configure_args --disable-boehm-threads"
277 AM_CONDITIONAL([USE_THREADS], [false])
278 AM_CONDITIONAL([NATIVE_THREADS], [false])
281 green | native | posix | pthreads)
282 AC_DEFINE([USE_THREADS], 1, [use threads])
283 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
284 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
286 AM_CONDITIONAL([USE_THREADS], [true])
288 if test x"$enable_threads" != "xgreen"; then
289 AC_MSG_RESULT(yes, native)
290 AC_CHECK_LIB(pthread, main)
291 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
293 CFLAGS="$CFLAGS -D_REENTRANT"
295 dnl tell boehm to support threads as well
296 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-boehm-threads=posix"
297 AM_CONDITIONAL([NATIVE_THREADS], [true])
300 AC_MSG_RESULT(yes, green)
302 dnl no threads for boehm
303 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-boehm-threads"
304 AM_CONDITIONAL([NATIVE_THREADS], [false])
308 AC_MSG_ERROR($enable_threads is an unknown thread package)
313 dnl Check whether the compiler supports the __thread keyword.
314 if test "x$use__thread" != xno; then
315 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
316 [cat > conftest.c <<\EOF
319 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
320 ac_cv_gcc___thread=yes
322 ac_cv_gcc___thread=no
325 if test "$ac_cv_gcc___thread" = yes; then
326 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
329 ac_cv_gcc___thread=no
333 dnl check if linear scan register allocator(lsra) should be used
334 AC_ARG_ENABLE([lsra], [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])])
336 AC_MSG_CHECKING(whether lsra should be supported)
337 if test x"$enable_lsra" = "xno"; then
341 AC_DEFINE([LSRA], 1, [use lsra])
345 dnl check for inlining
346 dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
348 dnl AC_MSG_CHECKING(whether method inlining should be disabled)
349 dnl if test x"$enable_inlining" = "xno"; then
350 dnl AC_MSG_RESULT(yes)
351 dnl AM_CONDITIONAL([USE_INLINING], [false])
353 dnl AC_MSG_RESULT(no)
354 AC_DEFINE([USE_INLINING], 1, [use method inlining])
355 AM_CONDITIONAL([USE_INLINING], [true])
359 dnl check for instruction scheduler
360 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
362 AC_MSG_CHECKING(whether instruction scheduler should be supported)
363 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
364 case "${ARCH_DIR}" in
368 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
373 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
374 AM_CONDITIONAL([USE_SCHEDULER], [true])
377 AM_CONDITIONAL([USE_SCHEDULER], [false])
381 dnl check if zlib should be used
382 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
384 AC_MSG_CHECKING(whether zip archives should be supported)
385 if test x"$enable_zlib" = "xno"; then
387 AM_CONDITIONAL([USE_ZLIB], [false])
390 AC_DEFINE([USE_ZLIB], 1, [use zlib])
391 AC_CHECK_HEADERS([zlib.h])
392 AC_CHECK_LIB(z, main)
393 AM_CONDITIONAL([USE_ZLIB], [true])
397 dnl check if CACAO should be linked statically
398 AC_ARG_ENABLE([staticvm], [AS_HELP_STRING(--enable-staticvm, link GNU classpath's native libraries statically into CACAO [[default=no]])])
400 AC_MSG_CHECKING(whether to link GNU classpath statically into CACAO)
401 if test x"$enable_staticvm" = "xyes"; then
405 if test x"${ENABLE_STATICVM}" = "x1"; then
407 AM_CONDITIONAL([ENABLE_STATICVM], [true])
410 AM_CONDITIONAL([ENABLE_STATICVM], [false])
412 AC_SUBST(ENABLE_STATICVM)
415 dnl check if we build gtk peers
416 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers [[default=yes]])])
418 AC_MSG_CHECKING(whether to compile GTK awt peers)
419 if test x"$enable_gtk_peer" = "xno"; then
421 AM_CONDITIONAL([USE_GTK_PEER], [false])
422 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-gtk-peer"
426 AC_DEFINE([USE_GTK], 1, [use gtk])
427 AM_CONDITIONAL([USE_GTK_PEER], [true])
430 AC_SUBST(USE_GTK_PEER)
433 dnl pass configure options to classpath
434 if test x"${ENABLE_STATICVM}" = "x1"; then
435 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
436 AM_CONDITIONAL([ENABLE_STATICVM], [true])
437 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-static --disable-shared"
439 dnl check for some classpath related stuff when we link statically
442 dnl taken from GNU classpath configure.ac
443 if test x"${USE_GTK_PEER}" = "xyes"; then
444 AC_ERROR(XXX this is not supported yet)
446 if test "$no_x" = yes; then
447 AC_MSG_ERROR([GTK+ peers requested but no X library available])
449 dnl We explicitly want the XTest Extension for Robot support.
450 AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
451 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
453 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 libart-2.0 gdk-pixbuf-2.0)
458 AC_SUBST(CAIRO_CFLAGS)
459 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
460 AC_SUBST(PANGOFT2_LIBS)
461 AC_SUBST(PANGOFT2_CFLAGS)
464 AM_CONDITIONAL([ENABLE_STATICVM], [false])
465 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-static --enable-shared"
469 dnl should we use an external classpath installation
470 AC_ARG_WITH([external-classpath], [AS_HELP_STRING(--with-external-classpath=<dir>,installation directory of external GNU classpath [[default=no]])])
472 AC_MSG_CHECKING(whether to use an external GNU classpath)
473 if test x"$with_external_classpath" != "x"; then
474 if test x"$with_external_classpath" = "xyes"; then
475 AC_MSG_ERROR(please specify the installation prefix)
477 AC_MSG_RESULT($with_external_classpath)
478 AC_DEFINE([WITH_EXTERNAL_CLASSPATH], 1, [external classpath])
479 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [true])
480 EXTERNAL_CLASSPATH_PREFIX="$with_external_classpath"
481 AC_DEFINE_UNQUOTED([EXTERNAL_CLASSPATH_PREFIX], "${EXTERNAL_CLASSPATH_PREFIX}", [external classpath directory])
482 AC_SUBST(EXTERNAL_CLASSPATH_PREFIX)
485 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [false])
489 dnl set some essential classpath options, even if their classpath default is
491 ac_configure_args="$ac_configure_args --libdir=${CACAO_INSTALL_PREFIX}/jre/lib/${ARCH_DIR} --enable-jni --disable-cni --disable-regen-headers ${CONFIGURE_ARGS}"
494 dnl now configure boehm gc and gnu classpath
495 dnl the export is not my favorite (is there another way?)
497 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath src/libltdl)
500 AC_CONFIG_FILES([Makefile]
503 [doc/handbook/Makefile]
507 [src/cacaoh/Makefile]
510 [src/native/Makefile]
511 [src/native/include/Makefile]
512 [src/native/jvmti/Makefile]
513 [src/native/tools/Makefile]
514 [src/native/vm/Makefile]
515 [src/scripts/Makefile]
520 [src/scripts/rmiregistry]
521 [src/threads/Makefile]
522 [src/threads/green/Makefile]
523 [src/threads/native/Makefile]
524 [src/toolbox/Makefile]
526 [src/vm/jit/Makefile]
527 [src/vm/jit/alpha/Makefile]
528 [src/vm/jit/arm/Makefile]
529 [src/vm/jit/i386/Makefile]
530 [src/vm/jit/i386/linux/Makefile]
531 [src/vm/jit/i386/freebsd/Makefile]
532 [src/vm/jit/inline/Makefile]
533 [src/vm/jit/loop/Makefile]
534 [src/vm/jit/mips/Makefile]
535 [src/vm/jit/powerpc/Makefile]
536 [src/vm/jit/powerpc/darwin/Makefile]
537 [src/vm/jit/powerpc/linux/Makefile]
538 [src/vm/jit/schedule/Makefile]
539 [src/vm/jit/tools/Makefile]
540 [src/vm/jit/verify/Makefile]
541 [src/vm/jit/x86_64/Makefile]
543 [tests/codepatching/Makefile]
544 [tests/native/Makefile]
545 [tests/regression/Makefile])
552 ## indent-tabs-mode: t
555 ## compile-command: "automake --add-missing"