summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-03-27 13:20:37 +0200
committerIvan Maidanski <ivmai@mail.ru>2012-04-03 05:55:10 +0200
commit2b0fd8f841b9a6ed3d2811125af22df00e238129 (patch)
tree7a5bcfd99a8ef21f79f31462789a17947cc3c13f /configure.ac
parent5d58dc64cbc631f9b80556aeef7c0f7fb3a57501 (diff)
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.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index bdc02d2..b34e0c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -685,6 +685,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.