jamvm
view configure.ac @ 410:3857371c74a7
Fix location of runtime library and inclusion of reflection classes.
| author | andrew |
|---|---|
| date | Tue Aug 05 08:33:25 2008 +0100 (2008-08-05) |
| parents | 24373fc1d951 |
| children |
line source
1 ##
2 ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
3 ## Robert Lougher <rob@lougher.org.uk>.
4 ##
5 ## This file is part of JamVM.
6 ##
7 ## This program is free software; you can redistribute it and/or
8 ## modify it under the terms of the GNU General Public License
9 ## as published by the Free Software Foundation; either version 2,
10 ## or (at your option) any later version.
11 ##
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
16 ##
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 ##
22 dnl Process this file with autoconf to produce a configure script.
24 AC_INIT(src/jam.c)
25 AM_INIT_AUTOMAKE(jamvm, 1.5.1)
26 AC_CONFIG_HEADERS([src/config.h])
27 AC_PREFIX_DEFAULT(/usr/local/jamvm)
29 AC_CANONICAL_HOST
31 case "$host" in
32 i[[3456]]86-*-linux*) host_cpu=i386 host_os=linux ;;
33 i[[3456]]86-*-kfreebsd*) host_cpu=i386 host_os=linux ;;
34 i[[3456]]86-*-darwin*) host_cpu=i386 host_os=darwin ;;
35 arm*-*-darwin*) host_cpu=arm host_os=darwin libdl_needed=no ;;
36 i386-*-openbsd*) host_os=bsd libdl_needed=no ;;
37 i386-*-freebsd*) host_os=bsd libdl_needed=no ;;
38 x86_64-*-linux*) host_os=linux ;;
39 hppa*-*-linux*) host_cpu=parisc host_os=linux ;;
40 mipsel-*-linux*) host_cpu=mips host_os=linux ;;
41 amd64-*-openbsd*) host_os=bsd libdl_needed=no ;;
42 amd64-*-freebsd*) host_os=bsd libdl_needed=no ;;
43 arm*-*-linux*) host_cpu=arm host_os=linux ;;
44 arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
45 arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
46 powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
47 powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
48 powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
49 powerpc-*-darwin*) host_os=darwin ;;
50 *) AC_MSG_ERROR($host not supported) ;;
51 esac
53 arch=$host_cpu
54 os=$host_os
55 AC_SUBST(arch)
56 AC_SUBST(os)
58 AC_ARG_ENABLE(tracegc,
59 [AS_HELP_STRING(--enable-tracegc,add gc tracing (for debugging))],
60 [if test "$enableval" != no; then
61 AC_DEFINE([TRACEGC],1,[defined if gc tracing enabled for debugging])
62 fi],)
64 AC_ARG_ENABLE(tracealloc,
65 [AS_HELP_STRING(--enable-tracealloc,add object allocation tracing (for debugging))],
66 [if test "$enableval" != no; then
67 AC_DEFINE([TRACEALLOC],1,[defined if object allocation tracing enabled for debugging])
68 fi],)
70 AC_ARG_ENABLE(tracefnlz,
71 [AS_HELP_STRING(--enable-tracefnlz,add object finalisation tracing (for debugging))],
72 [if test "$enableval" != no; then
73 AC_DEFINE([TRACEFNLZ],1,[defined if object finalisation tracing enabled for debugging])
74 fi],)
76 AC_ARG_ENABLE(tracedll,
77 [AS_HELP_STRING(--enable-tracedll,add library loading/lookup tracing (for debugging))],
78 [if test "$enableval" != no; then
79 AC_DEFINE([TRACEDLL],1,[defined if library loading/unloading tracing enabled for debugging])
80 fi],)
82 AC_ARG_ENABLE(tracelock,
83 [AS_HELP_STRING(--enable-tracelock,add object locking tracing (for debugging))],
84 [if test "$enableval" != no; then
85 AC_DEFINE([TRACELOCK],1,[defined if object locking tracing enabled for debugging])
86 fi],)
88 AC_ARG_ENABLE(tracethread,
89 [AS_HELP_STRING(--enable-tracethread,add thread creation tracing (for debugging))],
90 [if test "$enableval" != no; then
91 AC_DEFINE([TRACETHREAD],1,[defined if thread creation tracing enabled for debugging])
92 fi],)
94 AC_ARG_ENABLE(tracecompact,
95 [AS_HELP_STRING(--enable-tracecompact,add GC compaction phase tracing (for debugging))],
96 [if test "$enableval" != no; then
97 AC_DEFINE([TRACECOMPACT],1,[defined if GC compaction phase tracing enabled for debugging])
98 fi],)
100 AC_ARG_ENABLE(tracedirect,
101 [AS_HELP_STRING(--enable-tracedirect,add interpreter direct-mode tracing (for debugging))],
102 [if test "$enableval" != no; then
103 AC_DEFINE([TRACEDIRECT],1,[defined if interpreter direct-mode tracing enabled for debugging])
104 fi],)
106 AC_ARG_ENABLE(traceinlining,
107 [AS_HELP_STRING(--enable-traceinlining,add interpreter inlining tracing (for debugging))],
108 [if test "$enableval" != no; then
109 AC_DEFINE([TRACEINLINING],1,[defined if interpreter inlining tracing enabled for debugging])
110 fi],)
112 AC_ARG_ENABLE(traceclass,
113 [AS_HELP_STRING(--enable-traceclass,add classfile parsing tracing (for debugging))],
114 [if test "$enableval" != no; then
115 AC_DEFINE([TRACECLASS],1,[defined if classfile parsing tracing enabled for debugging])
116 fi],)
118 AC_ARG_ENABLE(traceexcep,
119 [AS_HELP_STRING(--enable-traceexcep,add exception handling tracing (for debugging))],
120 [if test "$enableval" != no; then
121 AC_DEFINE([TRACEEXCEP],1,[defined if exception handling tracing enabled for debugging])
122 fi],)
124 AC_ARG_ENABLE(tracenative,
125 [AS_HELP_STRING(--enable-tracenative,add native method tracing (for debugging))],
126 [if test "$enableval" != no; then
127 AC_DEFINE([TRACENATIVE],1,[defined if native method tracing enabled for debugging])
128 fi],)
130 AC_ARG_ENABLE(traceresolve,
131 [AS_HELP_STRING(--enable-traceresolve,add resolver tracing (for debugging))],
132 [if test "$enableval" != no; then
133 AC_DEFINE([TRACERESOLVE],1,[defined if resolver tracing enabled for debugging])
134 fi],)
136 AC_ARG_ENABLE(trace,
137 [AS_HELP_STRING(--enable-trace,add all tracing (for debugging))],
138 [if test "$enableval" != no; then
139 AC_DEFINE([TRACEGC],1,[defined if gc tracing enabled for debugging])
140 AC_DEFINE([TRACEALLOC],1,[defined if object allocation tracing enabled for debugging])
141 AC_DEFINE([TRACEFNLZ],1,[defined if object finalisation tracing enabled for debugging])
142 AC_DEFINE([TRACEDLL],1,[defined if library loading/unloading tracing enabled for debugging])
143 AC_DEFINE([TRACELOCK],1,[defined if object locking tracing enabled for debugging])
144 AC_DEFINE([TRACETHREAD],1,[defined if thread creation tracing enabled for debugging])
145 AC_DEFINE([TRACECOMPACT],1,[defined if GC compaction phase tracing enabled for debugging])
146 AC_DEFINE([TRACEDIRECT],1,[defined if interpreter direct-mode tracing enabled for debugging])
147 AC_DEFINE([TRACEINLINING],1,[defined if interpreter inlining tracing enabled for debugging])
148 AC_DEFINE([TRACECLASS],1,[defined if classfile parsing tracing enabled for debugging])
149 AC_DEFINE([TRACEEXCEP],1,[defined if exception handling tracing enabled for debugging])
150 AC_DEFINE([TRACENATIVE],1,[defined if native method tracing enabled for debugging])
151 AC_DEFINE([TRACERESOLVE],1,[defined if resolver tracing enabled for debugging])
152 fi],)
154 AC_ARG_ENABLE(int-threading,
155 [AS_HELP_STRING(--enable-int-threading,enable threaded version of the interpreter (default enabled))],,)
157 AC_ARG_ENABLE(int-direct,
158 [AS_HELP_STRING(--enable-int-direct,enable direct threaded version of the interpreter (default enabled))],,)
160 AC_ARG_ENABLE(int-caching,
161 [AS_HELP_STRING(--enable-int-caching,enable stack-caching version of the interpreter
162 (disabled by default on x86-64, enabled otherwise))],,
163 [if test "$host_cpu" = x86_64; then
164 enable_int_caching=no
165 fi])
167 AC_ARG_ENABLE(int-prefetch,
168 [AS_HELP_STRING(--enable-int-prefetch,enable prefetching version of the interpreter
169 (by default enabled on powerpc, disabled otherwise))],,
170 [if test "$host_cpu" != powerpc; then
171 enable_int_prefetch=no
172 fi])
174 AC_ARG_ENABLE(runtime-reloc-checks,
175 [AS_HELP_STRING(--enable-runtime-reloc-checks,compute relocatability at runtime (inlining interpreter))],,
176 enable_runtime_reloc_checks=no)
178 AC_ARG_ENABLE(int-inlining,
179 [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
180 (by default enabled on x86_64, i386 and powerpc, disabled otherwise))],,
181 [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc && \
182 test "$cross_compiling" = no -o "$enable_runtime_reloc_checks" != no; then
183 enable_int_inlining=yes
184 else
185 enable_int_inlining=no
186 fi])
188 if test "$enable_int_threading" != no; then
189 AC_DEFINE([THREADED],1,[interpreter threaded])
191 if test "$enable_int_caching" != no; then
192 AC_DEFINE([USE_CACHE],1,[interpreter uses caching])
193 fi
195 if test "$enable_int_direct" != no; then
196 AC_DEFINE([DIRECT],1,[interpreter direct])
198 if test "$enable_int_prefetch" != no; then
199 AC_DEFINE([PREFETCH],1,[interpreter uses prefetching])
200 fi
202 if test "$enable_int_inlining" != no; then
203 AC_DEFINE([INLINING],1,[interpreter inlining])
204 interp_cflags=-fno-reorder-blocks
206 if test "$enable_runtime_reloc_checks" != no; then
207 AC_DEFINE([RUNTIME_RELOC_CHECKS],1,[compute relocatability at runtime])
208 else
209 compile_time_reloc_checks=yes
210 fi
211 fi
212 fi
213 fi
215 AC_SUBST(interp_cflags)
216 AM_CONDITIONAL(COMPILE_TIME_RELOC_CHECKS, test "$compile_time_reloc_checks" = yes)
218 AC_ARG_ENABLE(ffi,
219 [AS_HELP_STRING(--enable-ffi,use libffi to call native methods)],,
220 [if test "$host_cpu" != parisc; then
221 enable_ffi=no
222 fi])
224 dnl Based on the AC_CHECK_WITH_JAVA_RUNTIME_LIBRARY function
225 dnl found in CACAO's m4/java-runtime-library.m4.
226 AC_MSG_CHECKING(which Java runtime library to use)
227 AC_ARG_WITH([java-runtime-library],
228 [AS_HELP_STRING(--with-java-runtime-library=<type>,specifies which type of classpath to use as Java runtime library (classpath,openjdk) [[default=classpath]])],
229 [case "${withval}" in
230 gnuclasspath)
231 WITH_JAVA_RUNTIME_LIBRARY=classpath
232 AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], 1, [use GNU Classpath])
233 AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH)
234 ;;
235 openjdk)
236 WITH_JAVA_RUNTIME_LIBRARY=openjdk
237 AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_OPENJDK], 1, [use OpenJDK's Java SE classes])
238 AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
239 ;;
240 *)
241 AC_MSG_ERROR(unknown classpath ${withval})
242 ;;
243 esac],
244 [WITH_JAVA_RUNTIME_LIBRARY=classpath
245 AC_DEFINE([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], 1, [use GNU Classpath])
246 AC_SUBST(WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH)])
247 AC_MSG_RESULT(${WITH_JAVA_RUNTIME_LIBRARY})
248 AM_CONDITIONAL([WITH_JAVA_RUNTIME_LIBRARY_CLASSPATH], test x"${WITH_JAVA_RUNTIME_LIBRARY}" = "xclasspath")
249 AM_CONDITIONAL([WITH_JAVA_RUNTIME_LIBRARY_OPENJDK], test x"${WITH_JAVA_RUNTIME_LIBRARY}" = "xopenjdk")
251 AC_MSG_CHECKING(location of the Java runtime library)
252 AC_ARG_WITH(java-runtime-library-install-dir,
253 [AS_HELP_STRING(--with-java-runtime-library-install-dir=<dir>,installation directory of Java runtime library
254 (default /usr/local/classpath))],
255 [with_runtime_install_dir=${withval}],
256 [with_runtime_install_dir=/usr/local/classpath])
258 AC_DEFINE_UNQUOTED(RUNTIME_INSTALL_DIR, "$with_runtime_install_dir",
259 [Java runtime library installation directory (prefix)])
261 AC_SUBST(with_runtime_install_dir)
262 AC_MSG_RESULT(${with_runtime_install_dir})
264 if test "$prefix" = "NONE"; then
265 install_dir=$ac_default_prefix
266 else
267 install_dir=$prefix
268 fi
269 AC_DEFINE_UNQUOTED(INSTALL_DIR, "$install_dir", [Installation directory (prefix)])
271 AC_ARG_ENABLE(zip,
272 [AS_HELP_STRING(--disable-zip,turn-off zip support in the bootstrap loader)],,)
274 dnl Initialise libtool
275 AC_DISABLE_STATIC
276 AC_PROG_LIBTOOL
278 dnl Checks for programs.
279 AC_PROG_CC
280 AM_PROG_AS
282 AC_CHECK_PROGS(JAVAC, ecj jikes "gcj -C" javac)
284 dnl Checks for libraries.
286 AC_CHECK_LIB(pthread,pthread_self,,AC_MSG_ERROR(libpthread is missing))
287 AC_CHECK_LIB(m,fmod,,AC_MSG_ERROR(libm is missing))
289 if test "$libdl_needed" != no; then
290 AC_CHECK_LIB(dl,dlopen,,AC_MSG_ERROR(libdl is missing))
291 fi
293 if test "$enable_zip" != no; then
294 AC_CHECK_LIB(z,inflate,,AC_MSG_ERROR(zlib is missing))
295 fi
297 if test "$enable_ffi" != no; then
298 AC_CHECK_LIB(ffi,ffi_call,,AC_MSG_ERROR(libffi is missing))
299 fi
301 dnl Checks for header files.
302 AC_HEADER_STDC
303 AC_CHECK_HEADERS(sys/time.h unistd.h endian.h sys/param.h locale.h)
305 if test "$enable_zip" != no; then
306 AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR(zlib.h is missing))
307 fi
309 if test "$enable_ffi" != no; then
310 AC_CHECK_HEADER(ffi.h,,AC_MSG_ERROR(ffi.h is missing))
311 fi
313 if test "$enable_zip" != no; then
314 AC_DEFINE([USE_ZIP],1,[use zip])
315 use_zip_yes=
316 use_zip_no='#'
317 else
318 use_zip_yes='#'
319 use_zip_no=
320 fi
322 AC_SUBST(use_zip_yes)
323 AC_SUBST(use_zip_no)
325 if test "$enable_ffi" != no; then
326 AC_DEFINE([USE_FFI],1,[use FFI])
327 fi
329 dnl Checks for typedefs, structures, and compiler characteristics.
330 AC_C_CONST
331 AC_HEADER_TIME
333 dnl Checks for library functions.
334 AC_FUNC_ALLOCA
335 AC_FUNC_MMAP
336 AC_CHECK_FUNCS(gettimeofday strtol setlocale)
337 AM_LC_MESSAGES
339 AM_MAINTAINER_MODE
341 AC_CONFIG_LINKS(src/arch.h:src/arch/$arch.h)
343 AC_CONFIG_FILES(
344 Makefile \
345 src/Makefile \
346 src/interp/Makefile \
347 src/interp/engine/Makefile \
348 src/arch/Makefile \
349 src/os/Makefile \
350 src/os/linux/Makefile \
351 src/os/darwin/Makefile \
352 src/os/bsd/Makefile \
353 src/os/linux/powerpc/Makefile \
354 src/os/linux/arm/Makefile \
355 src/os/linux/i386/Makefile \
356 src/os/linux/x86_64/Makefile \
357 src/os/linux/parisc/Makefile \
358 src/os/linux/mips/Makefile \
359 src/os/darwin/i386/Makefile \
360 src/os/darwin/arm/Makefile \
361 src/os/darwin/powerpc/Makefile \
362 src/os/bsd/powerpc/Makefile \
363 src/os/bsd/arm/Makefile \
364 src/os/bsd/i386/Makefile \
365 src/os/bsd/x86_64/Makefile \
366 lib/Makefile \
367 lib/java/Makefile \
368 lib/java/lang/Makefile \
369 lib/jamvm/Makefile \
370 lib/jamvm/java/Makefile \
371 lib/jamvm/java/lang/Makefile \
372 lib/java/lang/reflect/Makefile \
373 lib/java/security/Makefile \
374 lib/gnu/Makefile \
375 lib/sun/reflect/annotation/Makefile \
376 lib/sun/reflect/Makefile \
377 lib/sun/Makefile \
378 lib/gnu/classpath/Makefile)
380 AC_OUTPUT
