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*)
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_SOLARIS_THREADS)
129 AC_DEFINE(GC_SOLARIS_PTHREADS)
132 AC_DEFINE(GC_IRIX_THREADS)
135 AC_DEFINE(GC_WIN32_THREADS)
138 AC_DEFINE(GC_DARWIN_THREADS)
139 AC_DEFINE(THREAD_LOCAL_ALLOC)
140 if test "${enable_parallel_mark}" = yes; then
141 AC_DEFINE(PARALLEL_MARK)
145 AC_DEFINE(GC_OSF1_THREADS)
146 if test "${enable_parallel_mark}" = yes; then
147 AC_DEFINE(PARALLEL_MARK)
148 AC_DEFINE(THREAD_LOCAL_ALLOC)
149 # May want to enable it in other cases, too.
150 # Measurements havent yet been done.
152 INCLUDES="$INCLUDES -pthread"
153 THREADLIBS="-lpthread -lrt"
158 AC_DEFINE(GC_WIN32_THREADS)
159 dnl Wine getenv may not return NULL for missing entry
164 AC_MSG_RESULT($THREADLIBS)
165 # Use pthread GCC switch
167 if test "${enable_parallel_mark}" = yes; then
168 AC_DEFINE(PARALLEL_MARK)
170 AC_DEFINE(THREAD_LOCAL_ALLOC)
171 AC_DEFINE(GC_DGUX386_THREADS)
172 AC_DEFINE(DGUX_THREADS)
173 # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
174 INCLUDES="-pthread $INCLUDES"
179 AC_DEFINE(GC_AIX_THREADS)
180 AC_DEFINE(_REENTRANT)
182 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
183 AC_MSG_ERROR(thread package $THREADS not yet supported)
186 AC_MSG_ERROR($THREADS is an unknown thread package)
196 AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
198 # We never want libdl on darwin. It is a fake libdl that just ends up making
203 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
207 AC_SUBST(EXTRA_TEST_LIBS)
212 dnl If the target is an eCos system, use the appropriate eCos
214 dnl FIXME: this should not be a local option but a global target
215 dnl system; at present there is no eCos target.
218 [ --with-ecos enable runtime eCos target support],
219 TARGET_ECOS="$with_ecos"
227 case "$TARGET_ECOS" in
232 CXXINCLUDES="-I${TARGET_ECOS}/include"
233 addobjs="$addobjs ecos.lo"
237 if test "${enable_cplusplus}" = yes; then
238 addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
239 addtests="$addtests test_cpp"
242 AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
247 AC_SUBST(CXXINCLUDES)
249 # Configuration of shared libraries
251 AC_MSG_CHECKING(whether to build shared libraries)
264 # Configuration of machine-dependent code
266 AC_MSG_CHECKING(which machine-dependent code should be used)
270 machdep="alpha_mach_dep.lo"
271 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
272 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
276 machdep="alpha_mach_dep.lo"
278 i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
279 AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
282 machdep="mips_ultrix_mach_dep.lo"
283 AC_DEFINE(STACKBASE, __stackbase)
284 AC_DEFINE(DATASTART_IS_ETEXT)
287 machdep="mips_ultrix_mach-dep.lo"
289 mips-nec-sysv*|mips-unknown-sysv*)
294 machdep="mips_sgi_mach_dep.lo"
295 AC_DEFINE(NO_EXECUTE_PERMISSION)
298 machdep="sparc_netbsd_mach_dep.lo"
300 sparc-sun-solaris2.3)
301 machdep="sparc_mach_dep.lo"
302 AC_DEFINE(SUNOS53_SHARED_LIB)
304 sparc-sun-solaris2.*)
305 machdep="sparc_mach_dep.lo"
308 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
311 if test x"$machdep" = x; then
312 AC_MSG_RESULT($machdep)
313 machdep="mach_dep.lo"
315 addobjs="$addobjs $machdep"
317 AC_SUBST(addincludes)
324 # Check for AViiON Machines running DGUX
327 AC_CHECK_HEADER(sys/dg_sys_info.h,
330 ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
331 if test $ac_is_dgux = yes; then
332 if test "$enable_full_debug" = "yes"; then
333 CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
334 CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
336 CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
337 CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
343 dnl We use these options to decide which functions to include.
344 AC_ARG_WITH(target-subdir,
345 [ --with-target-subdir=SUBDIR
346 configuring with a cross compiler])
347 AC_ARG_WITH(cross-host,
348 [ --with-cross-host=HOST configuring with a cross compiler])
350 # automake wants to see AC_EXEEXT. But we don't need it. And having
351 # it is actually a problem, because the compiler we're passed can't
352 # necessarily do a full link. So we fool automake here.
354 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
355 # to nothing, so nothing would remain between `then' and `fi' if it
356 # were not for the `:' below.
361 AC_MSG_CHECKING([for threads package to use])
362 AC_MSG_RESULT($THREADS)
364 dnl As of 4.13a2, the collector will not properly work on Solaris when
365 dnl built with gcc and -O. So we remove -O in the appropriate case.
367 AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
369 sparc-sun-solaris2*|*aix*)
370 if test "$GCC" = yes; then
378 new_CFLAGS="$new_CFLAGS $i"
387 *) AC_MSG_RESULT(no) ;;
390 dnl We need to override the top-level CFLAGS. This is how we do it.
394 dnl Include defines that have become de facto standard.
395 dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
397 AC_DEFINE(NO_SIGNALS)
398 AC_DEFINE(NO_EXECUTE_PERMISSION)
399 dnl AC_DEFINE(ALL_INTERIOR_POINTERS)
401 dnl By default, make the library as general as possible.
402 AC_DEFINE(JAVA_FINALIZATION)
403 AC_DEFINE(GC_GCJ_SUPPORT)
404 AC_DEFINE(ATOMIC_UNCOLLECTABLE)
406 dnl This is something of a hack. When cross-compiling we turn off
407 dnl some functionality. We also enable the "small" configuration.
408 dnl These is only correct when targetting an embedded system. FIXME.
409 if test -n "${with_cross_host}"; then
412 AC_DEFINE(SMALL_CONFIG)
413 AC_DEFINE(NO_DEBUGGING)
417 AC_ARG_ENABLE(full-debug,
418 [ --enable-full-debug include full support for pointer backtracing etc.],
419 [ if test "$enable_full_debug" = "yes"; then
420 AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
421 AC_DEFINE(KEEP_BACK_PTRS)
422 AC_DEFINE(DBG_HDRS_ALL)
425 AC_DEFINE(MAKE_BACK_GRAPH)
426 AC_DEFINE(SAVE_CALL_COUNT, 8)
427 AC_CHECK_LIB(unwind, backtrace, [
428 AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
430 AC_MSG_WARN("Client code may need to link against libunwind.")
433 x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
434 AC_DEFINE(MAKE_BACK_GRAPH)
435 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
436 AC_DEFINE(SAVE_CALL_COUNT, 8)
439 AC_DEFINE(MAKE_BACK_GRAPH)
446 AC_ARG_ENABLE(redirect-malloc,
447 [ --enable-redirect-malloc redirect malloc and friends to GC routines])
449 if test "${enable_redirect_malloc}" = yes; then
450 if test "${enable_full_debug}" = yes; then
451 AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
452 AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
453 AC_DEFINE(REDIRECT_FREE, GC_debug_free)
455 AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
461 AC_ARG_ENABLE(gc-assertions,
462 [ --enable-gc-assertions collector-internal assertion checking])
463 if test "${enable_gc_assertions}" = yes; then
464 AC_DEFINE(GC_ASSERTIONS)
467 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
469 if test "${multilib}" = "yes"; then
470 multilib_arg="--enable-multilib"
477 include/private/Makefile
481 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}