1 dnl Process this file with autoconf to produce configure.
9 dnl We use these options to decide which functions to include.
10 AC_ARG_WITH(target-subdir,
11 [ --with-target-subdir=SUBDIR
12 configuring with a cross compiler])
13 AC_ARG_WITH(cross-host,
14 [ --with-cross-host=HOST configuring with a cross compiler])
17 # automake wants to see AC_EXEEXT. But we don't need it. And having
18 # it is actually a problem, because the compiler we're passed can't
19 # necessarily do a full link. So we fool automake here.
21 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
22 # to nothing, so nothing would remain between `then' and `fi' if it
23 # were not for the `:' below.
28 AC_MSG_CHECKING([for thread model used by GCC])
29 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
30 AC_MSG_RESULT([$THREADS])
32 INCLUDES=-I${srcdir}/include
43 AC_DEFINE(LINUX_THREADS)
47 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
48 AC_DEFINE(FREEBSD_THREADS)
49 INCLUDES="$INCLUDES -pthread"
53 AC_DEFINE(SOLARIS_THREADS)
54 AC_DEFINE(_SOLARIS_PTHREADS)
57 AC_DEFINE(IRIX_THREADS)
64 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
65 AC_MSG_ERROR(thread package $THREADS not yet supported)
68 AC_MSG_ERROR($THREADS is an unknown thread package)
73 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
74 AC_SUBST(EXTRA_TEST_LIBS)
76 AC_ARG_ENABLE(java-gc,
78 << --enable-java-gc=TYPE choose garbage collector [boehm]>>,
83 if test "$GC" = "boehm"; then
84 target_all=libgcjgc.la
88 dnl If the target is an eCos system, use the appropriate eCos
90 dnl FIXME: this should not be a local option but a global target
91 dnl system; at present there is no eCos target.
94 [ --with-ecos enable runtime eCos target support],
95 TARGET_ECOS="$with_ecos"
100 case "$TARGET_ECOS" in
105 CXXINCLUDES="-I${TARGET_ECOS}/include"
106 addobjs="$addobjs ecos.lo"
112 AC_SUBST(CXXINCLUDES)
117 machdep="alpha_mach_dep.lo"
120 machdep="mips_ultrix_mach_dep.lo"
121 AC_DEFINE(STACKBASE, __stackbase)
122 AC_DEFINE(DATASTART_IS_ETEXT)
125 machdep="mips_ultrix_mach-dep.lo"
128 machdep="mips_sgi_mach_dep.lo"
129 AC_DEFINE(NO_EXECUTE_PERMISSION)
131 sparc-sun-solaris2.3*)
132 AC_DEFINE(SUNOS53_SHARED_LIB)
135 if test x"$machdep" = x; then
136 machdep="mach_dep.lo"
138 addobjs="$addobjs $machdep"
141 dnl As of 4.13a2, the collector will not properly work on Solaris when
142 dnl built with gcc and -O. So we remove -O in the appropriate case.
145 if test "$GCC" = yes; then
152 new_CFLAGS="$new_CFLAGS $i"
161 dnl We need to override the top-level CFLAGS. This is how we do it.
165 dnl Define a few things to retarget the library towards
168 AC_DEFINE(NO_SIGNALS)
169 AC_DEFINE(JAVA_FINALIZATION)
170 AC_DEFINE(GC_GCJ_SUPPORT)
172 dnl This is something of a hack. When cross-compiling we turn off
173 dnl some functionality. We also enable the "small" configuration.
174 dnl These is only correct when targetting an embedded system. FIXME.
175 if test -n "${with_cross_host}"; then
178 AC_DEFINE(SMALL_CONFIG)
179 AC_DEFINE(NO_DEBUGGING)
182 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
184 if test "${multilib}" = "yes"; then
185 multilib_arg="--enable-multilib"
192 dnl Put all the -D options in a file. These are required before
193 dnl boehm-config.h can be included. This is a huge hack brought
194 dnl about by overall poor structuring of this entire library.
195 echo "$DEFS" > boehm-cflags
197 if test -n "$CONFIG_FILES"; then
198 ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
203 with_multisubdir=${with_multisubdir}
204 ac_configure_args="${multilib_arg} ${ac_configure_args}"
205 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
206 boehm_gc_basedir=${boehm_gc_basedir}