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,7.2alpha4,Hans.Boehm@hp.com)
21 ## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
22 AC_CONFIG_SRCDIR(gcj_mlc.c)
23 AC_CONFIG_MACRO_DIR([m4])
26 AC_REVISION($Revision: 1.58 $)
28 AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc])
29 AM_CONFIG_HEADER([include/private/config.h])
39 ## FIXME: really needed? (AC_LIBTOOL already provides this)
41 AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
45 . ${srcdir}/configure.host
47 GC_CFLAGS=${gc_cflags}
50 AC_ARG_ENABLE(boehm-threads,
51 [AC_HELP_STRING([--enable-boehm-threads=TYPE], [choose threading package])],
53 [ AC_MSG_CHECKING([for thread model used by GCC])
54 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
55 if test -z "$THREADS"; then
58 AC_MSG_RESULT([$THREADS]) ])
60 AC_ARG_ENABLE(parallel-mark,
61 [AC_HELP_STRING([--enable-parallel-mark],
62 [parallelize marking and free list construction])],
65 AC_MSG_ERROR([Parallel mark requires --enable-boehm-threads=x spec])
70 AC_ARG_ENABLE(cplusplus,
71 [AC_HELP_STRING([--enable-cplusplus], [install C++ support])])
73 dnl Features which may be selected in the following thread-detection switch.
74 AH_TEMPLATE([PARALLEL_MARK], [Define to enable parallel marking.])
75 AH_TEMPLATE([THREAD_LOCAL_ALLOC],
76 [Define to enable thread-local allocation optimisation.])
77 AH_TEMPLATE([USE_COMPILER_TLS],
78 [Define to use of compiler-support for thread-local variables.])
80 dnl Thread selection macros.
81 AH_TEMPLATE([GC_THREADS], [Define to support threads.])
82 AH_TEMPLATE([GC_AIX_THREADS], [Define to support IBM AIX threads.])
83 AH_TEMPLATE([GC_DARWIN_THREADS], [Define to support Darwin pthreads.])
84 AH_TEMPLATE([GC_FREEBSD_THREADS], [Define to support FreeBSD pthreads.])
85 AH_TEMPLATE([GC_GNU_THREADS], [Define to support GNU pthreads.])
86 AH_TEMPLATE([GC_HPUX_THREADS], [Define to support HP/UX 11 pthreads.])
87 AH_TEMPLATE([GC_IRIX_THREADS], [Define to support Irix pthreads.])
88 AH_TEMPLATE([GC_LINUX_THREADS], [Define to support pthreads on Linux.])
89 AH_TEMPLATE([GC_NETBSD_THREADS], [Define to support NetBSD pthreads.])
90 AH_TEMPLATE([GC_OPENBSD_THREADS], [Define to support OpenBSD pthreads.])
91 AH_TEMPLATE([GC_OSF1_THREADS], [Define to support Tru64 pthreads.])
92 AH_TEMPLATE([GC_SOLARIS_THREADS], [Define to support Solaris pthreads.])
93 AH_TEMPLATE([GC_WIN32_THREADS], [Define to support win32 threads.])
95 dnl System header feature requests.
96 AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.])
97 AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).])
100 need_atomic_ops_asm=false
101 ## Libraries needed to support dynamic loading and/or threads.
108 THREADDLLIBS=-lpthread
110 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*)
111 AC_DEFINE(GC_LINUX_THREADS)
112 AC_DEFINE(_REENTRANT)
113 if test "${enable_parallel_mark}" = yes; then
114 AC_DEFINE(PARALLEL_MARK)
116 AC_DEFINE(THREAD_LOCAL_ALLOC)
117 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
120 AC_DEFINE(GC_LINUX_THREADS)
121 AC_DEFINE(_REENTRANT)
124 AC_DEFINE(GC_AIX_THREADS)
125 AC_DEFINE(_REENTRANT)
128 AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")
129 AC_DEFINE(GC_HPUX_THREADS)
130 AC_DEFINE(_POSIX_C_SOURCE,199506L)
131 if test "${enable_parallel_mark}" = yes; then
132 AC_DEFINE(PARALLEL_MARK)
134 AC_DEFINE(THREAD_LOCAL_ALLOC)
135 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
136 THREADDLLIBS="-lpthread -lrt"
137 # HPUX needs REENTRANT for the _r calls.
138 AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.])
141 AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
144 AC_DEFINE(GC_OPENBSD_THREADS)
145 THREADDLLIBS=-pthread
146 INCLUDES="$INCLUDES -pthread"
150 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
151 AC_DEFINE(GC_FREEBSD_THREADS)
152 INCLUDES="$INCLUDES -pthread"
155 AC_DEFINE(GC_FREEBSD_THREADS)
156 INCLUDES="$INCLUDES -pthread"
157 THREADDLLIBS=-pthread
158 AC_DEFINE(_REENTRANT)
159 if test "${enable_parallel_mark}" = yes; then
160 AC_DEFINE(PARALLEL_MARK)
162 AC_DEFINE(THREAD_LOCAL_ALLOC)
163 AC_DEFINE(USE_COMPILER_TLS)
166 AC_DEFINE(GC_GNU_THREADS)
167 AC_DEFINE(_REENTRANT)
168 AC_DEFINE(THREAD_LOCAL_ALLOC)
171 AC_MSG_WARN("Only on NetBSD 2.0 or later.")
172 AC_DEFINE(GC_NETBSD_THREADS)
173 AC_DEFINE(_REENTRANT)
175 THREADDLLIBS="-lpthread -lrt"
178 AC_DEFINE(GC_SOLARIS_THREADS)
179 AC_DEFINE(THREAD_LOCAL_ALLOC)
180 THREADDLLIBS="-lpthread -lrt"
181 if test "$GCC" != yes; then
183 need_atomic_ops_asm=true
187 AC_DEFINE(GC_IRIX_THREADS)
190 AC_DEFINE(GC_THREADS)
191 if test "${enable_parallel_mark}" = yes; then
192 AC_DEFINE(PARALLEL_MARK)
194 AC_DEFINE(THREAD_LOCAL_ALLOC)
195 # Cygwin doesn't have a real libpthread, so Libtool can't link
201 AC_DEFINE(GC_DARWIN_THREADS)
202 AC_DEFINE(THREAD_LOCAL_ALLOC)
203 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
204 # Parallel-mark is currently unreliable on Darwin; ignore request
205 # if test "${enable_parallel_mark}" = yes; then
206 # AC_DEFINE(PARALLEL_MARK)
211 AC_DEFINE(GC_OSF1_THREADS)
212 if test "${enable_parallel_mark}" = yes; then
213 AC_DEFINE(PARALLEL_MARK)
214 AC_DEFINE(THREAD_LOCAL_ALLOC)
215 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
216 # May want to enable it in other cases, too.
217 # Measurements havent yet been done.
219 INCLUDES="$INCLUDES -pthread"
220 THREADDLLIBS="-lpthread -lrt"
223 AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
228 AC_DEFINE(GC_THREADS)
229 if test "${enable_parallel_mark}" = yes; then
230 AC_DEFINE(PARALLEL_MARK)
231 AC_DEFINE(THREAD_LOCAL_ALLOC)
234 AC_DEFINE([EMPTY_GETENV_RESULTS], [1],
235 [Wine getenv may not return NULL for missing entry.])
239 AC_MSG_RESULT($THREADDLLIBS)
240 # Use pthread GCC switch
241 THREADDLLIBS=-pthread
242 if test "${enable_parallel_mark}" = yes; then
243 AC_DEFINE(PARALLEL_MARK)
245 AC_DEFINE(THREAD_LOCAL_ALLOC)
246 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
247 AC_DEFINE([GC_DGUX386_THREADS], 1,
248 [Define to enable support for DB/UX threads on i386.])
249 AC_DEFINE([DGUX_THREADS], 1,
250 [Define to enable support for DB/UX threads.])
251 # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
252 INCLUDES="-pthread $INCLUDES"
256 THREADDLLIBS=-lpthread
257 AC_DEFINE(GC_AIX_THREADS)
258 AC_DEFINE(_REENTRANT)
260 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
261 AC_MSG_ERROR(thread package $THREADS not yet supported)
264 AC_MSG_ERROR($THREADS is an unknown thread package)
267 AC_SUBST(THREADDLLIBS)
268 AM_CONDITIONAL(THREADS, test x$THREADS != xnone)
269 AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
270 AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
271 AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
272 AM_CONDITIONAL(OPENBSD_THREADS, test x$openbsd_threads = xtrue)
280 # Darwin needs a few extra special tests to deal with variation in the
284 AC_CHECK_MEMBER(ppc_thread_state_t.r0,
285 AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
286 [ppc_thread_state_t has field r0]),,
287 [#include <mach/thread_status.h>])
288 AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
289 AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
290 [ppc_thread_state_t has field __r0]),,
291 [#include <mach/thread_status.h>])
292 AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
293 AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
294 [ppc_thread_state64_t has field r0]),,
295 [#include <mach/thread_status.h>])
296 AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
297 AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
298 [ppc_thread_state64_t has field __r0]),,
299 [#include <mach/thread_status.h>])
302 AC_CHECK_MEMBER(x86_thread_state32_t.eax,
303 AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
304 [x86_thread_state32_t has field eax]),,
305 [#include <sys/cdefs.h>
306 #include <mach/thread_status.h>])
307 AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
308 AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
309 [x86_thread_state32_t has field __eax]),,
310 [#include <sys/cdefs.h>
311 #include <mach/thread_status.h>])
314 AC_CHECK_MEMBER(x86_thread_state64_t.rax,
315 AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
316 [x86_thread_state64_t has field rax]),,
317 [#include <sys/cdefs.h>
318 #include <mach/thread_status.h>])
319 AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
320 AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
321 [x86_thread_state64_t has field __rax]),,
322 [#include <sys/cdefs.h>
323 #include <mach/thread_status.h>])
328 AC_MSG_CHECKING(for xlc)
333 ], [compiler_xlc=yes], [compiler_xlc=no])
334 AC_MSG_RESULT($compiler_xlc)
335 AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
336 if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
337 # the darwin stack-frame-walking code is completely broken on xlc
338 AC_DEFINE([DARWIN_DONT_PARSE_STACK], 1, [See doc/README.macros.])
341 # We never want libdl on darwin. It is a fake libdl that just ends up making
342 # dyld calls anyway. The same applies to Cygwin.
347 AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
358 AM_CONDITIONAL(AVOID_CPP_LIB,test $avoid_cpp_lib = yes)
360 # extra LD Flags which are required for targets
363 extra_ldflags_libgc=-Wl,-single_module
366 AC_SUBST(extra_ldflags_libgc)
368 AC_SUBST(EXTRA_TEST_LIBS)
373 dnl If the target is an eCos system, use the appropriate eCos
375 dnl FIXME: this should not be a local option but a global target
376 dnl system; at present there is no eCos target.
379 [ --with-ecos enable runtime eCos target support],
380 TARGET_ECOS="$with_ecos"
386 case "$TARGET_ECOS" in
390 AC_DEFINE([ECOS], 1, [Define to enable eCos target support.])
391 CXXINCLUDES="-I${TARGET_ECOS}/include"
392 addobjs="$addobjs ecos.lo"
396 AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
401 AC_SUBST(CXXINCLUDES)
403 # Configuration of shared libraries
405 AC_MSG_CHECKING(whether to build shared libraries)
416 AC_MSG_RESULT($enable_shared)
418 # Configuration of machine-dependent code
420 AC_MSG_CHECKING(which machine-dependent code should be used)
424 machdep="mach_dep.lo"
425 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
426 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
430 machdep="mach_dep.lo"
432 i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
433 AC_DEFINE([SOLARIS25_PROC_VDB_BUG_FIXED], 1,
434 [See the comment in gcconfig.h.])
437 machdep="mach_dep.lo"
440 machdep="mach-dep.lo"
442 mips-nec-sysv*|mips-unknown-sysv*)
447 machdep="mach_dep.lo"
448 dnl AC_DEFINE(NO_EXECUTE_PERMISSION)
449 dnl This is now redundant, but it is also important for incremental GC
450 dnl performance under Irix.
453 machdep="mach_dep.lo sparc_mach_dep.lo"
456 machdep="mach_dep.lo sparc_netbsd_mach_dep.lo"
459 machdep="mach_dep.lo sparc_mach_dep.lo"
462 machdep="mach_dep.lo sparc_mach_dep.lo"
464 sparc-sun-solaris2.3)
465 machdep="mach_dep.lo sparc_mach_dep.lo"
466 AC_DEFINE(SUNOS53_SHARED_LIB, 1,
467 [Define to work around a Solaris 5.3 bug (see dyn_load.c).])
469 sparc*-sun-solaris2*)
470 machdep="mach_dep.lo sparc_mach_dep.lo"
473 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
476 if test x"$machdep" = x; then
477 AC_MSG_RESULT($machdep)
478 machdep="mach_dep.lo"
480 addobjs="$addobjs $machdep"
487 # Check for AViiON Machines running DGUX
488 # FIXME: Should this be moved down to below the gc-debug processing?
491 AC_CHECK_HEADER(sys/dg_sys_info.h,
494 ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
495 if test $ac_is_dgux = yes; then
496 if test "$enable_gc_debug" = "yes"; then
497 CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
498 CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
500 CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
501 CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
507 dnl We use these options to decide which functions to include.
508 AC_ARG_WITH(target-subdir,
509 [ --with-target-subdir=SUBDIR
510 configuring with a cross compiler])
511 AC_ARG_WITH(cross-host,
512 [ --with-cross-host=HOST configuring with a cross compiler])
514 # automake wants to see AC_EXEEXT. But we don't need it. And having
515 # it is actually a problem, because the compiler we're passed can't
516 # necessarily do a full link. So we fool automake here.
518 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
519 # to nothing, so nothing would remain between `then' and `fi' if it
520 # were not for the `:' below.
525 dnl As of 4.13a2, the collector will not properly work on Solaris when
526 dnl built with gcc and -O. So we remove -O in the appropriate case.
527 dnl Not needed anymore on Solaris.
528 AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
531 if test "$GCC" = yes; then
539 new_CFLAGS="$new_CFLAGS $i"
548 *) AC_MSG_RESULT(no) ;;
551 dnl Include defines that have become de facto standard.
552 dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
553 AC_DEFINE([NO_EXECUTE_PERMISSION], [1],
554 [Define to allow the collector to disable execute permission of heap objects.])
555 AC_DEFINE([ALL_INTERIOR_POINTERS], [1],
556 [Define to recognise all pointers to the interior of objects.])
559 dnl Interface Selection
560 dnl -------------------
562 dnl By default, make the library as general as possible.
563 dnl enable_gcj_support=no
564 AC_ARG_ENABLE(gcj-support,
565 [AC_HELP_STRING([--disable-gcj-support],
566 [Disable support for gcj.])])
567 AM_CONDITIONAL(ENABLE_GCJ_SUPPORT,
568 [test x"$enable_gcj_support" != xno])
569 if test x"$enable_gcj_support" != xno; then
570 AC_DEFINE(GC_GCJ_SUPPORT, 1, [Define to include support for gcj.])
576 AH_TEMPLATE([GC_HAVE_BUILTIN_BACKTRACE],
577 [Define if backtrace information is supported.])
578 AH_TEMPLATE([MAKE_BACK_GRAPH], [See doc/README.macros.])
579 AH_TEMPLATE([SAVE_CALL_COUNT],
580 [The number of caller frames saved when allocating with the
583 AC_ARG_ENABLE(gc-debug,
584 [AC_HELP_STRING([--enable-gc-debug],
585 [include full support for pointer backtracing etc.])],
586 [ if test "$enable_gc_debug" = "yes"; then
587 AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
588 AC_DEFINE([KEEP_BACK_PTRS], 1,
589 [Define to save back-pointers in debugging headers.])
591 AC_DEFINE([DBG_HDRS_ALL], 1,
592 [Define to force debug headers on all objects.])
595 AC_DEFINE(MAKE_BACK_GRAPH)
596 AC_DEFINE(SAVE_CALL_COUNT, 8)
597 AC_CHECK_LIB(unwind, backtrace, [
598 AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
600 AC_MSG_WARN("Client code may need to link against libunwind.")
603 x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
604 AC_DEFINE(MAKE_BACK_GRAPH)
605 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
606 AC_DEFINE(SAVE_CALL_COUNT, 8)
609 AC_DEFINE(MAKE_BACK_GRAPH)
613 AM_CONDITIONAL([KEEP_BACK_PTRS], [test x"$keep_back_ptrs" = xtrue])
615 AC_ARG_ENABLE(java-finalization,
616 [AC_HELP_STRING([--disable-java-finalization],
617 [Disable support for java finalization.])])
618 if test x"$enable_java_finalization" != xno; then
619 AC_DEFINE([JAVA_FINALIZATION], 1, [See doc/README.macros.])
622 AC_ARG_ENABLE(atomic-uncollectable,
623 [AC_HELP_STRING([--disable-atomic-uncollectible],
624 [Disable support for atomic uncollectible allocation.])])
625 if test x"$enable_atomic_uncollectible" != x"no"; then
626 AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1,
627 [Define to enable atomic uncollectible allocation.])
630 AC_ARG_ENABLE(redirect-malloc,
631 [AC_HELP_STRING([--enable-redirect-malloc],
632 [Redirect malloc and friends to GC routines])])
634 if test "${enable_redirect_malloc}" = yes; then
635 if test "${enable_gc_debug}" = yes; then
636 AC_DEFINE([REDIRECT_MALLOC], GC_debug_malloc_replacement,
637 [If defined, redirect malloc to this function.])
638 AC_DEFINE([REDIRECT_REALLOC], GC_debug_realloc_replacement,
639 [If defined, redirect GC_realloc to this function.])
640 AC_DEFINE([REDIRECT_FREE], GC_debug_free,
641 [If defined, redirect free to this function.])
643 AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
645 AC_DEFINE([GC_USE_DLOPEN_WRAP], 1, [See doc/README.macros.])
648 AC_ARG_ENABLE(large-config,
649 [AC_HELP_STRING([--enable-large-config],
650 [Optimize for large (> 100 MB) heap or root set])])
652 if test "${enable_large_config}" = yes; then
653 AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets.])
656 dnl This is something of a hack. When cross-compiling we turn off
657 dnl some functionality. We also enable the "small" configuration.
658 dnl These is only correct when targetting an embedded system. FIXME.
659 if test -n "${with_cross_host}"; then
660 AC_DEFINE([NO_CLOCK], 1, [Define to not use system clock (cross compiling).])
661 AC_DEFINE([SMALL_CONFIG], 1,
662 [Define to tune the collector for small heap sizes.])
663 AC_DEFINE([NO_DEBUGGING], 1,
664 [Disable debugging, like GC_dump and its callees.])
670 AC_ARG_ENABLE(gc-assertions,
671 [AC_HELP_STRING([--enable-gc-assertions],
672 [collector-internal assertion checking])])
673 if test "${enable_gc_assertions}" = yes; then
674 AC_DEFINE([GC_ASSERTIONS], 1, [Define to enable internal debug assertions.])
677 AC_ARG_ENABLE(munmap,
678 [AC_HELP_STRING([--enable-munmap=N],
679 [return page to the os if empty for N collections])],
680 MUNMAP_THRESHOLD=$enableval;
683 AC_MSG_ERROR([--enable-munmap requires --enable-mmap])
687 if test "${enable_munmap}" != ""; then
688 AC_DEFINE([USE_MMAP], 1,
689 [Define to use mmap instead of sbrk to expand the heap.])
690 AC_DEFINE([USE_MUNMAP], 1,
691 [Define to return memory to OS with munmap calls
692 (see doc/README.macros).])
693 if test "${MUNMAP_THRESHOLD}" = "yes"; then
696 AC_DEFINE_UNQUOTED([MUNMAP_THRESHOLD], [${MUNMAP_THRESHOLD}],
697 [Number of GC cycles to wait before unmapping an unused block.])
700 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
706 # Do we want to use an external libatomic_ops? By default use it if it's
708 AC_ARG_WITH([libatomic-ops],
709 [AS_HELP_STRING([--with-libatomic-ops[=yes|no|check]],
710 [Use a pre-installed libatomic_ops? (default: check)])],
711 [], [with_libatomic_ops=check])
713 # Check for an external libatomic_ops if the answer was yes or check. If not
714 # found, fail on yes, and convert check to no.
715 AS_IF([test x"$with_libatomic_ops" != xno],
716 [ AC_CHECK_HEADER([atomic_ops.h], [],
717 [ AS_IF([test x"$with_libatomic_ops" != xcheck],
718 [AC_MSG_ERROR([A pre-installed libatomic_ops was not found.])])
719 with_libatomic_ops=no ]) ])
721 # Finally, emit the definitions for bundled or pre-installed AO.
722 AC_MSG_CHECKING([which libatomic_ops to use])
723 AS_IF([test x"$with_libatomic_ops" != xno],
724 [ AC_MSG_RESULT([pre-installed])
725 ATOMIC_OPS_LIBS="-latomic_ops"
726 AC_SUBST([ATOMIC_OPS_LIBS]) ],
727 [ AC_MSG_RESULT([bundled])
728 AC_CONFIG_SUBDIRS([libatomic_ops])
730 AM_CONDITIONAL([USE_INTERNAL_LIBATOMIC_OPS],
731 [test x$with_libatomic_ops = xno -a x"$THREADS" != xnone])
732 AM_CONDITIONAL([NEED_ATOMIC_OPS_ASM],
733 [test x$with_libatomic_ops = xno -a x$need_atomic_ops_asm = xtrue])
735 dnl Produce the Files
736 dnl -----------------
738 AC_CONFIG_FILES([Makefile bdw-gc.pc])
740 AC_CONFIG_COMMANDS([default],,
743 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}