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