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.2,gc@linux.hpl.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.69 $)
28 AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc])
29 AM_CONFIG_HEADER([include/private/config.h])
42 . ${srcdir}/configure.host
44 GC_CFLAGS=${gc_cflags}
47 AC_ARG_ENABLE(threads,
48 [AC_HELP_STRING([--enable-threads=TYPE], [choose threading package])],
50 [ AC_MSG_CHECKING([for thread model used by GCC])
51 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
52 if test -z "$THREADS"; then
55 if test "$THREADS" = "posix"; then
58 # Adjust thread model if cross-compiling for MinGW.
63 AC_MSG_RESULT([$THREADS]) ])
65 AC_ARG_ENABLE(parallel-mark,
66 [AC_HELP_STRING([--enable-parallel-mark],
67 [parallelize marking and free list construction])],
70 AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
75 AC_ARG_ENABLE(cplusplus,
76 [AC_HELP_STRING([--enable-cplusplus], [install C++ support])])
78 dnl Features which may be selected in the following thread-detection switch.
79 AH_TEMPLATE([PARALLEL_MARK], [Define to enable parallel marking.])
80 AH_TEMPLATE([THREAD_LOCAL_ALLOC],
81 [Define to enable thread-local allocation optimisation.])
82 AH_TEMPLATE([USE_COMPILER_TLS],
83 [Define to use of compiler-support for thread-local variables.])
85 dnl Thread selection macros.
86 AH_TEMPLATE([GC_THREADS], [Define to support platform-specific \
88 AH_TEMPLATE([GC_AIX_THREADS], [Define to support IBM AIX threads.])
89 AH_TEMPLATE([GC_DARWIN_THREADS], [Define to support Darwin pthreads.])
90 AH_TEMPLATE([GC_FREEBSD_THREADS], [Define to support FreeBSD pthreads.])
91 AH_TEMPLATE([GC_GNU_THREADS], [Define to support GNU pthreads.])
92 AH_TEMPLATE([GC_HPUX_THREADS], [Define to support HP/UX 11 pthreads.])
93 AH_TEMPLATE([GC_IRIX_THREADS], [Define to support Irix pthreads.])
94 AH_TEMPLATE([GC_LINUX_THREADS], [Define to support pthreads on Linux.])
95 AH_TEMPLATE([GC_NETBSD_THREADS], [Define to support NetBSD pthreads.])
96 AH_TEMPLATE([GC_OPENBSD_THREADS], [Define to support OpenBSD pthreads.])
97 AH_TEMPLATE([GC_OSF1_THREADS], [Define to support Tru64 pthreads.])
98 AH_TEMPLATE([GC_SOLARIS_THREADS], [Define to support Solaris pthreads.])
99 AH_TEMPLATE([GC_WIN32_THREADS], [Define to support Win32 threads.])
100 AH_TEMPLATE([GC_WIN32_PTHREADS], [Define to support win32-pthreads.])
101 AH_TEMPLATE([GC_RTEMS_PTHREADS], [Define to support rtems-pthreads.])
103 dnl System header feature requests.
104 AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.])
105 AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).])
107 dnl GC API symbols export control.
108 AH_TEMPLATE([GC_DLL],
109 [Define to build dynamic libraries with only API symbols exposed.])
111 dnl Check for a flavor of supported inline keyword.
115 need_atomic_ops_asm=false
116 ## Libraries needed to support dynamic loading and/or threads.
123 AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
125 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* \
126 | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*)
127 AC_DEFINE(GC_LINUX_THREADS)
128 AC_DEFINE(_REENTRANT)
129 if test "${enable_parallel_mark}" = yes; then
130 AC_DEFINE(PARALLEL_MARK)
132 AC_DEFINE(THREAD_LOCAL_ALLOC)
133 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
136 AC_DEFINE(GC_LINUX_THREADS)
137 AC_DEFINE(_REENTRANT)
140 AC_DEFINE(GC_AIX_THREADS)
141 AC_DEFINE(_REENTRANT)
144 AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")
145 AC_DEFINE(GC_HPUX_THREADS)
146 AC_DEFINE(_POSIX_C_SOURCE,199506L)
147 if test "${enable_parallel_mark}" = yes; then
148 AC_DEFINE(PARALLEL_MARK)
150 AC_DEFINE(THREAD_LOCAL_ALLOC)
151 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
152 THREADDLLIBS="-lpthread -lrt"
153 # HPUX needs REENTRANT for the _r calls.
154 AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.])
157 AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
160 AC_DEFINE(GC_OPENBSD_THREADS)
161 THREADDLLIBS=-pthread
162 INCLUDES="$INCLUDES -pthread"
166 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
167 AC_DEFINE(GC_FREEBSD_THREADS)
168 INCLUDES="$INCLUDES -pthread"
171 AC_DEFINE(GC_FREEBSD_THREADS)
172 INCLUDES="$INCLUDES -pthread"
173 THREADDLLIBS=-pthread
174 AC_DEFINE(_REENTRANT)
175 if test "${enable_parallel_mark}" = yes; then
176 AC_DEFINE(PARALLEL_MARK)
178 AC_DEFINE(THREAD_LOCAL_ALLOC)
179 AC_DEFINE(USE_COMPILER_TLS)
182 AC_DEFINE(GC_GNU_THREADS)
183 AC_DEFINE(_REENTRANT)
184 AC_DEFINE(THREAD_LOCAL_ALLOC)
187 AC_MSG_WARN("Only on NetBSD 2.0 or later.")
188 AC_DEFINE(GC_NETBSD_THREADS)
189 AC_DEFINE(_REENTRANT)
191 THREADDLLIBS="-lpthread -lrt"
194 AC_DEFINE(GC_SOLARIS_THREADS)
195 if test "${enable_parallel_mark}" = yes; then
196 AC_DEFINE(PARALLEL_MARK)
198 AC_DEFINE(THREAD_LOCAL_ALLOC)
199 # Need to use alternate thread library, otherwise gctest hangs
201 multi_os_directory=`$CC -print-multi-os-directory`
202 THREADDLLIBS="-L/usr/lib/lwp/$multi_os_directory \
203 -R/usr/lib/lwp/$multi_os_directory -lpthread -lrt"
206 AC_DEFINE(GC_IRIX_THREADS)
209 AC_DEFINE(GC_WIN32_THREADS)
210 if test "${enable_parallel_mark}" = yes; then
211 AC_DEFINE(PARALLEL_MARK)
213 AC_DEFINE(THREAD_LOCAL_ALLOC)
214 # Cygwin doesn't have a real libpthread, so Libtool can't link
220 AC_DEFINE(GC_WIN32_PTHREADS)
221 # Using win32-pthreads
222 if test "${enable_parallel_mark}" = yes; then
223 AC_DEFINE(PARALLEL_MARK)
225 AC_DEFINE(THREAD_LOCAL_ALLOC)
226 THREADDLLIBS="-lpthread"
230 AC_DEFINE(GC_DARWIN_THREADS)
231 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
232 # Parallel-mark is not well-tested on Darwin
233 if test "${enable_parallel_mark}" = yes; then
234 AC_DEFINE(PARALLEL_MARK)
236 AC_DEFINE(THREAD_LOCAL_ALLOC)
240 AC_DEFINE(GC_OSF1_THREADS)
241 if test "${enable_parallel_mark}" = yes; then
242 AC_DEFINE(PARALLEL_MARK)
243 AC_DEFINE(THREAD_LOCAL_ALLOC)
244 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
245 # May want to enable it in other cases, too.
246 # Measurements have not yet been done.
248 INCLUDES="$INCLUDES -pthread"
249 THREADDLLIBS="-lpthread -lrt"
252 AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
257 if test "$GCC" != yes; then
259 need_atomic_ops_asm=true
265 AC_DEFINE(GC_WIN32_THREADS)
266 if test "${enable_parallel_mark}" = yes; then
267 AC_DEFINE(PARALLEL_MARK)
268 AC_DEFINE(THREAD_LOCAL_ALLOC)
270 if test "${enable_shared}" != yes || test "${enable_static}" != no; then
271 # Imply THREAD_LOCAL_ALLOC unless GC_DLL.
272 AC_DEFINE(THREAD_LOCAL_ALLOC)
276 AC_DEFINE([EMPTY_GETENV_RESULTS], [1],
277 [Wine getenv may not return NULL for missing entry.])
281 AC_MSG_RESULT($THREADDLLIBS)
282 # Use pthread GCC switch
283 THREADDLLIBS=-pthread
284 if test "${enable_parallel_mark}" = yes; then
285 AC_DEFINE(PARALLEL_MARK)
287 AC_DEFINE(THREAD_LOCAL_ALLOC)
288 AC_MSG_WARN("Explicit GC_INIT() calls may be required.");
289 AC_DEFINE([GC_DGUX386_THREADS], 1,
290 [Define to enable support for DB/UX threads on i386.])
291 AC_DEFINE([DGUX_THREADS], 1,
292 [Define to enable support for DB/UX threads.])
293 # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
294 INCLUDES="-pthread $INCLUDES"
298 THREADDLLIBS=-lpthread
299 AC_DEFINE(GC_AIX_THREADS)
300 AC_DEFINE(_REENTRANT)
304 AC_DEFINE(GC_RTEMS_PTHREADS)
305 AC_DEFINE(THREAD_LOCAL_ALLOC)
307 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
308 AC_MSG_ERROR(thread package $THREADS not yet supported)
311 AC_MSG_ERROR($THREADS is an unknown thread package)
314 AC_SUBST(THREADDLLIBS)
315 AM_CONDITIONAL(THREADS, test x$THREADS != xnone)
316 AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
317 AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
318 AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
319 AM_CONDITIONAL(OPENBSD_THREADS, test x$openbsd_threads = xtrue)
327 AC_MSG_CHECKING(for xlc)
332 ], [compiler_xlc=yes], [compiler_xlc=no])
333 AC_MSG_RESULT($compiler_xlc)
334 AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
335 if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
336 # the darwin stack-frame-walking code is completely broken on xlc
337 AC_DEFINE([DARWIN_DONT_PARSE_STACK], 1, [See doc/README.macros.])
340 if test "$GCC" == yes; then
341 # Disable aliasing optimization unless forced to.
342 AC_MSG_CHECKING([whether gcc supports -fno-strict-aliasing])
343 ac_cv_fno_strict_aliasing=no
344 for cflag in $CFLAGS; do
347 # Opposite option already present
348 ac_cv_fno_strict_aliasing=skipped
353 if test "$ac_cv_fno_strict_aliasing" != skipped; then
355 CFLAGS="$CFLAGS -fno-strict-aliasing"
356 AC_TRY_COMPILE([],[], [ac_cv_fno_strict_aliasing=yes], [])
358 AS_IF([test "$ac_cv_fno_strict_aliasing" = yes],
359 [CFLAGS="$CFLAGS -fno-strict-aliasing"], [])
361 AC_MSG_RESULT($ac_cv_fno_strict_aliasing)
365 # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64
366 # and unnecessary everywhere.
368 # We never want libdl on darwin. It is a fake libdl that just ends up making
369 # dyld calls anyway. The same applies to Cygwin.
373 AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
384 AM_CONDITIONAL(AVOID_CPP_LIB,test $avoid_cpp_lib = yes)
386 # extra LD Flags which are required for targets
389 extra_ldflags_libgc=-Wl,-single_module
392 AC_SUBST(extra_ldflags_libgc)
394 AC_SUBST(EXTRA_TEST_LIBS)
399 dnl If the target is an eCos system, use the appropriate eCos
401 dnl FIXME: this should not be a local option but a global target
402 dnl system; at present there is no eCos target.
405 [ --with-ecos enable runtime eCos target support],
406 TARGET_ECOS="$with_ecos"
412 case "$TARGET_ECOS" in
416 AC_DEFINE([ECOS], 1, [Define to enable eCos target support.])
417 CXXINCLUDES="-I${TARGET_ECOS}/include"
418 addobjs="$addobjs ecos.lo"
422 AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
427 AC_SUBST(CXXINCLUDES)
429 # Configuration of shared libraries
431 AC_MSG_CHECKING(whether to build shared libraries)
442 AC_MSG_RESULT($enable_shared)
444 # Compile with GC_DLL defined unless building static libraries.
445 if test "${enable_shared}" == yes; then
446 if test "${enable_static}" == no; then
448 # FIXME: Also pass -fvisibility=hidden option if GCC v4+ and not Win32.
452 # Configuration of machine-dependent code
454 AC_MSG_CHECKING(which machine-dependent code should be used)
458 machdep="mach_dep.lo"
459 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
460 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
464 machdep="mach_dep.lo"
466 i?86-*-solaris2.[[89]])
467 # PROC_VDB appears to work in 2.8 and 2.9 but not in 2.10+ (for now).
468 AC_DEFINE([SOLARIS25_PROC_VDB_BUG_FIXED], 1,
469 [See the comment in gcconfig.h.])
472 machdep="mach_dep.lo"
475 machdep="mach-dep.lo"
477 mips-nec-sysv*|mips-unknown-sysv*)
482 machdep="mach_dep.lo"
483 dnl AC_DEFINE(NO_EXECUTE_PERMISSION)
484 dnl This is now redundant, but it is also important for incremental GC
485 dnl performance under Irix.
488 machdep="mach_dep.lo sparc_mach_dep.lo"
491 machdep="mach_dep.lo sparc_netbsd_mach_dep.lo"
494 machdep="mach_dep.lo sparc_mach_dep.lo"
497 machdep="mach_dep.lo sparc_mach_dep.lo"
499 sparc-sun-solaris2.3)
500 machdep="mach_dep.lo sparc_mach_dep.lo"
501 AC_DEFINE(SUNOS53_SHARED_LIB, 1,
502 [Define to work around a Solaris 5.3 bug (see dyn_load.c).])
504 sparc*-sun-solaris2*)
505 machdep="mach_dep.lo sparc_mach_dep.lo"
508 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
511 if test x"$machdep" = x; then
512 AC_MSG_RESULT($machdep)
513 machdep="mach_dep.lo"
515 addobjs="$addobjs $machdep"
521 dnl We use these options to decide which functions to include.
522 AC_ARG_WITH(target-subdir,
523 [ --with-target-subdir=SUBDIR
524 configuring with a cross compiler])
525 AC_ARG_WITH(cross-host,
526 [ --with-cross-host=HOST configuring with a cross compiler])
528 # automake wants to see AC_EXEEXT. But we don't need it. And having
529 # it is actually a problem, because the compiler we're passed can't
530 # necessarily do a full link. So we fool automake here.
532 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
533 # to nothing, so nothing would remain between `then' and `fi' if it
534 # were not for the `:' below.
539 dnl As of 4.13a2, the collector will not properly work on Solaris when
540 dnl built with gcc and -O. So we remove -O in the appropriate case.
541 dnl Not needed anymore on Solaris.
542 AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
545 if test "$GCC" = yes; then
553 new_CFLAGS="$new_CFLAGS $i"
562 *) AC_MSG_RESULT(no) ;;
565 dnl Include defines that have become de facto standard.
566 dnl ALL_INTERIOR_POINTERS and NO_EXECUTE_PERMISSION can be overridden in the startup code.
567 AC_DEFINE([NO_EXECUTE_PERMISSION], [1],
568 [Define to make the collector not allocate executable memory by default.])
569 AC_DEFINE([ALL_INTERIOR_POINTERS], [1],
570 [Define to recognise all pointers to the interior of objects.])
573 dnl Interface Selection
574 dnl -------------------
576 dnl By default, make the library as general as possible.
577 dnl enable_gcj_support=no
578 AC_ARG_ENABLE(gcj-support,
579 [AC_HELP_STRING([--disable-gcj-support],
580 [Disable support for gcj.])])
581 AM_CONDITIONAL(ENABLE_GCJ_SUPPORT,
582 [test x"$enable_gcj_support" != xno])
583 if test x"$enable_gcj_support" != xno; then
584 AC_DEFINE(GC_GCJ_SUPPORT, 1, [Define to include support for gcj.])
590 AH_TEMPLATE([GC_HAVE_BUILTIN_BACKTRACE],
591 [Define if backtrace information is supported.])
592 AH_TEMPLATE([MAKE_BACK_GRAPH], [See doc/README.macros.])
593 AH_TEMPLATE([SAVE_CALL_COUNT],
594 [The number of caller frames saved when allocating with the
597 AC_ARG_ENABLE(gc-debug,
598 [AC_HELP_STRING([--enable-gc-debug],
599 [include full support for pointer backtracing etc.])],
600 [ if test "$enable_gc_debug" = "yes"; then
601 AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
602 AC_DEFINE([KEEP_BACK_PTRS], 1,
603 [Define to save back-pointers in debugging headers.])
605 AC_DEFINE([DBG_HDRS_ALL], 1,
606 [Define to force debug headers on all objects.])
609 AC_DEFINE(MAKE_BACK_GRAPH)
610 AC_DEFINE(SAVE_CALL_COUNT, 8)
611 AC_CHECK_LIB(unwind, backtrace, [
612 AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
614 AC_MSG_WARN("Client code may need to link against libunwind.")
617 x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
618 AC_DEFINE(MAKE_BACK_GRAPH)
619 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
620 AC_DEFINE(SAVE_CALL_COUNT, 8)
623 AC_DEFINE(MAKE_BACK_GRAPH)
627 AM_CONDITIONAL([KEEP_BACK_PTRS], [test x"$keep_back_ptrs" = xtrue])
629 # Check for AViiON Machines running DGUX
631 AC_CHECK_HEADER(sys/dg_sys_info.h,
634 ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
635 if test $ac_is_dgux = yes; then
636 dgux_spec_opts="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
637 CFLAGS="$dgux_spec_opts $CFLAGS"
638 CXXFLAGS="$dgux_spec_opts $CXXFLAGS"
639 if test "$enable_gc_debug" = "yes"; then
640 CFLAGS="-g -mstandard $CFLAGS"
641 CXXFLAGS="-g -mstandard $CXXFLAGS"
647 AC_ARG_ENABLE(java-finalization,
648 [AC_HELP_STRING([--disable-java-finalization],
649 [Disable support for java finalization.])])
650 if test x"$enable_java_finalization" != xno; then
651 AC_DEFINE([JAVA_FINALIZATION], 1, [See doc/README.macros.])
654 AC_ARG_ENABLE(atomic-uncollectable,
655 [AC_HELP_STRING([--disable-atomic-uncollectible],
656 [Disable support for atomic uncollectible allocation.])])
657 if test x"$enable_atomic_uncollectible" != x"no"; then
658 AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1,
659 [Define to enable atomic uncollectible allocation.])
662 AC_ARG_ENABLE(redirect-malloc,
663 [AC_HELP_STRING([--enable-redirect-malloc],
664 [Redirect malloc and friends to GC routines])])
666 if test "${enable_redirect_malloc}" = yes; then
667 if test "${enable_gc_debug}" = yes; then
668 AC_DEFINE([REDIRECT_MALLOC], GC_debug_malloc_replacement,
669 [If defined, redirect malloc to this function.])
670 AC_DEFINE([REDIRECT_REALLOC], GC_debug_realloc_replacement,
671 [If defined, redirect GC_realloc to this function.])
672 AC_DEFINE([REDIRECT_FREE], GC_debug_free,
673 [If defined, redirect free to this function.])
675 AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
677 AC_DEFINE([GC_USE_DLOPEN_WRAP], 1, [See doc/README.macros.])
680 AC_ARG_ENABLE(large-config,
681 [AC_HELP_STRING([--enable-large-config],
682 [Optimize for large (> 100 MB) heap or root set])])
684 if test "${enable_large_config}" = yes; then
685 AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets.])
688 AC_ARG_ENABLE(handle-fork,
689 [AC_HELP_STRING([--enable-handle-fork],
690 [Attempt to ensure a usable collector after fork() in multi-threaded
693 if test "${enable_handle_fork}" = yes; then
694 AC_DEFINE(HANDLE_FORK, 1,
695 [Define to install pthread_atfork() handlers by default.])
696 elif test "${enable_handle_fork}" = no; then
697 AC_DEFINE(NO_HANDLE_FORK, 1,
698 [Prohibit installation of pthread_atfork() handlers.])
701 dnl This is something of a hack. When cross-compiling we turn off
702 dnl some functionality. We also enable the "small" configuration.
703 dnl These is only correct when targetting an embedded system. FIXME.
704 if test -n "${with_cross_host}"; then
705 AC_DEFINE([NO_CLOCK], 1, [Define to not use system clock (cross compiling).])
706 AC_DEFINE([SMALL_CONFIG], 1,
707 [Define to tune the collector for small heap sizes.])
710 if test "$enable_gc_debug" == "no"; then
711 AC_DEFINE([NO_DEBUGGING], 1,
712 [Disable debugging, like GC_dump and its callees.])
717 AC_ARG_ENABLE(gc-assertions,
718 [AC_HELP_STRING([--enable-gc-assertions],
719 [collector-internal assertion checking])])
720 if test "${enable_gc_assertions}" = yes; then
721 AC_DEFINE([GC_ASSERTIONS], 1, [Define to enable internal debug assertions.])
724 AC_ARG_ENABLE(munmap,
725 [AC_HELP_STRING([--enable-munmap=N],
726 [return page to the os if empty for N collections])],
727 MUNMAP_THRESHOLD=$enableval;
730 AC_MSG_ERROR([--enable-munmap requires --enable-mmap])
734 if test "${enable_munmap}" != ""; then
735 AC_DEFINE([USE_MMAP], 1,
736 [Define to use mmap instead of sbrk to expand the heap.])
737 AC_DEFINE([USE_MUNMAP], 1,
738 [Define to return memory to OS with munmap calls
739 (see doc/README.macros).])
740 if test "${MUNMAP_THRESHOLD}" = "yes"; then
743 AC_DEFINE_UNQUOTED([MUNMAP_THRESHOLD], [${MUNMAP_THRESHOLD}],
744 [Number of GC cycles to wait before unmapping an unused block.])
747 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
753 # Do we want to use an external libatomic_ops? By default use it if it's
755 AC_ARG_WITH([libatomic-ops],
756 [AS_HELP_STRING([--with-libatomic-ops[=yes|no|check]],
757 [Use a external libatomic_ops? (default: check)])],
758 [], [with_libatomic_ops=check])
760 # Check for an external libatomic_ops if the answer was yes or check. If not
761 # found, fail on yes, and convert check to no.
762 AS_IF([test x"$with_libatomic_ops" != xno],
763 [ PKG_CHECK_MODULES([ATOMIC_OPS], [atomic_ops], [],
764 [ AS_IF([test x"$with_libatomic_ops" != xcheck],
765 [AC_MSG_ERROR([A external libatomic_ops was not found.])])
766 with_libatomic_ops=no ]) ])
768 # If we have neither an external or an internal version, offer a useful hint
770 AS_IF([test x"$with_libatomic_ops" = xno -a ! -e "$srcdir/libatomic_ops"],
771 [ AC_MSG_ERROR([libatomic_ops is required. You can either install it on your system, or fetch and unpack a recent version into the source directory and link or rename it to libatomic_ops.]) ])
773 # Finally, emit the definitions for bundled or external AO.
774 AC_MSG_CHECKING([which libatomic_ops to use])
775 AS_IF([test x"$with_libatomic_ops" != xno],
776 [ AC_MSG_RESULT([external]) ],
777 [ AC_MSG_RESULT([internal])
778 ATOMIC_OPS_CFLAGS='-I$(top_builddir)/libatomic_ops/src -I$(top_srcdir)/libatomic_ops/src'
780 AC_SUBST([ATOMIC_OPS_CFLAGS])
781 AC_CONFIG_SUBDIRS([libatomic_ops])
783 AM_CONDITIONAL([USE_INTERNAL_LIBATOMIC_OPS],
784 [test x$with_libatomic_ops = xno -a x"$THREADS" != xnone])
785 AM_CONDITIONAL([NEED_ATOMIC_OPS_ASM],
786 [test x$with_libatomic_ops = xno -a x$need_atomic_ops_asm = xtrue])
788 dnl Produce the Files
789 dnl -----------------
791 AC_CONFIG_FILES([Makefile bdw-gc.pc])
793 AC_CONFIG_COMMANDS([default],,
796 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}