diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt index 5686a0c5d..4a3214d75 100644 --- a/extdep/CMakeLists.txt +++ b/extdep/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.8) include(ExternalProject) - # all dependencies will be installed into this directory, separated by platform string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") @@ -14,6 +13,8 @@ include(jsoncpp.cmake) include(argtable2.cmake) include(json-rpc-cpp.cmake) include(cryptopp.cmake) +include(snappy.cmake) +include(leveldb.cmake) # will be re-eanbled later # include(curl.cmake) diff --git a/extdep/leveldb.cmake b/extdep/leveldb.cmake new file mode 100644 index 000000000..82d9f5a05 --- /dev/null +++ b/extdep/leveldb.cmake @@ -0,0 +1,22 @@ +if(APPLE) +ExternalProject_Add(leveldb + DEPENDS snappy + URL https://leveldb.googlecode.com/files/leveldb-1.15.0.tar.gz + BINARY_DIR leveldb-prefix/src/leveldb + CONFIGURE_COMMAND patch < ${CMAKE_CURRENT_SOURCE_DIR}/leveldb_osx.patch + BUILD_COMMAND export ETH_DEPENDENCY_INSTALL_DIR=${ETH_DEPENDENCY_INSTALL_DIR} && make -j 3 + INSTALL_COMMAND cp -rf include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include/ && mv libleveldb.a ${ETH_DEPENDENCY_INSTALL_DIR}/lib && mv libleveldb.dylib.1.15 ${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib + ) +elseif(WIN32) +ExternalProject_Add(leveldb + GIT_REPOSITORY https://code.google.com/p/leveldb + GIT_TAG windows + BINARY_DIR leveldb-prefix/src/leveldb + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + ) +else() + +endif() + diff --git a/extdep/leveldb_osx.patch b/extdep/leveldb_osx.patch new file mode 100644 index 000000000..ac9e8f528 --- /dev/null +++ b/extdep/leveldb_osx.patch @@ -0,0 +1,18 @@ +--- Makefile 2014-11-07 00:54:05.000000000 +0100 ++++ MakefilePatch 2014-11-07 00:56:59.000000000 +0100 +@@ -17,11 +17,11 @@ + # this file is generated by the previous line to set build flags and sources + include build_config.mk + +-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) +-CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) ++CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) ++CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -DSNAPPY -I$(ETH_DEPENDENCY_INSTALL_DIR)/include + +-LDFLAGS += $(PLATFORM_LDFLAGS) +-LIBS += $(PLATFORM_LIBS) ++LDFLAGS += $(PLATFORM_LDFLAGS) -L$(ETH_DEPENDENCY_INSTALL_DIR)/lib ++LIBS += $(PLATFORM_LIBS) -lsnappy + + LIBOBJECTS = $(SOURCES:.cc=.o) + MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o) diff --git a/extdep/snappy.cmake b/extdep/snappy.cmake new file mode 100644 index 000000000..a15418304 --- /dev/null +++ b/extdep/snappy.cmake @@ -0,0 +1,14 @@ +if(APPLE) +ExternalProject_Add(snappy + URL https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz + BINARY_DIR snappy-prefix/src/snappy + CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${ETH_DEPENDENCY_INSTALL_DIR} + BUILD_COMMAND "" + INSTALL_COMMAND make install + ) +elseif(WIN32) + +else() + +endif() +