This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUILD: add boost library and jemalloc
[Summary] 1. add extra/boost/boost_1_59_0.tar.gz 2. add jemalloc(4.2.1): revision 3de0353 from https://github.com/jemalloc/jemalloc
- Loading branch information
Showing
202 changed files
with
69,753 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
INCLUDE(ExternalProject) | ||
|
||
MACRO (USE_BUNDLED_JEMALLOC) | ||
SET(SOURCE_DIR "${CMAKE_SOURCE_DIR}/extra/jemalloc") | ||
SET(BINARY_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/extra/jemalloc/build") | ||
SET(LIBJEMALLOC "libjemalloc") | ||
SET(JEMALLOC_CONFIGURE_OPTS "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" "--with-private-namespace=jemalloc_internal_" "--enable-cc-silence") | ||
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT APPLE) # see the comment in CMakeLists.txt | ||
LIST(APPEND JEMALLOC_CONFIGURE_OPTS --enable-debug) | ||
ENDIF() | ||
|
||
IF(CMAKE_GENERATOR MATCHES "Makefiles") | ||
SET(MAKE_COMMAND ${CMAKE_MAKE_PROGRAM}) | ||
ELSE() # Xcode/Ninja generators | ||
SET(MAKE_COMMAND make) | ||
ENDIF() | ||
|
||
ExternalProject_Add(jemalloc | ||
PREFIX extra/jemalloc | ||
SOURCE_DIR ${SOURCE_DIR} | ||
BINARY_DIR ${BINARY_DIR} | ||
STAMP_DIR ${BINARY_DIR} | ||
CONFIGURE_COMMAND "${SOURCE_DIR}/configure" ${JEMALLOC_CONFIGURE_OPTS} | ||
BUILD_COMMAND ${MAKE_COMMAND} "build_lib_static" | ||
INSTALL_COMMAND "" | ||
) | ||
ADD_LIBRARY(libjemalloc STATIC IMPORTED) | ||
SET_TARGET_PROPERTIES(libjemalloc PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/lib/libjemalloc_pic.a") | ||
ADD_DEPENDENCIES(libjemalloc jemalloc) | ||
ENDMACRO() | ||
|
||
IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR APPLE) | ||
# Linux and OSX are the only systems where bundled jemalloc can be built without problems, | ||
# as they both have GNU make and jemalloc actually compiles. | ||
# Also, BSDs use jemalloc as malloc already | ||
SET(WITH_JEMALLOC_DEFAULT "yes") | ||
ELSE() | ||
SET(WITH_JEMALLOC_DEFAULT "no") | ||
ENDIF() | ||
|
||
SET(WITH_JEMALLOC ${WITH_JEMALLOC_DEFAULT} CACHE STRING | ||
"Which jemalloc to use. Possible values are 'no', 'bundled', 'system', 'yes' (system if possible, otherwise bundled)") | ||
|
||
MACRO (CHECK_JEMALLOC) | ||
IF(WITH_JEMALLOC STREQUAL "system" OR WITH_JEMALLOC STREQUAL "yes") | ||
CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC) | ||
IF (HAVE_JEMALLOC) | ||
SET(LIBJEMALLOC jemalloc) | ||
SET(MALLOC_LIBRARY "system jemalloc") | ||
ELSEIF (WITH_JEMALLOC STREQUAL "system") | ||
MESSAGE(FATAL_ERROR "system jemalloc is not found") | ||
ELSEIF (WITH_JEMALLOC STREQUAL "yes") | ||
SET(trybundled 1) | ||
ENDIF() | ||
ENDIF() | ||
IF(WITH_JEMALLOC STREQUAL "bundled" OR trybundled) | ||
USE_BUNDLED_JEMALLOC() | ||
SET(MALLOC_LIBRARY "bundled jemalloc") | ||
ENDIF() | ||
ENDMACRO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Download from: | ||
http://jenkins.percona.com/downloads/boost/boost_1_59_0.tar.gz | ||
|
||
md5sum: | ||
51528a0e3b33d9e10aaa311d9eb451e3 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Unless otherwise specified, files in the jemalloc source distribution are | ||
subject to the following license: | ||
-------------------------------------------------------------------------------- | ||
Copyright (C) 2002-2016 Jason Evans <jasone@canonware.com>. | ||
All rights reserved. | ||
Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved. | ||
Copyright (C) 2009-2016 Facebook, Inc. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice(s), | ||
this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice(s), | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS | ||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
-------------------------------------------------------------------------------- |
Oops, something went wrong.