cd148c44a9ba66e1adf0567ddf430fa8efa8de5d
[cacao.git] / configure.ac
1 dnl configure.ac
2 dnl
3 dnl Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 dnl C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 dnl E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 dnl J. Wenninger, Institut f. Computersprachen - TU Wien
7 dnl 
8 dnl This file is part of CACAO.
9 dnl 
10 dnl This program is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU General Public License as
12 dnl published by the Free Software Foundation; either version 2, or (at
13 dnl your option) any later version.
14 dnl 
15 dnl This program is distributed in the hope that it will be useful, but
16 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 dnl General Public License for more details.
19 dnl 
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with this program; if not, write to the Free Software
22 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 dnl 02110-1301, USA.
24 dnl 
25 dnl $Id: configure.ac 7352 2007-02-13 22:11:37Z ajordan $
26
27 dnl Process this file with autoconf to produce a configure script.
28
29
30 AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
31 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
32 AC_CANONICAL_HOST
33 AC_PREREQ(2.59)
34 AM_INIT_AUTOMAKE([1.9.0])
35 AM_MAINTAINER_MODE
36
37 AM_CONFIG_HEADER([config.h])
38
39 AC_PREFIX_DEFAULT(/usr/local/cacao)
40
41
42 dnl set optimization and debugging for all architectures and systems
43 if test x"$CFLAGS" = "x"; then
44     OPT_CFLAGS="-O0 -g3"
45 else
46     OPT_CFLAGS=$CFLAGS
47 fi
48
49 dnl system type
50 case "$host_cpu" in
51 alpha | alphaev56 | alphapca56 )
52     ARCH_DIR="alpha"
53     ARCH_CFLAGS="-mieee -D__ALPHA__"
54     ;;
55
56 arm | armv4tl | armv5b | armv5l )
57     ARCH_DIR="arm"
58     ARCH_CFLAGS="-D__ARM__"
59     ;;
60
61 hppa2.0 )
62     ARCH_DIR="parisc"
63     ARCH_CFLAGS="-D__PARISC__"
64     ;;
65
66 i386 | i486 | i586 | i686 )
67     ARCH_DIR="i386"
68     ARCH_CFLAGS="-D__I386__"
69     ;;
70
71 m68k )
72     ARCH_DIR="m68k"
73     ARCH_CFLAGS="-D__M68K__"
74     ;;
75
76 mips | mipsel )
77     ARCH_DIR="mips"
78     ARCH_CFLAGS="-D__MIPS__"
79     ;;
80
81 powerpc )
82     ARCH_DIR="powerpc"
83     ARCH_CFLAGS="-D__POWERPC__"
84     ;;
85
86 powerpc64 )
87     ARCH_DIR="powerpc64"
88     ARCH_CFLAGS="-D__POWERPC64__"
89     ;;
90
91 sparc | sparc64 )
92     ARCH_DIR="sparc64"
93     ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
94     ;;
95
96 x86_64 )
97     ARCH_DIR="x86_64"
98     ARCH_CFLAGS="-D__X86_64__"
99     ;;
100
101 xdspcore )
102     ARCH_DIR="xdspcore"
103     ENABLE_STATICVM="yes"
104     ARCH_CFLAGS="-D__XDSPCORE__"
105     USE_SCHEDULER="1"
106     ;;
107
108 s390 )
109     ARCH_DIR="s390"
110     ARCH_CFLAGS="-D__S390__"
111     ;;
112
113
114 * )
115     AC_MSG_ERROR($host_cpu systems are not supported at this time)
116     ;;
117 esac
118
119 dnl host type
120 case "$host_os" in
121 *cygwin* )
122     OS_DIR="cygwin"
123     INTRP_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -Wall -Wno-long-long"
124     ARCH_CFLAGS="$ARCH_CFLAGS -D__WINDOWS__ -D__CYGWIN__ -ansi -pedantic -Wall -Wno-long-long"
125     ;;
126
127 *darwin* )
128     OS_DIR="darwin"
129     INTRP_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -Wall -Wno-long-long"
130     ARCH_CFLAGS="$ARCH_CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
131     ;;
132
133 *freebsd* )
134     OS_DIR="freebsd"
135     INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
136     ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
137     ;;
138
139 *irix* )
140     OS_DIR="irix"
141     INTRP_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
142     ARCH_CFLAGS="$ARCH_CFLAGS -D__IRIX__"
143     ;;
144
145 *kfreebsd*-gnu)
146     OS_DIR="freebsd"
147     INTRP_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
148     ARCH_CFLAGS="$ARCH_CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
149     ;;
150
151 dnl must be before *linux*
152 *uclinux | *elf )
153     OS_DIR="uclinux"
154     INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
155     ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
156     ;;
157
158 *linux* | *Linux* )
159     OS_DIR="linux"
160     INTRP_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
161     ARCH_CFLAGS="$ARCH_CFLAGS -D__LINUX__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
162     ;;
163
164 *netbsd* )
165     OS_DIR="netbsd"
166     INTRP_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
167     ARCH_CFLAGS="$ARCH_CFLAGS -D__NETBSD__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE"
168     ;;
169
170 *solaris* )
171     OS_DIR="solaris"
172     INTRP_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE"
173     ARCH_CFLAGS="$ARCH_CFLAGS -D__SOLARIS__ -ansi -pedantic -Wall -Wno-long-long -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_BSD_SOURCE"
174     ;;
175
176 * )
177     ;;
178 esac
179
180
181 dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
182 dnl we set it properly at the end of this file
183 CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
184
185 dnl set interpreter flags
186 AC_SUBST(INTRP_CFLAGS)
187
188 dnl define some stuff required for --fullversion
189 AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
190 AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
191 AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS", [CFLAGS used])
192
193
194 dnl define and substitute some architecture specific variables
195 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
196 AC_SUBST(ARCH_DIR)
197 AC_SUBST(OS_DIR)
198 AC_SUBST(USE_SCHEDULER)
199
200
201 dnl Checks for programs.
202 AC_PROG_CC
203 AM_PROG_AS
204 AC_PROG_LD
205 AC_PROG_LD_GNU
206 AC_PROG_RANLIB
207 AC_PROG_LN_S
208 AC_PROG_MAKE_SET
209 AM_PROG_MKDIR_P
210
211 dnl Checks for header files.
212 AC_HEADER_DIRENT
213 AC_HEADER_STDC
214 AC_CHECK_HEADERS([fcntl.h])
215 AC_CHECK_HEADERS([sys/time.h])
216 AC_CHECK_HEADERS([unistd.h])
217 AC_CHECK_HEADERS([sys/ioctl.h])
218
219 dnl this is for fdlibm
220 AC_CHECK_HEADERS([stdint.h])
221 AC_CHECK_HEADERS([inttypes.h])
222 AC_CHECK_HEADERS([sys/config.h])
223 AC_CHECK_HEADERS([sys/types.h])
224 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
225 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
226 AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
227 AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
228
229 dnl Checks for typedefs, structures, and compiler characteristics.
230 AC_C_CONST
231 AC_C_INLINE
232 AC_C_ATTRIBUTE
233 AC_TYPE_OFF_T
234 AC_TYPE_SIZE_T
235 AC_HEADER_TIME
236 AC_STRUCT_TM
237
238 dnl Checks for library functions.
239 AC_PROG_GCC_TRADITIONAL
240 AC_TYPE_SIGNAL
241 AC_FUNC_MEMCMP
242 AC_FUNC_MMAP
243 AC_CHECK_FUNCS([calloc mmap getpagesize free])
244 AC_CHECK_FUNCS([getcwd gettimeofday])
245 AC_CHECK_FUNCS([scandir])
246 AC_CHECK_FUNCS([isnan])
247
248 dnl Checks for libraries.
249
250 dnl Checking sizeof void *
251 AC_CHECK_SIZEOF(void *)
252 AC_C_BIGENDIAN
253
254
255 dnl define install prefix
256 if test "x$prefix" = "xNONE"; then
257     CACAO_PREFIX=$ac_default_prefix
258 else
259     CACAO_PREFIX=$prefix
260 fi
261 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
262 AC_SUBST(CACAO_PREFIX)
263
264 dnl define libdir prefix
265 if test "x$libdir" = "xNONE"; then
266     CACAO_LIBDIR=$ac_default_libdir
267 else
268     CACAO_LIBDIR=$libdir
269 fi
270 dnl expand CACAO_LIBDIR to something that is usable in C code
271 AS_AC_EXPAND([CACAO_LIBDIR], ${CACAO_LIBDIR})
272 AC_DEFINE_UNQUOTED([CACAO_LIBDIR], "${CACAO_LIBDIR}", [library installation prefix])
273 AC_SUBST(CACAO_LIBDIR)
274
275
276 dnl Features
277
278 dnl check arguments
279
280 dnl check which Java configuration to use
281 AC_MSG_CHECKING(which Java configuration to use)
282 AC_ARG_ENABLE([java],
283               [AS_HELP_STRING(--enable-java,enable specific Java configuration (cldc1.1,javase) [[default=javase]])],
284               [case "${enableval}" in
285                    cldc1.1)
286                        ENABLE_JAVAME_CLDC1_1=yes
287                        AC_DEFINE([ENABLE_JAVAME_CLDC1_1], 1, [compile for Java ME CLDC1.1])
288                        AC_MSG_RESULT(cldc1.1)
289                        ;;
290                    javase)
291                        ENABLE_JAVASE=yes
292                        AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
293                        AC_MSG_RESULT(javase)
294                        ;;
295                    *)
296                        AC_MSG_ERROR(${enableval} is an unknown configuration)
297                        ;;
298                esac],
299                [ENABLE_JAVASE=yes
300                 AC_DEFINE([ENABLE_JAVASE], 1, [compile for Java SE])
301                 AC_MSG_RESULT(j2se)])
302 AM_CONDITIONAL([ENABLE_JAVAME_CLDC1_1], test x"${ENABLE_JAVAME_CLDC1_1}" = "xyes")
303 AM_CONDITIONAL([ENABLE_JAVASE], test x"${ENABLE_JAVASE}" = "xyes")
304
305
306 dnl check for JIT compiler
307 AC_MSG_CHECKING(whether JIT compiler should be compiled)
308 AC_ARG_ENABLE([jit],
309               [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
310               [case "${enableval}" in
311                    no) ENABLE_JIT=no;;
312                    *) ENABLE_JIT=yes;;
313                esac],
314               [ENABLE_JIT=yes])
315 AC_MSG_RESULT(${ENABLE_JIT})
316 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
317
318 if test x"${ENABLE_JIT}" = "xyes"; then
319     AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
320 fi
321
322
323 dnl check for stuff that should be done in software
324 AC_CHECK_SOFTFLOAT
325 AC_CHECK_SOFT_FLOAT_CMP
326 AC_CHECK_SOFT_DOUBLE_CMP
327
328
329 dnl check for interpreter
330 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
331
332 AC_MSG_CHECKING(whether interpreter should be compiled)
333 if test x"$enable_intrp" = "xyes"; then
334     AC_MSG_RESULT(yes)
335     AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
336     AM_CONDITIONAL([ENABLE_INTRP], [true])
337     ENABLE_INTRP=yes
338
339     AC_ASM_SKIP16
340
341     dnl check for libffi
342     AC_ARG_WITH([ffi],
343                 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
344                 [WITH_FFI=yes
345                  AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
346                  AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
347                  AC_DEFINE([WITH_FFI], 1, [use libffi])],
348                 [WITH_FFI=no])
349
350     dnl check for libffcall
351     AC_ARG_WITH([ffcall],
352                 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
353                 [WITH_FFCALL=yes
354                  AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
355                  AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
356                  AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
357                 [WITH_FFCALL=no])
358
359     dnl check for libffi or libffcall
360     if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
361         AC_ERROR(Enable only libffi or libffcall.)
362     fi
363     if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
364         AC_ERROR(Enable one of libffi or libffcall.)
365     fi
366
367 else
368     AC_MSG_RESULT(no)
369     AM_CONDITIONAL([ENABLE_INTRP], [false])
370     ENABLE_INTRP="no"
371 fi
372
373 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
374     AC_ERROR(You have to enable at least the JIT or the interpreter.)
375 fi
376
377
378 dnl check for garbage collector usage
379 AC_ARG_ENABLE([gc], [AS_HELP_STRING(--enable-gc,enable garbage collector support (none,boehm,cacao) [[default=boehm]])])
380 AC_MSG_CHECKING(whether GC should be enabled)
381 enable_gc=${enable_gc:-boehm}
382 case "$enable_gc" in
383 no | none)
384     AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
385     ENABLE_GC=none
386     AC_MSG_RESULT(no)
387     ;;
388
389 boehm)
390     AC_DEFINE([ENABLE_GC_BOEHM], 1, [enable conservative boehm-gc])
391     ENABLE_GC=boehm
392     AC_MSG_RESULT(yes, boehm-gc)
393     ;;
394
395 cacao)
396     AC_DEFINE([ENABLE_GC_CACAO], 1, [enable exact cacao-gc])
397     ENABLE_GC=cacao
398     AC_MSG_RESULT(yes, cacao-gc)
399     ;;
400
401 *)
402     AC_MSG_ERROR($enable_gc is an unknown garbage collector package)
403     ;;
404 esac
405 AM_CONDITIONAL([DISABLE_GC], test x"${ENABLE_GC}" = "xnone")
406 AM_CONDITIONAL([ENABLE_GC_BOEHM], test x"${ENABLE_GC}" = "xboehm")
407 AM_CONDITIONAL([ENABLE_GC_CACAO], test x"${ENABLE_GC}" = "xcacao")
408
409
410 dnl check for dump memory usage
411 AC_MSG_CHECKING(whether dump memory should be disabled)
412 AC_ARG_ENABLE([dump],
413               [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
414               [case "${enableval}" in
415                    no)
416                        DISABLE_DUMP=yes
417                        AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
418                        ;;
419                    *) DISABLE_DUMP=no;;
420                esac],
421                [DISABLE_DUMP=no])
422 AC_MSG_RESULT(${DISABLE_DUMP})
423
424
425 dnl check for debug
426 AC_MSG_CHECKING(whether debug code generation should be enabled)
427 AC_ARG_ENABLE([debug],
428               [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
429               [case "${enableval}" in
430                    no) NDEBUG=yes
431                        AC_DEFINE([NDEBUG], 1, [disable debug code])
432                        ;;
433                    *) NDEBUG=no;;
434                esac],
435               [NDEBUG=no])
436
437 if test x"${NDEBUG}" = "xno"; then
438     AC_MSG_RESULT(yes)
439 else
440     AC_MSG_RESULT(no)
441 fi
442 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
443
444
445 dnl check for memcheck support
446 AC_MSG_CHECKING(whether debugging memory checks should be enabled)
447 AC_ARG_ENABLE([memcheck],
448               [AS_HELP_STRING(--enable-memcheck,enable debugging memory checks [[default=no]])],
449               [case "${enableval}" in
450                    yes) ENABLE_MEMCHECK=yes;;
451                    *) ENABLE_MEMCHECK=no;;
452                esac],
453               [ENABLE_MEMCHECK=no])
454 AC_MSG_RESULT(${ENABLE_MEMCHECK})
455 AM_CONDITIONAL([ENABLE_MEMCHECK], test x"${ENABLE_MEMCHECK}" = "xyes")
456
457 if test x"${ENABLE_MEMCHECK}" = "xyes"; then
458     AC_DEFINE([ENABLE_MEMCHECK], 1, [perform debugging memory checks])
459 fi
460
461
462 dnl check for disassembler support
463 AC_MSG_CHECKING(whether disassembler should be enabled)
464 AC_ARG_ENABLE([disassembler],
465               [AS_HELP_STRING(--enable-disassembler,enable disassembler [[default=no]])],
466               [case "${enableval}" in
467                    yes) ENABLE_DISASSEMBLER=yes;;
468                    *) ENABLE_DISASSEMBLER=no;;
469                esac],
470               [ENABLE_DISASSEMBLER=no])
471 AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
472 AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
473
474 if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
475     AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
476
477     dnl check for binutils headers and libraries on some architectures for the
478     dnl disassembler
479     case "${ARCH_DIR}" in
480         arm | i386 | powerpc | x86_64 | sparc64 | powerpc64 | s390)
481             AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
482             AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
483             AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
484             AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
485
486             case "${OS_DIR}" in
487                 cygwin | darwin | netbsd )
488                      AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from binutils))])
489                      ;;
490             esac
491
492             AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from binutils))])
493             AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from binutils))])
494             AC_CHECK_LIB(opcodes, disassembler,, [AC_MSG_ERROR(cannot find libopcodes (from binutils))])
495             AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
496             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
497             ;;
498         * )
499             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
500             ;;
501     esac
502 else
503     AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
504 fi
505
506
507 dnl check for statistics
508 AC_MSG_CHECKING(whether statistics generation should be enabled)
509 AC_ARG_ENABLE([statistics],
510               [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
511               [case "${enableval}" in
512                    yes) ENABLE_STATISTICS=yes;;
513                    *) ENABLE_STATISTICS=no;;
514                esac],
515               [ENABLE_STATISTICS=no])
516 AC_MSG_RESULT(${ENABLE_STATISTICS})
517 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
518
519 if test x"${ENABLE_STATISTICS}" = "xyes"; then
520     AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
521 fi
522
523
524 dnl check for verifier
525 AC_MSG_CHECKING(whether classfile verification should be enabled)
526 AC_ARG_ENABLE([verifier],
527               [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])],
528               [case "${enableval}" in
529                    no) ENABLE_VERIFIER=no;;
530                    *) ENABLE_VERIFIER=yes;;
531                esac],
532               [ENABLE_VERIFIER=yes])
533 AC_MSG_RESULT(${ENABLE_VERIFIER})
534 AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes")
535
536 if test x"${ENABLE_VERIFIER}" = "xyes"; then
537     AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification])
538 fi
539
540
541 dnl check for compiler timing
542 AC_MSG_CHECKING(whether real-time timing should be enabled)
543 AC_ARG_ENABLE([rt-timing],
544               [AS_HELP_STRING(--enable-rt-timing,enable real-time timing [[default=no]])],
545               [case "${enableval}" in
546                    yes) ENABLE_RT_TIMING=yes;;
547                    *) ENABLE_RT_TIMING=no;;
548                esac],
549               [ENABLE_RT_TIMING=no])
550 AC_MSG_RESULT(${ENABLE_RT_TIMING})
551 AM_CONDITIONAL([ENABLE_RT_TIMING], test x"${ENABLE_RT_TIMING}" = "xyes")
552
553 if test x"${ENABLE_RT_TIMING}" = "xyes"; then
554     AC_DEFINE([ENABLE_RT_TIMING], 1, [enable real-time timing])
555 fi
556
557
558 dnl check for cycle count statistics
559 AC_MSG_CHECKING(whether cycle count statistics should be enabled)
560 AC_ARG_ENABLE([cycles-stats],
561               [AS_HELP_STRING(--enable-cycles-stats,enable cycle count statistics [[default=no]])],
562               [case "${enableval}" in
563                    yes) ENABLE_CYCLES_STATS=yes;;
564                    *) ENABLE_CYCLES_STATS=no;;
565                esac],
566               [ENABLE_CYCLES_STATS=no])
567 AC_MSG_RESULT(${ENABLE_CYCLES_STATS})
568 AM_CONDITIONAL([ENABLE_CYCLES_STATS], test x"${ENABLE_CYCLES_STATS}" = "xyes")
569
570 if test x"${ENABLE_CYCLES_STATS}" = "xyes"; then
571     AC_DEFINE([ENABLE_CYCLES_STATS], 1, [enable cycle count statistics])
572 fi
573
574
575 dnl check for JVMTI
576 AC_MSG_CHECKING(whether to compile JVMTI support)
577 AC_ARG_ENABLE([jvmti],
578               [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
579               [case "${enableval}" in
580                    yes) ENABLE_JVMTI=yes;;
581                    *) ENABLE_JVMTI=no;;
582                esac],
583               [ENABLE_JVMTI=no])
584 AC_MSG_RESULT(${ENABLE_JVMTI})
585 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
586
587 if test x"${ENABLE_JVMTI}" = "xyes"; then
588     AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
589 fi
590
591
592 dnl threads
593 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,native) [[default=native]])])
594 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
595
596 AC_MSG_CHECKING(whether to include threads support)
597 enable_threads=${enable_threads:-native}
598 case "$enable_threads" in
599 no | none | single)
600     AC_MSG_RESULT(no)
601     dnl no threads for boehm
602     ac_configure_args="$ac_configure_args --disable-boehm-threads"
603     AM_CONDITIONAL([ENABLE_THREADS], [false])
604     ;;
605
606 native | posix | pthreads)
607     AC_DEFINE([ENABLE_THREADS], 1, [enable threads])
608     
609     AM_CONDITIONAL([ENABLE_THREADS], [true])
610     
611     AC_MSG_RESULT(yes, native)
612     AC_CHECK_LIB(pthread, main)
613
614     ARCH_CFLAGS="$ARCH_CFLAGS -D_REENTRANT"
615
616     dnl we changed ARCH_CFLAGS, set CFLAGS again
617     CFLAGS="$ARCH_CFLAGS $OPT_CFLAGS"
618
619     dnl tell boehm to support threads as well
620     ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
621     ;;
622
623 *)
624     AC_MSG_ERROR($enable_threads is an unknown thread package)
625     ;;
626 esac
627
628
629 dnl Check whether the compiler supports the __thread keyword.
630 if test "x$use__thread" != xno; then
631   AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
632   [cat > conftest.c <<\EOF
633 __thread int a = 42;
634 EOF
635   if AC_TRY_COMMAND([${CC-cc} $ARCH_CFLAGS $OPT_CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
636     ac_cv_gcc___thread=yes 
637   else
638     ac_cv_gcc___thread=no
639   fi
640   rm -f conftest*])
641   if test "$ac_cv_gcc___thread" = yes; then
642     AC_DEFINE([HAVE___THREAD], 1, [have __thread])
643   fi
644 else
645   ac_cv_gcc___thread=no
646 fi
647
648
649 dnl check if if-conversion should be supported
650 AC_MSG_CHECKING(whether if-conversion should be supported)
651 AC_ARG_ENABLE([ifconv],
652               [AS_HELP_STRING(--disable-ifconv,disable if-conversion [[default=yes]])],
653               [case "${enableval}" in
654                    no) ENABLE_IFCONV=no;;
655                    *) ENABLE_IFCONV=yes;;
656                esac],
657               [ENABLE_IFCONV=yes])
658 AC_MSG_RESULT(${ENABLE_IFCONV})
659 AM_CONDITIONAL([ENABLE_IFCONV], test x"${ENABLE_IFCONV}" = "xyes")
660    
661 if test x"${ENABLE_IFCONV}" = "xyes"; then
662     AC_DEFINE([ENABLE_IFCONV], 1, [enable if-conversion])
663 fi
664
665
666 dnl check for inlining
667 AC_MSG_CHECKING(whether method inlining should be supported)
668 AC_ARG_ENABLE([inlining],
669               [AS_HELP_STRING(--enable-inlining,enable method inlining [[default=no]])],
670               [case "${enableval}" in
671                    yes) ENABLE_INLINING=yes;;
672                    *) ENABLE_INLINING=no;;
673                esac],
674               [ENABLE_INLINING=no])
675 AC_MSG_RESULT(${ENABLE_INLINING})
676 AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
677
678 if test x"${ENABLE_INLINING}" = "xyes"; then
679     AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
680 fi
681
682
683 dnl check for inlining debug options
684 AC_MSG_CHECKING(whether method inlining debug options should be enabled)
685 AC_ARG_ENABLE([inlining-debug],
686               [AS_HELP_STRING(--enable-inlining-debug,enable method inlining debug options [[default=no]])],
687               [case "${enableval}" in
688                    yes) ENABLE_INLINING_DEBUG=yes;;
689                    *) ENABLE_INLINING_DEBUG=no;;
690                esac],
691               [ENABLE_INLINING_DEBUG=no])
692 AC_MSG_RESULT(${ENABLE_INLINING_DEBUG})
693 AM_CONDITIONAL([ENABLE_INLINING_DEBUG], test x"${ENABLE_INLINING_DEBUG}" = "xyes")
694
695 if test x"${ENABLE_INLINING_DEBUG}" = "xyes"; then
696     AC_DEFINE([ENABLE_INLINING_DEBUG], 1, [enable method inlining debug options])
697 fi
698
699
700 dnl check for replacement
701 AC_MSG_CHECKING(whether on-stack replacement should be supported)
702 AC_ARG_ENABLE([replacement],
703               [AS_HELP_STRING(--enable-replacement,enable on-stack replacement [[default=no]])],
704               [case "${enableval}" in
705                    yes) ENABLE_REPLACEMENT=yes;;
706                    *) ENABLE_REPLACEMENT=no;;
707                esac],
708               [ENABLE_REPLACEMENT=no])
709 AC_MSG_RESULT(${ENABLE_REPLACEMENT})
710 AM_CONDITIONAL([ENABLE_REPLACEMENT], test x"${ENABLE_REPLACEMENT}" = "xyes")
711
712 if test x"${ENABLE_REPLACEMENT}" = "xyes"; then
713     AC_DEFINE([ENABLE_REPLACEMENT], 1, [use on-stack replacement])
714 fi
715
716
717 dnl check for loop optimization
718 AC_MSG_CHECKING(whether loop optimization should be supported)
719 AC_ARG_ENABLE([loop],
720               [AS_HELP_STRING(--enable-loop,enable loop optimization [[default=no]])],
721               [case "${enableval}" in
722                    yes) ENABLE_LOOP=yes;;
723                    *) ENABLE_LOOP=no;;
724                esac],
725               [ENABLE_LOOP=no])
726 AC_MSG_RESULT(${ENABLE_LOOP})
727 AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
728
729 if test x"${ENABLE_LOOP}" = "xyes"; then
730     AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
731 fi
732
733
734 dnl check if linear scan register allocator(lsra) with SSA should be used
735 AC_MSG_CHECKING(whether lsra with ssa should be supported)
736 AC_ARG_ENABLE([ssa],
737               [AS_HELP_STRING(--disable-ssa,disable ssa [[default=no]])],
738               [case "${enableval}" in
739                    no) ENABLE_SSA=no;;
740                    *) ENABLE_SSA=yes;;
741                esac],
742               [ENABLE_SSA=no])
743 AC_MSG_RESULT(${ENABLE_SSA})
744 AM_CONDITIONAL([ENABLE_SSA], test x"${ENABLE_SSA}" = "xyes")
745
746 if test x"${ENABLE_SSA}" = "xyes"; then
747     AC_DEFINE([ENABLE_SSA], 1, [enable lsra with ssa])
748     ENABLE_LSRA="no"
749 fi
750
751
752 dnl check if linear scan register allocator(lsra) should be used
753 AC_MSG_CHECKING(whether lsra should be supported)
754 AC_ARG_ENABLE([lsra],
755               [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=no]])],
756               [case "${enableval}" in
757                    yes) ENABLE_LSRA=yes;;
758                    *) ENABLE_LSRA=no;;
759                esac],
760               [ENABLE_LSRA=no])
761    
762 if test x"${ENABLE_LSRA}" = "xyes"; then
763     if test x"${ENABLE_SSA}" = "xyes"; then
764         ENABLE_LSRA="no"
765     fi
766 fi
767 AC_MSG_RESULT(${ENABLE_LSRA})
768 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
769  
770 if test x"${ENABLE_LSRA}" = "xyes"; then
771     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
772 fi
773
774
775 dnl check if profiling should be supported
776 AC_MSG_CHECKING(whether profiling should be supported)
777 AC_ARG_ENABLE([profiling],
778               [AS_HELP_STRING(--enable-profiling,enable profiling [[default=no]])],
779               [case "${enableval}" in
780                    yes) ENABLE_PROFILING=yes;;
781                    *) ENABLE_PROFILING=no;;
782                esac],
783               [ENABLE_PROFILING=no])
784 AC_MSG_RESULT(${ENABLE_PROFILING})
785 AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
786    
787 if test x"${ENABLE_PROFILING}" = "xyes"; then
788     AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
789 fi
790
791
792 dnl check for instruction scheduler
793 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
794
795 AC_MSG_CHECKING(whether instruction scheduler should be supported)
796 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
797         case "${ARCH_DIR}" in
798                 xdspcore )
799                         ;;
800                 * )
801                         AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
802                         ;;
803         esac
804
805         AC_MSG_RESULT(yes)
806         AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
807         AM_CONDITIONAL([USE_SCHEDULER], [true])
808 else
809         AC_MSG_RESULT(no)
810         AM_CONDITIONAL([USE_SCHEDULER], [false])
811 fi
812
813
814 dnl check if zlib should be used
815 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
816 AC_ARG_ENABLE([zlib],
817               [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
818               [case "${enableval}" in
819                   no) ENABLE_ZLIB=no;;
820                   *) ENABLE_ZLIB=yes;;
821                esac],
822               [ENABLE_ZLIB=yes])
823 AC_MSG_RESULT(${ENABLE_ZLIB})
824
825 if test x"${ENABLE_ZLIB}" = "xyes"; then
826     AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
827     AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
828     AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
829     AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
830 fi
831 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
832
833
834 dnl check if a libjvm.so should be built
835 AC_MSG_CHECKING(whether to build a libjvm.so)
836 AC_ARG_ENABLE([libjvm],
837               [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
838               [case "${enableval}" in
839                   no) ENABLE_LIBJVM=no;;
840                   *) ENABLE_LIBJVM=yes;;
841                esac],
842               [ENABLE_LIBJVM=yes])
843 AC_MSG_RESULT(${ENABLE_LIBJVM})
844 AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
845 AC_SUBST(ENABLE_LIBJVM)
846
847 if test x"${ENABLE_LIBJVM}" = "xyes"; then
848     AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
849
850     dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
851     enable_shared=yes
852     enable_static=no
853 else
854     enable_shared=no
855     enable_static=yes
856 fi
857
858 dnl libtool stuff
859 AC_LIBTOOL_DLOPEN
860 AC_PROG_LIBTOOL
861
862
863 dnl check if CACAO should be linked statically
864 AC_MSG_CHECKING(whether to link CACAO statically)
865 AC_ARG_ENABLE([staticvm],
866               [AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
867               [case "${enableval}" in
868                   yes) ENABLE_STATICVM=yes
869                        AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
870                        ;;
871                   *) ENABLE_STATICVM=no;;
872                esac],
873               [ENABLE_STATICVM=no])
874 AC_MSG_RESULT(${ENABLE_STATICVM})
875 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
876 AC_SUBST(ENABLE_STATICVM)
877
878
879 dnl where is CACAO's vm.zip
880 AC_MSG_CHECKING(where CACAO's vm.zip is installed)
881 AC_ARG_WITH([vm-zip],
882             [AS_HELP_STRING(--with-vm-zip=<path>,path to CACAO's vm.zip (includes the name of the file and may be flat) [[default=/usr/local/cacao/share/cacao/vm.zip]])],
883             [CACAO_VM_ZIP=${withval}],
884             [CACAO_VM_ZIP=${CACAO_PREFIX}/share/cacao/vm.zip])
885 AC_MSG_RESULT(${CACAO_VM_ZIP})
886 AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
887 AC_SUBST(CACAO_VM_ZIP)
888
889
890 dnl which Java core library are we using?
891 AC_MSG_CHECKING(which Java core library to use)
892 AC_ARG_WITH([classpath],
893             [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (gnu) [[default=gnu]])],
894             [case "${withval}" in
895                 cldc1.1)
896                     WITH_CLASSPATH=cldc1.1
897                     AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
898                     AC_SUBST(WITH_CLASSPATH_CLDC1_1)
899                     ;;
900                 gnu)
901                     WITH_CLASSPATH=gnu
902                     AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
903                     AC_SUBST(WITH_CLASSPATH_GNU)
904                     ;;
905                 *)
906                     AC_MSG_ERROR(unknown classpath ${withval})
907                     ;;
908              esac],
909             [WITH_CLASSPATH=gnu
910              AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
911              AC_SUBST(WITH_CLASSPATH_GNU)])
912 AC_MSG_RESULT(${WITH_CLASSPATH})
913 AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
914 AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
915
916
917 dnl where is Java core library installed?
918 AC_MSG_CHECKING(where Java core library is installed)
919 AC_ARG_WITH([classpath-prefix],
920             [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
921             [CLASSPATH_PREFIX=${withval}],
922             [CLASSPATH_PREFIX=/usr/local/classpath])
923 AC_MSG_RESULT(${CLASSPATH_PREFIX})
924 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
925 AC_SUBST(CLASSPATH_PREFIX)
926
927
928 dnl where are Java core library classes installed?
929 AC_MSG_CHECKING(where Java core library classes are installed)
930 AC_ARG_WITH([classpath-classes],
931             [AS_HELP_STRING(--with-classpath-classes=<path>,path to Java core library classes (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
932             [CLASSPATH_CLASSES=${withval}],
933             [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
934 AC_MSG_RESULT(${CLASSPATH_CLASSES})
935 AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
936 AC_SUBST(CLASSPATH_CLASSES)
937
938
939 dnl where are Java core library native libraries installed?
940 AC_MSG_CHECKING(where Java core library native libraries are installed)
941 AC_ARG_WITH([classpath-libdir],
942             [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
943             [CLASSPATH_LIBDIR=${withval}],
944             [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
945 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
946
947 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
948 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
949 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [Java core library native libraries installation directory])
950 AC_SUBST(CLASSPATH_LIBDIR)
951
952
953 dnl where are Java core library headers installed?
954 AC_MSG_CHECKING(where Java core library headers are installed)
955 AC_ARG_WITH([classpath-includedir],
956             [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library headers [[default=/usr/local/classpath/include]])],
957             [CLASSPATH_INCLUDEDIR=${withval}],
958             [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
959 AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
960
961 AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
962                 [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [Java core library jni.h header])],
963                 [AC_MSG_ERROR(cannot find jni.h)])
964
965
966 dnl if we compile for a JRE-style directory layout
967 AC_MSG_CHECKING(if we compile for a JRE-style directory layout)
968 AC_ARG_WITH([jre-layout],
969             [AS_HELP_STRING(--with-jre-layout,compile for JRE-style directory layout [[default=no]])],
970             [case "${enableval}" in
971                 yes) WITH_JRE_LAYOUT=yes
972                      AC_DEFINE([WITH_JRE_LAYOUT], 1, [with JRE layout])
973                      ;;
974                 *) WITH_JRE_LAYOUT=no;;
975              esac],
976             [WITH_JRE_LAYOUT=no])
977 AC_MSG_RESULT(${WITH_JRE_LAYOUT})
978
979
980 dnl check if GNU Classpath should be linked statically into CACAO
981 AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
982 AC_ARG_WITH([static-classpath],
983             [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
984             [case "${enableval}" in
985                 yes) WITH_STATIC_CLASSPATH=yes;;
986                 *) WITH_STATIC_CLASSPATH=no;;
987              esac],
988             [WITH_STATIC_CLASSPATH=no])
989 AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
990
991 if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
992     AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
993
994     dnl check for some classpath related stuff when we link statically
995     AM_ICONV_LINK
996 else
997     dnl we need this check for --enable-staticvm, otherwise ltdl can't find dlopen
998     if test x"${ENABLE_STATICVM}" = "xyes"; then
999         AC_CHECK_LIB(dl, dlopen,, [AC_MSG_ERROR(cannot find libdl)])
1000     fi
1001
1002     AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
1003     AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
1004 fi
1005 AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
1006 AC_SUBST(WITH_STATIC_CLASSPATH)
1007
1008
1009 dnl check for some programs we need
1010 AC_PROG_JAVAC
1011 AC_PROG_JAR
1012
1013
1014 dnl finally pass CFLAGS to Makefiles via AM_CFLAGS
1015 CFLAGS=$OPT_CFLAGS
1016 AM_CFLAGS=$ARCH_CFLAGS
1017 AC_SUBST(AM_CFLAGS)
1018
1019
1020 AC_CONFIG_FILES([Makefile]
1021                 [contrib/Makefile]
1022                 [contrib/setenvinstalled]
1023                 [contrib/setenvsource]
1024                 [doc/Makefile]
1025                 [doc/handbook/Makefile]
1026                 [man/Makefile]
1027                 [src/Makefile]
1028                 [src/cacao/Makefile]
1029                 [src/cacaoh/Makefile]
1030                 [src/fdlibm/Makefile]
1031                 [src/lib/Makefile]
1032                 [src/mm/Makefile]
1033                 [src/mm/cacao-gc/Makefile]
1034                 [src/native/Makefile]
1035                 [src/native/include/Makefile]
1036                 [src/native/jvmti/Makefile]
1037                 [src/native/tools/Makefile]
1038                 [src/native/vm/Makefile]
1039                 [src/native/vm/cldc1.1/Makefile]
1040                 [src/native/vm/gnu/Makefile]
1041                 [src/scripts/Makefile]
1042                 [src/scripts/java]
1043                 [src/threads/Makefile]
1044                 [src/threads/native/Makefile]
1045                 [src/threads/none/Makefile]
1046                 [src/toolbox/Makefile]
1047                 [src/vm/Makefile]
1048                 [src/vm/jit/Makefile]
1049                 [src/vm/jit/allocator/Makefile]
1050                 [src/vm/jit/alpha/Makefile]
1051                 [src/vm/jit/alpha/freebsd/Makefile]
1052                 [src/vm/jit/alpha/linux/Makefile]
1053                 [src/vm/jit/arm/Makefile]
1054                 [src/vm/jit/arm/linux/Makefile]
1055                 [src/vm/jit/i386/Makefile]
1056                 [src/vm/jit/i386/cygwin/Makefile]
1057                 [src/vm/jit/i386/darwin/Makefile]
1058                 [src/vm/jit/i386/freebsd/Makefile]
1059                 [src/vm/jit/i386/linux/Makefile]
1060                 [src/vm/jit/intrp/Makefile]
1061                 [src/vm/jit/inline/Makefile]
1062                 [src/vm/jit/loop/Makefile]
1063                 [src/vm/jit/mips/Makefile]
1064                 [src/vm/jit/mips/irix/Makefile]
1065                 [src/vm/jit/mips/linux/Makefile]
1066                 [src/vm/jit/optimizing/Makefile]
1067                 [src/vm/jit/parisc/Makefile]
1068                 [src/vm/jit/parisc/linux/Makefile]
1069                 [src/vm/jit/powerpc/Makefile]
1070                 [src/vm/jit/powerpc/darwin/Makefile]
1071                 [src/vm/jit/powerpc/linux/Makefile]
1072                 [src/vm/jit/powerpc/netbsd/Makefile]
1073                 [src/vm/jit/powerpc64/Makefile]
1074                 [src/vm/jit/powerpc64/linux/Makefile]
1075                 [src/vm/jit/s390/Makefile]
1076                 [src/vm/jit/schedule/Makefile]
1077                 [src/vm/jit/sparc64/Makefile]
1078                 [src/vm/jit/sparc64/linux/Makefile]
1079                 [src/vm/jit/tools/Makefile]
1080                 [src/vm/jit/verify/Makefile]
1081                 [src/vm/jit/x86_64/Makefile]
1082                 [src/vm/jit/x86_64/freebsd/Makefile]
1083                 [src/vm/jit/x86_64/linux/Makefile]
1084                 [src/vmcore/Makefile]
1085                 [tests/Makefile]
1086                 [tests/regression/Makefile]
1087                 [tests/regression/codepatching/Makefile]
1088                 [tests/regression/jasmin/Makefile]
1089                 [tests/regression/native/Makefile])
1090
1091
1092 dnl now configure subpackages with OPT_CFLAGS and ARCH_CFLAGS
1093 export OPT_CFLAGS
1094 export ARCH_CFLAGS
1095 AC_CONFIG_SUBDIRS(src/mm/boehm-gc)
1096
1097
1098 AC_OUTPUT
1099
1100
1101 ## Local variables:
1102 ## mode: m4
1103 ## indent-tabs-mode: t
1104 ## c-basic-offset: 4
1105 ## tab-width: 8
1106 ## compile-command: "automake --add-missing"
1107 ## End: