1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(cacao, 0.90, cacao@complang.tuwien.ac.at)
4 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
9 AM_CONFIG_HEADER([config.h])
11 AC_PREFIX_DEFAULT(/usr/local/cacao)
19 CFLAGS="-mieee -D__ALPHA__"
22 i386* | i486* | i586* | i686* )
25 CFLAGS="-D__I386__ $CFLAGS"
32 dnl for MIPSPro Compiler
33 dnl CFLAGS="-64 -O0 -g3 -OPT:Olimit=0 -woff 1110,1164,1515 -D__MIPS__ -D__MIPSEB__"
34 CFLAGS="-64 -O0 -g3 -D__MIPS__ -D__MIPSEB__"
37 dnl CFLAGS="-O0 -mabi=64 -g3 -D__MIPS__ -D__MIPSEB__"
38 dnl LDFLAGS="-mabi=64"
44 CFLAGS="-D__POWERPC__"
54 AC_MSG_ERROR($host_cpu systems are not supported at this time)
60 CFLAGS="-ansi -pedantic -Wall -Wno-long-long -O0 -g3 $CFLAGS -D__LINUX__ -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
63 CFLAGS="-ansi -pedantic -Wall -Wno-long-long -O0 -g3 $CFLAGS -D__DARWIN__"
66 CFLAGS="$CFLAGS -D__IRIX__"
72 dnl define install prefix
73 if test "x$prefix" = xNONE; then
74 CFLAGS="$CFLAGS -DINSTALL_PREFIX=\"\\\"$ac_default_prefix\\\"\""
76 CFLAGS="$CFLAGS -DINSTALL_PREFIX=\"\\\"$prefix\\\"\""
80 AC_DEFINE_UNQUOTED([ARCH_DIR], "$ARCH_DIR", [Architecture directory])
83 AC_ARG_ENABLE([dynamicclasspath], [AS_HELP_STRING(--disable-dynamicclasspath, link classpath native code static even on platforms supporting dynamic loading)], [use_dynamicclasspath=$enableval], [use_dynamicclasspath=yes])
84 dnl force static classpath linking ??
85 AC_MSG_CHECKING(Link classpath static)
86 if test "xno" == "x$use_dynamicclasspath"; then
90 if test "$STATIC_CLASSPATH" == "1"; then
95 AC_SUBST(STATIC_CLASSPATH)
97 dnl Checks for programs.
106 dnl Checks for header files.
109 AC_CHECK_HEADERS([fcntl.h])
110 AC_CHECK_HEADERS([sys/time.h])
111 AC_CHECK_HEADERS([unistd.h])
112 AC_CHECK_HEADERS([sys/ioctl.h])
114 dnl Checks for typedefs, structures, and compiler characteristics.
122 dnl Checks for library functions.
123 AC_PROG_GCC_TRADITIONAL
127 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
129 dnl Checks for libraries.
130 AC_CHECK_LIB(m, fmod)
132 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
133 if test $ac_cv_func_mmap_fixed_mapped = yes; then
134 AC_CACHE_CHECK(whether MAP_FAILED is defined,
137 [#include <sys/mman.h>
141 ac_cv_map_failed=yes,
142 ac_cv_map_failed=no))
144 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
147 [#include <sys/mman.h>
151 ac_cv_map_anonymous=yes,
152 ac_cv_map_anonymous=no))
154 AC_CACHE_CHECK(whether MAP_ANON is defined,
157 [#include <sys/mman.h>
164 if test $ac_cv_map_failed = yes; then
165 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
168 if test $ac_cv_map_anonymous = yes; then
169 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
172 if test $ac_cv_map_anon = yes; then
173 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
181 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
182 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--disable-__thread,do not use TLS features even when supporting them)], [use__thread=$enableval], [use__thread=yes])
186 AC_MSG_CHECKING(whether to include threads support)
187 enable_threads=${enable_threads:-native}
188 case "$enable_threads" in
191 dnl no threads for boehm
192 ac_configure_args="$ac_configure_args --disable-boehm-threads"
193 AM_CONDITIONAL([USE_THREADS], [false])
194 AM_CONDITIONAL([NATIVE_THREADS], [false])
197 green | native | posix | pthreads)
198 AC_DEFINE([USE_THREADS], 1, [use threads])
199 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
200 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
202 AM_CONDITIONAL([USE_THREADS], [true])
204 if test x"$enable_threads" != "xgreen"; then
205 AC_MSG_RESULT(yes, native)
206 AC_CHECK_LIB(pthread, main)
207 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
209 CFLAGS="$CFLAGS -D_REENTRANT"
211 dnl tell boehm to support threads as well and classpath to
212 dnl synchronize VM threads portably
213 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync"
214 AM_CONDITIONAL([NATIVE_THREADS], [true])
217 AC_MSG_RESULT(yes, green)
219 dnl no threads for boehm
220 ac_configure_args="$ac_configure_args --disable-boehm-threads"
221 AM_CONDITIONAL([NATIVE_THREADS], [false])
225 AC_MSG_ERROR($enable_threads is an unknown thread package)
230 dnl Check whether the compiler supports the __thread keyword.
231 if test "x$use__thread" != xno; then
232 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
233 [cat > conftest.c <<\EOF
236 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
237 ac_cv_gcc___thread=yes
239 ac_cv_gcc___thread=no
242 if test "$ac_cv_gcc___thread" = yes; then
243 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
246 ac_cv_gcc___thread=no
250 dnl check if zlib should be used
251 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
253 AC_MSG_CHECKING(whether zip archives should be supported)
254 if test x"$enable_zlib" = "xno"; then
256 AM_CONDITIONAL([USE_ZLIB], [false])
259 AC_DEFINE([USE_ZLIB], 1, [use zlib])
260 AC_CHECK_HEADERS([zlib.h])
261 AC_CHECK_LIB(z, main)
262 AM_CONDITIONAL([USE_ZLIB], [true])
267 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])])
271 AC_MSG_CHECKING(whether to use gtk awt peers)
272 if test x"$enable_gtk_peer" = "xyes"; then
274 AC_DEFINE([USE_GTK], 1, [use gtk])
275 AM_CONDITIONAL([USE_GTK_PEER], [true])
279 ac_configure_args="$ac_configure_args --disable-gtk-peer"
280 AM_CONDITIONAL([USE_GTK_PEER], [false])
284 if test "x1" == "x$STATIC_CLASSPATH"; then
285 AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked])
286 AM_CONDITIONAL([STATIC_CLASSPATH], [true])
289 AM_CONDITIONAL([STATIC_CLASSPATH], [false])
293 dnl set some essential classpath options, even if their classpath default is
295 ac_configure_args="$ac_configure_args --enable-jni --disable-cni --disable-regen-headers --enable-static --enable-shared --enable-load-library"
298 dnl now configure boehm gc and gnu classpath
299 dnl the export is not my favorite (is there another way?)
301 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath)
306 doc/handbook/Makefile \
310 src/cacaoh/Makefile \
312 src/native/Makefile \
313 src/native/include/Makefile \
314 src/native/tools/Makefile \
315 src/native/vm/Makefile \
316 src/threads/Makefile \
317 src/threads/green/Makefile \
318 src/threads/native/Makefile \
319 src/toolbox/Makefile \
321 src/vm/jit/Makefile \
322 src/vm/jit/alpha/Makefile \
323 src/vm/jit/i386/Makefile \
324 src/vm/jit/inline/Makefile \
325 src/vm/jit/loop/Makefile \
326 src/vm/jit/mips/Makefile \
327 src/vm/jit/powerpc/Makefile \
328 src/vm/jit/tools/Makefile \
329 src/vm/jit/verify/Makefile \
330 src/vm/jit/x86_64/Makefile \
332 tests/jvm98/Makefile \
333 tests/kaffe/Makefile )
338 ## indent-tabs-mode: t
341 ## compile-command: "automake --add-missing"