Fix LDC, LDC_W, and INSTANCEOF opcodes, more debugging
[jamvm-avr32-jem.git] / configure.ac
blob41be3c50baaa7f3fde26787a81065493c3f015d1
1 ##
2 ## Copyright (C) 2003, 2004, 2005, 2006, 2007
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.
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.
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.
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.0)
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 i386-*-openbsd*) host_os=bsd libdl_needed=no ;;
36 i386-*-freebsd*) host_os=bsd libdl_needed=no ;;
37 x86_64-*-linux*) host_os=linux ;;
38 hppa*-*-linux*) host_cpu=parisc host_os=linux ;;
39 mipsel-*-linux*) host_cpu=mips host_os=linux ;;
40 amd64-*-openbsd*) host_os=bsd libdl_needed=no ;;
41 amd64-*-freebsd*) host_os=bsd libdl_needed=no ;;
42 arm*-*-linux*) host_cpu=arm host_os=linux ;;
43 arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
44 arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
45 powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
46 powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
47 powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
48 powerpc-*-darwin*) host_os=darwin ;;
49 *) AC_MSG_ERROR($host not supported) ;;
50 esac
52 arch=$host_cpu
53 os=$host_os
54 AC_SUBST(arch)
55 AC_SUBST(os)
57 AC_ARG_ENABLE(tracegc,
58     [AS_HELP_STRING(--enable-tracegc,add gc tracing (for debugging))],
59     [if test "$enableval" != no; then
60         AC_DEFINE([TRACEGC],1,[defined if gc tracing enabled for debugging])
61     fi],)
63 AC_ARG_ENABLE(tracealloc,
64     [AS_HELP_STRING(--enable-tracealloc,add object allocation tracing (for debugging))],
65     [if test "$enableval" != no; then
66         AC_DEFINE([TRACEALLOC],1,[defined if object allocation tracing enabled for debugging])
67     fi],)
69 AC_ARG_ENABLE(tracefnlz,
70     [AS_HELP_STRING(--enable-tracefnlz,add object finalisation tracing (for debugging))],
71     [if test "$enableval" != no; then
72         AC_DEFINE([TRACEFNLZ],1,[defined if object finalisation tracing enabled for debugging])
73     fi],)
75 AC_ARG_ENABLE(tracedll,
76     [AS_HELP_STRING(--enable-tracedll,add library loading/lookup tracing (for debugging))],
77     [if test "$enableval" != no; then
78         AC_DEFINE([TRACEDLL],1,[defined if library loading/unloading tracing enabled for debugging])
79     fi],)
81 AC_ARG_ENABLE(tracelock,
82     [AS_HELP_STRING(--enable-tracelock,add object locking tracing (for debugging))],
83     [if test "$enableval" != no; then
84         AC_DEFINE([TRACELOCK],1,[defined if object locking tracing enabled for debugging])
85     fi],)
87 AC_ARG_ENABLE(tracethread,
88     [AS_HELP_STRING(--enable-tracethread,add thread creation tracing (for debugging))],
89     [if test "$enableval" != no; then
90         AC_DEFINE([TRACETHREAD],1,[defined if thread creation tracing enabled for debugging])
91     fi],)
93 AC_ARG_ENABLE(tracecompact,
94     [AS_HELP_STRING(--enable-tracecompact,add GC compaction phase tracing (for debugging))],
95     [if test "$enableval" != no; then
96         AC_DEFINE([TRACECOMPACT],1,[defined if GC compaction phase tracing enabled for debugging])
97     fi],)
99 AC_ARG_ENABLE(tracedirect,
100     [AS_HELP_STRING(--enable-tracedirect,add interpreter direct-mode tracing (for debugging))],
101     [if test "$enableval" != no; then
102         AC_DEFINE([TRACEDIRECT],1,[defined if interpreter direct-mode tracing enabled for debugging])
103     fi],)
105 AC_ARG_ENABLE(traceinlining,
106     [AS_HELP_STRING(--enable-traceinlining,add interpreter inlining tracing (for debugging))],
107     [if test "$enableval" != no; then
108         AC_DEFINE([TRACEINLINING],1,[defined if interpreter inlining tracing enabled for debugging])
109     fi],)
111 AC_ARG_ENABLE(trace,
112     [AS_HELP_STRING(--enable-trace,add all tracing (for debugging))],
113     [if test "$enableval" != no; then
114         AC_DEFINE([TRACEGC],1,[defined if gc tracing enabled for debugging])
115         AC_DEFINE([TRACEALLOC],1,[defined if object allocation tracing enabled for debugging])
116         AC_DEFINE([TRACEFNLZ],1,[defined if object finalisation tracing enabled for debugging])
117         AC_DEFINE([TRACEDLL],1,[defined if library loading/unloading tracing enabled for debugging])
118         AC_DEFINE([TRACELOCK],1,[defined if object locking tracing enabled for debugging])
119         AC_DEFINE([TRACETHREAD],1,[defined if thread creation tracing enabled for debugging])
120         AC_DEFINE([TRACECOMPACT],1,[defined if GC compaction phase tracing enabled for debugging])
121         AC_DEFINE([TRACEDIRECT],1,[defined if interpreter direct-mode tracing enabled for debugging])
122         AC_DEFINE([TRACEINLINING],1,[defined if interpreter inlining tracing enabled for debugging])
123     fi],)
125 AC_ARG_ENABLE(int-threading,
126     [AS_HELP_STRING(--enable-int-threading,enable threaded version of the interpreter (default enabled))],,)
128 AC_ARG_ENABLE(int-direct,
129     [AS_HELP_STRING(--enable-int-direct,enable direct threaded version of the interpreter (default enabled))],,)
131 AC_ARG_ENABLE(int-caching,
132     [AS_HELP_STRING(--enable-int-caching,enable stack-caching version of the interpreter
133                    (disabled by default on x86-64, enabled otherwise))],,
134     [if test "$host_cpu" = x86_64; then
135          enable_int_caching=no
136      fi])
138 AC_ARG_ENABLE(int-prefetch,
139     [AS_HELP_STRING(--enable-int-prefetch,enable prefetching version of the interpreter
140                    (by default enabled on powerpc, disabled otherwise))],,
141     [if test "$host_cpu" != powerpc; then
142          enable_int_prefetch=no
143      fi])
145 AC_ARG_ENABLE(runtime-reloc-checks,
146     [AS_HELP_STRING(--enable-runtime-reloc-checks,compute relocatability at runtime (inlining interpreter))],,
147         enable_runtime_reloc_checks=no)
149 AC_ARG_ENABLE(int-inlining,
150     [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
151                    (by default enabled on x86_64, i386 and powerpc, disabled otherwise))],,
152     [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc && \
153         test "$cross_compiling" = no -o "$enable_runtime_reloc_checks" != no; then
154          enable_int_inlining=yes
155        else
156          enable_int_inlining=no
157      fi])
159 if test "$enable_int_threading" != no; then
160     AC_DEFINE([THREADED],1,[interpreter threaded])
162     if test "$enable_int_caching" != no; then
163         AC_DEFINE([USE_CACHE],1,[interpreter uses caching])
164     fi
166     if test "$enable_int_direct" != no; then
167         AC_DEFINE([DIRECT],1,[interpreter direct])
169         if test "$enable_int_prefetch" != no; then
170             AC_DEFINE([PREFETCH],1,[interpreter uses prefetching])
171         fi
173         if test "$enable_int_inlining" != no; then
174             AC_DEFINE([INLINING],1,[interpreter inlining])
175             interp_cflags=-fno-reorder-blocks 
177             if test "$enable_runtime_reloc_checks" != no; then
178                 AC_DEFINE([RUNTIME_RELOC_CHECKS],1,[compute relocatability at runtime])
179             else
180                 compile_time_reloc_checks=yes
181             fi
182         fi
183     fi
186 AC_SUBST(interp_cflags)
187 AM_CONDITIONAL(COMPILE_TIME_RELOC_CHECKS, test "$compile_time_reloc_checks" = yes)
189 AC_ARG_ENABLE(ffi,
190     [AS_HELP_STRING(--enable-ffi,use libffi to call native methods)],,
191     [if test "$host_cpu" != x86_64 -a "$host_cpu" != parisc; then
192         enable_ffi=no
193      fi])
195 AC_ARG_WITH(classpath-install-dir,
196     [AS_HELP_STRING(--with-classpath-install-dir=<dir>,installation directory of GNU classpath
197                    (default /usr/local/classpath))],,
198     [with_classpath_install_dir=/usr/local/classpath])
200 AC_DEFINE_UNQUOTED(CLASSPATH_INSTALL_DIR, "$with_classpath_install_dir",
201     [GNU Classpath installation directory (prefix)])
203 AC_SUBST(with_classpath_install_dir)
205 if test "$prefix" = "NONE"; then
206     install_dir=$ac_default_prefix
207 else
208     install_dir=$prefix
210 AC_DEFINE_UNQUOTED(INSTALL_DIR, "$install_dir", [Installation directory (prefix)])
212 AC_ARG_ENABLE(zip,
213     [AS_HELP_STRING(--disable-zip,turn-off zip support in the bootstrap loader)],,)
215 dnl Initialise libtool
216 AC_DISABLE_STATIC
217 AC_PROG_LIBTOOL
219 dnl Checks for programs.
220 AC_PROG_CC
221 AM_PROG_AS
223 AC_CHECK_PROGS(JAVAC, ecj jikes "gcj -C" javac)
225 dnl Checks for libraries.
227 AC_CHECK_LIB(pthread,pthread_self,,AC_MSG_ERROR(libpthread is missing))
228 AC_CHECK_LIB(m,fmod,,AC_MSG_ERROR(libm is missing))
230 if test "$libdl_needed" != no; then
231     AC_CHECK_LIB(dl,dlopen,,AC_MSG_ERROR(libdl is missing))
234 AC_CHECK_LIB(z,inflate,,
235     [if test "$enable_zip" != no; then
236         AC_MSG_WARN(cannot find libz -- zip/jar support in bootclasspath is disabled)
237         enable_zip=no
238     fi])
240 AC_CHECK_LIB(ffi,ffi_call,,
241     [if test "$enable_ffi" != no; then
242         AC_MSG_ERROR(cannot find libffi)
243     fi])
245 dnl Checks for header files.
246 AC_HEADER_STDC
248 AC_CHECK_HEADER(zlib.h,,
249     [if test "$enable_zip" != no; then
250         AC_MSG_WARN(cannot find zlib.h -- zip/jar support in bootclasspath is disabled)
251         enable_zip=no
252     fi])
254 AC_CHECK_HEADER(ffi.h,,
255     [if test "$enable_ffi" != no; then
256         AC_MSG_ERROR(cannot find ffi.h)
257     fi])
259 if test "$enable_zip" != no; then
260     AC_DEFINE([USE_ZIP],1,[use zip])
261     use_zip_yes=
262     use_zip_no='#'
263 else
264     use_zip_yes='#'
265     use_zip_no=
268 AC_SUBST(use_zip_yes)
269 AC_SUBST(use_zip_no)
271 if test "$enable_ffi" != no; then
272     AC_DEFINE([USE_FFI],1,[use FFI])
275 AC_CHECK_HEADERS(sys/time.h unistd.h endian.h sys/param.h locale.h)
277 dnl Checks for typedefs, structures, and compiler characteristics.
278 AC_C_CONST
279 AC_HEADER_TIME
281 dnl Checks for library functions.
282 AC_FUNC_ALLOCA
283 AC_FUNC_MMAP
284 AC_CHECK_FUNCS(gettimeofday strtol setlocale)
285 AM_LC_MESSAGES
287 AM_MAINTAINER_MODE
289 AC_CONFIG_LINKS(src/arch.h:src/arch/$arch.h)
291 AC_CONFIG_FILES(
292     Makefile \
293     src/Makefile \
294     src/interp/Makefile \
295     src/interp/engine/Makefile \
296     src/arch/Makefile \
297     src/os/Makefile \
298     src/os/linux/Makefile \
299     src/os/darwin/Makefile \
300     src/os/bsd/Makefile \
301     src/os/linux/powerpc/Makefile \
302     src/os/linux/arm/Makefile \
303     src/os/linux/i386/Makefile \
304     src/os/linux/x86_64/Makefile \
305     src/os/linux/parisc/Makefile \
306     src/os/linux/mips/Makefile \
307     src/os/darwin/i386/Makefile \
308     src/os/darwin/powerpc/Makefile \
309     src/os/bsd/powerpc/Makefile \
310     src/os/bsd/arm/Makefile \
311     src/os/bsd/i386/Makefile \
312     src/os/bsd/x86_64/Makefile \
313     lib/Makefile \
314     lib/java/Makefile \
315     lib/java/lang/Makefile \
316     lib/jamvm/Makefile \
317     lib/jamvm/java/Makefile \
318     lib/jamvm/java/lang/Makefile \
319     lib/java/lang/reflect/Makefile \
320     lib/java/security/Makefile \
321     lib/gnu/Makefile \
322     lib/sun/reflect/annotation/Makefile \
323     lib/sun/reflect//Makefile \
324     lib/sun/Makefile \
325     lib/gnu/classpath/Makefile)
327 AC_OUTPUT