1 dnl autoconf; autoheader; automake
3 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(cacao, 0.40, cacao@complang.tuwien.ac.at)
5 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
10 AM_CONFIG_HEADER([config.h])
12 AC_PREFIX_DEFAULT(/usr/local/cacao)
20 CFLAGS="-mieee -D__ALPHA__"
21 AC_DEFINE([TRACE_ARGS_NUM], 6, [Defines integer argument register count])
22 AC_DEFINE([USE_CODEMMAP], 1, [use code mmap])
25 i386* | i486* | i586* | i686* )
34 CFLAGS="-64 -O2 -OPT:Olimit=0 -g -woff 1110,1164,1515 -D__MIPS__"
36 AC_DEFINE([TRACE_ARGS_NUM], 8, [Defines integer argument register count])
42 CFLAGS="-D__POWERPC__"
43 AC_DEFINE([TRACE_ARGS_NUM], 8, [Defines integer argument register count])
53 AC_MSG_ERROR($host_cpu systems are not supported at this time)
59 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"
62 CFLAGS="-ansi -pedantic -Wall -Wno-long-long -O0 -g3 $CFLAGS -D__DARWIN__"
65 CFLAGS="$CFLAGS -D__IRIX__"
72 AC_DEFINE_UNQUOTED([ARCH_DIR], "$ARCH_DIR", [Architecture directory])
75 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])
76 dnl force static classpath linking ??
77 AC_MSG_CHECKING(Link classpath static)
78 if test "xno" == "x$use_dynamicclasspath"; then
82 if test "$STATIC_CLASSPATH" == "1"; then
87 AC_SUBST(STATIC_CLASSPATH)
89 dnl Checks for programs.
95 dnl Checks for header files.
98 AC_CHECK_HEADERS([fcntl.h])
99 AC_CHECK_HEADERS([sys/time.h])
100 AC_CHECK_HEADERS([unistd.h])
101 AC_CHECK_HEADERS([sys/ioctl.h])
103 dnl Checks for typedefs, structures, and compiler characteristics.
111 dnl Checks for library functions.
112 AC_PROG_GCC_TRADITIONAL
116 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
118 dnl Checks for libraries.
119 AC_CHECK_LIB(m, fmod)
121 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
122 if test $ac_cv_func_mmap_fixed_mapped = yes; then
123 AC_CACHE_CHECK(whether MAP_FAILED is defined,
126 [#include <sys/mman.h>
130 ac_cv_map_failed=yes,
131 ac_cv_map_failed=no))
133 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
136 [#include <sys/mman.h>
140 ac_cv_map_anonymous=yes,
141 ac_cv_map_anonymous=no))
143 AC_CACHE_CHECK(whether MAP_ANON is defined,
146 [#include <sys/mman.h>
153 if test $ac_cv_map_failed = yes; then
154 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
157 if test $ac_cv_map_anonymous = yes; then
158 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
161 if test $ac_cv_map_anon = yes; then
162 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
170 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
171 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--disable-__thread,do not use TLS features even when supporting them)], [use__thread=$enableval], [use__thread=yes])
175 AC_MSG_CHECKING(whether to include threads support)
176 enable_threads=${enable_threads:-native}
177 case "$enable_threads" in
180 dnl no threads for boehm
181 ac_configure_args="$ac_configure_args --disable-boehm-threads"
182 AM_CONDITIONAL([USE_THREADS], [false])
183 AM_CONDITIONAL([NATIVE_THREADS], [false])
186 green | native | posix | pthreads)
187 AC_DEFINE([USE_THREADS], 1, [use threads])
188 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
189 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
191 AM_CONDITIONAL([USE_THREADS], [true])
193 if test x"$enable_threads" != "xgreen"; then
194 AC_MSG_RESULT(yes, native)
195 AC_CHECK_LIB(pthread, main)
196 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
198 CFLAGS="$CFLAGS -D_REENTRANT"
200 dnl tell boehm to support threads as well and classpath to
201 dnl synchronize VM threads portably
202 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync"
203 AM_CONDITIONAL([NATIVE_THREADS], [true])
206 AC_MSG_RESULT(yes, green)
208 dnl no threads for boehm
209 ac_configure_args="$ac_configure_args --disable-boehm-threads"
210 AM_CONDITIONAL([NATIVE_THREADS], [false])
214 AC_MSG_ERROR($enable_threads is an unknown thread package)
219 dnl Check whether the compiler supports the __thread keyword.
220 if test "x$use__thread" != xno; then
221 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
222 [cat > conftest.c <<\EOF
225 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
226 ac_cv_gcc___thread=yes
228 ac_cv_gcc___thread=no
231 if test "$ac_cv_gcc___thread" = yes; then
232 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
235 ac_cv_gcc___thread=no
239 dnl check if zlib should be used
240 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
242 AC_MSG_CHECKING(whether zip archives should be supported)
243 if test x"$enable_zlib" = "xno"; then
245 AM_CONDITIONAL([USE_ZLIB], [false])
248 AC_DEFINE([USE_ZLIB], 1, [use zlib])
249 AC_CHECK_HEADERS([zlib.h])
250 AC_CHECK_LIB(z, main)
251 AM_CONDITIONAL([USE_ZLIB], [true])
255 dnl set some essential classpath options, even if their classpath default is
257 ac_configure_args="$ac_configure_args --enable-jni --disable-cni --disable-regen-headers --enable-static --enable-shared --enable-load-library"
261 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])])
265 AC_MSG_CHECKING(whether to use gtk awt peers)
266 if test x"$enable_gtk_peer" = "xyes"; then
268 AC_DEFINE([USE_GTK], 1, [use gtk])
269 AM_CONDITIONAL([USE_GTK_PEER], [true])
273 ac_configure_args="$ac_configure_args --disable-gtk-peer"
274 AM_CONDITIONAL([USE_GTK_PEER], [false])
278 if test "x1" == "x$STATIC_CLASSPATH"; then
279 AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked])
280 AM_CONDITIONAL([STATIC_CLASSPATH], [true])
283 AM_CONDITIONAL([STATIC_CLASSPATH], [false])
287 dnl now configure boehm gc and gnu classpath
288 dnl the export is not my favorite (is there another way?)
290 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath)
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"