]>
Commit | Line | Data |
---|---|---|
7ddf92a8 | 1 | # Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006 by Red Hat, Inc. All rights reserved. |
d38d6003 | 2 | # Copyright 2004 Nathanael Nerode |
5a2586cf TT |
3 | # |
4 | # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED | |
5 | # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. | |
6 | # | |
7 | # Permission is hereby granted to use or copy this program | |
8 | # for any purpose, provided the above notices are retained on all copies. | |
9 | # Permission to modify the code and to distribute modified code is granted, | |
10 | # provided the above notices are retained, and a notice that the code was | |
11 | # modified is included with the above copyright notice. | |
12 | # | |
13 | # Original author: Tom Tromey | |
d38d6003 | 14 | # Modified by Nathanael Nerode |
5a2586cf | 15 | |
1530be84 TT |
16 | dnl Process this file with autoconf to produce configure. |
17 | ||
8ab705be | 18 | AC_PREREQ(2.59) |
13b040f1 NN |
19 | AC_INIT |
20 | AC_CONFIG_SRCDIR(gcj_mlc.c) | |
6706f116 AO |
21 | # This works around the fact that libtool configuration may change LD |
22 | # for this particular configuration, but some shells, instead of | |
23 | # keeping the changes in LD private, export them just because LD is | |
24 | # exported. | |
25 | ORIGINAL_LD_FOR_MULTILIBS=$LD | |
26 | ||
bf9a420e | 27 | AM_ENABLE_MULTILIB(, ..) |
b1891e51 | 28 | |
13b040f1 NN |
29 | AC_CANONICAL_HOST |
30 | AC_CANONICAL_TARGET | |
b1891e51 | 31 | |
d38d6003 | 32 | # Get the 'noncanonical' system names. |
13b040f1 | 33 | ACX_NONCANONICAL_TARGET |
d38d6003 | 34 | |
b1891e51 NN |
35 | # This works around an automake problem. |
36 | mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs" | |
37 | AC_SUBST(mkinstalldirs) | |
38 | ||
54f28c21 | 39 | AM_INIT_AUTOMAKE(gc, 6.6, no-define) |
a749e46c NN |
40 | |
41 | # The autoconf 2.5x version of the no-executables hack. | |
a749e46c NN |
42 | GCC_NO_EXECUTABLES |
43 | ||
44 | # Yak. We must force CC and CXX to /not/ be precious variables; otherwise | |
45 | # the wrong, non-multilib-adjusted value will be used in multilibs. | |
46 | # As a side effect, we have to subst CFLAGS and CXXFLAGS ourselves. | |
47 | ||
48 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
49 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
50 | AC_PROG_CC | |
51 | AC_PROG_CXX | |
1b3b24c2 | 52 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
a749e46c | 53 | |
bf9a420e PB |
54 | AM_PROG_CC_C_O |
55 | ||
a749e46c NN |
56 | AC_SUBST(CFLAGS) |
57 | AC_SUBST(CXXFLAGS) | |
58 | ||
7664e6f8 NN |
59 | # Newer automakes demand CCAS and CCASFLAGS. |
60 | : ${CCAS='$(CC)'} | |
61 | : ${CCASFLAGS='$(CFLAGS)'} | |
62 | AC_SUBST(CCAS) | |
63 | AC_SUBST(CCASFLAGS) | |
64 | ||
a749e46c NN |
65 | AC_CHECK_TOOL(AS, as) |
66 | AC_CHECK_TOOL(AR, ar) | |
67 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
68 | ||
69 | AC_PROG_INSTALL | |
70 | ||
71 | AM_MAINTAINER_MODE | |
72 | ||
13b040f1 | 73 | . ${srcdir}/configure.host |
a749e46c | 74 | |
13b040f1 NN |
75 | case ${gc_basedir} in |
76 | /* | [A-Za-z]:[/\\]*) gc_flagbasedir=${gc_basedir} ;; | |
77 | *) gc_flagbasedir='$(top_builddir)/'${gc_basedir} ;; | |
a749e46c NN |
78 | esac |
79 | ||
13b040f1 | 80 | gc_cflags="${gc_cflags} -Iinclude -I"'$(top_builddir)'"/./targ-include -I${gc_flagbasedir}/libc/include" |
a749e46c NN |
81 | case "${host}" in |
82 | *-*-cygwin32*) | |
13b040f1 | 83 | gc_cflags="${gc_cflags} -I${gc_flagbasedir}/../winsup/include" |
a749e46c NN |
84 | ;; |
85 | esac | |
86 | ||
e59be1b1 KT |
87 | dnl Add for mingw targets GC_BUILD option |
88 | case "${host}" in | |
89 | *-*-mingw*) | |
90 | gc_cflags="${gc_cflags} -DGC_BUILD=1" | |
91 | ;; | |
92 | esac | |
93 | ||
13b040f1 | 94 | dnl gc_cflags="${gc_cflags} -fno-builtin" |
a749e46c NN |
95 | |
96 | GC_CFLAGS=${gc_cflags} | |
97 | AC_SUBST(GC_CFLAGS) | |
1530be84 | 98 | |
13b040f1 | 99 | AC_PROG_LIBTOOL |
66deb2be | 100 | |
1530be84 TT |
101 | dnl We use these options to decide which functions to include. |
102 | AC_ARG_WITH(target-subdir, | |
61e922d2 RO |
103 | [ --with-target-subdir=SUBDIR |
104 | configuring with a cross compiler]) | |
1530be84 | 105 | AC_ARG_WITH(cross-host, |
61e922d2 | 106 | [ --with-cross-host=HOST configuring with a cross compiler]) |
1530be84 | 107 | |
0ff95153 TT |
108 | AC_MSG_CHECKING([for thread model used by GCC]) |
109 | THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` | |
110 | if test -z "$THREADS"; then | |
111 | THREADS=no | |
112 | fi | |
113 | AC_MSG_RESULT([$THREADS]) | |
5a2586cf TT |
114 | |
115 | AC_ARG_ENABLE(parallel-mark, | |
116 | [ --enable-parallel-mark parallelize marking and free list construction], | |
117 | [case "$THREADS" in | |
118 | no | none | single) | |
119 | AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec]) | |
120 | ;; | |
121 | esac] | |
122 | ) | |
1530be84 | 123 | |
bf9a420e | 124 | AM_CPPFLAGS="-I`cd $srcdir && ${PWDCMD-pwd}`/include" |
e301621d | 125 | THREADLIBS= |
1530be84 TT |
126 | case "$THREADS" in |
127 | no | none | single) | |
128 | THREADS=none | |
129 | ;; | |
f3968b05 | 130 | posix | posix95 | pthreads) |
1530be84 | 131 | THREADS=posix |
62aa6b06 | 132 | THREADLIBS=-lpthread |
1530be84 | 133 | case "$host" in |
30c3de1f | 134 | x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*) |
5572488d KC |
135 | AC_DEFINE(GC_LINUX_THREADS,1,[support for Xavier Leroy's Linux threads]) |
136 | AC_DEFINE(_REENTRANT,1,[Use reentrant code]) | |
30c3de1f | 137 | if test "${enable_parallel_mark}" = yes; then |
5572488d | 138 | AC_DEFINE(PARALLEL_MARK,1,[allow the marker to run in multiple threads]) |
5a2586cf | 139 | fi |
5572488d | 140 | AC_DEFINE(THREAD_LOCAL_ALLOC,1,[define GC_local_malloc() & GC_local_malloc_atomic()]) |
5a2586cf | 141 | ;; |
1530be84 | 142 | *-*-linux*) |
5572488d KC |
143 | AC_DEFINE(GC_LINUX_THREADS,1) |
144 | AC_DEFINE(_REENTRANT,1) | |
1530be84 | 145 | ;; |
30c3de1f | 146 | *-*-aix*) |
5572488d KC |
147 | AC_DEFINE(GC_AIX_THREADS,1,[support AIX threads]) |
148 | AC_DEFINE(_REENTRANT,1) | |
30c3de1f | 149 | ;; |
d0c03515 AT |
150 | *-*-hpux11*) |
151 | AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.") | |
5572488d KC |
152 | AC_DEFINE(GC_HPUX_THREADS,1,[enables support for HP/UX 11 pthreads]) |
153 | AC_DEFINE(_POSIX_C_SOURCE,199506L,[POSIX version of C Source]) | |
5a2586cf | 154 | if test "${enable_parallel_mark}" = yes; then |
5572488d | 155 | AC_DEFINE(PARALLEL_MARK,1) |
5a2586cf | 156 | fi |
5572488d | 157 | AC_DEFINE(THREAD_LOCAL_ALLOC,1) |
5a2586cf | 158 | THREADLIBS="-lpthread -lrt" |
d0c03515 AT |
159 | # HPUX needs REENTRANT for the _r calls. |
160 | AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads]) | |
161 | ;; | |
162 | *-*-hpux10*) | |
163 | AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.") | |
5a2586cf | 164 | ;; |
eb496303 PS |
165 | *-*-kfreebsd*-gnu) |
166 | AC_DEFINE(GC_FREEBSD_THREADS) | |
167 | INCLUDES="$INCLUDES -pthread" | |
168 | THREADDLLIBS=-pthread | |
169 | AC_DEFINE(_REENTRANT) | |
170 | if test "${enable_parallel_mark}" = yes; then | |
171 | AC_DEFINE(PARALLEL_MARK) | |
172 | fi | |
173 | AC_DEFINE(THREAD_LOCAL_ALLOC) | |
174 | AC_DEFINE(USE_COMPILER_TLS, 1,[use tls for boehm]) | |
175 | ;; | |
62aa6b06 | 176 | *-*-freebsd*) |
79f777fd | 177 | AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") |
5572488d | 178 | AC_DEFINE(GC_FREEBSD_THREADS,1,[support FreeBSD threads]) |
bf9a420e | 179 | AM_CPPFLAGS="$AM_CPPFLAGS -pthread" |
62aa6b06 LR |
180 | THREADLIBS=-pthread |
181 | ;; | |
1530be84 | 182 | *-*-solaris*) |
5572488d | 183 | AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads]) |
28e2ff77 RO |
184 | # Need to use alternate thread library, otherwise gctest hangs |
185 | # on Solaris 8. | |
186 | multi_os_directory=`$CC -print-multi-os-directory` | |
187 | THREADLIBS="-L/usr/lib/lwp/$multi_os_directory \ | |
188 | -R/usr/lib/lwp/$multi_os_directory -lpthread -lthread -lrt" | |
1530be84 | 189 | ;; |
14caa62f | 190 | *-*-irix*) |
5572488d | 191 | AC_DEFINE(GC_IRIX_THREADS,1,[support for Irix pthreads]) |
14caa62f | 192 | ;; |
a2d6e915 | 193 | *-*-cygwin*) |
5572488d | 194 | AC_DEFINE(GC_WIN32_THREADS,1,[support for win32 threads]) |
30c3de1f JS |
195 | ;; |
196 | *-*-darwin*) | |
5572488d KC |
197 | AC_DEFINE(GC_DARWIN_THREADS,1,[support for Mac OS X pthreads]) |
198 | AC_DEFINE(THREAD_LOCAL_ALLOC,1) | |
30c3de1f | 199 | if test "${enable_parallel_mark}" = yes; then |
5572488d | 200 | AC_DEFINE(PARALLEL_MARK,1) |
30c3de1f JS |
201 | fi |
202 | ;; | |
203 | *-*-osf*) | |
5572488d | 204 | AC_DEFINE(GC_OSF1_THREADS,1,[support for Tru64 pthreads]) |
30c3de1f | 205 | if test "${enable_parallel_mark}" = yes; then |
5572488d KC |
206 | AC_DEFINE(PARALLEL_MARK,1) |
207 | AC_DEFINE(THREAD_LOCAL_ALLOC,1) | |
30c3de1f JS |
208 | # May want to enable it in other cases, too. |
209 | # Measurements havent yet been done. | |
210 | fi | |
bf9a420e | 211 | AM_CPPFLAGS="$AM_CPPFLAGS -pthread" |
30c3de1f | 212 | THREADLIBS="-lpthread -lrt" |
a2d6e915 | 213 | ;; |
1530be84 TT |
214 | esac |
215 | ;; | |
df61a3d2 | 216 | win32) |
5572488d | 217 | AC_DEFINE(GC_WIN32_THREADS,1) |
aa44273b HB |
218 | dnl Old wine getenv may not return NULL for missing entry. |
219 | dnl Define EMPTY_GETENV_RESULTS here to work around the bug. | |
30c3de1f JS |
220 | ;; |
221 | dgux386) | |
222 | THREADS=dgux386 | |
223 | AC_MSG_RESULT($THREADLIBS) | |
224 | # Use pthread GCC switch | |
225 | THREADLIBS=-pthread | |
226 | if test "${enable_parallel_mark}" = yes; then | |
5572488d | 227 | AC_DEFINE(PARALLEL_MARK,1) |
e83a44d2 | 228 | fi |
5572488d KC |
229 | AC_DEFINE(THREAD_LOCAL_ALLOC,1) |
230 | AC_DEFINE(GC_DGUX386_THREADS,1,[support for DB/UX on I386 threads]) | |
231 | AC_DEFINE(DGUX_THREADS,1,[No description]) | |
30c3de1f | 232 | # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread |
bf9a420e | 233 | AM_CPPFLAGS="-pthread $AM_CPPFLAGS" |
30c3de1f JS |
234 | ;; |
235 | aix) | |
236 | THREADS=posix | |
237 | THREADLIBS=-lpthread | |
5572488d KC |
238 | AC_DEFINE(GC_AIX_THREADS,1) |
239 | AC_DEFINE(_REENTRANT,1) | |
df61a3d2 AM |
240 | ;; |
241 | decosf1 | irix | mach | os2 | solaris | dce | vxworks) | |
1530be84 TT |
242 | AC_MSG_ERROR(thread package $THREADS not yet supported) |
243 | ;; | |
244 | *) | |
245 | AC_MSG_ERROR($THREADS is an unknown thread package) | |
246 | ;; | |
247 | esac | |
e301621d | 248 | AC_SUBST(THREADLIBS) |
1530be84 | 249 | |
8c048b48 | 250 | case "$host" in |
30c3de1f JS |
251 | powerpc-*-darwin*) |
252 | powerpc_darwin=true | |
253 | ;; | |
254 | esac | |
255 | AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue) | |
256 | ||
4f6d8cc8 GK |
257 | # Darwin needs a few extra special tests to deal with variation in the |
258 | # system headers. | |
259 | case "$host" in | |
260 | powerpc*-*-darwin*) | |
261 | AC_CHECK_MEMBER(ppc_thread_state_t.r0, | |
583cb3d3 AT |
262 | AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1, |
263 | [ppc_thread_state_t has field r0]),, | |
4f6d8cc8 GK |
264 | [#include <mach/thread_status.h>]) |
265 | AC_CHECK_MEMBER(ppc_thread_state_t.__r0, | |
583cb3d3 AT |
266 | AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl |
267 | [ppc_thread_state_t has field __r0]),, | |
4f6d8cc8 GK |
268 | [#include <mach/thread_status.h>]) |
269 | AC_CHECK_MEMBER(ppc_thread_state64_t.r0, | |
583cb3d3 AT |
270 | AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl |
271 | [ppc_thread_state64_t has field r0]),, | |
4f6d8cc8 GK |
272 | [#include <mach/thread_status.h>]) |
273 | AC_CHECK_MEMBER(ppc_thread_state64_t.__r0, | |
583cb3d3 AT |
274 | AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl |
275 | [ppc_thread_state64_t has field __r0]),, | |
4f6d8cc8 GK |
276 | [#include <mach/thread_status.h>]) |
277 | ;; | |
278 | i?86*-*-darwin*) | |
583cb3d3 AT |
279 | AC_CHECK_MEMBER(x86_thread_state32_t.eax, |
280 | AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl | |
281 | [x86_thread_state32_t has field eax]),, | |
9a35ada5 | 282 | [#include <sys/cdefs.h> |
583cb3d3 AT |
283 | #include <mach/thread_status.h>]) |
284 | AC_CHECK_MEMBER(x86_thread_state32_t.__eax, | |
285 | AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl | |
286 | [x86_thread_state32_t has field __eax]),, | |
9a35ada5 | 287 | [#include <sys/cdefs.h> |
583cb3d3 | 288 | #include <mach/thread_status.h>]) |
4f6d8cc8 | 289 | ;; |
583cb3d3 AT |
290 | x86_64-*-darwin*) |
291 | AC_CHECK_MEMBER(x86_thread_state64_t.rax, | |
292 | AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl | |
293 | [x86_thread_state64_t has field rax]),, | |
294 | [#include <sys/cdefs.h> | |
295 | #include <mach/thread_status.h>]) | |
296 | AC_CHECK_MEMBER(x86_thread_state64_t.__rax, | |
297 | AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl | |
298 | [x86_thread_state64_t has field __rax]),, | |
299 | [#include <sys/cdefs.h> | |
300 | #include <mach/thread_status.h>]) | |
301 | ;; | |
4f6d8cc8 GK |
302 | *) ;; |
303 | esac | |
304 | ||
30c3de1f JS |
305 | # We never want libdl on darwin. It is a fake libdl that just ends up making |
306 | # dyld calls anyway | |
307 | case "$host" in | |
308 | *-*-darwin*) ;; | |
8c048b48 | 309 | *) |
30c3de1f JS |
310 | AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl") |
311 | ;; | |
312 | esac | |
313 | ||
53630715 AT |
314 | # extra LD Flags which are required for targets |
315 | case "${host}" in | |
316 | *-*-darwin*) | |
317 | extra_ldflags_libgc=-Wl,-single_module | |
318 | ;; | |
319 | esac | |
320 | AC_SUBST(extra_ldflags_libgc) | |
321 | ||
f2beb7ef APB |
322 | AC_SUBST(EXTRA_TEST_LIBS) |
323 | ||
5a2586cf | 324 | target_all=libgcjgc.la |
1530be84 TT |
325 | AC_SUBST(target_all) |
326 | ||
327 | dnl If the target is an eCos system, use the appropriate eCos | |
328 | dnl I/O routines. | |
329 | dnl FIXME: this should not be a local option but a global target | |
330 | dnl system; at present there is no eCos target. | |
331 | TARGET_ECOS="no" | |
332 | AC_ARG_WITH(ecos, | |
61e922d2 | 333 | [ --with-ecos enable runtime eCos target support], |
1530be84 TT |
334 | TARGET_ECOS="$with_ecos" |
335 | ) | |
336 | ||
337 | addobjs= | |
30c3de1f JS |
338 | addlibs= |
339 | addincludes= | |
340 | addtests= | |
1530be84 TT |
341 | case "$TARGET_ECOS" in |
342 | no) | |
343 | ;; | |
344 | *) | |
5572488d | 345 | AC_DEFINE(ECOS,1,[Target is ECOS]) |
bf9a420e | 346 | AM_CPPFLAGS="${AM_CPPFLAGS} -I${TARGET_ECOS}/include" |
66deb2be | 347 | addobjs="$addobjs ecos.lo" |
1530be84 TT |
348 | ;; |
349 | esac | |
30c3de1f JS |
350 | |
351 | if test "${enable_cplusplus}" = yes; then | |
352 | addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h" | |
353 | addtests="$addtests test_cpp" | |
354 | fi | |
355 | ||
356 | AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes) | |
357 | ||
1530be84 TT |
358 | AC_SUBST(CXX) |
359 | ||
bf9a420e | 360 | AC_SUBST(AM_CPPFLAGS) |
1530be84 | 361 | |
30c3de1f JS |
362 | # Configuration of shared libraries |
363 | # | |
364 | AC_MSG_CHECKING(whether to build shared libraries) | |
365 | AC_ENABLE_SHARED | |
366 | ||
367 | case "$host" in | |
368 | alpha-*-openbsd*) | |
369 | enable_shared=no | |
370 | AC_MSG_RESULT(no) | |
371 | ;; | |
372 | *) | |
373 | AC_MSG_RESULT(yes) | |
374 | ;; | |
375 | esac | |
376 | ||
7ddf92a8 BM |
377 | # Checks for pthreads functions |
378 | # | |
379 | oldLIBS="$LIBS" | |
380 | LIBS="$LIBS $THREADLIBS" | |
381 | AC_CHECK_FUNCS([pthread_getattr_np]) | |
382 | LIBS="$oldLIBS" | |
383 | ||
30c3de1f JS |
384 | # Configuration of machine-dependent code |
385 | # | |
f0920e6c JJ |
386 | # Set NO_EXECUTE_PERMISSION by default because gcj already uses |
387 | # ffi_closure_{alloc,free} which takes care of allocating trampolines | |
388 | # in executable memory. | |
b27317b5 | 389 | # |
8c048b48 | 390 | AC_MSG_CHECKING(which machine-dependent code should be used) |
1530be84 TT |
391 | machdep= |
392 | case "$host" in | |
adb60117 RH |
393 | alpha*-*-openbsd*) |
394 | machdep="alpha_mach_dep.lo" | |
4c7726b1 BM |
395 | if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then |
396 | AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled) | |
4c7726b1 BM |
397 | fi |
398 | ;; | |
30c3de1f | 399 | alpha*-*-linux*) |
adb60117 RH |
400 | machdep="alpha_mach_dep.lo" |
401 | ;; | |
51ac684e | 402 | i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?) |
5572488d | 403 | AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED,1,[PROC_VDB in Solaris 2.5 gives wrong values for dirty bits]) |
adb60117 | 404 | ;; |
1530be84 | 405 | mipstx39-*-elf*) |
66deb2be | 406 | machdep="mips_ultrix_mach_dep.lo" |
5572488d KC |
407 | AC_DEFINE(STACKBASE, __stackbase,[No description]) |
408 | AC_DEFINE(DATASTART_IS_ETEXT,1,[No description]) | |
1530be84 | 409 | ;; |
276836f0 RO |
410 | mips-dec-ultrix*) |
411 | machdep="mips_ultrix_mach-dep.lo" | |
412 | ;; | |
30c3de1f | 413 | mips-nec-sysv*|mips-unknown-sysv*) |
5316699d | 414 | ;; |
8c048b48 NN |
415 | mips*-*-linux*) |
416 | ;; | |
276836f0 RO |
417 | mips-*-*) |
418 | machdep="mips_sgi_mach_dep.lo" | |
d42058b1 | 419 | ;; |
30c3de1f JS |
420 | sparc-*-netbsd*) |
421 | machdep="sparc_netbsd_mach_dep.lo" | |
422 | ;; | |
51ac684e | 423 | sparc-sun-solaris2.3) |
79f777fd | 424 | machdep="sparc_mach_dep.lo" |
5572488d | 425 | AC_DEFINE(SUNOS53_SHARED_LIB,1,[Avoid Solaris 5.3 dynamic library bug]) |
1530be84 | 426 | ;; |
ab52d207 | 427 | sparc*-sun-solaris2.*) |
79f777fd BM |
428 | machdep="sparc_mach_dep.lo" |
429 | ;; | |
430 | ia64-*-*) | |
4c7726b1 BM |
431 | machdep="mach_dep.lo ia64_save_regs_in_stack.lo" |
432 | ;; | |
1530be84 | 433 | esac |
f0920e6c | 434 | AC_DEFINE(NO_EXECUTE_PERMISSION,1,[cause some or all of the heap to not have execute permission]) |
1530be84 | 435 | if test x"$machdep" = x; then |
30c3de1f | 436 | AC_MSG_RESULT($machdep) |
66deb2be | 437 | machdep="mach_dep.lo" |
1530be84 TT |
438 | fi |
439 | addobjs="$addobjs $machdep" | |
440 | AC_SUBST(addobjs) | |
30c3de1f JS |
441 | AC_SUBST(addincludes) |
442 | AC_SUBST(addlibs) | |
443 | AC_SUBST(addtests) | |
444 | ||
30c3de1f JS |
445 | # |
446 | # Check for AViiON Machines running DGUX | |
447 | # | |
448 | AC_MSG_CHECKING(if host is AViiON running DGUX) | |
449 | ac_is_dgux=no | |
450 | AC_CHECK_HEADER(sys/dg_sys_info.h, | |
451 | [ac_is_dgux=yes;]) | |
452 | ||
8c048b48 | 453 | AC_MSG_RESULT($ac_is_dgux) |
30c3de1f JS |
454 | ## :GOTCHA: we do not check anything but sys/dg_sys_info.h |
455 | if test $ac_is_dgux = yes; then | |
456 | if test "$enable_full_debug" = "yes"; then | |
457 | CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2" | |
458 | CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2" | |
459 | else | |
460 | CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2" | |
461 | CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2" | |
462 | fi | |
463 | AC_SUBST(CFLAGS) | |
464 | AC_SUBST(CXXFLAGS) | |
465 | fi | |
466 | ||
1530be84 TT |
467 | dnl As of 4.13a2, the collector will not properly work on Solaris when |
468 | dnl built with gcc and -O. So we remove -O in the appropriate case. | |
ab52d207 | 469 | dnl Not needed anymore on Solaris. |
30c3de1f | 470 | AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary) |
1530be84 | 471 | case "$host" in |
ab52d207 | 472 | *aix*) |
1530be84 | 473 | if test "$GCC" = yes; then |
30c3de1f | 474 | AC_MSG_RESULT(yes) |
1530be84 TT |
475 | new_CFLAGS= |
476 | for i in $CFLAGS; do | |
477 | case "$i" in | |
478 | -O*) | |
479 | ;; | |
480 | *) | |
481 | new_CFLAGS="$new_CFLAGS $i" | |
482 | ;; | |
483 | esac | |
484 | done | |
485 | CFLAGS="$new_CFLAGS" | |
30c3de1f JS |
486 | else |
487 | AC_MSG_RESULT(no) | |
1530be84 TT |
488 | fi |
489 | ;; | |
30c3de1f | 490 | *) AC_MSG_RESULT(no) ;; |
1530be84 TT |
491 | esac |
492 | ||
493 | dnl We need to override the top-level CFLAGS. This is how we do it. | |
494 | MY_CFLAGS="$CFLAGS" | |
495 | AC_SUBST(MY_CFLAGS) | |
496 | ||
5a2586cf TT |
497 | dnl Include defines that have become de facto standard. |
498 | dnl ALL_INTERIOR_POINTERS can be overridden in startup code. | |
5572488d KC |
499 | AC_DEFINE(SILENT,1,[disables statistics printing]) |
500 | AC_DEFINE(NO_SIGNALS,1,[does not disable signals]) | |
501 | AC_DEFINE(ALL_INTERIOR_POINTERS,1,[allows all pointers to the interior of objects to be recognized]) | |
5a2586cf TT |
502 | |
503 | dnl By default, make the library as general as possible. | |
5572488d KC |
504 | AC_DEFINE(JAVA_FINALIZATION,1,[make it somewhat safer to finalize objects out of order]) |
505 | AC_DEFINE(GC_GCJ_SUPPORT,1,[include support for gcj]) | |
506 | AC_DEFINE(ATOMIC_UNCOLLECTABLE,1,[include code for GC_malloc_atomic_uncollectable]) | |
1530be84 | 507 | |
3c1cbf58 HB |
508 | AC_ARG_ENABLE(gc-debug, |
509 | [ --enable-gc-debug include full support for pointer backtracing etc.], | |
510 | [ if test "$enable_gc_debug" = "yes"; then | |
5a2586cf | 511 | AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.") |
5572488d KC |
512 | AC_DEFINE(KEEP_BACK_PTRS,1,[Add code to save back pointers]) |
513 | AC_DEFINE(DBG_HDRS_ALL,1,[Make sure that all objects have debug headers]) | |
5a2586cf | 514 | case $host in |
79f777fd | 515 | ia64-*-linux* ) |
5572488d | 516 | AC_DEFINE(MAKE_BACK_GRAPH,1,[Enable GC_PRINT_BACK_HEIGHT environment variable]) |
79f777fd | 517 | ;; |
48528b67 | 518 | x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) |
5572488d | 519 | AC_DEFINE(MAKE_BACK_GRAPH,1) |
5a2586cf | 520 | AC_MSG_WARN("Client must not use -fomit-frame-pointer.") |
5572488d | 521 | AC_DEFINE(SAVE_CALL_COUNT, 8, [number of call frames saved with objects allocated through the debugging interface]) |
5a2586cf | 522 | ;; |
30c3de1f | 523 | i[3456]86-*-dgux*) |
5572488d | 524 | AC_DEFINE(MAKE_BACK_GRAPH,1) |
30c3de1f | 525 | ;; |
3c1cbf58 HB |
526 | esac |
527 | fi]) | |
5a2586cf | 528 | |
5909b034 BM |
529 | if test "${gc_use_mmap}" = "yes"; then |
530 | AC_DEFINE(USE_MMAP, 1, [use MMAP instead of sbrk to get new memory]) | |
531 | fi | |
532 | ||
13b6e5b4 AO |
533 | if test -n "$with_cross_host" && |
534 | test x"$with_cross_host" != x"no"; then | |
d38d6003 | 535 | toolexecdir='$(exec_prefix)/$(target_noncanonical)' |
13b6e5b4 AO |
536 | toolexeclibdir='$(toolexecdir)/lib' |
537 | else | |
d38d6003 | 538 | toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)' |
13b6e5b4 AO |
539 | toolexeclibdir='$(libdir)' |
540 | fi | |
ff8b9ca8 AS |
541 | multi_os_directory=`$CC -print-multi-os-directory` |
542 | case $multi_os_directory in | |
543 | .) ;; # Avoid trailing /. | |
544 | *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; | |
545 | esac | |
13b6e5b4 AO |
546 | AC_SUBST(toolexecdir) |
547 | AC_SUBST(toolexeclibdir) | |
b48ed568 | 548 | |
1530be84 TT |
549 | if test "${multilib}" = "yes"; then |
550 | multilib_arg="--enable-multilib" | |
551 | else | |
552 | multilib_arg= | |
553 | fi | |
554 | ||
9a060b37 | 555 | AC_CONFIG_HEADERS([include/gc_config.h include/gc_ext_config.h]) |
4109fe85 | 556 | |
785fad0a | 557 | AC_CONFIG_FILES(Makefile include/Makefile threads.mk) |
bf9a420e | 558 | AC_OUTPUT |