jamvm
view configure.ac @ 402:24373fc1d951
Add additional tracing support.
2008-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
* .hgignore: Updated with autogen.sh output.
* configure.ac: Add new trace options.
* src/class.c,
* src/excep.c,
* src/natives.c,
* src/resolve.c: Add trace support.
* src/jam.h,
* src/dll.c,
* src/os/linux/os.c: Add support for reporting
the linking error using dlerror.
2008-08-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
* .hgignore: Updated with autogen.sh output.
* configure.ac: Add new trace options.
* src/class.c,
* src/excep.c,
* src/natives.c,
* src/resolve.c: Add trace support.
* src/jam.h,
* src/dll.c,
* src/os/linux/os.c: Add support for reporting
the linking error using dlerror.
| author | andrew |
|---|---|
| date | Tue Aug 05 05:46:09 2008 +0100 (2008-08-05) |
| parents | 3ca4c2fbbd7f |
| children | 3857371c74a7 |
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_ARG_WITH(java-runtime-library-install-dir,
252 [AS_HELP_STRING(--with-java-runtime-library-install-dir=<dir>,installation directory of Java runtime library
253 (default /usr/local/classpath))],,
254 [with_runtime_install_dir=/usr/local/classpath])
256 AC_DEFINE_UNQUOTED(RUNTIME_INSTALL_DIR, "$with_runtime_install_dir",
257 [Java runtime library installation directory (prefix)])
259 AC_SUBST(with_runtime_install_dir)
261 if test "$prefix" = "NONE"; then
262 install_dir=$ac_default_prefix
263 else
264 install_dir=$prefix
265 fi
266 AC_DEFINE_UNQUOTED(INSTALL_DIR, "$install_dir", [Installation directory (prefix)])
268 AC_ARG_ENABLE(zip,
269 [AS_HELP_STRING(--disable-zip,turn-off zip support in the bootstrap loader)],,)
271 dnl Initialise libtool
272 AC_DISABLE_STATIC
273 AC_PROG_LIBTOOL
275 dnl Checks for programs.
276 AC_PROG_CC
277 AM_PROG_AS
279 AC_CHECK_PROGS(JAVAC, ecj jikes "gcj -C" javac)
281 dnl Checks for libraries.
283 AC_CHECK_LIB(pthread,pthread_self,,AC_MSG_ERROR(libpthread is missing))
284 AC_CHECK_LIB(m,fmod,,AC_MSG_ERROR(libm is missing))
286 if test "$libdl_needed" != no; then
287 AC_CHECK_LIB(dl,dlopen,,AC_MSG_ERROR(libdl is missing))
288 fi
290 if test "$enable_zip" != no; then
291 AC_CHECK_LIB(z,inflate,,AC_MSG_ERROR(zlib is missing))
292 fi
294 if test "$enable_ffi" != no; then
295 AC_CHECK_LIB(ffi,ffi_call,,AC_MSG_ERROR(libffi is missing))
296 fi
298 dnl Checks for header files.
299 AC_HEADER_STDC
300 AC_CHECK_HEADERS(sys/time.h unistd.h endian.h sys/param.h locale.h)
302 if test "$enable_zip" != no; then
303 AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR(zlib.h is missing))
304 fi
306 if test "$enable_ffi" != no; then
307 AC_CHECK_HEADER(ffi.h,,AC_MSG_ERROR(ffi.h is missing))
308 fi
310 if test "$enable_zip" != no; then
311 AC_DEFINE([USE_ZIP],1,[use zip])
312 use_zip_yes=
313 use_zip_no='#'
314 else
315 use_zip_yes='#'
316 use_zip_no=
317 fi
319 AC_SUBST(use_zip_yes)
320 AC_SUBST(use_zip_no)
322 if test "$enable_ffi" != no; then
323 AC_DEFINE([USE_FFI],1,[use FFI])
324 fi
326 dnl Checks for typedefs, structures, and compiler characteristics.
327 AC_C_CONST
328 AC_HEADER_TIME
330 dnl Checks for library functions.
331 AC_FUNC_ALLOCA
332 AC_FUNC_MMAP
333 AC_CHECK_FUNCS(gettimeofday strtol setlocale)
334 AM_LC_MESSAGES
336 AM_MAINTAINER_MODE
338 AC_CONFIG_LINKS(src/arch.h:src/arch/$arch.h)
340 AC_CONFIG_FILES(
341 Makefile \
342 src/Makefile \
343 src/interp/Makefile \
344 src/interp/engine/Makefile \
345 src/arch/Makefile \
346 src/os/Makefile \
347 src/os/linux/Makefile \
348 src/os/darwin/Makefile \
349 src/os/bsd/Makefile \
350 src/os/linux/powerpc/Makefile \
351 src/os/linux/arm/Makefile \
352 src/os/linux/i386/Makefile \
353 src/os/linux/x86_64/Makefile \
354 src/os/linux/parisc/Makefile \
355 src/os/linux/mips/Makefile \
356 src/os/darwin/i386/Makefile \
357 src/os/darwin/arm/Makefile \
358 src/os/darwin/powerpc/Makefile \
359 src/os/bsd/powerpc/Makefile \
360 src/os/bsd/arm/Makefile \
361 src/os/bsd/i386/Makefile \
362 src/os/bsd/x86_64/Makefile \
363 lib/Makefile \
364 lib/java/Makefile \
365 lib/java/lang/Makefile \
366 lib/jamvm/Makefile \
367 lib/jamvm/java/Makefile \
368 lib/jamvm/java/lang/Makefile \
369 lib/java/lang/reflect/Makefile \
370 lib/java/security/Makefile \
371 lib/gnu/Makefile \
372 lib/sun/reflect/annotation/Makefile \
373 lib/sun/reflect/Makefile \
374 lib/sun/Makefile \
375 lib/gnu/classpath/Makefile)
377 AC_OUTPUT
