]> gcc.gnu.org Git - gcc.git/blame - boehm-gc/configure.in
crash18.C: Remove.
[gcc.git] / boehm-gc / configure.in
CommitLineData
13b6e5b4 1# Copyright (c) 1999, 2000, 2001, 2002, 2003 by Red Hat, Inc. All rights reserved.
5a2586cf
TT
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
5#
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.
11#
12# Original author: Tom Tromey
13
1530be84
TT
14dnl Process this file with autoconf to produce configure.
15
9110a741 16AC_INIT(gcj_mlc.c)
1530be84 17
6706f116
AO
18# This works around the fact that libtool configuration may change LD
19# for this particular configuration, but some shells, instead of
20# keeping the changes in LD private, export them just because LD is
21# exported.
22ORIGINAL_LD_FOR_MULTILIBS=$LD
23
5a2586cf
TT
24dnl Can't be done in GC_CONFIGURE because that confuses automake.
25AC_CONFIG_AUX_DIR(.)
26
27GC_CONFIGURE(.)
1530be84 28
66deb2be
TT
29AM_PROG_LIBTOOL
30
1530be84
TT
31dnl We use these options to decide which functions to include.
32AC_ARG_WITH(target-subdir,
61e922d2
RO
33[ --with-target-subdir=SUBDIR
34 configuring with a cross compiler])
1530be84 35AC_ARG_WITH(cross-host,
61e922d2 36[ --with-cross-host=HOST configuring with a cross compiler])
1530be84
TT
37
38AM_MAINTAINER_MODE
39# automake wants to see AC_EXEEXT. But we don't need it. And having
40# it is actually a problem, because the compiler we're passed can't
41# necessarily do a full link. So we fool automake here.
01ef8751
AO
42if false; then
43 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
44 # to nothing, so nothing would remain between `then' and `fi' if it
45 # were not for the `:' below.
46 :
47 AC_EXEEXT
1530be84
TT
48fi
49
0ff95153
TT
50AC_MSG_CHECKING([for thread model used by GCC])
51THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
52if test -z "$THREADS"; then
53 THREADS=no
54fi
55AC_MSG_RESULT([$THREADS])
5a2586cf
TT
56
57AC_ARG_ENABLE(parallel-mark,
58[ --enable-parallel-mark parallelize marking and free list construction],
59 [case "$THREADS" in
60 no | none | single)
61 AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
62 ;;
63 esac]
64)
1530be84 65
9110a741 66INCLUDES=-I${srcdir}/include
e301621d 67THREADLIBS=
1530be84
TT
68case "$THREADS" in
69 no | none | single)
70 THREADS=none
71 ;;
72 posix | pthreads)
73 THREADS=posix
62aa6b06 74 THREADLIBS=-lpthread
1530be84 75 case "$host" in
30c3de1f 76 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*)
5a2586cf
TT
77 AC_DEFINE(GC_LINUX_THREADS)
78 AC_DEFINE(_REENTRANT)
30c3de1f 79 if test "${enable_parallel_mark}" = yes; then
5a2586cf
TT
80 AC_DEFINE(PARALLEL_MARK)
81 fi
82 AC_DEFINE(THREAD_LOCAL_ALLOC)
83 ;;
1530be84 84 *-*-linux*)
5a2586cf 85 AC_DEFINE(GC_LINUX_THREADS)
1530be84
TT
86 AC_DEFINE(_REENTRANT)
87 ;;
30c3de1f
JS
88 *-*-aix*)
89 AC_DEFINE(GC_AIX_THREADS)
90 AC_DEFINE(_REENTRANT)
91 ;;
5a2586cf
TT
92 *-*-hpux*)
93 AC_MSG_WARN("Only HP/UX 11 threads are supported.")
94 AC_DEFINE(GC_HPUX_THREADS)
95 AC_DEFINE(_POSIX_C_SOURCE,199506L)
96 if test "${enable_parallel_mark}" = yes; then
97 AC_DEFINE(PARALLEL_MARK)
98 fi
99 AC_DEFINE(THREAD_LOCAL_ALLOC)
100 THREADLIBS="-lpthread -lrt"
101 ;;
62aa6b06 102 *-*-freebsd*)
79f777fd 103 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
4c7726b1 104 AC_DEFINE(GC_FREEBSD_THREADS)
9110a741 105 INCLUDES="$INCLUDES -pthread"
62aa6b06
LR
106 THREADLIBS=-pthread
107 ;;
1530be84 108 *-*-solaris*)
5a2586cf
TT
109 AC_DEFINE(GC_SOLARIS_THREADS)
110 AC_DEFINE(GC_SOLARIS_PTHREADS)
1530be84 111 ;;
14caa62f 112 *-*-irix*)
5a2586cf 113 AC_DEFINE(GC_IRIX_THREADS)
14caa62f 114 ;;
a2d6e915 115 *-*-cygwin*)
30c3de1f
JS
116 AC_DEFINE(GC_WIN32_THREADS)
117 ;;
118 *-*-darwin*)
119 AC_DEFINE(GC_DARWIN_THREADS)
120 AC_DEFINE(THREAD_LOCAL_ALLOC)
121 if test "${enable_parallel_mark}" = yes; then
122 AC_DEFINE(PARALLEL_MARK)
123 fi
124 ;;
125 *-*-osf*)
126 AC_DEFINE(GC_OSF1_THREADS)
127 if test "${enable_parallel_mark}" = yes; then
128 AC_DEFINE(PARALLEL_MARK)
129 AC_DEFINE(THREAD_LOCAL_ALLOC)
130 # May want to enable it in other cases, too.
131 # Measurements havent yet been done.
132 fi
133 INCLUDES="$INCLUDES -pthread"
134 THREADLIBS="-lpthread -lrt"
a2d6e915 135 ;;
1530be84
TT
136 esac
137 ;;
df61a3d2
AM
138 win32)
139 AC_DEFINE(GC_WIN32_THREADS)
30c3de1f 140 dnl Wine getenv may not return NULL for missing entry
512e32d2 141 AC_DEFINE(NO_GETENV)
30c3de1f
JS
142 ;;
143 dgux386)
144 THREADS=dgux386
145AC_MSG_RESULT($THREADLIBS)
146 # Use pthread GCC switch
147 THREADLIBS=-pthread
148 if test "${enable_parallel_mark}" = yes; then
149 AC_DEFINE(PARALLEL_MARK)
e83a44d2 150 fi
30c3de1f
JS
151 AC_DEFINE(THREAD_LOCAL_ALLOC)
152 AC_DEFINE(GC_DGUX386_THREADS)
153 AC_DEFINE(DGUX_THREADS)
154 # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
155 INCLUDES="-pthread $INCLUDES"
156 ;;
157 aix)
158 THREADS=posix
159 THREADLIBS=-lpthread
160 AC_DEFINE(GC_AIX_THREADS)
161 AC_DEFINE(_REENTRANT)
df61a3d2
AM
162 ;;
163 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
1530be84
TT
164 AC_MSG_ERROR(thread package $THREADS not yet supported)
165 ;;
166 *)
167 AC_MSG_ERROR($THREADS is an unknown thread package)
168 ;;
169esac
e301621d 170AC_SUBST(THREADLIBS)
1530be84 171
30c3de1f
JS
172case "$host" in
173 powerpc-*-darwin*)
174 powerpc_darwin=true
175 ;;
176esac
177AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
178
179# We never want libdl on darwin. It is a fake libdl that just ends up making
180# dyld calls anyway
181case "$host" in
182 *-*-darwin*) ;;
183 *)
184 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
185 ;;
186esac
187
f2beb7ef
APB
188AC_SUBST(EXTRA_TEST_LIBS)
189
5a2586cf 190target_all=libgcjgc.la
1530be84 191AC_SUBST(target_all)
f28c857f 192AC_SUBST(target_alias)
1530be84
TT
193
194dnl If the target is an eCos system, use the appropriate eCos
195dnl I/O routines.
196dnl FIXME: this should not be a local option but a global target
197dnl system; at present there is no eCos target.
198TARGET_ECOS="no"
199AC_ARG_WITH(ecos,
61e922d2 200[ --with-ecos enable runtime eCos target support],
1530be84
TT
201TARGET_ECOS="$with_ecos"
202)
203
204addobjs=
30c3de1f
JS
205addlibs=
206addincludes=
207addtests=
1530be84
TT
208CXXINCLUDES=
209case "$TARGET_ECOS" in
210 no)
211 ;;
212 *)
213 AC_DEFINE(ECOS)
214 CXXINCLUDES="-I${TARGET_ECOS}/include"
66deb2be 215 addobjs="$addobjs ecos.lo"
1530be84
TT
216 ;;
217esac
30c3de1f
JS
218
219if test "${enable_cplusplus}" = yes; then
220 addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
221 addtests="$addtests test_cpp"
222fi
223
224AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
225
1530be84
TT
226AC_SUBST(CXX)
227
228AC_SUBST(INCLUDES)
229AC_SUBST(CXXINCLUDES)
230
30c3de1f
JS
231# Configuration of shared libraries
232#
233AC_MSG_CHECKING(whether to build shared libraries)
234AC_ENABLE_SHARED
235
236case "$host" in
237 alpha-*-openbsd*)
238 enable_shared=no
239 AC_MSG_RESULT(no)
240 ;;
241 *)
242 AC_MSG_RESULT(yes)
243 ;;
244esac
245
246# Configuration of machine-dependent code
247#
248AC_MSG_CHECKING(which machine-dependent code should be used)
1530be84
TT
249machdep=
250case "$host" in
adb60117
RH
251 alpha*-*-openbsd*)
252 machdep="alpha_mach_dep.lo"
4c7726b1
BM
253 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
254 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
4c7726b1
BM
255 fi
256 ;;
30c3de1f 257 alpha*-*-linux*)
adb60117
RH
258 machdep="alpha_mach_dep.lo"
259 ;;
260 i?86-*-solaris2.[[89]]*)
261 AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
262 ;;
1530be84 263 mipstx39-*-elf*)
66deb2be 264 machdep="mips_ultrix_mach_dep.lo"
1530be84
TT
265 AC_DEFINE(STACKBASE, __stackbase)
266 AC_DEFINE(DATASTART_IS_ETEXT)
267 ;;
276836f0
RO
268 mips-dec-ultrix*)
269 machdep="mips_ultrix_mach-dep.lo"
270 ;;
30c3de1f 271 mips-nec-sysv*|mips-unknown-sysv*)
5316699d 272 ;;
30c3de1f
JS
273 mips*-*-linux*)
274 ;;
276836f0
RO
275 mips-*-*)
276 machdep="mips_sgi_mach_dep.lo"
277 AC_DEFINE(NO_EXECUTE_PERMISSION)
d42058b1 278 ;;
30c3de1f
JS
279 sparc-*-netbsd*)
280 machdep="sparc_netbsd_mach_dep.lo"
281 ;;
1530be84 282 sparc-sun-solaris2.3*)
79f777fd 283 machdep="sparc_mach_dep.lo"
1530be84
TT
284 AC_DEFINE(SUNOS53_SHARED_LIB)
285 ;;
79f777fd
BM
286 sparc-sun-solaris2.*)
287 machdep="sparc_mach_dep.lo"
288 ;;
289 ia64-*-*)
4c7726b1
BM
290 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
291 ;;
1530be84
TT
292esac
293if test x"$machdep" = x; then
30c3de1f 294AC_MSG_RESULT($machdep)
66deb2be 295 machdep="mach_dep.lo"
1530be84
TT
296fi
297addobjs="$addobjs $machdep"
298AC_SUBST(addobjs)
30c3de1f
JS
299AC_SUBST(addincludes)
300AC_SUBST(addlibs)
301AC_SUBST(addtests)
302
303AC_PROG_LIBTOOL
304
305#
306# Check for AViiON Machines running DGUX
307#
308AC_MSG_CHECKING(if host is AViiON running DGUX)
309ac_is_dgux=no
310AC_CHECK_HEADER(sys/dg_sys_info.h,
311[ac_is_dgux=yes;])
312
313AC_MSG_RESULT($ac_is_dgux)
314 ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
315if test $ac_is_dgux = yes; then
316 if test "$enable_full_debug" = "yes"; then
317 CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
318 CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
319 else
320 CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
321 CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
322 fi
323 AC_SUBST(CFLAGS)
324 AC_SUBST(CXXFLAGS)
325fi
326
327dnl We use these options to decide which functions to include.
328AC_ARG_WITH(target-subdir,
329[ --with-target-subdir=SUBDIR
330 configuring with a cross compiler])
331AC_ARG_WITH(cross-host,
332[ --with-cross-host=HOST configuring with a cross compiler])
333
334# automake wants to see AC_EXEEXT. But we don't need it. And having
335# it is actually a problem, because the compiler we're passed can't
336# necessarily do a full link. So we fool automake here.
337if false; then
338 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
339 # to nothing, so nothing would remain between `then' and `fi' if it
340 # were not for the `:' below.
341 :
342 AC_EXEEXT
343fi
1530be84
TT
344
345dnl As of 4.13a2, the collector will not properly work on Solaris when
346dnl built with gcc and -O. So we remove -O in the appropriate case.
30c3de1f
JS
347dnl
348AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
1530be84 349case "$host" in
30c3de1f 350 sparc-sun-solaris2*|*aix*)
1530be84 351 if test "$GCC" = yes; then
30c3de1f 352 AC_MSG_RESULT(yes)
1530be84
TT
353 new_CFLAGS=
354 for i in $CFLAGS; do
355 case "$i" in
356 -O*)
357 ;;
358 *)
359 new_CFLAGS="$new_CFLAGS $i"
360 ;;
361 esac
362 done
363 CFLAGS="$new_CFLAGS"
30c3de1f
JS
364 else
365 AC_MSG_RESULT(no)
1530be84
TT
366 fi
367 ;;
30c3de1f 368 *) AC_MSG_RESULT(no) ;;
1530be84
TT
369esac
370
371dnl We need to override the top-level CFLAGS. This is how we do it.
372MY_CFLAGS="$CFLAGS"
373AC_SUBST(MY_CFLAGS)
374
5a2586cf
TT
375dnl Include defines that have become de facto standard.
376dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
1530be84
TT
377AC_DEFINE(SILENT)
378AC_DEFINE(NO_SIGNALS)
5a2586cf
TT
379AC_DEFINE(NO_EXECUTE_PERMISSION)
380AC_DEFINE(ALL_INTERIOR_POINTERS)
381
382dnl By default, make the library as general as possible.
1530be84 383AC_DEFINE(JAVA_FINALIZATION)
0476f098 384AC_DEFINE(GC_GCJ_SUPPORT)
5a2586cf 385AC_DEFINE(ATOMIC_UNCOLLECTABLE)
1530be84 386
1530be84 387dnl This is something of a hack. When cross-compiling we turn off
df61a3d2
AM
388dnl some functionality. These is only correct when targetting an
389dnl embedded system. FIXME.
1530be84
TT
390if test -n "${with_cross_host}"; then
391 AC_DEFINE(NO_SIGSET)
0476f098 392 AC_DEFINE(NO_DEBUGGING)
1530be84
TT
393fi
394
5a2586cf
TT
395AC_ARG_ENABLE(full-debug,
396[ --enable-full-debug include full support for pointer backtracing etc.],
397[ if test "$enable_full_debug" = "yes"; then
398 AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.")
399 AC_DEFINE(KEEP_BACK_PTRS)
400 AC_DEFINE(DBG_HDRS_ALL)
401 case $host in
79f777fd
BM
402 ia64-*-linux* )
403 AC_DEFINE(MAKE_BACK_GRAPH)
404 ;;
48528b67 405 x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
79f777fd 406 AC_DEFINE(MAKE_BACK_GRAPH)
5a2586cf
TT
407 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
408 AC_DEFINE(SAVE_CALL_COUNT, 8)
409 ;;
30c3de1f
JS
410 i[3456]86-*-dgux*)
411 AC_DEFINE(MAKE_BACK_GRAPH)
412 ;;
5a2586cf
TT
413 esac ]
414 fi)
415
13b6e5b4
AO
416if test -n "$with_cross_host" &&
417 test x"$with_cross_host" != x"no"; then
418 toolexecdir='$(exec_prefix)/$(target_alias)'
419 toolexeclibdir='$(toolexecdir)/lib'
420else
421 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
422 toolexeclibdir='$(libdir)'
423fi
ff8b9ca8
AS
424multi_os_directory=`$CC -print-multi-os-directory`
425case $multi_os_directory in
426 .) ;; # Avoid trailing /.
427 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
428esac
13b6e5b4
AO
429AC_SUBST(toolexecdir)
430AC_SUBST(toolexeclibdir)
b48ed568 431
1530be84
TT
432if test "${multilib}" = "yes"; then
433 multilib_arg="--enable-multilib"
434else
435 multilib_arg=
436fi
437
1a8a749c 438AC_OUTPUT(Makefile include/Makefile, [
5a2586cf 439dnl Put all the -D options in a file.
1530be84
TT
440echo "$DEFS" > boehm-cflags
441
442if test -n "$CONFIG_FILES"; then
6706f116 443 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
5a2586cf 444 ac_file=Makefile . ${gc_basedir}/../config-ml.in
1530be84
TT
445fi],
446srcdir=${srcdir}
447host=${host}
448target=${target}
449with_multisubdir=${with_multisubdir}
450ac_configure_args="${multilib_arg} ${ac_configure_args}"
451CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
5a2586cf 452gc_basedir=${gc_basedir}
1530be84 453CC="${CC}"
3343fdd2 454ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
1530be84
TT
455DEFS="$DEFS"
456)
This page took 0.318433 seconds and 5 git commands to generate.