1
# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
3
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4
# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6
# Permission is hereby granted to use or copy this program
7
# for any purpose, provided the above notices are retained on all copies.
8
# Permission to modify the code and to distribute modified code is granted,
9
# provided the above notices are retained, and a notice that the code was
10
# modified is included with the above copyright notice.
12
# Original author: Tom Tromey
13
# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
15
dnl Process this file with autoconf to produce configure.
20
AC_INIT(gc,6.8,Hans.Boehm@hp.com)
21
## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
22
AC_CONFIG_SRCDIR(gcj_mlc.c)
25
AC_REVISION($Revision: 1.2 $)
37
AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
43
. [$]{srcdir}/configure.host
45
GC_CFLAGS=${gc_cflags}
48
AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package],
50
[ AC_MSG_CHECKING([for thread model used by GCC])
51
THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
52
if test -z "$THREADS"; then
55
AC_MSG_RESULT([$THREADS])])
57
AC_ARG_ENABLE(parallel-mark,
58
[ --enable-parallel-mark parallelize marking and free list construction],
61
AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
66
AC_ARG_ENABLE(cplusplus,
67
[ --enable-cplusplus install C++ support],
70
INCLUDES=-I${srcdir}/include
72
## Libraries needed to support dynamic loading and/or threads.
79
THREADDLLIBS=-lpthread
82
AC_DEFINE(GC_LINUX_THREADS)
84
if test "${enable_parallel_mark}" = yes; then
85
AC_DEFINE(PARALLEL_MARK)
87
AC_DEFINE(THREAD_LOCAL_ALLOC)
90
AC_DEFINE(GC_AIX_THREADS)
94
AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
95
AC_DEFINE(GC_HPUX_THREADS)
96
AC_DEFINE(_POSIX_C_SOURCE,199506L)
97
if test "${enable_parallel_mark}" = yes; then
98
AC_DEFINE(PARALLEL_MARK)
100
AC_DEFINE(THREAD_LOCAL_ALLOC)
101
THREADDLLIBS="-lpthread -lrt"
102
# HPUX needs REENTRANT for the _r calls.
103
AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
106
AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
109
AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
110
AC_DEFINE(GC_FREEBSD_THREADS)
111
INCLUDES="$INCLUDES -pthread"
112
THREADDLLIBS=-pthread
115
AC_DEFINE(GC_FREEBSD_THREADS)
116
INCLUDES="$INCLUDES -pthread"
117
THREADDLLIBS=-pthread
118
AC_DEFINE(_REENTRANT)
119
if test "${enable_parallel_mark}" = yes; then
120
AC_DEFINE(PARALLEL_MARK)
122
AC_DEFINE(THREAD_LOCAL_ALLOC)
123
AC_DEFINE(USE_COMPILER_TLS)
126
AC_MSG_WARN("Only on NetBSD 2.0 or later.")
127
AC_DEFINE(GC_NETBSD_THREADS)
128
AC_DEFINE(_REENTRANT)
130
THREADDLLIBS="-lpthread -lrt"
133
AC_DEFINE(GC_SOLARIS_THREADS)
134
AC_DEFINE(GC_SOLARIS_PTHREADS)
137
AC_DEFINE(GC_IRIX_THREADS)
140
AC_DEFINE(GC_WIN32_THREADS)
143
AC_DEFINE(GC_DARWIN_THREADS)
144
AC_DEFINE(THREAD_LOCAL_ALLOC)
145
if test "${enable_parallel_mark}" = yes; then
146
AC_DEFINE(PARALLEL_MARK)
150
AC_DEFINE(GC_OSF1_THREADS)
151
if test "${enable_parallel_mark}" = yes; then
152
AC_DEFINE(PARALLEL_MARK)
153
AC_DEFINE(THREAD_LOCAL_ALLOC)
154
# May want to enable it in other cases, too.
155
# Measurements havent yet been done.
157
INCLUDES="$INCLUDES -pthread"
158
THREADDLLIBS="-lpthread -lrt"
161
AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
166
AC_DEFINE(GC_WIN32_THREADS)
167
dnl Wine getenv may not return NULL for missing entry
172
AC_MSG_RESULT($THREADDLLIBS)
173
# Use pthread GCC switch
174
THREADDLLIBS=-pthread
175
if test "${enable_parallel_mark}" = yes; then
176
AC_DEFINE(PARALLEL_MARK)
178
AC_DEFINE(THREAD_LOCAL_ALLOC)
179
AC_DEFINE(GC_DGUX386_THREADS)
180
AC_DEFINE(DGUX_THREADS)
181
# Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
182
INCLUDES="-pthread $INCLUDES"
186
THREADDLLIBS=-lpthread
187
AC_DEFINE(GC_AIX_THREADS)
188
AC_DEFINE(_REENTRANT)
190
decosf1 | irix | mach | os2 | solaris | dce | vxworks)
191
AC_MSG_ERROR(thread package $THREADS not yet supported)
194
AC_MSG_ERROR($THREADS is an unknown thread package)
197
AC_SUBST(THREADDLLIBS)
204
AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
206
AC_MSG_CHECKING(for xlc)
211
], [compiler_xlc=yes], [compiler_xlc=no])
212
AC_MSG_RESULT($compiler_xlc)
213
AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
214
if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
215
# the darwin stack-frame-walking code is completely broken on xlc
216
AC_DEFINE(DARWIN_DONT_PARSE_STACK)
219
# We never want libdl on darwin. It is a fake libdl that just ends up making
224
AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
228
AC_SUBST(EXTRA_TEST_LIBS)
233
dnl If the target is an eCos system, use the appropriate eCos
235
dnl FIXME: this should not be a local option but a global target
236
dnl system; at present there is no eCos target.
239
[ --with-ecos enable runtime eCos target support],
240
TARGET_ECOS="$with_ecos"
248
case "$TARGET_ECOS" in
253
CXXINCLUDES="-I${TARGET_ECOS}/include"
254
addobjs="$addobjs ecos.lo"
258
if test "${enable_cplusplus}" = yes; then
259
addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
260
addtests="$addtests test_cpp"
263
AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
268
AC_SUBST(CXXINCLUDES)
270
# Configuration of shared libraries
272
AC_MSG_CHECKING(whether to build shared libraries)
285
# Configuration of machine-dependent code
287
AC_MSG_CHECKING(which machine-dependent code should be used)
291
machdep="alpha_mach_dep.lo"
292
if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
293
AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
297
machdep="alpha_mach_dep.lo"
299
i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
300
AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
303
machdep="mips_ultrix_mach_dep.lo"
304
AC_DEFINE(STACKBASE, __stackbase)
305
AC_DEFINE(DATASTART_IS_ETEXT)
308
machdep="mips_ultrix_mach-dep.lo"
310
mips-nec-sysv*|mips-unknown-sysv*)
315
machdep="mips_sgi_mach_dep.lo"
316
AC_DEFINE(NO_EXECUTE_PERMISSION)
319
machdep="sparc_netbsd_mach_dep.lo"
321
sparc-sun-solaris2.3)
322
machdep="sparc_mach_dep.lo"
323
AC_DEFINE(SUNOS53_SHARED_LIB)
325
sparc*-sun-solaris2.*)
326
machdep="sparc_mach_dep.lo"
329
machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
332
if test x"$machdep" = x; then
333
AC_MSG_RESULT($machdep)
334
machdep="mach_dep.lo"
336
addobjs="$addobjs $machdep"
338
AC_SUBST(addincludes)
345
# Check for AViiON Machines running DGUX
348
AC_CHECK_HEADER(sys/dg_sys_info.h,
351
## :GOTCHA: we do not check anything but sys/dg_sys_info.h
352
if test $ac_is_dgux = yes; then
353
if test "$enable_full_debug" = "yes"; then
354
CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
355
CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
357
CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
358
CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
364
dnl We use these options to decide which functions to include.
365
AC_ARG_WITH(target-subdir,
366
[ --with-target-subdir=SUBDIR
367
configuring with a cross compiler])
368
AC_ARG_WITH(cross-host,
369
[ --with-cross-host=HOST configuring with a cross compiler])
371
# automake wants to see AC_EXEEXT. But we don't need it. And having
372
# it is actually a problem, because the compiler we're passed can't
373
# necessarily do a full link. So we fool automake here.
375
# autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
376
# to nothing, so nothing would remain between `then' and `fi' if it
377
# were not for the `:' below.
382
dnl As of 4.13a2, the collector will not properly work on Solaris when
383
dnl built with gcc and -O. So we remove -O in the appropriate case.
384
dnl Not needed anymore on Solaris.
385
AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
388
if test "$GCC" = yes; then
396
new_CFLAGS="$new_CFLAGS $i"
405
*) AC_MSG_RESULT(no) ;;
408
dnl We need to override the top-level CFLAGS. This is how we do it.
412
dnl Include defines that have become de facto standard.
413
dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
415
AC_DEFINE(NO_SIGNALS)
416
AC_DEFINE(NO_EXECUTE_PERMISSION)
417
AC_DEFINE(ALL_INTERIOR_POINTERS)
419
dnl By default, make the library as general as possible.
420
AC_DEFINE(JAVA_FINALIZATION)
421
AC_DEFINE(GC_GCJ_SUPPORT)
422
AC_DEFINE(ATOMIC_UNCOLLECTABLE)
424
dnl This is something of a hack. When cross-compiling we turn off
425
dnl some functionality. We also enable the "small" configuration.
426
dnl These is only correct when targetting an embedded system. FIXME.
427
if test -n "${with_cross_host}"; then
430
AC_DEFINE(SMALL_CONFIG)
431
AC_DEFINE(NO_DEBUGGING)
435
AC_ARG_ENABLE(full-debug,
436
[ --enable-full-debug include full support for pointer backtracing etc.],
437
[ if test "$enable_full_debug" = "yes"; then
438
AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
439
AC_DEFINE(KEEP_BACK_PTRS)
440
AC_DEFINE(DBG_HDRS_ALL)
443
AC_DEFINE(MAKE_BACK_GRAPH)
444
AC_DEFINE(SAVE_CALL_COUNT, 8)
445
AC_CHECK_LIB(unwind, backtrace, [
446
AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
448
AC_MSG_WARN("Client code may need to link against libunwind.")
451
x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
452
AC_DEFINE(MAKE_BACK_GRAPH)
453
AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
454
AC_DEFINE(SAVE_CALL_COUNT, 8)
457
AC_DEFINE(MAKE_BACK_GRAPH)
464
AC_ARG_ENABLE(redirect-malloc,
465
[ --enable-redirect-malloc redirect malloc and friends to GC routines])
467
if test "${enable_redirect_malloc}" = yes; then
468
if test "${enable_full_debug}" = yes; then
469
AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
470
AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
471
AC_DEFINE(REDIRECT_FREE, GC_debug_free)
473
AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
477
AC_ARG_ENABLE(gc-assertions,
478
[ --enable-gc-assertions collector-internal assertion checking])
479
if test "${enable_gc_assertions}" = yes; then
480
AC_DEFINE(GC_ASSERTIONS)
483
AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
485
AC_OUTPUT([Makefile doc/Makefile include/Makefile],,
488
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}