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)
13 dnl define install prefix
14 CFLAGS="-DINSTALL_PREFIX=\"\\\"$prefix\\\"\""
22 CFLAGS="-mieee -D__ALPHA__"
25 i386* | i486* | i586* | i686* )
34 CFLAGS="-64 -O2 -OPT:Olimit=0 -g -woff 1110,1164,1515 -D__MIPS__"
41 CFLAGS="-D__POWERPC__"
47 CFLAGS="$CFLAGS -D__X86_64__"
51 AC_MSG_ERROR($host_cpu systems are not supported at this time)
57 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"
60 CFLAGS="-ansi -pedantic -Wall -Wno-long-long -O0 -g3 $CFLAGS -D__DARWIN__"
63 CFLAGS="$CFLAGS -D__IRIX__"
70 AC_DEFINE_UNQUOTED([ARCH_DIR], "$ARCH_DIR", [Architecture directory])
73 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])
74 dnl force static classpath linking ??
75 AC_MSG_CHECKING(Link classpath static)
76 if test "xno" == "x$use_dynamicclasspath"; then
80 if test "$STATIC_CLASSPATH" == "1"; then
85 AC_SUBST(STATIC_CLASSPATH)
87 dnl Checks for programs.
93 dnl Checks for header files.
96 AC_CHECK_HEADERS([fcntl.h])
97 AC_CHECK_HEADERS([sys/time.h])
98 AC_CHECK_HEADERS([unistd.h])
99 AC_CHECK_HEADERS([sys/ioctl.h])
101 dnl Checks for typedefs, structures, and compiler characteristics.
109 dnl Checks for library functions.
110 AC_PROG_GCC_TRADITIONAL
114 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
116 dnl Checks for libraries.
117 AC_CHECK_LIB(m, fmod)
119 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
120 if test $ac_cv_func_mmap_fixed_mapped = yes; then
121 AC_CACHE_CHECK(whether MAP_FAILED is defined,
124 [#include <sys/mman.h>
128 ac_cv_map_failed=yes,
129 ac_cv_map_failed=no))
131 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
134 [#include <sys/mman.h>
138 ac_cv_map_anonymous=yes,
139 ac_cv_map_anonymous=no))
141 AC_CACHE_CHECK(whether MAP_ANON is defined,
144 [#include <sys/mman.h>
151 if test $ac_cv_map_failed = yes; then
152 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
155 if test $ac_cv_map_anonymous = yes; then
156 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
159 if test $ac_cv_map_anon = yes; then
160 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
168 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
169 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--disable-__thread,do not use TLS features even when supporting them)], [use__thread=$enableval], [use__thread=yes])
173 AC_MSG_CHECKING(whether to include threads support)
174 enable_threads=${enable_threads:-native}
175 case "$enable_threads" in
178 dnl no threads for boehm
179 ac_configure_args="$ac_configure_args --disable-boehm-threads"
180 AM_CONDITIONAL([USE_THREADS], [false])
181 AM_CONDITIONAL([NATIVE_THREADS], [false])
184 green | native | posix | pthreads)
185 AC_DEFINE([USE_THREADS], 1, [use threads])
186 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
187 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
189 AM_CONDITIONAL([USE_THREADS], [true])
191 if test x"$enable_threads" != "xgreen"; then
192 AC_MSG_RESULT(yes, native)
193 AC_CHECK_LIB(pthread, main)
194 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
196 CFLAGS="$CFLAGS -D_REENTRANT"
198 dnl tell boehm to support threads as well and classpath to
199 dnl synchronize VM threads portably
200 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync"
201 AM_CONDITIONAL([NATIVE_THREADS], [true])
204 AC_MSG_RESULT(yes, green)
206 dnl no threads for boehm
207 ac_configure_args="$ac_configure_args --disable-boehm-threads"
208 AM_CONDITIONAL([NATIVE_THREADS], [false])
212 AC_MSG_ERROR($enable_threads is an unknown thread package)
217 dnl Check whether the compiler supports the __thread keyword.
218 if test "x$use__thread" != xno; then
219 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
220 [cat > conftest.c <<\EOF
223 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
224 ac_cv_gcc___thread=yes
226 ac_cv_gcc___thread=no
229 if test "$ac_cv_gcc___thread" = yes; then
230 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
233 ac_cv_gcc___thread=no
237 dnl check if zlib should be used
238 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
240 AC_MSG_CHECKING(whether zip archives should be supported)
241 if test x"$enable_zlib" = "xno"; then
243 AM_CONDITIONAL([USE_ZLIB], [false])
246 AC_DEFINE([USE_ZLIB], 1, [use zlib])
247 AC_CHECK_HEADERS([zlib.h])
248 AC_CHECK_LIB(z, main)
249 AM_CONDITIONAL([USE_ZLIB], [true])
254 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])])
258 AC_MSG_CHECKING(whether to use gtk awt peers)
259 if test x"$enable_gtk_peer" = "xyes"; then
261 AC_DEFINE([USE_GTK], 1, [use gtk])
262 AM_CONDITIONAL([USE_GTK_PEER], [true])
266 ac_configure_args="$ac_configure_args --disable-gtk-peer"
267 AM_CONDITIONAL([USE_GTK_PEER], [false])
271 if test "x1" == "x$STATIC_CLASSPATH"; then
272 AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked])
273 AM_CONDITIONAL([STATIC_CLASSPATH], [true])
276 AM_CONDITIONAL([STATIC_CLASSPATH], [false])
280 dnl set some essential classpath options, even if their classpath default is
282 ac_configure_args="$ac_configure_args --enable-jni --disable-cni --disable-regen-headers --enable-static --enable-shared --enable-load-library"
285 dnl now configure boehm gc and gnu classpath
286 dnl the export is not my favorite (is there another way?)
288 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath)
293 doc/handbook/Makefile \
297 src/cacaoh/Makefile \
299 src/native/Makefile \
300 src/native/include/Makefile \
301 src/native/tools/Makefile \
302 src/native/vm/Makefile \
303 src/threads/Makefile \
304 src/threads/green/Makefile \
305 src/threads/native/Makefile \
306 src/toolbox/Makefile \
308 src/vm/jit/Makefile \
309 src/vm/jit/alpha/Makefile \
310 src/vm/jit/i386/Makefile \
311 src/vm/jit/inline/Makefile \
312 src/vm/jit/loop/Makefile \
313 src/vm/jit/mips/Makefile \
314 src/vm/jit/powerpc/Makefile \
315 src/vm/jit/tools/Makefile \
316 src/vm/jit/verify/Makefile \
317 src/vm/jit/x86_64/Makefile \
319 tests/jvm98/Makefile \
320 tests/kaffe/Makefile )
325 ## indent-tabs-mode: t
328 ## compile-command: "automake --add-missing"