From 806d656802a1e3c2b55cd9e4530c6420340886c9 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 27 Mar 2012 13:20:37 +0200 Subject: [PATCH] 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. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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. -- 2.40.0