1 dnl autoconf; autoheader; automake
3 dnl Process this file with autoconf to produce a configure script.
7 AM_INIT_AUTOMAKE(cacao, 0.40)
8 AM_CONFIG_HEADER(config.h)
10 AC_PREFIX_DEFAULT(/usr/local/cacao)
17 CFLAGS="-ieee -O2 -g3"
18 COMPILER_SOURCES="compiler.h compiler.c"
19 COMPILER_OBJECTS="compiler.o"
20 AC_DEFINE(OLD_COMPILER)
25 CFLAGS="-64 -g -DMAP_ANONYMOUS=0 -woff 1048,1110,1164,1515"
31 i386* | i486* | i586* | i686* )
33 CFLAGS="-O0 -g3 -D__I386__"
34 COMPILER_SOURCES="compiler.h compiler.c"
35 COMPILER_OBJECTS="compiler.o"
38 sparc* | powerpc* | ppc* | * )
39 AC_MSG_ERROR($host-cpu systems are not supported at this time) ;;
43 AC_SUBST(COMPILER_SOURCES)
44 AC_SUBST(COMPILER_OBJECTS)
46 AC_DEFINE_UNQUOTED(SYSDEP_DIR, "$SYSDEP_DIR")
49 dnl Checks for programs.
54 dnl Checks for libraries.
57 dnl Checks for header files.
60 AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
62 dnl Checks for typedefs, structures, and compiler characteristics.
70 dnl Checks for library functions.
71 AC_PROG_GCC_TRADITIONAL
75 AC_CHECK_FUNCS(getcwd gettimeofday mkdir mktime select socket)
77 dnl Check for mmap header anomalies (missing MAP_FAILED, etc.)
78 if test $ac_cv_func_mmap_fixed_mapped = yes; then
79 AC_CACHE_CHECK(whether MAP_FAILED is defined,
82 [#include <sys/mman.h>
89 AC_CACHE_CHECK(whether MAP_ANONYMOUS is defined,
92 [#include <sys/mman.h>
96 ac_cv_map_anonymous=yes,
97 ac_cv_map_anonymous=no))
99 if test $ac_cv_map_failed = yes; then
100 AC_DEFINE(HAVE_MAP_FAILED)
103 if test $ac_cv_map_anonymous = yes; then
104 AC_DEFINE(HAVE_MAP_ANONYMOUS)
112 AC_ARG_ENABLE(threads, [ --enable-threads enable threads support])
113 AC_ARG_WITH(gc, [ --with-gc[=ARG] use garbage collector [gc2,gc1,boehm]])
116 AC_MSG_CHECKING(whether to include threads support)
117 if test x"$enable_threads" = "xno"; then
122 AC_DEFINE(USE_THREADS)
123 AC_DEFINE(EXTERNAL_OVERFLOW)
124 AC_DEFINE(DONT_FREE_FIRST)
126 LIBTHREAD="libthreads.a"
127 THREAD_OBJ="threads/libthreads.a"
132 dnl garbage collector version
133 AC_MSG_CHECKING(which garbage collector to use)
136 AC_MSG_RESULT(Boehm garbage collector)
137 GC_OBJ="mm/libboehm.a libgc.a"
138 if test ! -e libgc.a; then
139 AC_MSG_ERROR(libgc.a not found)
145 AC_MSG_RESULT(old garbage collector)
146 GC_OBJ="mm/libmm_old.a"
149 AC_MSG_RESULT(new garbage collector)
150 GC_OBJ="mm/libmm_new.a"
153 AC_MSG_ERROR(Invalid GC)