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__"
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 garbage collector usage
216 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])])
218 AC_MSG_CHECKING(whether GC should be used)
219 if test x"$enable_gc" = "xno"; then
221 AM_CONDITIONAL([DISABLE_GC], [true])
224 AM_CONDITIONAL([DISABLE_GC], [false])
227 dnl check for dump memory usage
228 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])])
230 AC_MSG_CHECKING(whether dump memory should be used)
231 if test x"$enable_dump" = "xno"; then
233 AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
238 dnl check for statistics
239 AC_ARG_ENABLE([statistics], [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])])
241 AC_MSG_CHECKING(whether statistics generation should be enabled)
242 if test x"$enable_statistics" = "xno"; then
244 AM_CONDITIONAL([STATISTICS], [false])
247 AC_DEFINE([STATISTICS], 1, [use statistics])
248 AM_CONDITIONAL([STATISTICS], [true])
252 AC_ARG_ENABLE([jvmti], [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])])
254 AC_MSG_CHECKING(whether to compile JVMTI support)
255 if test x"$enable_jvmti" = "xyes"; then
257 AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
258 AM_CONDITIONAL([ENABLE_JVMTI], [true])
261 AM_CONDITIONAL([ENABLE_JVMTI], [false])
266 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
267 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
269 AC_MSG_CHECKING(whether to include threads support)
270 enable_threads=${enable_threads:-native}
271 case "$enable_threads" in
274 dnl no threads for boehm
275 ac_configure_args="$ac_configure_args --disable-boehm-threads"
276 AM_CONDITIONAL([USE_THREADS], [false])
277 AM_CONDITIONAL([NATIVE_THREADS], [false])
280 green | native | posix | pthreads)
281 AC_DEFINE([USE_THREADS], 1, [use threads])
282 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
283 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
285 AM_CONDITIONAL([USE_THREADS], [true])
287 if test x"$enable_threads" != "xgreen"; then
288 AC_MSG_RESULT(yes, native)
289 AC_CHECK_LIB(pthread, main)
290 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
292 CFLAGS="$CFLAGS -D_REENTRANT"
294 dnl tell boehm to support threads as well
295 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-boehm-threads=posix"
296 AM_CONDITIONAL([NATIVE_THREADS], [true])
299 AC_MSG_RESULT(yes, green)
301 dnl no threads for boehm
302 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-boehm-threads"
303 AM_CONDITIONAL([NATIVE_THREADS], [false])
307 AC_MSG_ERROR($enable_threads is an unknown thread package)
312 dnl Check whether the compiler supports the __thread keyword.
313 if test "x$use__thread" != xno; then
314 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
315 [cat > conftest.c <<\EOF
318 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
319 ac_cv_gcc___thread=yes
321 ac_cv_gcc___thread=no
324 if test "$ac_cv_gcc___thread" = yes; then
325 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
328 ac_cv_gcc___thread=no
332 dnl check if linear scan register allocator(lsra) should be used
333 AC_ARG_ENABLE([lsra], [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])])
335 AC_MSG_CHECKING(whether lsra should be supported)
336 if test x"$enable_lsra" = "xno"; then
340 AC_DEFINE([LSRA], 1, [use lsra])
344 dnl check for inlining
345 dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
347 dnl AC_MSG_CHECKING(whether method inlining should be disabled)
348 dnl if test x"$enable_inlining" = "xno"; then
349 dnl AC_MSG_RESULT(yes)
350 dnl AM_CONDITIONAL([USE_INLINING], [false])
352 dnl AC_MSG_RESULT(no)
353 AC_DEFINE([USE_INLINING], 1, [use method inlining])
354 AM_CONDITIONAL([USE_INLINING], [true])
358 dnl check for instruction scheduler
359 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
361 AC_MSG_CHECKING(whether instruction scheduler should be supported)
362 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
363 case "${ARCH_DIR}" in
367 AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
372 AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
373 AM_CONDITIONAL([USE_SCHEDULER], [true])
376 AM_CONDITIONAL([USE_SCHEDULER], [false])
380 dnl check if zlib should be used
381 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
383 AC_MSG_CHECKING(whether zip archives should be supported)
384 if test x"$enable_zlib" = "xno"; then
386 AM_CONDITIONAL([USE_ZLIB], [false])
389 AC_DEFINE([USE_ZLIB], 1, [use zlib])
390 AC_CHECK_HEADERS([zlib.h])
391 AC_CHECK_LIB(z, main)
392 AM_CONDITIONAL([USE_ZLIB], [true])
396 dnl check if CACAO should be linked statically
397 AC_ARG_ENABLE([staticvm], [AS_HELP_STRING(--enable-staticvm, link GNU classpath's native libraries statically into CACAO [[default=no]])])
399 AC_MSG_CHECKING(whether to link GNU classpath statically into CACAO)
400 if test x"$enable_staticvm" = "xyes"; then
404 if test x"${ENABLE_STATICVM}" = "x1"; then
406 AM_CONDITIONAL([ENABLE_STATICVM], [true])
409 AM_CONDITIONAL([ENABLE_STATICVM], [false])
411 AC_SUBST(ENABLE_STATICVM)
414 dnl check if we build gtk peers
415 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers [[default=yes]])])
417 AC_MSG_CHECKING(whether to compile GTK awt peers)
418 if test x"$enable_gtk_peer" = "xno"; then
420 AM_CONDITIONAL([USE_GTK_PEER], [false])
421 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-gtk-peer"
425 AC_DEFINE([USE_GTK], 1, [use gtk])
426 AM_CONDITIONAL([USE_GTK_PEER], [true])
429 AC_SUBST(USE_GTK_PEER)
432 dnl pass configure options to classpath
433 if test x"${ENABLE_STATICVM}" = "x1"; then
434 AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
435 AM_CONDITIONAL([ENABLE_STATICVM], [true])
436 CONFIGURE_ARGS="${CONFIGURE_ARGS} --enable-static --disable-shared"
438 dnl check for some classpath related stuff when we link statically
441 dnl taken from GNU classpath configure.ac
442 if test x"${USE_GTK_PEER}" = "xyes"; then
443 AC_ERROR(XXX this is not supported yet)
445 if test "$no_x" = yes; then
446 AC_MSG_ERROR([GTK+ peers requested but no X library available])
448 dnl We explicitly want the XTest Extension for Robot support.
449 AC_CHECK_LIB([Xtst], [XTestQueryExtension], [true],
450 [AC_MSG_ERROR([libXtst NOT found, required for GdkRobot])],
452 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gthread-2.0 >= 2.2 libart-2.0 gdk-pixbuf-2.0)
457 AC_SUBST(CAIRO_CFLAGS)
458 PKG_CHECK_MODULES(PANGOFT2, pangoft2)
459 AC_SUBST(PANGOFT2_LIBS)
460 AC_SUBST(PANGOFT2_CFLAGS)
463 AM_CONDITIONAL([ENABLE_STATICVM], [false])
464 CONFIGURE_ARGS="${CONFIGURE_ARGS} --disable-static --enable-shared"
468 dnl should we use an external classpath installation
469 AC_ARG_WITH([external-classpath], [AS_HELP_STRING(--with-external-classpath=<dir>,installation directory of external GNU classpath [[default=no]])])
471 AC_MSG_CHECKING(whether to use an external GNU classpath)
472 if test x"$with_external_classpath" != "x"; then
473 if test x"$with_external_classpath" = "xyes"; then
474 AC_MSG_ERROR(please specify the installation prefix)
476 AC_MSG_RESULT($with_external_classpath)
477 AC_DEFINE([WITH_EXTERNAL_CLASSPATH], 1, [external classpath])
478 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [true])
479 EXTERNAL_CLASSPATH_PREFIX="$with_external_classpath"
480 AC_DEFINE_UNQUOTED([EXTERNAL_CLASSPATH_PREFIX], "${EXTERNAL_CLASSPATH_PREFIX}", [external classpath directory])
481 AC_SUBST(EXTERNAL_CLASSPATH_PREFIX)
484 AM_CONDITIONAL([WITH_EXTERNAL_CLASSPATH], [false])
488 dnl set some essential classpath options, even if their classpath default is
490 ac_configure_args="$ac_configure_args --libdir=${CACAO_INSTALL_PREFIX}/jre/lib/${ARCH_DIR} --enable-jni --disable-cni --disable-regen-headers ${CONFIGURE_ARGS}"
493 dnl now configure boehm gc and gnu classpath
494 dnl the export is not my favorite (is there another way?)
496 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath src/libltdl)
499 AC_CONFIG_FILES([Makefile]
502 [doc/handbook/Makefile]
506 [src/cacaoh/Makefile]
509 [src/native/Makefile]
510 [src/native/include/Makefile]
511 [src/native/jvmti/Makefile]
512 [src/native/tools/Makefile]
513 [src/native/vm/Makefile]
514 [src/scripts/Makefile]
519 [src/scripts/rmiregistry]
520 [src/threads/Makefile]
521 [src/threads/green/Makefile]
522 [src/threads/native/Makefile]
523 [src/toolbox/Makefile]
525 [src/vm/jit/Makefile]
526 [src/vm/jit/alpha/Makefile]
527 [src/vm/jit/arm/Makefile]
528 [src/vm/jit/i386/Makefile]
529 [src/vm/jit/i386/linux/Makefile]
530 [src/vm/jit/i386/freebsd/Makefile]
531 [src/vm/jit/inline/Makefile]
532 [src/vm/jit/loop/Makefile]
533 [src/vm/jit/mips/Makefile]
534 [src/vm/jit/mips/irix/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"