summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-05-30 16:54:49 (GMT)
committerJason Evans <jasone@canonware.com>2017-05-30 18:30:54 (GMT)
commitc606a87d2a2a946793cf0a29ca69a1962caf6008 (patch)
treec05fd628e3bd24cd68de881da3f4a2601d767f7d /configure.ac
parentbf6673a070a7d0b12a4d25c1f64dcf562f61f10a (diff)
downloadjemalloc-c606a87d2a2a946793cf0a29ca69a1962caf6008.zip
jemalloc-c606a87d2a2a946793cf0a29ca69a1962caf6008.tar.gz
jemalloc-c606a87d2a2a946793cf0a29ca69a1962caf6008.tar.bz2
Add the --disable-thp option to support cross compiling.
This resolves #669.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 22 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 8be4be4..bed01b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1792,11 +1792,29 @@ if test "x${je_cv_madvise}" = "xyes" ; then
madvise((void *)0, 0, MADV_HUGEPAGE);
madvise((void *)0, 0, MADV_NOHUGEPAGE);
], [je_cv_thp])
- if test "x${je_cv_thp}" = "xyes" ; then
- AC_DEFINE([JEMALLOC_THP], [ ])
- fi
fi
+dnl Enable transparent huge page support by default.
+AC_ARG_ENABLE([thp],
+ [AS_HELP_STRING([--disable-thp],
+ [Disable transparent huge page support])],
+[if test "x$enable_thp" = "xno" -o "x${je_cv_thp}" != "xyes" ; then
+ enable_thp="0"
+else
+ enable_thp="1"
+fi
+],
+[if test "x${je_cv_thp}" = "xyes" ; then
+ enable_thp="1"
+else
+ enable_thp="0"
+fi
+])
+if test "x$enable_thp" = "x1" ; then
+ AC_DEFINE([JEMALLOC_THP], [ ])
+fi
+AC_SUBST([enable_thp])
+
dnl ============================================================================
dnl Check whether __sync_{add,sub}_and_fetch() are available despite
dnl __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macros being undefined.
@@ -2141,6 +2159,7 @@ AC_MSG_RESULT([prof : ${enable_prof}])
AC_MSG_RESULT([prof-libunwind : ${enable_prof_libunwind}])
AC_MSG_RESULT([prof-libgcc : ${enable_prof_libgcc}])
AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
+AC_MSG_RESULT([thp : ${enable_thp}])
AC_MSG_RESULT([fill : ${enable_fill}])
AC_MSG_RESULT([utrace : ${enable_utrace}])
AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])