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.
18 AC_INIT(libgc-mono, 6.3alpha6, Hans_Boehm@hp.com)
20 AM_INIT_AUTOMAKE(libgc-mono, 6.2, no-define)
22 AC_CONFIG_SRCDIR(gcj_mlc.c)
31 dnl automake 1.6 and later need the AM_PROG_AS macro.
32 ifdef([AM_PROG_AS],[AM_PROG_AS],[])
34 AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
40 . [$]{srcdir}/configure.host
42 GC_CFLAGS=${gc_cflags}
45 case $enable_embed_check in
47 *) AC_MSG_ERROR([This module is now part of `mono' and can't be built as a stand-alone module any longer.]) ;;
50 THREADS=$with_libgc_threads
52 AC_ARG_ENABLE(parallel-mark,
53 [ --enable-parallel-mark parallelize marking and free list construction],
56 AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
61 AC_ARG_ENABLE(cplusplus,
62 [ --enable-cplusplus install C++ support],
65 INCLUDES=-I${srcdir}/include
75 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | s390*-*-linux* | powerpc-*-linux*)
76 AC_DEFINE(GC_LINUX_THREADS)
78 if test "${enable_parallel_mark}" = yes; then
79 AC_DEFINE(PARALLEL_MARK)
81 AC_DEFINE(THREAD_LOCAL_ALLOC)
84 AC_DEFINE(GC_LINUX_THREADS)
88 AC_DEFINE(GC_AIX_THREADS)
92 AC_MSG_WARN("Only HP/UX 11 threads are supported.")
93 AC_DEFINE(GC_HPUX_THREADS)
94 AC_DEFINE(_POSIX_C_SOURCE,199506L)
95 if test "${enable_parallel_mark}" = yes; then
96 AC_DEFINE(PARALLEL_MARK)
98 AC_DEFINE(THREAD_LOCAL_ALLOC)
99 THREADLIBS="-lpthread -lrt"
102 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
103 AC_DEFINE(GC_FREEBSD_THREADS)
104 if test "x$PTHREAD_CFLAGS" = "x"; then
105 INCLUDES="$INCLUDES -pthread"
107 INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
109 if test "x$PTHREAD_LIBS" = "x"; then
112 THREADLIBS=$PTHREAD_LIBS
116 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
117 AC_DEFINE(GC_FREEBSD_THREADS)
118 if test "x$PTHREAD_CFLAGS" != "x"; then
119 INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
121 if test "x$PTHREAD_LIBS" = "x"; then
124 THREADLIBS="$PTHREAD_LIBS"
128 AC_DEFINE(GC_FREEBSD_THREADS)
129 if test "x$PTHREAD_CFLAGS" != "x"; then
130 INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
132 if test "x$PTHREAD_LIBS" = "x"; then
135 THREADLIBS="$PTHREAD_LIBS"
139 AC_DEFINE(GC_SOLARIS_THREADS)
140 AC_DEFINE(GC_SOLARIS_PTHREADS)
143 AC_DEFINE(GC_IRIX_THREADS)
146 AC_DEFINE(GC_WIN32_THREADS)
149 AC_DEFINE(GC_DARWIN_THREADS)
150 AC_DEFINE(THREAD_LOCAL_ALLOC)
151 if test "${enable_parallel_mark}" = yes; then
152 AC_DEFINE(PARALLEL_MARK)
156 AC_DEFINE(GC_OSF1_THREADS)
157 if test "${enable_parallel_mark}" = yes; then
158 AC_DEFINE(PARALLEL_MARK)
159 AC_DEFINE(THREAD_LOCAL_ALLOC)
160 # May want to enable it in other cases, too.
161 # Measurements havent yet been done.
163 INCLUDES="$INCLUDES -pthread"
164 THREADLIBS="-lpthread -lrt"
169 AC_DEFINE(GC_WIN32_THREADS)
170 dnl Wine getenv may not return NULL for missing entry
175 AC_MSG_RESULT($THREADLIBS)
176 # Use pthread GCC switch
178 if test "${enable_parallel_mark}" = yes; then
179 AC_DEFINE(PARALLEL_MARK)
181 AC_DEFINE(THREAD_LOCAL_ALLOC)
182 AC_DEFINE(GC_DGUX386_THREADS)
183 AC_DEFINE(DGUX_THREADS)
184 # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
185 INCLUDES="-pthread $INCLUDES"
190 AC_DEFINE(GC_AIX_THREADS)
191 AC_DEFINE(_REENTRANT)
193 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
194 AC_MSG_ERROR(thread package $THREADS not yet supported)
197 AC_MSG_ERROR($THREADS is an unknown thread package)
207 AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
209 # We never want libdl on darwin. It is a fake libdl that just ends up making
214 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
218 AC_SUBST(EXTRA_TEST_LIBS)
223 dnl If the target is an eCos system, use the appropriate eCos
225 dnl FIXME: this should not be a local option but a global target
226 dnl system; at present there is no eCos target.
229 [ --with-ecos enable runtime eCos target support],
230 TARGET_ECOS="$with_ecos"
238 case "$TARGET_ECOS" in
243 CXXINCLUDES="-I${TARGET_ECOS}/include"
244 addobjs="$addobjs ecos.lo"
248 if test "${enable_cplusplus}" = yes; then
249 addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
250 addtests="$addtests test_cpp"
253 AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
258 AC_SUBST(CXXINCLUDES)
260 # Configuration of shared libraries
262 AC_MSG_CHECKING(whether to build shared libraries)
275 # Configuration of machine-dependent code
277 AC_MSG_CHECKING(which machine-dependent code should be used)
281 machdep="alpha_mach_dep.lo"
282 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
283 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
287 machdep="alpha_mach_dep.lo"
289 i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
290 AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
293 machdep="mips_ultrix_mach_dep.lo"
294 AC_DEFINE(STACKBASE, __stackbase)
295 AC_DEFINE(DATASTART_IS_ETEXT)
298 machdep="mips_ultrix_mach-dep.lo"
300 mips-nec-sysv*|mips-unknown-sysv*)
305 machdep="mips_sgi_mach_dep.lo"
306 AC_DEFINE(NO_EXECUTE_PERMISSION)
309 machdep="sparc_netbsd_mach_dep.lo"
311 sparc-sun-solaris2.3)
312 machdep="sparc_mach_dep.lo"
313 AC_DEFINE(SUNOS53_SHARED_LIB)
315 sparc-sun-solaris2.*)
316 machdep="sparc_mach_dep.lo"
319 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
322 if test x"$machdep" = x; then
323 AC_MSG_RESULT($machdep)
324 machdep="mach_dep.lo"
326 addobjs="$addobjs $machdep"
328 AC_SUBST(addincludes)
335 # Check for AViiON Machines running DGUX
338 AC_CHECK_HEADER(sys/dg_sys_info.h,
341 ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
342 if test $ac_is_dgux = yes; then
343 if test "$enable_full_debug" = "yes"; then
344 CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
345 CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
347 CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
348 CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
354 dnl We use these options to decide which functions to include.
355 AC_ARG_WITH(target-subdir,
356 [ --with-target-subdir=SUBDIR
357 configuring with a cross compiler])
358 AC_ARG_WITH(cross-host,
359 [ --with-cross-host=HOST configuring with a cross compiler])
361 # automake wants to see AC_EXEEXT. But we don't need it. And having
362 # it is actually a problem, because the compiler we're passed can't
363 # necessarily do a full link. So we fool automake here.
365 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
366 # to nothing, so nothing would remain between `then' and `fi' if it
367 # were not for the `:' below.
372 AC_MSG_CHECKING([for threads package to use])
373 AC_MSG_RESULT($THREADS)
375 dnl As of 4.13a2, the collector will not properly work on Solaris when
376 dnl built with gcc and -O. So we remove -O in the appropriate case.
378 AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
380 sparc-sun-solaris2*|*aix*)
381 if test "$GCC" = yes; then
389 new_CFLAGS="$new_CFLAGS $i"
398 *) AC_MSG_RESULT(no) ;;
401 dnl We need to override the top-level CFLAGS. This is how we do it.
405 dnl Include defines that have become de facto standard.
406 dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
408 AC_DEFINE(NO_SIGNALS)
409 AC_DEFINE(NO_EXECUTE_PERMISSION)
410 dnl AC_DEFINE(ALL_INTERIOR_POINTERS)
412 dnl By default, make the library as general as possible.
413 AC_DEFINE(JAVA_FINALIZATION)
414 AC_DEFINE(GC_GCJ_SUPPORT)
415 AC_DEFINE(ATOMIC_UNCOLLECTABLE)
417 dnl This is something of a hack. When cross-compiling we turn off
418 dnl some functionality. We also enable the "small" configuration.
419 dnl These is only correct when targetting an embedded system. FIXME.
420 if test -n "${with_cross_host}"; then
423 AC_DEFINE(SMALL_CONFIG)
424 AC_DEFINE(NO_DEBUGGING)
428 AC_ARG_ENABLE(full-debug,
429 [ --enable-full-debug include full support for pointer backtracing etc.],
430 [ if test "$enable_full_debug" = "yes"; then
431 AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
432 AC_DEFINE(KEEP_BACK_PTRS)
433 AC_DEFINE(DBG_HDRS_ALL)
436 AC_DEFINE(MAKE_BACK_GRAPH)
437 AC_DEFINE(SAVE_CALL_COUNT, 8)
438 AC_CHECK_LIB(unwind, backtrace, [
439 AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
441 AC_MSG_WARN("Client code may need to link against libunwind.")
444 x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
445 AC_DEFINE(MAKE_BACK_GRAPH)
446 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
447 AC_DEFINE(SAVE_CALL_COUNT, 8)
450 AC_DEFINE(MAKE_BACK_GRAPH)
457 AC_ARG_ENABLE(redirect-malloc,
458 [ --enable-redirect-malloc redirect malloc and friends to GC routines])
460 if test "${enable_redirect_malloc}" = yes; then
461 if test "${enable_full_debug}" = yes; then
462 AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
463 AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
464 AC_DEFINE(REDIRECT_FREE, GC_debug_free)
466 AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
472 AC_ARG_ENABLE(gc-assertions,
473 [ --enable-gc-assertions collector-internal assertion checking])
474 if test "${enable_gc_assertions}" = yes; then
475 AC_DEFINE(GC_ASSERTIONS)
478 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
480 if test "${multilib}" = "yes"; then
481 multilib_arg="--enable-multilib"
488 include/private/Makefile
492 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}