/vendor/gc/configure.ac

http://github.com/feyeleanor/RubyGoLightly · m4 · 688 lines · 569 code · 65 blank · 54 comment · 0 complexity · aafe0769bd763768854d3201acf18bce MD5 · raw file

  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. dnl Process this file with autoconf to produce configure.
  15. # Initialization
  16. # ==============
  17. AC_INIT(gc,7.1,Hans.Boehm@hp.com)
  18. ## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
  19. AC_CONFIG_SRCDIR(gcj_mlc.c)
  20. AC_CANONICAL_TARGET
  21. AC_PREREQ(2.53)
  22. AC_REVISION($Revision: 1.35 $)
  23. GC_SET_VERSION
  24. AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc])
  25. AM_MAINTAINER_MODE
  26. AC_SUBST(PACKAGE)
  27. AC_SUBST(GC_VERSION)
  28. AM_PROG_CC_C_O
  29. AC_PROG_CXX
  30. AM_PROG_AS
  31. ## FIXME: really needed? (AC_LIBTOOL already provides this)
  32. AC_CHECK_TOOL(AR, ar)
  33. AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
  34. AC_PROG_INSTALL
  35. . ${srcdir}/configure.host
  36. GC_CFLAGS=${gc_cflags}
  37. AC_SUBST(GC_CFLAGS)
  38. AC_ARG_ENABLE(threads,
  39. [AC_HELP_STRING([--enable-threads=TYPE], [choose threading package])],
  40. THREADS=$enableval,
  41. [ AC_MSG_CHECKING([for thread model used by GCC])
  42. THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
  43. if test -z "$THREADS"; then
  44. THREADS=no
  45. fi
  46. AC_MSG_RESULT([$THREADS]) ])
  47. AC_ARG_ENABLE(parallel-mark,
  48. [AC_HELP_STRING([--enable-parallel-mark],
  49. [parallelize marking and free list construction])],
  50. [case "$THREADS" in
  51. no | none | single)
  52. AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
  53. ;;
  54. esac ]
  55. )
  56. AC_ARG_ENABLE(cplusplus,
  57. [AC_HELP_STRING([--enable-cplusplus], [install C++ support])])
  58. INCLUDES=-I${srcdir}/include
  59. THREADDLLIBS=
  60. need_atomic_ops_asm=false
  61. ## Libraries needed to support dynamic loading and/or threads.
  62. case "$THREADS" in
  63. no | none | single)
  64. THREADS=none
  65. ;;
  66. posix | pthreads)
  67. THREADS=posix
  68. THREADDLLIBS=-lpthread
  69. case "$host" in
  70. x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux*)
  71. AC_DEFINE(GC_LINUX_THREADS)
  72. AC_DEFINE(_REENTRANT)
  73. if test "${enable_parallel_mark}" = yes; then
  74. AC_DEFINE(PARALLEL_MARK)
  75. fi
  76. AC_DEFINE(THREAD_LOCAL_ALLOC)
  77. AC_MSG_WARN("Explict GC_INIT() calls may be required.");
  78. ;;
  79. *-*-linux*)
  80. AC_DEFINE(GC_LINUX_THREADS)
  81. AC_DEFINE(_REENTRANT)
  82. ;;
  83. *-*-aix*)
  84. AC_DEFINE(GC_AIX_THREADS)
  85. AC_DEFINE(_REENTRANT)
  86. ;;
  87. *-*-hpux11*)
  88. AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")
  89. AC_DEFINE(GC_HPUX_THREADS)
  90. AC_DEFINE(_POSIX_C_SOURCE,199506L)
  91. if test "${enable_parallel_mark}" = yes; then
  92. AC_DEFINE(PARALLEL_MARK)
  93. fi
  94. AC_DEFINE(THREAD_LOCAL_ALLOC)
  95. AC_MSG_WARN("Explict GC_INIT() calls may be required.");
  96. THREADDLLIBS="-lpthread -lrt"
  97. # HPUX needs REENTRANT for the _r calls.
  98. AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
  99. ;;
  100. *-*-hpux10*)
  101. AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
  102. ;;
  103. *-*-freebsd*)
  104. AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
  105. AC_DEFINE(GC_FREEBSD_THREADS)
  106. INCLUDES="$INCLUDES -pthread"
  107. ;;
  108. *-*-kfreebsd*-gnu)
  109. AC_DEFINE(GC_FREEBSD_THREADS)
  110. INCLUDES="$INCLUDES -pthread"
  111. THREADDLLIBS=-pthread
  112. AC_DEFINE(_REENTRANT)
  113. if test "${enable_parallel_mark}" = yes; then
  114. AC_DEFINE(PARALLEL_MARK)
  115. fi
  116. AC_DEFINE(THREAD_LOCAL_ALLOC)
  117. AC_DEFINE(USE_COMPILER_TLS)
  118. ;;
  119. *-*-gnu*)
  120. AC_DEFINE(GC_GNU_THREADS)
  121. AC_DEFINE(_REENTRANT)
  122. AC_DEFINE(THREAD_LOCAL_ALLOC)
  123. ;;
  124. *-*-netbsd*)
  125. AC_MSG_WARN("Only on NetBSD 2.0 or later.")
  126. AC_DEFINE(GC_NETBSD_THREADS)
  127. AC_DEFINE(_REENTRANT)
  128. AC_DEFINE(_PTHREADS)
  129. THREADDLLIBS="-lpthread -lrt"
  130. ;;
  131. *-*-solaris*)
  132. AC_DEFINE(GC_SOLARIS_THREADS)
  133. AC_DEFINE(THREAD_LOCAL_ALLOC)
  134. THREADDLLIBS="-lpthread -lrt"
  135. if test "$GCC" != yes; then
  136. CFLAGS="$CFLAGS -O"
  137. need_atomic_ops_asm=true
  138. fi
  139. ;;
  140. *-*-irix*)
  141. AC_DEFINE(GC_IRIX_THREADS)
  142. ;;
  143. *-*-cygwin*)
  144. AC_DEFINE(GC_WIN32_THREADS)
  145. AC_DEFINE(THREAD_LOCAL_ALLOC)
  146. win32_threads=true
  147. ;;
  148. *-*-darwin*)
  149. AC_DEFINE(GC_DARWIN_THREADS)
  150. AC_DEFINE(THREAD_LOCAL_ALLOC)
  151. AC_MSG_WARN("Explict GC_INIT() calls may be required.");
  152. # Parallel-mark is currently unreliable on Darwin; ignore request
  153. # if test "${enable_parallel_mark}" = yes; then
  154. # AC_DEFINE(PARALLEL_MARK)
  155. # fi
  156. darwin_threads=true
  157. ;;
  158. *-*-osf*)
  159. AC_DEFINE(GC_OSF1_THREADS)
  160. if test "${enable_parallel_mark}" = yes; then
  161. AC_DEFINE(PARALLEL_MARK)
  162. AC_DEFINE(THREAD_LOCAL_ALLOC)
  163. AC_MSG_WARN("Explict GC_INIT() calls may be required.");
  164. # May want to enable it in other cases, too.
  165. # Measurements havent yet been done.
  166. fi
  167. INCLUDES="$INCLUDES -pthread"
  168. THREADDLLIBS="-lpthread -lrt"
  169. ;;
  170. *)
  171. AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
  172. ;;
  173. esac
  174. ;;
  175. win32)
  176. AC_DEFINE(GC_WIN32_THREADS)
  177. dnl Wine getenv may not return NULL for missing entry
  178. AC_DEFINE(NO_GETENV)
  179. ;;
  180. dgux386)
  181. THREADS=dgux386
  182. AC_MSG_RESULT($THREADDLLIBS)
  183. # Use pthread GCC switch
  184. THREADDLLIBS=-pthread
  185. if test "${enable_parallel_mark}" = yes; then
  186. AC_DEFINE(PARALLEL_MARK)
  187. fi
  188. AC_DEFINE(THREAD_LOCAL_ALLOC)
  189. AC_MSG_WARN("Explict GC_INIT() calls may be required.");
  190. AC_DEFINE(GC_DGUX386_THREADS)
  191. AC_DEFINE(DGUX_THREADS)
  192. # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
  193. INCLUDES="-pthread $INCLUDES"
  194. ;;
  195. aix)
  196. THREADS=posix
  197. THREADDLLIBS=-lpthread
  198. AC_DEFINE(GC_AIX_THREADS)
  199. AC_DEFINE(_REENTRANT)
  200. ;;
  201. decosf1 | irix | mach | os2 | solaris | dce | vxworks)
  202. AC_MSG_ERROR(thread package $THREADS not yet supported)
  203. ;;
  204. *)
  205. AC_MSG_ERROR($THREADS is an unknown thread package)
  206. ;;
  207. esac
  208. AC_SUBST(THREADDLLIBS)
  209. AM_CONDITIONAL(THREADS, test x$THREADS != xnone)
  210. AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
  211. AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
  212. AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
  213. case "$host" in
  214. powerpc-*-darwin*)
  215. powerpc_darwin=true
  216. ;;
  217. esac
  218. # Darwin needs a few extra special tests to deal with variation in the
  219. # system headers.
  220. case "$host" in
  221. powerpc*-*-darwin*)
  222. AC_CHECK_MEMBER(ppc_thread_state_t.r0,
  223. AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
  224. [ppc_thread_state_t has field r0]),,
  225. [#include <mach/thread_status.h>])
  226. AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
  227. AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
  228. [ppc_thread_state_t has field __r0]),,
  229. [#include <mach/thread_status.h>])
  230. AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
  231. AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
  232. [ppc_thread_state64_t has field r0]),,
  233. [#include <mach/thread_status.h>])
  234. AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
  235. AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
  236. [ppc_thread_state64_t has field __r0]),,
  237. [#include <mach/thread_status.h>])
  238. ;;
  239. i?86*-*-darwin*)
  240. AC_CHECK_MEMBER(x86_thread_state32_t.eax,
  241. AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
  242. [x86_thread_state32_t has field eax]),,
  243. [#include <sys/cdefs.h>
  244. #include <mach/thread_status.h>])
  245. AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
  246. AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
  247. [x86_thread_state32_t has field __eax]),,
  248. [#include <sys/cdefs.h>
  249. #include <mach/thread_status.h>])
  250. ;;
  251. x86_64-*-darwin*)
  252. AC_CHECK_MEMBER(x86_thread_state64_t.rax,
  253. AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
  254. [x86_thread_state64_t has field rax]),,
  255. [#include <sys/cdefs.h>
  256. #include <mach/thread_status.h>])
  257. AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
  258. AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
  259. [x86_thread_state64_t has field __rax]),,
  260. [#include <sys/cdefs.h>
  261. #include <mach/thread_status.h>])
  262. ;;
  263. *) ;;
  264. esac
  265. AC_MSG_CHECKING(for xlc)
  266. AC_TRY_COMPILE([],[
  267. #ifndef __xlC__
  268. # error
  269. #endif
  270. ], [compiler_xlc=yes], [compiler_xlc=no])
  271. AC_MSG_RESULT($compiler_xlc)
  272. AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
  273. if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
  274. # the darwin stack-frame-walking code is completely broken on xlc
  275. AC_DEFINE(DARWIN_DONT_PARSE_STACK)
  276. fi
  277. # We never want libdl on darwin. It is a fake libdl that just ends up making
  278. # dyld calls anyway
  279. case "$host" in
  280. *-*-darwin*) ;;
  281. *)
  282. AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
  283. ;;
  284. esac
  285. case "$host" in
  286. *-*-hpux*)
  287. avoid_cpp_lib=yes;;
  288. *)
  289. avoid_cpp_lib=no;
  290. ;;
  291. esac
  292. AM_CONDITIONAL(AVOID_CPP_LIB,test $avoid_cpp_lib = yes)
  293. # extra LD Flags which are required for targets
  294. case "${host}" in
  295. *-*-darwin*)
  296. extra_ldflags_libgc=-Wl,-single_module
  297. ;;
  298. esac
  299. AC_SUBST(extra_ldflags_libgc)
  300. AC_SUBST(EXTRA_TEST_LIBS)
  301. target_all=libgc.la
  302. AC_SUBST(target_all)
  303. dnl If the target is an eCos system, use the appropriate eCos
  304. dnl I/O routines.
  305. dnl FIXME: this should not be a local option but a global target
  306. dnl system; at present there is no eCos target.
  307. TARGET_ECOS="no"
  308. AC_ARG_WITH(ecos,
  309. [ --with-ecos enable runtime eCos target support],
  310. TARGET_ECOS="$with_ecos"
  311. )
  312. addobjs=
  313. addlibs=
  314. CXXINCLUDES=
  315. case "$TARGET_ECOS" in
  316. no)
  317. ;;
  318. *)
  319. AC_DEFINE(ECOS)
  320. CXXINCLUDES="-I${TARGET_ECOS}/include"
  321. addobjs="$addobjs ecos.lo"
  322. ;;
  323. esac
  324. AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
  325. AC_SUBST(CXX)
  326. AC_SUBST(INCLUDES)
  327. AC_SUBST(CXXINCLUDES)
  328. # Configuration of shared libraries
  329. #
  330. AC_MSG_CHECKING(whether to build shared libraries)
  331. AC_ENABLE_SHARED
  332. case "$host" in
  333. alpha-*-openbsd*)
  334. enable_shared=no
  335. ;;
  336. *)
  337. ;;
  338. esac
  339. AC_MSG_RESULT($enable_shared)
  340. # Configuration of machine-dependent code
  341. #
  342. AC_MSG_CHECKING(which machine-dependent code should be used)
  343. machdep=
  344. case "$host" in
  345. alpha-*-openbsd*)
  346. machdep="mach_dep.lo"
  347. if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
  348. AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
  349. fi
  350. ;;
  351. alpha*-*-linux*)
  352. machdep="mach_dep.lo"
  353. ;;
  354. i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
  355. AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
  356. ;;
  357. mipstx39-*-elf*)
  358. machdep="mach_dep.lo"
  359. AC_DEFINE(STACKBASE, __stackbase)
  360. AC_DEFINE(DATASTART_IS_ETEXT)
  361. ;;
  362. mips-dec-ultrix*)
  363. machdep="mach-dep.lo"
  364. ;;
  365. mips-nec-sysv*|mips-unknown-sysv*)
  366. ;;
  367. mips*-*-linux*)
  368. ;;
  369. mips-*-*)
  370. machdep="mach_dep.lo"
  371. dnl AC_DEFINE(NO_EXECUTE_PERMISSION)
  372. dnl This is now redundant, but it is also important for incremental GC
  373. dnl performance under Irix.
  374. ;;
  375. sparc-*-netbsd*)
  376. machdep="mach_dep.lo sparc_netbsd_mach_dep.lo"
  377. ;;
  378. sparc-sun-solaris2.3)
  379. machdep="mach_dep.lo sparc_mach_dep.lo"
  380. AC_DEFINE(SUNOS53_SHARED_LIB)
  381. ;;
  382. sparc*-sun-solaris2.*)
  383. machdep="mach_dep.lo sparc_mach_dep.lo"
  384. ;;
  385. ia64-*-*)
  386. machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
  387. ;;
  388. esac
  389. if test x"$machdep" = x; then
  390. AC_MSG_RESULT($machdep)
  391. machdep="mach_dep.lo"
  392. fi
  393. addobjs="$addobjs $machdep"
  394. AC_SUBST(addobjs)
  395. AC_SUBST(addlibs)
  396. AC_PROG_LIBTOOL
  397. #
  398. # Check for AViiON Machines running DGUX
  399. #
  400. ac_is_dgux=no
  401. AC_CHECK_HEADER(sys/dg_sys_info.h,
  402. [ac_is_dgux=yes;])
  403. ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
  404. if test $ac_is_dgux = yes; then
  405. if test "$enable_full_debug" = "yes"; then
  406. CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
  407. CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
  408. else
  409. CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
  410. CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
  411. fi
  412. AC_SUBST(CFLAGS)
  413. AC_SUBST(CXXFLAGS)
  414. fi
  415. dnl We use these options to decide which functions to include.
  416. AC_ARG_WITH(target-subdir,
  417. [ --with-target-subdir=SUBDIR
  418. configuring with a cross compiler])
  419. AC_ARG_WITH(cross-host,
  420. [ --with-cross-host=HOST configuring with a cross compiler])
  421. # automake wants to see AC_EXEEXT. But we don't need it. And having
  422. # it is actually a problem, because the compiler we're passed can't
  423. # necessarily do a full link. So we fool automake here.
  424. if false; then
  425. # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
  426. # to nothing, so nothing would remain between `then' and `fi' if it
  427. # were not for the `:' below.
  428. :
  429. AC_EXEEXT
  430. fi
  431. dnl As of 4.13a2, the collector will not properly work on Solaris when
  432. dnl built with gcc and -O. So we remove -O in the appropriate case.
  433. dnl Not needed anymore on Solaris.
  434. AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
  435. case "$host" in
  436. *aix*)
  437. if test "$GCC" = yes; then
  438. AC_MSG_RESULT(yes)
  439. new_CFLAGS=
  440. for i in $CFLAGS; do
  441. case "$i" in
  442. -O*)
  443. ;;
  444. *)
  445. new_CFLAGS="$new_CFLAGS $i"
  446. ;;
  447. esac
  448. done
  449. CFLAGS="$new_CFLAGS"
  450. else
  451. AC_MSG_RESULT(no)
  452. fi
  453. ;;
  454. *) AC_MSG_RESULT(no) ;;
  455. esac
  456. dnl Include defines that have become de facto standard.
  457. dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
  458. AC_DEFINE(NO_EXECUTE_PERMISSION)
  459. AC_DEFINE(ALL_INTERIOR_POINTERS)
  460. dnl Interface Selection
  461. dnl -------------------
  462. dnl
  463. dnl By default, make the library as general as possible.
  464. dnl enable_gcj_support=no
  465. AC_ARG_ENABLE(gcj-support,
  466. [AC_HELP_STRING([--disable-gcj-support],
  467. [Disable support for gcj.])])
  468. AM_CONDITIONAL(ENABLE_GCJ_SUPPORT,
  469. [test x"$enable_gcj_support" != xno])
  470. if test x"$enable_gcj_support" != xno; then
  471. AC_DEFINE(GC_GCJ_SUPPORT, 1, [Define to include support for gcj])
  472. fi
  473. AC_ARG_ENABLE(java-finalization,
  474. [AC_HELP_STRING([--disable-java-finalization],
  475. [Disable support for java finalization.])])
  476. if test x"$enable_java_finalization" != xno; then
  477. AC_DEFINE(JAVA_FINALIZATION)
  478. fi
  479. AC_ARG_ENABLE(atomic-uncollectable,
  480. [AC_HELP_STRING([--disable-atomic-uncollectible],
  481. [Disable support for atomic uncollectible allocation.])])
  482. if test x"$enable_atomic_uncollectible" != x"no"; then
  483. AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1,
  484. [Define to enable atomic uncollectible allocation.])
  485. fi
  486. AC_ARG_ENABLE(redirect-malloc,
  487. [AC_HELP_STRING([--enable-redirect-malloc],
  488. [Redirect malloc and friends to GC routines])])
  489. if test "${enable_redirect_malloc}" = yes; then
  490. if test "${enable_full_debug}" = yes; then
  491. AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
  492. AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
  493. AC_DEFINE(REDIRECT_FREE, GC_debug_free)
  494. else
  495. AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
  496. fi
  497. AC_DEFINE(GC_USE_DLOPEN_WRAP)
  498. fi
  499. AC_ARG_ENABLE(large-config,
  500. [AC_HELP_STRING([--enable-large-config],
  501. [Optimize for large (> 100 MB) heap or root set])])
  502. if test "${enable_large_config}" = yes; then
  503. AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets])
  504. fi
  505. dnl This is something of a hack. When cross-compiling we turn off
  506. dnl some functionality. We also enable the "small" configuration.
  507. dnl These is only correct when targetting an embedded system. FIXME.
  508. if test -n "${with_cross_host}"; then
  509. AC_DEFINE(NO_CLOCK)
  510. AC_DEFINE(SMALL_CONFIG)
  511. AC_DEFINE(NO_DEBUGGING)
  512. fi
  513. dnl Debugging
  514. dnl ---------
  515. UNWINDLIBS=
  516. AC_ARG_ENABLE(gc-debug,
  517. [AC_HELP_STRING([--enable-gc-debug],
  518. [include full support for pointer backtracing etc.])],
  519. [ if test "$enable_gc_debug" = "yes"; then
  520. AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
  521. AC_DEFINE(KEEP_BACK_PTRS)
  522. AC_DEFINE(DBG_HDRS_ALL)
  523. case $host in
  524. ia64-*-linux* )
  525. AC_DEFINE(MAKE_BACK_GRAPH)
  526. AC_DEFINE(SAVE_CALL_COUNT, 8)
  527. AC_CHECK_LIB(unwind, backtrace, [
  528. AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
  529. UNWINDLIBS=-lunwind
  530. AC_MSG_WARN("Client code may need to link against libunwind.")
  531. ])
  532. ;;
  533. x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
  534. AC_DEFINE(MAKE_BACK_GRAPH)
  535. AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
  536. AC_DEFINE(SAVE_CALL_COUNT, 8)
  537. ;;
  538. i[3456]86-*-dgux*)
  539. AC_DEFINE(MAKE_BACK_GRAPH)
  540. ;;
  541. esac ]
  542. fi)
  543. AC_SUBST(UNWINDLIBS)
  544. AC_ARG_ENABLE(gc-assertions,
  545. [AC_HELP_STRING([--enable-gc-assertions],
  546. [collector-internal assertion checking])])
  547. if test "${enable_gc_assertions}" = yes; then
  548. AC_DEFINE(GC_ASSERTIONS)
  549. fi
  550. AC_ARG_ENABLE(munmap,
  551. [AC_HELP_STRING([--enable-munmap=N],
  552. [return page to the os if empty for N collections])],
  553. MUNMAP_THRESHOLD=$enableval;
  554. [case "$MMAP" in
  555. no)
  556. AC_MSG_ERROR([--enable-munmap requires --enable-mmap])
  557. ;;
  558. esac]
  559. )
  560. if test "${enable_munmap}" != ""; then
  561. AC_DEFINE(USE_MMAP)
  562. AC_DEFINE(USE_MUNMAP)
  563. if test "${MUNMAP_THRESHOLD}" = "yes"; then
  564. MUNMAP_THRESHOLD=6
  565. fi
  566. AC_DEFINE_UNQUOTED(MUNMAP_THRESHOLD, ${MUNMAP_THRESHOLD})
  567. fi
  568. AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
  569. dnl Atomic Ops
  570. dnl ----------
  571. atomic_ops_libs=-latomic_ops
  572. AC_CHECK_HEADER(atomic_ops.h,
  573. [ AC_MSG_NOTICE([Using pre-installed libatomic_ops]) ],
  574. [ ao_dir=
  575. for candidate in ${srcdir}/libatomic_ops*; do
  576. case $candidate in
  577. *.tar.gz)
  578. ;;
  579. *install)
  580. dnl generated by alternate Makefile.
  581. ;;
  582. *)
  583. if test -e "$candidate"; then
  584. ao_dir="$candidate"
  585. fi
  586. ;;
  587. esac
  588. done
  589. if test -z "$ao_dir"; then
  590. AC_MSG_ERROR([Missig libatomic_ops.])
  591. fi
  592. ao_version="${ao_dir#*libatomic_ops-}"
  593. AC_MSG_NOTICE([Using internal version of libatomic_ops])
  594. dnl Automake does not accept shell variables in AC_CONFIG_SUBDIRS
  595. test -e libatomic_ops \
  596. || ln -s ${ao_dir} libatomic_ops
  597. AC_CONFIG_SUBDIRS(libatomic_ops)
  598. dnl Also copy the source files to be linked in.
  599. test -e atomic_ops.c \
  600. || ln -s libatomic_ops/src/atomic_ops.c \
  601. atomic_ops.c
  602. test -e atomic_ops_sysdeps.S \
  603. || ln -s libatomic_ops/src/atomic_ops_sysdeps.S \
  604. atomic_ops_sysdeps.S
  605. dnl This gets the source include files, which is often close enough.
  606. dnl It also makes atomic_ops_sysdeps.S assemble.
  607. GC_CFLAGS="${GC_CFLAGS} -I libatomic_ops/src"
  608. maybe_libatomic_ops="libatomic_ops"
  609. ])
  610. AM_CONDITIONAL(USE_INTERNAL_LIBATOMIC_OPS,
  611. test -n "$maybe_libatomic_ops" -a "$THREADS" != "none")
  612. AM_CONDITIONAL(NEED_ATOMIC_OPS_ASM, test -n "$maybe_libatomic_ops" -a x$need_atomic_ops_asm = xtrue)
  613. AC_SUBST(atomic_ops_libs)
  614. dnl Produce the Files
  615. dnl -----------------
  616. AC_CONFIG_FILES([Makefile bdw-gc.pc])
  617. AC_CONFIG_COMMANDS([default],,
  618. [ srcdir=${srcdir}
  619. host=${host}
  620. CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  621. CC="${CC}"
  622. DEFS="$DEFS" ])
  623. AC_OUTPUT