aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-12-03 16:47:36 -0800
committerJason Evans <jasone@canonware.com>2016-12-03 16:50:58 -0800
commitacb7b1f53e25fcad89375512e6eaea8115dc6af5 (patch)
tree63f318c558656c195a020896e3bb1c63b08ad2a5 /configure.ac
parent7179351a45f00fa943cfe23b555036615b91ce9d (diff)
downloadplatform_external_jemalloc_new-acb7b1f53e25fcad89375512e6eaea8115dc6af5.tar.gz
platform_external_jemalloc_new-acb7b1f53e25fcad89375512e6eaea8115dc6af5.tar.bz2
platform_external_jemalloc_new-acb7b1f53e25fcad89375512e6eaea8115dc6af5.zip
Add --disable-syscall.
This resolves #517.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac31
1 files changed, 22 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 2e3ef364..ab2c0bee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1366,20 +1366,33 @@ if test "x${je_cv_mach_absolute_time}" = "xyes" ; then
AC_DEFINE([JEMALLOC_HAVE_MACH_ABSOLUTE_TIME])
fi
-dnl Check if syscall(2) is usable. Treat warnings as errors, so that e.g. OS X
-dnl 10.12's deprecation warning prevents use.
-SAVED_CFLAGS="${CFLAGS}"
-JE_CFLAGS_APPEND([-Werror])
-JE_COMPILABLE([syscall(2)], [
+dnl Use syscall(2) (if available) by default.
+AC_ARG_ENABLE([syscall],
+ [AS_HELP_STRING([--disable-syscall], [Disable use of syscall(2)])],
+[if test "x$enable_syscall" = "xno" ; then
+ enable_syscall="0"
+else
+ enable_syscall="1"
+fi
+],
+[enable_syscall="1"]
+)
+if test "x$enable_syscall" = "x1" ; then
+ dnl Check if syscall(2) is usable. Treat warnings as errors, so that e.g. OS
+ dnl X 10.12's deprecation warning prevents use.
+ SAVED_CFLAGS="${CFLAGS}"
+ JE_CFLAGS_APPEND([-Werror])
+ JE_COMPILABLE([syscall(2)], [
#include <sys/syscall.h>
#include <unistd.h>
], [
syscall(SYS_write, 2, "hello", 5);
],
- [je_cv_syscall])
-CFLAGS="${SAVED_CFLAGS}"
-if test "x$je_cv_syscall" = "xyes" ; then
- AC_DEFINE([JEMALLOC_HAVE_SYSCALL], [ ])
+ [je_cv_syscall])
+ CFLAGS="${SAVED_CFLAGS}"
+ if test "x$je_cv_syscall" = "xyes" ; then
+ AC_DEFINE([JEMALLOC_USE_SYSCALL], [ ])
+ fi
fi
dnl Check if the GNU-specific secure_getenv function exists.