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
14 dnl Process this file with autoconf to produce configure.
18 dnl Can't be done in GC_CONFIGURE because that confuses automake.
25 dnl We use these options to decide which functions to include.
26 AC_ARG_WITH(target-subdir,
27 [ --with-target-subdir=SUBDIR
28 configuring with a cross compiler])
29 AC_ARG_WITH(cross-host,
30 [ --with-cross-host=HOST configuring with a cross compiler])
33 # automake wants to see AC_EXEEXT. But we don't need it. And having
34 # it is actually a problem, because the compiler we're passed can't
35 # necessarily do a full link. So we fool automake here.
37 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
38 # to nothing, so nothing would remain between `then' and `fi' if it
39 # were not for the `:' below.
44 AC_MSG_CHECKING([for thread model used by GCC])
45 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
46 if test -z "$THREADS"; then
49 AC_MSG_RESULT([$THREADS])
51 AC_ARG_ENABLE(parallel-mark,
52 [ --enable-parallel-mark parallelize marking and free list construction],
55 AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
60 INCLUDES=-I${srcdir}/include
70 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*)
71 AC_DEFINE(GC_LINUX_THREADS)
73 if test "${enable_parallel_mark}"; then
74 AC_DEFINE(PARALLEL_MARK)
76 AC_DEFINE(THREAD_LOCAL_ALLOC)
79 AC_DEFINE(GC_LINUX_THREADS)
83 AC_MSG_WARN("Only HP/UX 11 threads are supported.")
84 AC_DEFINE(GC_HPUX_THREADS)
85 AC_DEFINE(_POSIX_C_SOURCE,199506L)
86 if test "${enable_parallel_mark}" = yes; then
87 AC_DEFINE(PARALLEL_MARK)
89 AC_DEFINE(THREAD_LOCAL_ALLOC)
90 THREADLIBS="-lpthread -lrt"
93 AC_MSG_WARN("Threaded GC is prone to deadlock before FreeBSD 4.5.")
94 AC_MSG_WARN("Related symptom is pthread_join returns spurious EINTR.")
95 AC_DEFINE(GC_FREEBSD_THREADS)
96 INCLUDES="$INCLUDES -pthread"
100 AC_DEFINE(GC_SOLARIS_THREADS)
101 AC_DEFINE(GC_SOLARIS_PTHREADS)
104 AC_DEFINE(GC_IRIX_THREADS)
111 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
112 AC_MSG_ERROR(thread package $THREADS not yet supported)
115 AC_MSG_ERROR($THREADS is an unknown thread package)
120 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
121 AC_SUBST(EXTRA_TEST_LIBS)
123 target_all=libgcjgc.la
125 AC_SUBST(target_alias)
127 dnl If the target is an eCos system, use the appropriate eCos
129 dnl FIXME: this should not be a local option but a global target
130 dnl system; at present there is no eCos target.
133 [ --with-ecos enable runtime eCos target support],
134 TARGET_ECOS="$with_ecos"
139 case "$TARGET_ECOS" in
144 CXXINCLUDES="-I${TARGET_ECOS}/include"
145 addobjs="$addobjs ecos.lo"
151 AC_SUBST(CXXINCLUDES)
156 machdep="alpha_mach_dep.lo"
159 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
160 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
164 i?86-*-solaris2.[[89]]*)
165 AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
168 machdep="mips_ultrix_mach_dep.lo"
169 AC_DEFINE(STACKBASE, __stackbase)
170 AC_DEFINE(DATASTART_IS_ETEXT)
173 machdep="mips_ultrix_mach-dep.lo"
176 machdep="mips_sgi_mach_dep.lo"
177 AC_DEFINE(NO_EXECUTE_PERMISSION)
179 sparc-sun-solaris2.3*)
180 AC_DEFINE(SUNOS53_SHARED_LIB)
183 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
186 if test x"$machdep" = x; then
187 machdep="mach_dep.lo"
189 addobjs="$addobjs $machdep"
192 dnl As of 4.13a2, the collector will not properly work on Solaris when
193 dnl built with gcc and -O. So we remove -O in the appropriate case.
196 if test "$GCC" = yes; then
203 new_CFLAGS="$new_CFLAGS $i"
212 dnl We need to override the top-level CFLAGS. This is how we do it.
216 dnl Include defines that have become de facto standard.
217 dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
219 AC_DEFINE(NO_SIGNALS)
220 AC_DEFINE(NO_EXECUTE_PERMISSION)
221 AC_DEFINE(ALL_INTERIOR_POINTERS)
223 dnl By default, make the library as general as possible.
224 AC_DEFINE(JAVA_FINALIZATION)
225 AC_DEFINE(GC_GCJ_SUPPORT)
226 AC_DEFINE(ATOMIC_UNCOLLECTABLE)
228 dnl This is something of a hack. When cross-compiling we turn off
229 dnl some functionality. We also enable the "small" configuration.
230 dnl These is only correct when targetting an embedded system. FIXME.
231 if test -n "${with_cross_host}"; then
234 AC_DEFINE(SMALL_CONFIG)
235 AC_DEFINE(NO_DEBUGGING)
238 AC_ARG_ENABLE(full-debug,
239 [ --enable-full-debug include full support for pointer backtracing etc.],
240 [ if test "$enable_full_debug" = "yes"; then
241 AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.")
242 AC_DEFINE(KEEP_BACK_PTRS)
243 AC_DEFINE(DBG_HDRS_ALL)
245 x86-*-linux* | i586-*-linux* | i686-*-linux* )
246 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
247 AC_DEFINE(SAVE_CALL_COUNT, 8)
252 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
254 if test "${multilib}" = "yes"; then
255 multilib_arg="--enable-multilib"
260 AC_OUTPUT(Makefile include/Makefile, [
261 dnl Put all the -D options in a file.
262 echo "$DEFS" > boehm-cflags
264 if test -n "$CONFIG_FILES"; then
265 ac_file=Makefile . ${gc_basedir}/../config-ml.in
270 with_multisubdir=${with_multisubdir}
271 ac_configure_args="${multilib_arg} ${ac_configure_args}"
272 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
273 gc_basedir=${gc_basedir}