Skip to content

Commit

Permalink
CMake: Added leveldb library to 3rdparty external builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatch01 authored and jmlvanre committed Mar 2, 2016
1 parent 2de2e57 commit 312ad65
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 4 deletions.
21 changes: 21 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ set(UPSTREAM_URL ${3RDPARTY_DEPENDENCIES})
set(REBUNDLED_DIR ${CMAKE_CURRENT_SOURCE_DIR})

if (REBUNDLED)
set(LEVELDB_URL ${REBUNDLED_DIR}/leveldb-${LEVELDB_VERSION}.tar.gz)
set(ZOOKEEPER_URL ${REBUNDLED_DIR}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
else (REBUNDLED)
set(LEVELDB_URL ${UPSTREAM_URL}/leveldb-${LEVELDB_VERSION}.tar.gz)
set(ZOOKEEPER_URL ${UPSTREAM_URL}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz)
endif (REBUNDLED)

Expand Down Expand Up @@ -80,3 +82,22 @@ ExternalProject_Add(
INSTALL_COMMAND ${ZOOKEEPER_INSTALL_CMD}
URL ${ZOOKEEPER_URL}
)

if (NOT WIN32)
set(LEVELDB_CONFIG_CMD cd ${LEVELDB_ROOT} && ./configure --prefix=${LEVELDB_ROOT}-lib)
set(LEVELDB_BUILD_CMD cd ${LEVELDB_ROOT} && make)
set(LEVELDB_INSTALL_CMD cd ${LEVELDB_ROOT} && make install)
PATCH_CMD(
${MESOS_3RDPARTY_SRC}/leveldb-${LEVELDB_VERSION}.patch
LEVELDB_PATCH_CMD)

ExternalProject_Add(
${LEVELDB_TARGET}
PREFIX ${LEVELDB_TARGET}
PATCH_COMMAND ${LEVELDB_PATCH_CMD}
CONFIGURE_COMMAND ${CMAKE_NOOP}
BUILD_COMMAND ${LEVELDB_BUILD_CMD}
INSTALL_COMMAND ${CMAKE_NOOP}
URL ${LEVELDB_URL}
)
endif (NOT WIN32)
2 changes: 1 addition & 1 deletion 3rdparty/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CONFIGURE_ARGS = @CONFIGURE_ARGS@ --enable-shared=no --with-pic --srcdir=.
include versions.am

DISTRIBUTE = distribute-$(DISTRIBUTE_VERSION)
LEVELDB = leveldb
LEVELDB = leveldb-$(LEVELDB_VERSION)
PIP = pip-$(PIP_VERSION)
WHEEL = wheel-$(WHEEL_VERSION)
ZOOKEEPER = zookeeper-$(ZOOKEEPER_VERSION)
Expand Down
3 changes: 3 additions & 0 deletions 3rdparty/cmake/Mesos3rdpartyConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)

if (NOT WIN32)
EXTERNAL("leveldb" ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
EXTERNAL("zookeeper" ${ZOOKEEPER_VERSION} "${MESOS_3RDPARTY_BIN}")
elseif (WIN32)
# The latest release of ZK, 3.4.7, does not compile on Windows. Therefore, we
Expand All @@ -32,6 +33,7 @@ set(ZOOKEEPER_C_ROOT ${ZOOKEEPER_ROOT}/src/c)
set(ZOOKEEPER_LIB ${ZOOKEEPER_ROOT}/src/c)

# Convenience variables for include directories of third-party dependencies.
set(LEVELDB_INCLUDE_DIR ${LEVELDB_ROOT}/include)
set(ZOOKEEPER_INCLUDE_GENDIR ${ZOOKEEPER_C_ROOT}/generated)
set(ZOOKEEPER_INCLUDE_DIR ${ZOOKEEPER_C_ROOT}/include)

Expand All @@ -45,6 +47,7 @@ endif (NOT WIN32)
# Convenience variables for "lflags", the symbols we pass to CMake to generate
# things like `-L/path/to/glog` or `-lglog`.
if (NOT WIN32)
set(LEVELDB_LFLAG ${LEVELDB_ROOT}/libleveldb.a)
set(ZOOKEEPER_LFLAG ${ZOOKEEPER_LIB}/lib/libzookeeper_mt.a)
else (NOT WIN32)
set(ZOOKEEPER_LFLAG zookeeper)
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/cmake/Versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(CURL_VERSION "7.43.0")
set(GLOG_VERSION "0.3.3")
set(GMOCK_VERSION "1.7.0")
set(HTTP_PARSER_VERSION "1c3624a")
set(LEVELDB_VERSION "1.4")
set(LIBAPR_VERSION "1.5.2")
set(LIBEV_VERSION "4.15")
# TODO(hausdorff): (MESOS-3529) transition this back to a non-beta version.
Expand Down
File renamed without changes.
Binary file added 3rdparty/leveldb-1.4.tar.gz
Binary file not shown.
Binary file removed 3rdparty/leveldb.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions 3rdparty/versions.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# still need to update version numbers in src/python/setup.py.in too!

DISTRIBUTE_VERSION = 0.6.26
LEVELDB_VERSION = 1.4
PIP_VERSION = 7.1.2
WHEEL_VERSION = 0.24.0
ZOOKEEPER_VERSION = 3.4.5
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


======================================================================
For leveldb (3rdparty/leveldb.tar.gz):
For leveldb (3rdparty/leveldb-1.4.tar.gz):
======================================================================

Copyright (c) 2011 The LevelDB Authors. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include ../3rdparty/libprocess/3rdparty/versions.am
DISTRIBUTE = 3rdparty/distribute-$(DISTRIBUTE_VERSION)
PIP = 3rdparty/pip-$(PIP_VERSION)
WHEEL = 3rdparty/wheel-$(WHEEL_VERSION)
LEVELDB = 3rdparty/leveldb
LEVELDB = 3rdparty/leveldb-$(LEVELDB_VERSION)
ZOOKEEPER = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/src/c
ZOOKEEPER_JAR = 3rdparty/zookeeper-$(ZOOKEEPER_VERSION)/zookeeper-$(ZOOKEEPER_VERSION).jar
LIBPROCESS = 3rdparty/libprocess
Expand Down
2 changes: 1 addition & 1 deletion src/python/native/ext_modules.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abs_top_builddir = '@abs_top_builddir@'
src_python_native = os.path.join(
'src', 'python', 'native', 'src', 'mesos', 'native')

leveldb = os.path.join('3rdparty', 'leveldb')
leveldb = os.path.join('3rdparty', 'leveldb-1.4')
zookeeper = os.path.join('3rdparty', 'zookeeper-3.4.5', 'src', 'c')
libprocess = os.path.join('3rdparty', 'libprocess')

Expand Down
3 changes: 3 additions & 0 deletions src/slave/cmake/SlaveConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(AGENT_DEPENDENCIES
${PROCESS_DEPENDENCIES}
${PROCESS_TARGET}
${ZOOKEEPER_TARGET}
${LEVELDB_TARGET}
make_bin_include_dir
make_bin_src_dir
)
Expand All @@ -48,6 +49,7 @@ set(AGENT_INCLUDE_DIRS
${PROCESS_INCLUDE_DIRS}
${ZOOKEEPER_INCLUDE_DIR}
${ZOOKEEPER_INCLUDE_GENDIR}
${LEVELDB_INCLUDE_DIR}
)

# Define third-party lib install directories. Used to tell the compiler
Expand All @@ -73,6 +75,7 @@ set(AGENT_LIBS
if (NOT WIN32)
set(AGENT_LIBS
${AGENT_LIBS}
${LEVELDB_LFLAG}
${SASL_LFLAG}
)
endif (NOT WIN32)
Expand Down

0 comments on commit 312ad65

Please sign in to comment.