From: Andy Wingo Date: Tue, 27 Mar 2012 11:20:37 +0000 (+0200) Subject: configure: add --enable-handle-fork option X-Git-Tag: gc7_3alpha2~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=806d656802a1e3c2b55cd9e4530c6420340886c9;p=gc configure: add --enable-handle-fork option * configure.ac: Add --enable-handle-fork option; if explicitly passed, enables or disables the pthread_atfork support; if not passed, the default, as determined by gcconfig.h, is to enable HANDLE_FORK if it is supported on the target platform. --- diff --git a/configure.ac b/configure.ac index a29881bf..93072186 100644 --- a/configure.ac +++ b/configure.ac @@ -785,6 +785,19 @@ if test "${enable_large_config}" = yes; then AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets.]) fi +AC_ARG_ENABLE(handle-fork, + [AC_HELP_STRING([--enable-handle-fork], + [Attempt to ensure a usable collector after fork() in multi-threaded + programs.])]) + +if test "${enable_handle_fork}" = yes; then + AC_DEFINE(HANDLE_FORK, 1, + [Define to install pthread_atfork() handlers if available.]) +elif test "${enable_handle_fork}" = no; then + AC_DEFINE(NO_HANDLE_FORK, 1, + [Define to inhibit installation of pthread_atfork() handlers.]) +fi + dnl This is something of a hack. When cross-compiling we turn off dnl some functionality. We also enable the "small" configuration. dnl These is only correct when targetting an embedded system. FIXME.