From ea432102a8e913e2041df7e18f27caf408c6713e Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 10 Mar 2014 14:36:42 -0500 Subject: [PATCH] Teach configure script --enable-jemalloc, --with-jemalloc. Addresses BIT-1128. --- CMakeLists.txt | 7 +++++++ configure | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f773381ae8..71f6a6a8fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,10 @@ if (NOT BinPAC_ROOT_DIR AND endif () FindRequiredPackage(BinPAC) +if (ENABLE_JEMALLOC) + find_package(JeMalloc) +endif () + if (MISSING_PREREQS) foreach (prereq ${MISSING_PREREQ_DESCS}) message(SEND_ERROR ${prereq}) @@ -105,6 +109,7 @@ include_directories(BEFORE ${BinPAC_INCLUDE_DIR} ${LIBMAGIC_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} + ${JEMALLOC_INCLUDE_DIR} ) # Optional Dependencies @@ -184,6 +189,7 @@ set(brodeps ${BIND_LIBRARY} ${LIBMAGIC_LIBRARY} ${ZLIB_LIBRARY} + ${JEMALLOC_LIBRARIES} ${OPTLIBS} ) @@ -268,6 +274,7 @@ message( "\ngperftools found: ${HAVE_PERFTOOLS}" "\n tcmalloc: ${USE_PERFTOOLS_TCMALLOC}" "\n debugging: ${USE_PERFTOOLS_DEBUG}" + "\njemalloc: ${ENABLE_JEMALLOC}" "\ncURL: ${USE_CURL}" "\n" "\nDataSeries: ${USE_DATASERIES}" diff --git a/configure b/configure index ba9bf58301..5690712c3a 100755 --- a/configure +++ b/configure @@ -32,6 +32,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --enable-perftools force use of Google perftools on non-Linux systems (automatically on when perftools is present on Linux) --enable-perftools-debug use Google's perftools for debugging + --enable-jemalloc link against jemalloc --enable-ruby build ruby bindings for broccoli (deprecated) --disable-broccoli don't build or install the Broccoli library --disable-broctl don't install Broctl @@ -54,6 +55,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... Optional Packages in Non-Standard Locations: --with-geoip=PATH path to the libGeoIP install root --with-perftools=PATH path to Google Perftools install root + --with-jemalloc=PATH path to jemalloc install root --with-python=PATH path to Python interpreter --with-python-lib=PATH path to libpython --with-python-inc=PATH path to Python headers @@ -105,6 +107,7 @@ append_cache_entry BRO_ETC_INSTALL_DIR PATH $prefix/etc append_cache_entry ENABLE_DEBUG BOOL false append_cache_entry ENABLE_PERFTOOLS BOOL false append_cache_entry ENABLE_PERFTOOLS_DEBUG BOOL false +append_cache_entry ENABLE_JEMALLOC BOOL false append_cache_entry BinPAC_SKIP_INSTALL BOOL true append_cache_entry BUILD_SHARED_LIBS BOOL true append_cache_entry INSTALL_AUX_TOOLS BOOL true @@ -160,6 +163,9 @@ while [ $# -ne 0 ]; do append_cache_entry ENABLE_PERFTOOLS BOOL true append_cache_entry ENABLE_PERFTOOLS_DEBUG BOOL true ;; + --enable-jemalloc) + append_cache_entry ENABLE_JEMALLOC BOOL true + ;; --disable-broccoli) append_cache_entry INSTALL_BROCCOLI BOOL false ;; @@ -214,6 +220,9 @@ while [ $# -ne 0 ]; do --with-perftools=*) append_cache_entry GooglePerftools_ROOT_DIR PATH $optarg ;; + --with-jemalloc=*) + append_cache_entry JeMalloc_ROOT_DIR PATH $optarg + ;; --with-python=*) append_cache_entry PYTHON_EXECUTABLE PATH $optarg ;;