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"
31 CFLAGS="-64 -O2 -OPT:Olimit=0 -g -woff 1110,1164,1515 -D__MIPS__"
38 CFLAGS="-D__POWERPC__"
48 AC_MSG_ERROR($host_cpu systems are not supported at this time)
54 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"
57 CFLAGS="-ansi -pedantic -Wall -Wno-long-long -O0 -g3 $CFLAGS -D__DARWIN__"
60 CFLAGS="$CFLAGS -D__IRIX__"
66 dnl define install prefix
67 if test "x$prefix" = xNONE; then
68 CFLAGS="$CFLAGS -DINSTALL_PREFIX=\"\\\"$ac_default_prefix\\\"\""
70 CFLAGS="$CFLAGS -DINSTALL_PREFIX=\"\\\"$prefix\\\"\""
74 AC_DEFINE_UNQUOTED([ARCH_DIR], "$ARCH_DIR", [Architecture directory])
77 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])
78 dnl force static classpath linking ??
79 AC_MSG_CHECKING(Link classpath static)
80 if test "xno" == "x$use_dynamicclasspath"; then
84 if test "$STATIC_CLASSPATH" == "1"; then
89 AC_SUBST(STATIC_CLASSPATH)
91 dnl Checks for programs.
99 dnl Checks for header files.
102 AC_CHECK_HEADERS([fcntl.h])
103 AC_CHECK_HEADERS([sys/time.h])
104 AC_CHECK_HEADERS([unistd.h])
105 AC_CHECK_HEADERS([sys/ioctl.h])
107 dnl Checks for typedefs, structures, and compiler characteristics.
115 dnl Checks for library functions.
116 AC_PROG_GCC_TRADITIONAL
120 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
122 dnl Checks for libraries.
123 AC_CHECK_LIB(m, fmod)
125 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
126 if test $ac_cv_func_mmap_fixed_mapped = yes; then
127 AC_CACHE_CHECK(whether MAP_FAILED is defined,
130 [#include <sys/mman.h>
134 ac_cv_map_failed=yes,
135 ac_cv_map_failed=no))
137 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
140 [#include <sys/mman.h>
144 ac_cv_map_anonymous=yes,
145 ac_cv_map_anonymous=no))
147 AC_CACHE_CHECK(whether MAP_ANON is defined,
150 [#include <sys/mman.h>
157 if test $ac_cv_map_failed = yes; then
158 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
161 if test $ac_cv_map_anonymous = yes; then
162 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
165 if test $ac_cv_map_anon = yes; then
166 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
174 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
175 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--disable-__thread,do not use TLS features even when supporting them)], [use__thread=$enableval], [use__thread=yes])
179 AC_MSG_CHECKING(whether to include threads support)
180 enable_threads=${enable_threads:-native}
181 case "$enable_threads" in
184 dnl no threads for boehm
185 ac_configure_args="$ac_configure_args --disable-boehm-threads"
186 AM_CONDITIONAL([USE_THREADS], [false])
187 AM_CONDITIONAL([NATIVE_THREADS], [false])
190 green | native | posix | pthreads)
191 AC_DEFINE([USE_THREADS], 1, [use threads])
192 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
193 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
195 AM_CONDITIONAL([USE_THREADS], [true])
197 if test x"$enable_threads" != "xgreen"; then
198 AC_MSG_RESULT(yes, native)
199 AC_CHECK_LIB(pthread, main)
200 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
202 CFLAGS="$CFLAGS -D_REENTRANT"
204 dnl tell boehm to support threads as well and classpath to
205 dnl synchronize VM threads portably
206 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync"
207 AM_CONDITIONAL([NATIVE_THREADS], [true])
210 AC_MSG_RESULT(yes, green)
212 dnl no threads for boehm
213 ac_configure_args="$ac_configure_args --disable-boehm-threads"
214 AM_CONDITIONAL([NATIVE_THREADS], [false])
218 AC_MSG_ERROR($enable_threads is an unknown thread package)
223 dnl Check whether the compiler supports the __thread keyword.
224 if test "x$use__thread" != xno; then
225 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
226 [cat > conftest.c <<\EOF
229 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
230 ac_cv_gcc___thread=yes
232 ac_cv_gcc___thread=no
235 if test "$ac_cv_gcc___thread" = yes; then
236 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
239 ac_cv_gcc___thread=no
243 dnl check if zlib should be used
244 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
246 AC_MSG_CHECKING(whether zip archives should be supported)
247 if test x"$enable_zlib" = "xno"; then
249 AM_CONDITIONAL([USE_ZLIB], [false])
252 AC_DEFINE([USE_ZLIB], 1, [use zlib])
253 AC_CHECK_HEADERS([zlib.h])
254 AC_CHECK_LIB(z, main)
255 AM_CONDITIONAL([USE_ZLIB], [true])
260 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])])
264 AC_MSG_CHECKING(whether to use gtk awt peers)
265 if test x"$enable_gtk_peer" = "xyes"; then
267 AC_DEFINE([USE_GTK], 1, [use gtk])
268 AM_CONDITIONAL([USE_GTK_PEER], [true])
272 ac_configure_args="$ac_configure_args --disable-gtk-peer"
273 AM_CONDITIONAL([USE_GTK_PEER], [false])
277 if test "x1" == "x$STATIC_CLASSPATH"; then
278 AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked])
279 AM_CONDITIONAL([STATIC_CLASSPATH], [true])
282 AM_CONDITIONAL([STATIC_CLASSPATH], [false])
286 dnl set some essential classpath options, even if their classpath default is
288 ac_configure_args="$ac_configure_args --enable-jni --disable-cni --disable-regen-headers --enable-static --enable-shared --enable-load-library"
291 dnl now configure boehm gc and gnu classpath
292 dnl the export is not my favorite (is there another way?)
294 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath)
299 doc/handbook/Makefile \
303 src/cacaoh/Makefile \
305 src/native/Makefile \
306 src/native/include/Makefile \
307 src/native/tools/Makefile \
308 src/native/vm/Makefile \
309 src/threads/Makefile \
310 src/threads/green/Makefile \
311 src/threads/native/Makefile \
312 src/toolbox/Makefile \
314 src/vm/jit/Makefile \
315 src/vm/jit/alpha/Makefile \
316 src/vm/jit/i386/Makefile \
317 src/vm/jit/inline/Makefile \
318 src/vm/jit/loop/Makefile \
319 src/vm/jit/mips/Makefile \
320 src/vm/jit/powerpc/Makefile \
321 src/vm/jit/tools/Makefile \
322 src/vm/jit/verify/Makefile \
323 src/vm/jit/x86_64/Makefile \
325 tests/jvm98/Makefile \
326 tests/kaffe/Makefile )
331 ## indent-tabs-mode: t
334 ## compile-command: "automake --add-missing"