| 1 | # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
|
|---|
| 2 | #
|
|---|
| 3 | # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
|
|---|
| 4 | # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
|
|---|
| 5 | #
|
|---|
| 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.
|
|---|
| 11 | #
|
|---|
| 12 | # Original author: Tom Tromey
|
|---|
| 13 | # Modified by: Grzegorz Jakacki <jakacki at acm dot org>
|
|---|
| 14 |
|
|---|
| 15 | dnl Process this file with autoconf to produce configure.
|
|---|
| 16 |
|
|---|
| 17 | # Initialization
|
|---|
| 18 | # ==============
|
|---|
| 19 |
|
|---|
| 20 | AC_INIT(gc,6.8,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_CANONICAL_TARGET
|
|---|
| 24 | AC_PREREQ(2.53)
|
|---|
| 25 | AC_REVISION($Revision: 1.2 $)
|
|---|
| 26 | GC_SET_VERSION
|
|---|
| 27 | AM_INIT_AUTOMAKE
|
|---|
| 28 |
|
|---|
| 29 | AC_SUBST(PACKAGE)
|
|---|
| 30 | AC_SUBST(GC_VERSION)
|
|---|
| 31 |
|
|---|
| 32 | AC_PROG_CC
|
|---|
| 33 | AC_PROG_CXX
|
|---|
| 34 |
|
|---|
| 35 | AM_PROG_AS
|
|---|
| 36 | AC_CHECK_TOOL(AR, ar)
|
|---|
| 37 | AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
|
|---|
| 38 |
|
|---|
| 39 | AC_PROG_INSTALL
|
|---|
| 40 |
|
|---|
| 41 | AM_MAINTAINER_MODE
|
|---|
| 42 |
|
|---|
| 43 | . [$]{srcdir}/configure.host
|
|---|
| 44 |
|
|---|
| 45 | GC_CFLAGS=${gc_cflags}
|
|---|
| 46 | AC_SUBST(GC_CFLAGS)
|
|---|
| 47 |
|
|---|
| 48 | AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package],
|
|---|
| 49 | THREADS=$enableval,
|
|---|
| 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
|
|---|
| 53 | THREADS=no
|
|---|
| 54 | fi
|
|---|
| 55 | AC_MSG_RESULT([$THREADS])])
|
|---|
| 56 |
|
|---|
| 57 | AC_ARG_ENABLE(parallel-mark,
|
|---|
| 58 | [ --enable-parallel-mark parallelize marking and free list construction],
|
|---|
| 59 | [case "$THREADS" in
|
|---|
| 60 | no | none | single)
|
|---|
| 61 | AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
|
|---|
| 62 | ;;
|
|---|
| 63 | esac]
|
|---|
| 64 | )
|
|---|
| 65 |
|
|---|
| 66 | AC_ARG_ENABLE(cplusplus,
|
|---|
| 67 | [ --enable-cplusplus install C++ support],
|
|---|
| 68 | )
|
|---|
| 69 |
|
|---|
| 70 | INCLUDES=-I${srcdir}/include
|
|---|
| 71 | THREADDLLIBS=
|
|---|
| 72 | ## Libraries needed to support dynamic loading and/or threads.
|
|---|
| 73 | case "$THREADS" in
|
|---|
| 74 | no | none | single)
|
|---|
| 75 | THREADS=none
|
|---|
| 76 | ;;
|
|---|
| 77 | posix | pthreads)
|
|---|
| 78 | THREADS=posix
|
|---|
| 79 | THREADDLLIBS=-lpthread
|
|---|
| 80 | case "$host" in
|
|---|
| 81 | x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*)
|
|---|
| 82 | AC_DEFINE(GC_LINUX_THREADS)
|
|---|
| 83 | AC_DEFINE(_REENTRANT)
|
|---|
| 84 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 85 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 86 | fi
|
|---|
| 87 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 88 | ;;
|
|---|
| 89 | *-*-linux*)
|
|---|
| 90 | AC_DEFINE(GC_LINUX_THREADS)
|
|---|
| 91 | AC_DEFINE(_REENTRANT)
|
|---|
| 92 | ;;
|
|---|
| 93 | *-*-aix*)
|
|---|
| 94 | AC_DEFINE(GC_AIX_THREADS)
|
|---|
| 95 | AC_DEFINE(_REENTRANT)
|
|---|
| 96 | ;;
|
|---|
| 97 | *-*-hpux11*)
|
|---|
| 98 | AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
|
|---|
| 99 | AC_DEFINE(GC_HPUX_THREADS)
|
|---|
| 100 | AC_DEFINE(_POSIX_C_SOURCE,199506L)
|
|---|
| 101 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 102 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 103 | fi
|
|---|
| 104 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 105 | THREADDLLIBS="-lpthread -lrt"
|
|---|
| 106 | # HPUX needs REENTRANT for the _r calls.
|
|---|
| 107 | AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
|
|---|
| 108 | ;;
|
|---|
| 109 | *-*-hpux10*)
|
|---|
| 110 | AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
|
|---|
| 111 | ;;
|
|---|
| 112 | *-*-freebsd*)
|
|---|
| 113 | AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
|
|---|
| 114 | AC_DEFINE(GC_FREEBSD_THREADS)
|
|---|
| 115 | INCLUDES="$INCLUDES -pthread"
|
|---|
| 116 | THREADDLLIBS=-pthread
|
|---|
| 117 | ;;
|
|---|
| 118 | *-*-kfreebsd*-gnu)
|
|---|
| 119 | AC_DEFINE(GC_FREEBSD_THREADS)
|
|---|
| 120 | INCLUDES="$INCLUDES -pthread"
|
|---|
| 121 | THREADDLLIBS=-pthread
|
|---|
| 122 | AC_DEFINE(_REENTRANT)
|
|---|
| 123 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 124 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 125 | fi
|
|---|
| 126 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 127 | AC_DEFINE(USE_COMPILER_TLS)
|
|---|
| 128 | ;;
|
|---|
| 129 | *-*-netbsd*)
|
|---|
| 130 | AC_MSG_WARN("Only on NetBSD 2.0 or later.")
|
|---|
| 131 | AC_DEFINE(GC_NETBSD_THREADS)
|
|---|
| 132 | AC_DEFINE(_REENTRANT)
|
|---|
| 133 | AC_DEFINE(_PTHREADS)
|
|---|
| 134 | THREADDLLIBS="-lpthread -lrt"
|
|---|
| 135 | ;;
|
|---|
| 136 | *-*-solaris*)
|
|---|
| 137 | AC_DEFINE(GC_SOLARIS_THREADS)
|
|---|
| 138 | AC_DEFINE(GC_SOLARIS_PTHREADS)
|
|---|
| 139 | ;;
|
|---|
| 140 | *-*-irix*)
|
|---|
| 141 | AC_DEFINE(GC_IRIX_THREADS)
|
|---|
| 142 | ;;
|
|---|
| 143 | *-*-cygwin*)
|
|---|
| 144 | AC_DEFINE(GC_WIN32_THREADS)
|
|---|
| 145 | ;;
|
|---|
| 146 | *-*-darwin*)
|
|---|
| 147 | AC_DEFINE(GC_DARWIN_THREADS)
|
|---|
| 148 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 149 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 150 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 151 | fi
|
|---|
| 152 | ;;
|
|---|
| 153 | *-*-osf*)
|
|---|
| 154 | AC_DEFINE(GC_OSF1_THREADS)
|
|---|
| 155 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 156 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 157 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 158 | # May want to enable it in other cases, too.
|
|---|
| 159 | # Measurements havent yet been done.
|
|---|
| 160 | fi
|
|---|
| 161 | INCLUDES="$INCLUDES -pthread"
|
|---|
| 162 | THREADDLLIBS="-lpthread -lrt"
|
|---|
| 163 | ;;
|
|---|
| 164 | *)
|
|---|
| 165 | AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
|
|---|
| 166 | ;;
|
|---|
| 167 | esac
|
|---|
| 168 | ;;
|
|---|
| 169 | win32)
|
|---|
| 170 | AC_DEFINE(GC_WIN32_THREADS)
|
|---|
| 171 | dnl Wine getenv may not return NULL for missing entry
|
|---|
| 172 | AC_DEFINE(NO_GETENV)
|
|---|
| 173 | ;;
|
|---|
| 174 | dgux386)
|
|---|
| 175 | THREADS=dgux386
|
|---|
| 176 | AC_MSG_RESULT($THREADDLLIBS)
|
|---|
| 177 | # Use pthread GCC switch
|
|---|
| 178 | THREADDLLIBS=-pthread
|
|---|
| 179 | if test "${enable_parallel_mark}" = yes; then
|
|---|
| 180 | AC_DEFINE(PARALLEL_MARK)
|
|---|
| 181 | fi
|
|---|
| 182 | AC_DEFINE(THREAD_LOCAL_ALLOC)
|
|---|
| 183 | AC_DEFINE(GC_DGUX386_THREADS)
|
|---|
| 184 | AC_DEFINE(DGUX_THREADS)
|
|---|
| 185 | # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
|
|---|
| 186 | INCLUDES="-pthread $INCLUDES"
|
|---|
| 187 | ;;
|
|---|
| 188 | aix)
|
|---|
| 189 | THREADS=posix
|
|---|
| 190 | THREADDLLIBS=-lpthread
|
|---|
| 191 | AC_DEFINE(GC_AIX_THREADS)
|
|---|
| 192 | AC_DEFINE(_REENTRANT)
|
|---|
| 193 | ;;
|
|---|
| 194 | decosf1 | irix | mach | os2 | solaris | dce | vxworks)
|
|---|
| 195 | AC_MSG_ERROR(thread package $THREADS not yet supported)
|
|---|
| 196 | ;;
|
|---|
| 197 | *)
|
|---|
| 198 | AC_MSG_ERROR($THREADS is an unknown thread package)
|
|---|
| 199 | ;;
|
|---|
| 200 | esac
|
|---|
| 201 | AC_SUBST(THREADDLLIBS)
|
|---|
| 202 |
|
|---|
| 203 | case "$host" in
|
|---|
| 204 | powerpc-*-darwin*)
|
|---|
| 205 | powerpc_darwin=true
|
|---|
| 206 | ;;
|
|---|
| 207 | esac
|
|---|
| 208 | AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
|
|---|
| 209 |
|
|---|
| 210 | AC_MSG_CHECKING(for xlc)
|
|---|
| 211 | AC_TRY_COMPILE([],[
|
|---|
| 212 | #ifndef __xlC__
|
|---|
| 213 | # error
|
|---|
| 214 | #endif
|
|---|
| 215 | ], [compiler_xlc=yes], [compiler_xlc=no])
|
|---|
| 216 | AC_MSG_RESULT($compiler_xlc)
|
|---|
| 217 | AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
|
|---|
| 218 | if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
|
|---|
| 219 | # the darwin stack-frame-walking code is completely broken on xlc
|
|---|
| 220 | AC_DEFINE(DARWIN_DONT_PARSE_STACK)
|
|---|
| 221 | fi
|
|---|
| 222 |
|
|---|
| 223 | # We never want libdl on darwin. It is a fake libdl that just ends up making
|
|---|
| 224 | # dyld calls anyway
|
|---|
| 225 | case "$host" in
|
|---|
| 226 | *-*-darwin*) ;;
|
|---|
| 227 | *)
|
|---|
| 228 | AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
|
|---|
| 229 | ;;
|
|---|
| 230 | esac
|
|---|
| 231 |
|
|---|
| 232 | AC_SUBST(EXTRA_TEST_LIBS)
|
|---|
| 233 |
|
|---|
| 234 | target_all=libgc.la
|
|---|
| 235 | AC_SUBST(target_all)
|
|---|
| 236 |
|
|---|
| 237 | dnl If the target is an eCos system, use the appropriate eCos
|
|---|
| 238 | dnl I/O routines.
|
|---|
| 239 | dnl FIXME: this should not be a local option but a global target
|
|---|
| 240 | dnl system; at present there is no eCos target.
|
|---|
| 241 | TARGET_ECOS="no"
|
|---|
| 242 | AC_ARG_WITH(ecos,
|
|---|
| 243 | [ --with-ecos enable runtime eCos target support],
|
|---|
| 244 | TARGET_ECOS="$with_ecos"
|
|---|
| 245 | )
|
|---|
| 246 |
|
|---|
| 247 | addobjs=
|
|---|
| 248 | addlibs=
|
|---|
| 249 | addincludes=
|
|---|
| 250 | addtests=
|
|---|
| 251 | CXXINCLUDES=
|
|---|
| 252 | case "$TARGET_ECOS" in
|
|---|
| 253 | no)
|
|---|
| 254 | ;;
|
|---|
| 255 | *)
|
|---|
| 256 | AC_DEFINE(ECOS)
|
|---|
| 257 | CXXINCLUDES="-I${TARGET_ECOS}/include"
|
|---|
| 258 | addobjs="$addobjs ecos.lo"
|
|---|
| 259 | ;;
|
|---|
| 260 | esac
|
|---|
| 261 |
|
|---|
| 262 | if test "${enable_cplusplus}" = yes; then
|
|---|
| 263 | addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
|
|---|
| 264 | addtests="$addtests test_cpp"
|
|---|
| 265 | fi
|
|---|
| 266 |
|
|---|
| 267 | AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
|
|---|
| 268 |
|
|---|
| 269 | AC_SUBST(CXX)
|
|---|
| 270 |
|
|---|
| 271 | AC_SUBST(INCLUDES)
|
|---|
| 272 | AC_SUBST(CXXINCLUDES)
|
|---|
| 273 |
|
|---|
| 274 | # Configuration of shared libraries
|
|---|
| 275 | #
|
|---|
| 276 | AC_MSG_CHECKING(whether to build shared libraries)
|
|---|
| 277 | AC_ENABLE_SHARED
|
|---|
| 278 |
|
|---|
| 279 | case "$host" in
|
|---|
| 280 | alpha-*-openbsd*)
|
|---|
| 281 | enable_shared=no
|
|---|
| 282 | AC_MSG_RESULT(no)
|
|---|
| 283 | ;;
|
|---|
| 284 | *)
|
|---|
| 285 | AC_MSG_RESULT(yes)
|
|---|
| 286 | ;;
|
|---|
| 287 | esac
|
|---|
| 288 |
|
|---|
| 289 | # Configuration of machine-dependent code
|
|---|
| 290 | #
|
|---|
| 291 | AC_MSG_CHECKING(which machine-dependent code should be used)
|
|---|
| 292 | machdep=
|
|---|
| 293 | case "$host" in
|
|---|
| 294 | alpha-*-openbsd*)
|
|---|
| 295 | machdep="alpha_mach_dep.lo"
|
|---|
| 296 | if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
|
|---|
| 297 | AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
|
|---|
| 298 | fi
|
|---|
| 299 | ;;
|
|---|
| 300 | alpha*-*-linux*)
|
|---|
| 301 | machdep="alpha_mach_dep.lo"
|
|---|
| 302 | ;;
|
|---|
| 303 | i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
|
|---|
| 304 | AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
|
|---|
| 305 | ;;
|
|---|
| 306 | mipstx39-*-elf*)
|
|---|
| 307 | machdep="mips_ultrix_mach_dep.lo"
|
|---|
| 308 | AC_DEFINE(STACKBASE, __stackbase)
|
|---|
| 309 | AC_DEFINE(DATASTART_IS_ETEXT)
|
|---|
| 310 | ;;
|
|---|
| 311 | mips-dec-ultrix*)
|
|---|
| 312 | machdep="mips_ultrix_mach-dep.lo"
|
|---|
| 313 | ;;
|
|---|
| 314 | mips-nec-sysv*|mips-unknown-sysv*)
|
|---|
| 315 | ;;
|
|---|
| 316 | mips*-*-linux*)
|
|---|
| 317 | ;;
|
|---|
| 318 | mips-*-*)
|
|---|
| 319 | machdep="mips_sgi_mach_dep.lo"
|
|---|
| 320 | AC_DEFINE(NO_EXECUTE_PERMISSION)
|
|---|
| 321 | ;;
|
|---|
| 322 | sparc-*-netbsd*)
|
|---|
| 323 | machdep="sparc_netbsd_mach_dep.lo"
|
|---|
| 324 | ;;
|
|---|
| 325 | sparc-sun-solaris2.3)
|
|---|
| 326 | machdep="sparc_mach_dep.lo"
|
|---|
| 327 | AC_DEFINE(SUNOS53_SHARED_LIB)
|
|---|
| 328 | ;;
|
|---|
| 329 | sparc*-sun-solaris2.*)
|
|---|
| 330 | machdep="sparc_mach_dep.lo"
|
|---|
| 331 | ;;
|
|---|
| 332 | ia64-*-*)
|
|---|
| 333 | machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
|
|---|
| 334 | ;;
|
|---|
| 335 | esac
|
|---|
| 336 | if test x"$machdep" = x; then
|
|---|
| 337 | AC_MSG_RESULT($machdep)
|
|---|
| 338 | machdep="mach_dep.lo"
|
|---|
| 339 | fi
|
|---|
| 340 | addobjs="$addobjs $machdep"
|
|---|
| 341 | AC_SUBST(addobjs)
|
|---|
| 342 | AC_SUBST(addincludes)
|
|---|
| 343 | AC_SUBST(addlibs)
|
|---|
| 344 | AC_SUBST(addtests)
|
|---|
| 345 |
|
|---|
| 346 | AC_PROG_LIBTOOL
|
|---|
| 347 |
|
|---|
| 348 | #
|
|---|
| 349 | # Check for AViiON Machines running DGUX
|
|---|
| 350 | #
|
|---|
| 351 | ac_is_dgux=no
|
|---|
| 352 | AC_CHECK_HEADER(sys/dg_sys_info.h,
|
|---|
| 353 | [ac_is_dgux=yes;])
|
|---|
| 354 |
|
|---|
| 355 | ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
|
|---|
| 356 | if test $ac_is_dgux = yes; then
|
|---|
| 357 | if test "$enable_full_debug" = "yes"; then
|
|---|
| 358 | CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
|
|---|
| 359 | CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
|
|---|
| 360 | else
|
|---|
| 361 | CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
|
|---|
| 362 | CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
|
|---|
| 363 | fi
|
|---|
| 364 | AC_SUBST(CFLAGS)
|
|---|
| 365 | AC_SUBST(CXXFLAGS)
|
|---|
| 366 | fi
|
|---|
| 367 |
|
|---|
| 368 | dnl We use these options to decide which functions to include.
|
|---|
| 369 | AC_ARG_WITH(target-subdir,
|
|---|
| 370 | [ --with-target-subdir=SUBDIR
|
|---|
| 371 | configuring with a cross compiler])
|
|---|
| 372 | AC_ARG_WITH(cross-host,
|
|---|
| 373 | [ --with-cross-host=HOST configuring with a cross compiler])
|
|---|
| 374 |
|
|---|
| 375 | # automake wants to see AC_EXEEXT. But we don't need it. And having
|
|---|
| 376 | # it is actually a problem, because the compiler we're passed can't
|
|---|
| 377 | # necessarily do a full link. So we fool automake here.
|
|---|
| 378 | if false; then
|
|---|
| 379 | # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
|
|---|
| 380 | # to nothing, so nothing would remain between `then' and `fi' if it
|
|---|
| 381 | # were not for the `:' below.
|
|---|
| 382 | :
|
|---|
| 383 | AC_EXEEXT
|
|---|
| 384 | fi
|
|---|
| 385 |
|
|---|
| 386 | dnl As of 4.13a2, the collector will not properly work on Solaris when
|
|---|
| 387 | dnl built with gcc and -O. So we remove -O in the appropriate case.
|
|---|
| 388 | dnl Not needed anymore on Solaris.
|
|---|
| 389 | AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
|
|---|
| 390 | case "$host" in
|
|---|
| 391 | *aix*)
|
|---|
| 392 | if test "$GCC" = yes; then
|
|---|
| 393 | AC_MSG_RESULT(yes)
|
|---|
| 394 | new_CFLAGS=
|
|---|
| 395 | for i in $CFLAGS; do
|
|---|
| 396 | case "$i" in
|
|---|
| 397 | -O*)
|
|---|
| 398 | ;;
|
|---|
| 399 | *)
|
|---|
| 400 | new_CFLAGS="$new_CFLAGS $i"
|
|---|
| 401 | ;;
|
|---|
| 402 | esac
|
|---|
| 403 | done
|
|---|
| 404 | CFLAGS="$new_CFLAGS"
|
|---|
| 405 | else
|
|---|
| 406 | AC_MSG_RESULT(no)
|
|---|
| 407 | fi
|
|---|
| 408 | ;;
|
|---|
| 409 | *) AC_MSG_RESULT(no) ;;
|
|---|
| 410 | esac
|
|---|
| 411 |
|
|---|
| 412 | dnl We need to override the top-level CFLAGS. This is how we do it.
|
|---|
| 413 | MY_CFLAGS="$CFLAGS"
|
|---|
| 414 | AC_SUBST(MY_CFLAGS)
|
|---|
| 415 |
|
|---|
| 416 | dnl Include defines that have become de facto standard.
|
|---|
| 417 | dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
|
|---|
| 418 | AC_DEFINE(SILENT)
|
|---|
| 419 | AC_DEFINE(NO_SIGNALS)
|
|---|
| 420 | AC_DEFINE(NO_EXECUTE_PERMISSION)
|
|---|
| 421 | AC_DEFINE(ALL_INTERIOR_POINTERS)
|
|---|
| 422 |
|
|---|
| 423 | dnl By default, make the library as general as possible.
|
|---|
| 424 | AC_DEFINE(JAVA_FINALIZATION)
|
|---|
| 425 | AC_DEFINE(GC_GCJ_SUPPORT)
|
|---|
| 426 | AC_DEFINE(ATOMIC_UNCOLLECTABLE)
|
|---|
| 427 |
|
|---|
| 428 | dnl This is something of a hack. When cross-compiling we turn off
|
|---|
| 429 | dnl some functionality. We also enable the "small" configuration.
|
|---|
| 430 | dnl These is only correct when targetting an embedded system. FIXME.
|
|---|
| 431 | if test -n "${with_cross_host}"; then
|
|---|
| 432 | AC_DEFINE(NO_SIGSET)
|
|---|
| 433 | AC_DEFINE(NO_CLOCK)
|
|---|
| 434 | AC_DEFINE(SMALL_CONFIG)
|
|---|
| 435 | AC_DEFINE(NO_DEBUGGING)
|
|---|
| 436 | fi
|
|---|
| 437 |
|
|---|
| 438 | UNWINDLIBS=
|
|---|
| 439 | AC_ARG_ENABLE(full-debug,
|
|---|
| 440 | [ --enable-full-debug include full support for pointer backtracing etc.],
|
|---|
| 441 | [ if test "$enable_full_debug" = "yes"; then
|
|---|
| 442 | AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
|
|---|
| 443 | AC_DEFINE(KEEP_BACK_PTRS)
|
|---|
| 444 | AC_DEFINE(DBG_HDRS_ALL)
|
|---|
| 445 | case $host in
|
|---|
| 446 | ia64-*-linux* )
|
|---|
| 447 | AC_DEFINE(MAKE_BACK_GRAPH)
|
|---|
| 448 | AC_DEFINE(SAVE_CALL_COUNT, 8)
|
|---|
| 449 | AC_CHECK_LIB(unwind, backtrace, [
|
|---|
| 450 | AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
|
|---|
| 451 | UNWINDLIBS=-lunwind
|
|---|
| 452 | AC_MSG_WARN("Client code may need to link against libunwind.")
|
|---|
| 453 | ])
|
|---|
| 454 | ;;
|
|---|
| 455 | x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
|
|---|
| 456 | AC_DEFINE(MAKE_BACK_GRAPH)
|
|---|
| 457 | AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
|
|---|
| 458 | AC_DEFINE(SAVE_CALL_COUNT, 8)
|
|---|
| 459 | ;;
|
|---|
| 460 | i[3456]86-*-dgux*)
|
|---|
| 461 | AC_DEFINE(MAKE_BACK_GRAPH)
|
|---|
| 462 | ;;
|
|---|
| 463 | esac ]
|
|---|
| 464 | fi)
|
|---|
| 465 |
|
|---|
| 466 | AC_SUBST(UNWINDLIBS)
|
|---|
| 467 |
|
|---|
| 468 | AC_ARG_ENABLE(redirect-malloc,
|
|---|
| 469 | [ --enable-redirect-malloc redirect malloc and friends to GC routines])
|
|---|
| 470 |
|
|---|
| 471 | if test "${enable_redirect_malloc}" = yes; then
|
|---|
| 472 | if test "${enable_full_debug}" = yes; then
|
|---|
| 473 | AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
|
|---|
| 474 | AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
|
|---|
| 475 | AC_DEFINE(REDIRECT_FREE, GC_debug_free)
|
|---|
| 476 | else
|
|---|
| 477 | AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
|
|---|
| 478 | fi
|
|---|
| 479 | fi
|
|---|
| 480 |
|
|---|
| 481 | AC_ARG_ENABLE(gc-assertions,
|
|---|
| 482 | [ --enable-gc-assertions collector-internal assertion checking])
|
|---|
| 483 | if test "${enable_gc_assertions}" = yes; then
|
|---|
| 484 | AC_DEFINE(GC_ASSERTIONS)
|
|---|
| 485 | fi
|
|---|
| 486 |
|
|---|
| 487 | AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
|
|---|
| 488 |
|
|---|
| 489 | AC_OUTPUT([Makefile doc/Makefile include/Makefile],,
|
|---|
| 490 | srcdir=${srcdir}
|
|---|
| 491 | host=${host}
|
|---|
| 492 | CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
|---|
| 493 | CC="${CC}"
|
|---|
| 494 | DEFS="$DEFS"
|
|---|
| 495 | )
|
|---|