1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(cacao, 0.92cvs, 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)
20 CFLAGS="-mieee -D__ALPHA__"
23 i386 | i486 | i586 | i686 )
26 CFLAGS="-D__I386__ $CFLAGS"
33 dnl for MIPSPro Compiler
34 dnl CFLAGS="-64 -OPT:Olimit=0 -woff 1110,1164,1515 -D__MIPS__ -D__MIPSEB__"
35 CFLAGS="-64 -OPT:Olimit=0 -D__MIPS__ -D__MIPSEB__"
38 dnl CFLAGS="-mabi=64 -D__MIPS__ -D__MIPSEB__"
39 dnl LDFLAGS="-mabi=64"
45 CFLAGS="-D__POWERPC__"
55 AC_MSG_ERROR($host_cpu systems are not supported at this time)
60 dnl set optimization and debugging for all architectures and systems
61 CFLAGS="-O0 -g3 $CFLAGS"
66 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"
69 CFLAGS="-ansi -pedantic -Wall -Wno-long-long $CFLAGS -D__DARWIN__"
72 CFLAGS="$CFLAGS -D__IRIX__"
79 dnl define install prefix
80 if test "x$prefix" = xNONE; then
81 CACAO_INSTALL_PREFIX=$ac_default_prefix
83 CACAO_INSTALL_PREFIX=$prefix
85 AC_DEFINE_UNQUOTED([CACAO_INSTALL_PREFIX], "$CACAO_INSTALL_PREFIX", [Installation prefix])
86 AC_SUBST(CACAO_INSTALL_PREFIX)
89 AC_DEFINE_UNQUOTED([ARCH_DIR], "$ARCH_DIR", [Architecture directory])
93 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])
94 dnl force static classpath linking ??
95 AC_MSG_CHECKING(Link classpath static)
96 if test "xno" == "x$use_dynamicclasspath"; then
100 if test "$STATIC_CLASSPATH" == "1"; then
105 AC_SUBST(STATIC_CLASSPATH)
107 dnl Checks for programs.
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.
132 dnl Checks for library functions.
133 AC_PROG_GCC_TRADITIONAL
137 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
139 dnl Checks for libraries.
140 AC_CHECK_LIB(m, fmod)
142 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
143 if test $ac_cv_func_mmap_fixed_mapped = yes; then
144 AC_CACHE_CHECK(whether MAP_FAILED is defined,
147 [#include <sys/mman.h>
151 ac_cv_map_failed=yes,
152 ac_cv_map_failed=no))
154 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
157 [#include <sys/mman.h>
161 ac_cv_map_anonymous=yes,
162 ac_cv_map_anonymous=no))
164 AC_CACHE_CHECK(whether MAP_ANON is defined,
167 [#include <sys/mman.h>
174 if test $ac_cv_map_failed = yes; then
175 AC_DEFINE([HAVE_MAP_FAILED], 1, [Define if <sys/mman.h> defines MAP_FAILED])
178 if test $ac_cv_map_anonymous = yes; then
179 AC_DEFINE([HAVE_MAP_ANONYMOUS], 1, [Define if <sys/mman.h> defines MAP_ANONYMOUS])
182 if test $ac_cv_map_anon = yes; then
183 AC_DEFINE([HAVE_MAP_ANON], 1, [Define if <sys/mman.h> defines MAP_ANON])
191 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
192 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
196 AC_MSG_CHECKING(whether to include threads support)
197 enable_threads=${enable_threads:-native}
198 case "$enable_threads" in
201 dnl no threads for boehm
202 ac_configure_args="$ac_configure_args --disable-boehm-threads"
203 AM_CONDITIONAL([USE_THREADS], [false])
204 AM_CONDITIONAL([NATIVE_THREADS], [false])
207 green | native | posix | pthreads)
208 AC_DEFINE([USE_THREADS], 1, [use threads])
209 AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow])
210 AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first])
212 AM_CONDITIONAL([USE_THREADS], [true])
214 if test x"$enable_threads" != "xgreen"; then
215 AC_MSG_RESULT(yes, native)
216 AC_CHECK_LIB(pthread, main)
217 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
219 CFLAGS="$CFLAGS -D_REENTRANT"
221 dnl tell boehm to support threads as well
222 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
223 AM_CONDITIONAL([NATIVE_THREADS], [true])
226 AC_MSG_RESULT(yes, green)
228 dnl no threads for boehm
229 ac_configure_args="$ac_configure_args --disable-boehm-threads"
230 AM_CONDITIONAL([NATIVE_THREADS], [false])
234 AC_MSG_ERROR($enable_threads is an unknown thread package)
239 dnl Check whether the compiler supports the __thread keyword.
240 if test "x$use__thread" != xno; then
241 AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
242 [cat > conftest.c <<\EOF
245 if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
246 ac_cv_gcc___thread=yes
248 ac_cv_gcc___thread=no
251 if test "$ac_cv_gcc___thread" = yes; then
252 AC_DEFINE([HAVE___THREAD], 1, [have __thread])
255 ac_cv_gcc___thread=no
259 dnl check if zlib should be used
260 AC_ARG_ENABLE([zlib], [AS_HELP_STRING(--enable-zlib,enable zip archive class storage (needs zlib) [[default=yes]])])
262 AC_MSG_CHECKING(whether zip archives should be supported)
263 if test x"$enable_zlib" = "xno"; then
265 AM_CONDITIONAL([USE_ZLIB], [false])
268 AC_DEFINE([USE_ZLIB], 1, [use zlib])
269 AC_CHECK_HEADERS([zlib.h])
270 AC_CHECK_LIB(z, main)
271 AM_CONDITIONAL([USE_ZLIB], [true])
276 AC_ARG_ENABLE([gtk-peer], [AS_HELP_STRING(--enable-gtk-peer,compile GTK native peers [[default=no]])])
280 AC_MSG_CHECKING(whether to use gtk awt peers)
281 if test x"$enable_gtk_peer" = "xyes"; then
283 AC_DEFINE([USE_GTK], 1, [use gtk])
284 AM_CONDITIONAL([USE_GTK_PEER], [true])
288 ac_configure_args="$ac_configure_args --disable-gtk-peer"
289 AM_CONDITIONAL([USE_GTK_PEER], [false])
293 if test "x1" == "x$STATIC_CLASSPATH"; then
294 AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked])
295 AM_CONDITIONAL([STATIC_CLASSPATH], [true])
298 AM_CONDITIONAL([STATIC_CLASSPATH], [false])
302 dnl set some essential classpath options, even if their classpath default is
304 ac_configure_args="$ac_configure_args --libdir=${CACAO_INSTALL_PREFIX}/jre/lib/${ARCH_DIR} --enable-jni --disable-cni --disable-regen-headers --enable-static --enable-shared --enable-load-library"
307 dnl now configure boehm gc and gnu classpath
308 dnl the export is not my favorite (is there another way?)
310 AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath)
313 AC_CONFIG_FILES([Makefile]
315 [doc/handbook/Makefile]
319 [src/cacaoh/Makefile]
321 [src/native/Makefile]
322 [src/native/include/Makefile]
323 [src/native/vm/Makefile]
324 [src/scripts/Makefile]
328 [src/scripts/rmiregistry]
329 [src/threads/Makefile]
330 [src/threads/green/Makefile]
331 [src/threads/native/Makefile]
332 [src/toolbox/Makefile]
334 [src/vm/jit/Makefile]
335 [src/vm/jit/alpha/Makefile]
336 [src/vm/jit/i386/Makefile]
337 [src/vm/jit/inline/Makefile]
338 [src/vm/jit/loop/Makefile]
339 [src/vm/jit/mips/Makefile]
340 [src/vm/jit/powerpc/Makefile]
341 [src/vm/jit/schedule/Makefile]
342 [src/vm/jit/tools/Makefile]
343 [src/vm/jit/verify/Makefile]
344 [src/vm/jit/x86_64/Makefile]
346 [tests/kaffe/Makefile]
347 [tests/native/Makefile])
354 ## indent-tabs-mode: t
357 ## compile-command: "automake --add-missing"