* doc/inlining_stacktrace.txt: Added warning about signedness.
[cacao.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(cacao, 0.94+cvs, cacao@cacaojvm.org)
4 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
5 AC_CANONICAL_HOST
6 AC_PREREQ(2.59)
7 AM_INIT_AUTOMAKE([1.9.0])
8 AM_MAINTAINER_MODE
9
10 AM_CONFIG_HEADER([config.h])
11
12 AC_PREFIX_DEFAULT(/usr/local/cacao)
13
14
15 dnl set optimization and debugging for all architectures and systems
16 if test x"$CFLAGS" = "x"; then
17         CFLAGS="-O0 -g3"
18 fi
19
20 dnl system type
21 case "$host_cpu" in
22 alpha | alphaev56 | alphapca56 )
23         ARCH_DIR="alpha"
24         CFLAGS="$CFLAGS -mieee -D__ALPHA__"
25         ;;
26
27 arm | armv4tl | armv5b )
28         ARCH_DIR="arm"
29         CFLAGS="$CFLAGS -D__ARM__"
30         ;;
31
32 i386 | i486 | i586 | i686 )
33         ARCH_DIR="i386"
34         CFLAGS="$CFLAGS -D__I386__"
35         ;;
36
37 mips )
38         ARCH_DIR="mips"
39         CFLAGS="$CFLAGS -D__MIPS__"
40         ;;
41
42 powerpc )
43         ARCH_DIR="powerpc"
44         CFLAGS="$CFLAGS -D__POWERPC__"
45         ;;
46
47 powerpc64 )
48         ARCH_DIR="powerpc64"
49         CFLAGS="$CFLAGS -D__POWERPC64__"
50         ;;
51
52 x86_64 )
53         ARCH_DIR="x86_64"
54         CFLAGS="$CFLAGS -D__X86_64__"
55         ;;
56
57 xdspcore )
58         ARCH_DIR="xdspcore"
59         ENABLE_STATICVM="yes"
60         CFLAGS="$CFLAGS -D__XDSPCORE__"
61         USE_SCHEDULER="1"
62         ;;
63 * )
64         AC_MSG_ERROR($host_cpu systems are not supported at this time)
65         ;;
66 esac
67
68 dnl host type
69 echo $host_os
70 case "$host_os" in
71 *linux* | *Linux* )
72         OS_DIR="linux"
73         CFLAGS="$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"
74         ;;
75 *darwin* )
76         OS_DIR="darwin"
77         CFLAGS="$CFLAGS -D__DARWIN__ -ansi -pedantic -Wall -Wno-long-long"
78         ;;
79 *freebsd* )
80         OS_DIR="freebsd"
81         CFLAGS="$CFLAGS -D__FREEBSD__ -ansi -pedantic -Wall -Wno-long-long -D_XOPEN_SOURCE_EXTENDED"
82         ;;
83 *irix* )
84         OS_DIR="irix"
85         CFLAGS="$CFLAGS -D__IRIX__"
86         ;;
87 * )
88         ;;
89 esac
90
91
92 dnl define and substitute some architecture specific variables
93 AC_DEFINE_UNQUOTED([ARCH_DIR], "${ARCH_DIR}", [architecture directory])
94 AC_SUBST(ARCH_DIR)
95 AC_SUBST(OS_DIR)
96 AC_SUBST(USE_SCHEDULER)
97
98
99 dnl Checks for programs.
100 AC_PROG_CC
101 AM_PROG_AS
102 AC_PROG_LD
103 AC_PROG_LD_GNU
104 AC_PROG_RANLIB
105 AC_DISABLE_SHARED
106 AC_PROG_LN_S
107 AC_PROG_MAKE_SET
108 AM_PROG_MKDIR_P
109
110 dnl libtool stuff
111 AC_LIBTOOL_DLOPEN
112 AC_PROG_LIBTOOL
113
114 dnl Checks for header files.
115 AC_HEADER_DIRENT
116 AC_HEADER_STDC
117 AC_CHECK_HEADERS([fcntl.h])
118 AC_CHECK_HEADERS([sys/time.h])
119 AC_CHECK_HEADERS([unistd.h])
120 AC_CHECK_HEADERS([sys/ioctl.h])
121
122 dnl this is for fdlibm
123 AC_CHECK_HEADERS([stdint.h])
124 AC_CHECK_HEADERS([inttypes.h])
125 AC_CHECK_HEADERS([sys/config.h])
126 AC_CHECK_HEADERS([sys/types.h])
127 AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
128 AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
129 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]))
130 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]))
131
132 dnl Checks for typedefs, structures, and compiler characteristics.
133 AC_C_CONST
134 AC_C_INLINE
135 AC_C_ATTRIBUTE
136 AC_TYPE_OFF_T
137 AC_TYPE_SIZE_T
138 AC_HEADER_TIME
139 AC_STRUCT_TM
140
141 dnl Checks for library functions.
142 AC_PROG_GCC_TRADITIONAL
143 AC_TYPE_SIGNAL
144 AC_FUNC_MEMCMP
145 AC_CHECK_FUNCS([calloc mprotect getpagesize free])
146 AC_CHECK_FUNCS([getcwd gettimeofday])
147 AC_CHECK_FUNCS([scandir])
148 AC_CHECK_FUNCS([mmap])
149 AC_CHECK_FUNCS([isnan])
150
151 dnl Checks for libraries.
152
153 dnl Checking sizeof void *
154 AC_CHECK_SIZEOF(void *)
155 AC_C_BIGENDIAN
156
157
158 dnl check which ld flags are required to export symbols
159 if test x"$with_gnu_ld" = "xyes"; then
160     EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
161 else
162     EXPORT_SYMBOLS_FLAGS=""
163 fi
164 AC_SUBST(EXPORT_SYMBOLS_FLAGS)
165
166
167 dnl define install prefix
168 if test "x$prefix" = "xNONE"; then
169     CACAO_PREFIX=$ac_default_prefix
170 else
171     CACAO_PREFIX=$prefix
172 fi
173 AC_DEFINE_UNQUOTED([CACAO_PREFIX], "${CACAO_PREFIX}", [installation prefix])
174 AC_SUBST(CACAO_PREFIX)
175
176
177 dnl Features
178
179 dnl check arguments
180
181 dnl check for JIT compiler
182 AC_MSG_CHECKING(whether JIT compiler should be compiled)
183 AC_ARG_ENABLE([jit],
184               [AS_HELP_STRING(--disable-jit,disable JIT compiler [[default=yes]])],
185               [case "${enableval}" in
186                    no) ENABLE_JIT=no;;
187                    *) ENABLE_JIT=yes;;
188                esac],
189               [ENABLE_JIT=yes])
190 AC_MSG_RESULT(${ENABLE_JIT})
191 AM_CONDITIONAL([ENABLE_JIT], test x"${ENABLE_JIT}" = "xyes")
192
193 if test x"${ENABLE_JIT}" = "xyes"; then
194     AC_DEFINE([ENABLE_JIT], 1, [enable JIT compiler])
195 fi
196
197
198 dnl check if softfloat should be used
199 AC_MSG_CHECKING(whether softfloat should be used)
200 AC_ARG_ENABLE([softfloat],
201               [AS_HELP_STRING(--enable-softfloat,use softfloat [[default=no]])],
202               [case "${enableval}" in
203                   yes) ENABLE_SOFTFLOAT=yes;;
204                   *) ENABLE_SOFTFLOAT=no;;
205                esac],
206               [ENABLE_SOFTFLOAT=no])
207 AC_MSG_RESULT(${ENABLE_SOFTFLOAT})
208
209 if test x"${ENABLE_SOFTFLOAT}" = "xyes"; then
210     AC_DEFINE([ENABLE_SOFTFLOAT], 1, [enable softfloat])
211 fi
212
213
214 dnl check for interpreter
215 AC_ARG_ENABLE([intrp], [AS_HELP_STRING(--enable-intrp,enable interpreter [[default=no]])])
216
217 AC_MSG_CHECKING(whether interpreter should be compiled)
218 if test x"$enable_intrp" = "xyes"; then
219     AC_MSG_RESULT(yes)
220     AC_DEFINE([ENABLE_INTRP], 1, [enable interpreter])
221     AM_CONDITIONAL([ENABLE_INTRP], [true])
222     ENABLE_INTRP=yes
223
224     AC_ASM_SKIP16
225
226     dnl check for libffi
227     AC_ARG_WITH([ffi],
228                 [AS_HELP_STRING(--with-ffi,use libffi to call native functions)],
229                 [WITH_FFI=yes
230                  AC_CHECK_HEADERS([ffi.h],, [AC_MSG_ERROR(cannot find ffi.h)])
231                  AC_CHECK_LIB(ffi, ffi_call,, [AC_MSG_ERROR(cannot find libffi)])
232                  AC_DEFINE([WITH_FFI], 1, [use libffi])],
233                 [WITH_FFI=no])
234
235     dnl check for libffcall
236     AC_ARG_WITH([ffcall],
237                 [AS_HELP_STRING(--with-ffcall,use libffcall to call native functions)],
238                 [WITH_FFCALL=yes
239                  AC_CHECK_HEADERS([avcall.h],, [AC_MSG_ERROR(cannot find avcall.h)])
240                  AC_CHECK_LIB(avcall, __builtin_avcall,, [AC_MSG_ERROR(cannot find libavcall (from libffcall))])
241                  AC_DEFINE([WITH_FFCALL], 1, [use libffcall])],
242                 [WITH_FFCALL=no])
243
244     dnl check for libffi or libffcall
245     if test x"${WITH_FFI}" = "xyes" -a x"${WITH_FFCALL}" = "xyes"; then
246         AC_ERROR(Enable only libffi or libffcall.)
247     fi
248     if test x"${WITH_FFI}" = "xno" -a x"${WITH_FFCALL}" = "xno"; then
249         AC_ERROR(Enable one of libffi or libffcall.)
250     fi
251
252 else
253     AC_MSG_RESULT(no)
254     AM_CONDITIONAL([ENABLE_INTRP], [false])
255     ENABLE_INTRP="no"
256 fi
257
258 if test x"${ENABLE_JIT}" = "xno" -a x"${ENABLE_INTRP}" = "xno"; then
259     AC_ERROR(You have to enable at least the JIT or the interpreter.)
260 fi
261
262
263 dnl check for garbage collector usage
264 AC_MSG_CHECKING(whether GC should be disabled)
265 AC_ARG_ENABLE([gc],
266               [AS_HELP_STRING(--disable-gc,disable garbage collector (for debugging only!) [[default=yes]])],
267               [case "${enableval}" in
268                    no) DISABLE_GC=yes
269                        AC_DEFINE([DISABLE_GC], 1, [disable garbage collector])
270                        ;;
271                    *) DISABLE_GC=no;;
272                esac],
273               [DISABLE_GC=no])
274 AC_MSG_RESULT(${DISABLE_GC})
275 AM_CONDITIONAL([DISABLE_GC], test x"${DISABLE_GC}" = "xyes")
276
277
278 dnl check for dump memory usage
279 AC_MSG_CHECKING(whether dump memory should be disabled)
280 AC_ARG_ENABLE([dump],
281               [AS_HELP_STRING(--disable-dump,disable dump memory (for debugging only!) [[default=yes]])],
282               [case "${enableval}" in
283                    no)
284                        DISABLE_DUMP=yes
285                        AC_DEFINE([DISABLE_DUMP], 1, [disable dump memory])
286                        ;;
287                    *) DISABLE_DUMP=no;;
288                esac],
289                [DISABLE_DUMP=no])
290 AC_MSG_RESULT(${DISABLE_DUMP})
291
292
293 dnl check for debug
294 AC_MSG_CHECKING(whether debug code generation should be enabled)
295 AC_ARG_ENABLE([debug],
296               [AS_HELP_STRING(--disable-debug,disable debug code generation [[default=yes]])],
297               [case "${enableval}" in
298                    no) NDEBUG=yes
299                        AC_DEFINE([NDEBUG], 1, [disable debug code])
300                        ;;
301                    *) NDEBUG=no;;
302                esac],
303               [NDEBUG=no])
304
305 if test x"${NDEBUG}" = "xno"; then
306     AC_MSG_RESULT(yes)
307
308     dnl check for binutils headers and libraries on some architectures for the
309     dnl disassembler
310     case "${ARCH_DIR}" in
311         arm | i386 | powerpc | x86_64 )
312             AC_CHECK_HEADER([ansidecl.h],, [AC_MSG_ERROR(cannot find ansidecl.h)])
313             AC_CHECK_HEADER([symcat.h],, [AC_MSG_ERROR(cannot find symcat.h)])
314             AC_CHECK_HEADER([bfd.h],, [AC_MSG_ERROR(cannot find bfd.h)])
315             AC_CHECK_HEADER([dis-asm.h],, [AC_MSG_ERROR(cannot find dis-asm.h)])
316
317             case "${OS_DIR}" in
318                 cygwin | darwin )
319                      AC_CHECK_LIB(intl, dcgettext,, [AC_MSG_ERROR(cannot find libintl (from bintuils))])
320                      ;;
321             esac
322
323             AC_CHECK_LIB(iberty, xstrerror,, [AC_MSG_ERROR(cannot find libiberty (from bintuils))])
324             AC_CHECK_LIB(bfd, bfd_get_arch,, [AC_MSG_ERROR(cannot find libbfd (from bintuils))])
325             AC_CHECK_LIB(opcodes, init_disassemble_info,, [AC_MSG_ERROR(cannot find libopcodes (from bintuils))])
326             AC_DEFINE([WITH_BINUTILS_DISASSEMBLER], 1, [use binutils disassembler])
327             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [true])
328             ;;
329         * )
330             AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
331             ;;
332     esac
333
334 else
335     AC_MSG_RESULT(no)
336     AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
337 fi
338 AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
339
340
341 dnl check for statistics
342 AC_MSG_CHECKING(whether statistics generation should be enabled)
343 AC_ARG_ENABLE([statistics],
344               [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])],
345               [case "${enableval}" in
346                    no) ENABLE_STATISTICS=no;;
347                    *) ENABLE_STATISTICS=yes;;
348                esac],
349               [ENABLE_STATISTICS=yes])
350 AC_MSG_RESULT(${ENABLE_STATISTICS})
351 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
352
353 if test x"${ENABLE_STATISTICS}" = "xyes"; then
354     AC_DEFINE([ENABLE_STATISTICS], 1, [enable statistics])
355 fi
356
357
358 dnl check for JVMTI
359 AC_MSG_CHECKING(whether to compile JVMTI support)
360 AC_ARG_ENABLE([jvmti],
361               [AS_HELP_STRING(--enable-jvmti,enable JVMTI [[default=no]])],
362               [case "${enableval}" in
363                    yes) ENABLE_JVMTI=yes;;
364                    *) ENABLE_JVMTI=no;;
365                esac],
366               [ENABLE_JVMTI=no])
367 AC_MSG_RESULT(${ENABLE_JVMTI})
368 AM_CONDITIONAL([ENABLE_JVMTI], test x"${ENABLE_JVMTI}" = "xyes")
369
370 if test x"${ENABLE_JVMTI}" = "xyes"; then
371     AC_DEFINE([ENABLE_JVMTI], 1, [use JVMTI])
372 fi
373
374
375 dnl threads
376 AC_ARG_ENABLE([threads], [AS_HELP_STRING(--enable-threads,enable threads support (none,green,native) [[default=native]])])
377 AC_ARG_ENABLE([__thread], [AS_HELP_STRING(--enable-__thread,use TLS features)], [use__thread=$enableval], [use__thread=no])
378
379 AC_MSG_CHECKING(whether to include threads support)
380 enable_threads=${enable_threads:-native}
381 case "$enable_threads" in
382 no | none | single)
383         AC_MSG_RESULT(no)
384         dnl no threads for boehm
385         ac_configure_args="$ac_configure_args --disable-boehm-threads"
386         AM_CONDITIONAL([USE_THREADS], [false])
387         AM_CONDITIONAL([NATIVE_THREADS], [false])
388         ;;
389
390 green | native | posix | pthreads)
391         AC_DEFINE([USE_THREADS], 1, [use threads])
392
393         AM_CONDITIONAL([USE_THREADS], [true])
394
395         if test x"$enable_threads" != "xgreen"; then
396                 AC_MSG_RESULT(yes, native)
397                 AC_CHECK_LIB(pthread, main)
398                 AC_DEFINE([NATIVE_THREADS], 1, [use pthreads])
399
400                 CFLAGS="$CFLAGS -D_REENTRANT"
401
402                 dnl tell boehm to support threads as well
403                 ac_configure_args="$ac_configure_args --enable-boehm-threads=posix"
404                 AM_CONDITIONAL([NATIVE_THREADS], [true])
405
406         else
407                 AC_MSG_RESULT(yes, green)
408
409                 dnl no threads for boehm
410                 ac_configure_args="$ac_configure_args --disable-boehm-threads"
411                 AM_CONDITIONAL([NATIVE_THREADS], [false])
412         fi
413     ;;
414 *)
415     AC_MSG_ERROR($enable_threads is an unknown thread package)
416     ;;
417 esac
418
419
420 dnl Check whether the compiler supports the __thread keyword.
421 if test "x$use__thread" != xno; then
422   AC_CACHE_CHECK([for __thread], ac_cv_gcc___thread,
423   [cat > conftest.c <<\EOF
424 __thread int a = 42;
425 EOF
426   if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
427     ac_cv_gcc___thread=yes 
428   else
429     ac_cv_gcc___thread=no
430   fi
431   rm -f conftest*])
432   if test "$ac_cv_gcc___thread" = yes; then
433     AC_DEFINE([HAVE___THREAD], 1, [have __thread])
434   fi
435 else
436   ac_cv_gcc___thread=no
437 fi
438
439
440 dnl check if linear scan register allocator(lsra) should be used
441 AC_MSG_CHECKING(whether lsra should be supported)
442 AC_ARG_ENABLE([lsra],
443               [AS_HELP_STRING(--enable-lsra,enable linear scan register allocator [[default=yes]])],
444               [case "${enableval}" in
445                    no) ENABLE_LSRA=no;;
446                    *) ENABLE_LSRA=yes;;
447                esac],
448               [ENABLE_LSRA=yes])
449 AC_MSG_RESULT(${ENABLE_LSRA})
450 AM_CONDITIONAL([ENABLE_LSRA], test x"${ENABLE_LSRA}" = "xyes")
451    
452 if test x"${ENABLE_LSRA}" = "xyes"; then
453     AC_DEFINE([ENABLE_LSRA], 1, [enable lsra])
454 fi
455
456
457 dnl check for inlining
458 dnl AC_ARG_ENABLE([inlining], [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])])
459
460 dnl AC_MSG_CHECKING(whether method inlining should be disabled)
461 dnl if test x"$enable_inlining" = "xno"; then
462 dnl     AC_MSG_RESULT(yes)
463 dnl     AM_CONDITIONAL([USE_INLINING], [false])
464 dnl else
465 dnl     AC_MSG_RESULT(no)
466         AC_DEFINE([USE_INLINING], 1, [use method inlining])
467         AM_CONDITIONAL([USE_INLINING], [true])
468 dnl fi
469
470
471 dnl check for instruction scheduler
472 AC_ARG_ENABLE([scheduler], [AS_HELP_STRING(--enable-scheduler,enable instruction scheduler [[default=no]])])
473
474 AC_MSG_CHECKING(whether instruction scheduler should be supported)
475 if test x"${USE_SCHEDULER}" = "x1" -o x"$enable_scheduler" = "xyes"; then
476         case "${ARCH_DIR}" in
477                 xdspcore )
478                         ;;
479                 * )
480                         AC_MSG_ERROR(instruction scheduler is not available for ${ARCH_DIR} code generator)
481                         ;;
482         esac
483
484         AC_MSG_RESULT(yes)
485         AC_DEFINE([USE_SCHEDULER], 1, [use scheduler])
486         AM_CONDITIONAL([USE_SCHEDULER], [true])
487 else
488         AC_MSG_RESULT(no)
489         AM_CONDITIONAL([USE_SCHEDULER], [false])
490 fi
491
492
493 dnl check if zlib should be used
494 AC_MSG_CHECKING(whether ZIP/JAR archives should be supported)
495 AC_ARG_ENABLE([zlib],
496               [AS_HELP_STRING(--disable-zlib,disable ZIP/JAR archive support (needs zlib) [[default=yes]])],
497               [case "${enableval}" in
498                   no) ENABLE_ZLIB=no;;
499                   *) ENABLE_ZLIB=yes;;
500                esac],
501               [ENABLE_ZLIB=yes])
502 AC_MSG_RESULT(${ENABLE_ZLIB})
503
504 if test x"${ENABLE_ZLIB}" = "xyes"; then
505     AC_CHECK_HEADERS([zconf.h],, [AC_MSG_ERROR(cannot find zconf.h)])
506     AC_CHECK_HEADERS([zlib.h],, [AC_MSG_ERROR(cannot find zlib.h)])
507     AC_CHECK_LIB(z, inflate,, [AC_MSG_ERROR(cannot find libz)])
508     AC_DEFINE([ENABLE_ZLIB], 1, [use zlib])
509     VM_ZIP_STRING=vm.zip
510 else
511     VM_ZIP_STRING=classes/
512 fi
513 AC_DEFINE_UNQUOTED(VM_ZIP_STRING, "${VM_ZIP_STRING}", [define to the string base name of the VM zip file])
514 AC_SUBST(VM_ZIP_STRING)
515 AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
516
517
518 dnl check if CACAO should be linked statically
519 AC_MSG_CHECKING(whether to link GNU classpath native libraries statically into CACAO)
520 AC_ARG_ENABLE([staticvm],
521               [AS_HELP_STRING(--enable-staticvm, link GNU classpath native libraries statically into CACAO [[default=no]])],
522               [case "${enableval}" in
523                   yes) ENABLE_STATICVM=yes;;
524                   *) ENABLE_STATICVM=no;;
525                esac],
526               [ENABLE_STATICVM=no])
527 AC_MSG_RESULT(${ENABLE_STATICVM})
528
529 if test x"${ENABLE_STATICVM}" = "xyes"; then
530     AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
531
532     dnl check for some classpath related stuff when we link statically
533     AM_ICONV_LINK
534 else
535     AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
536     AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
537 fi
538 AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
539 AC_SUBST(ENABLE_STATICVM)
540
541
542 dnl is GNU classpath installed somewhere different
543 AC_MSG_CHECKING(where GNU Classpath is installed)
544 AC_ARG_WITH([classpath-prefix],
545             [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of GNU Classpath [[default=/usr/local/classpath]])],
546             [CLASSPATH_PREFIX=${withval}],
547             [CLASSPATH_PREFIX=/usr/local/classpath])
548 AC_MSG_RESULT(${CLASSPATH_PREFIX})
549 AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [GNU Classpath installation directory])
550 AC_SUBST(CLASSPATH_PREFIX)
551
552 AC_MSG_CHECKING(where GNU Classpath libraries are installed)
553 AC_ARG_WITH([classpath-libdir],
554             [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of GNU Classpath libraries [[default=/usr/local/classpath/lib]])],
555             [CLASSPATH_LIBDIR=${withval}],
556             [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
557 AC_MSG_RESULT(${CLASSPATH_LIBDIR})
558
559 dnl expand CLASSPATH_LIBDIR to something that is usable in C code
560 AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
561 AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [GNU Classpath libraries installation directory])
562
563 AC_SUBST(CLASSPATH_LIBDIR)
564
565
566
567 dnl Maybe the user has Classpath installed 'flat'.
568 AC_ARG_WITH([flat-classpath], [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
569 if test x"$with_flat_classpath" = "x"; then
570         GLIBJ_ZIP_STRING=glibj.zip
571 else
572         GLIBJ_ZIP_STRING=
573 fi
574 AC_SUBST(GLIBJ_ZIP_STRING)
575 AC_DEFINE_UNQUOTED(GLIBJ_ZIP_STRING, "$GLIBJ_ZIP_STRING", [define to the string base name of the classpath zip file])
576
577
578 dnl check for some programs we need
579 AC_PROG_JAVAC
580 AC_PROG_JAR
581
582
583 dnl now configure subpackages
584 dnl the export is not my favorite (is there another way?)
585 export CFLAGS
586 AC_CONFIG_SUBDIRS(src/boehm-gc)
587
588 AC_CONFIG_FILES([Makefile]
589                 [contrib/Makefile]
590                 [contrib/setenvinstalled]
591                 [contrib/setenvsource]
592                 [doc/Makefile]
593                 [doc/handbook/Makefile]
594                 [man/Makefile]
595                 [src/Makefile]
596                 [src/cacao/Makefile]
597                 [src/cacaoh/Makefile]
598                 [src/fdlibm/Makefile]
599                 [src/lib/Makefile]
600                 [src/mm/Makefile]
601                 [src/native/Makefile]
602                 [src/native/include/Makefile]
603                 [src/native/jvmti/Makefile]
604                 [src/native/tools/Makefile]
605                 [src/native/vm/Makefile]
606                 [src/scripts/Makefile]
607                 [src/scripts/java]
608                 [src/scripts/rmiregistry]
609                 [src/threads/Makefile]
610                 [src/threads/green/Makefile]
611                 [src/threads/native/Makefile]
612                 [src/toolbox/Makefile]
613                 [src/vm/Makefile]
614                 [src/vm/jit/Makefile]
615                 [src/vm/jit/allocator/Makefile]
616                 [src/vm/jit/alpha/Makefile]
617                 [src/vm/jit/alpha/freebsd/Makefile]
618                 [src/vm/jit/alpha/linux/Makefile]
619                 [src/vm/jit/i386/Makefile]
620                 [src/vm/jit/i386/freebsd/Makefile]
621                 [src/vm/jit/i386/linux/Makefile]
622                 [src/vm/jit/intrp/Makefile]
623                 [src/vm/jit/inline/Makefile]
624                 [src/vm/jit/loop/Makefile]
625                 [src/vm/jit/mips/Makefile]
626                 [src/vm/jit/mips/irix/Makefile]
627                 [src/vm/jit/mips/linux/Makefile]
628                 [src/vm/jit/powerpc/Makefile]
629                 [src/vm/jit/powerpc/darwin/Makefile]
630                 [src/vm/jit/powerpc/linux/Makefile]
631                 [src/vm/jit/schedule/Makefile]
632                 [src/vm/jit/tools/Makefile]
633                 [src/vm/jit/verify/Makefile]
634                 [src/vm/jit/x86_64/Makefile]
635                 [tests/Makefile]
636                 [tests/regression/Makefile]
637                 [tests/regression/codepatching/Makefile]
638                 [tests/regression/native/Makefile])
639
640 AC_OUTPUT
641
642
643 ## Local variables:
644 ## mode: m4
645 ## indent-tabs-mode: t
646 ## c-basic-offset: 4
647 ## tab-width: 8
648 ## compile-command: "automake --add-missing"
649 ## End: