Browse Source

leveldb precompiled dylib is working!

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
aafd5c8d9a
  1. 3
      extdep/CMakeLists.txt
  2. 15
      extdep/eth_download.cmake
  3. 12
      extdep/scripts/leveldb_osx.sh

3
extdep/CMakeLists.txt

@ -36,7 +36,8 @@ else()
eth_download(cryptopp)
eth_download(snappy
OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snappy_osx.sh)
eth_download(leveldb)
eth_download(leveldb
OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/leveldb_osx.sh)
#include(compile/leveldb.cmake)
#eth_download("leveldb")

15
extdep/eth_download.cmake

@ -8,6 +8,16 @@
# eth_download("json-rpc-cpp")
# eth_download("json-rpc-cpp" VERSION "0.3.2")
#
# params:
# VERSION - exact version we want to use
# OSX_SCRIPT - script which will be executed on apple in install phase
# UNIX_SCRIPT - script which will be executed on unix in install phase
# WIN_SCRIPT - script which will be executed on win in install phase
# OSX_SCRIPT, WIN_SCRIPT, UNIX_SCRIPT are taking 2 params:
# $1 is package_source,
# $2 is ETH_DEPENDENCY_INSTALL_DIR
#
# parsing arguments
# http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html
#
@ -47,7 +57,8 @@ macro(eth_download eth_package_name)
endif()
if (eth_package_install)
message(STATUS "install script is at: ${eth_package_install}")
message(STATUS "install script: ${eth_package_install}")
set (eth_package_install ${eth_package_install} . ${ETH_DEPENDENCY_INSTALL_DIR})
else ()
set (eth_package_install echo 0) # cause empty string is not handled properly
endif()
@ -57,7 +68,7 @@ macro(eth_download eth_package_name)
BINARY_DIR ${eth_package_name}-prefix/src/${eth_package_name}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${eth_package_copy}
INSTALL_COMMAND ${eth_package_install} . ${ETH_DEPENDENCY_INSTALL_DIR}
INSTALL_COMMAND ${eth_package_install}
)
endmacro()

12
extdep/scripts/leveldb_osx.sh

@ -0,0 +1,12 @@
#!/bin/bash
ETH_DEPENDENCY_SOURCE_DIR=$1
ETH_DEPENDENCY_INSTALL_DIR=$2
OLD_SNAPPY_DYLIB="/Users/marekkotewicz/ethereum/cpp-ethereum/extdep/install/darwin/lib/libsnappy.1.dylib"
SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib
LEVELDB_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib
install_name_tool -id ${LEVELDB_DYLIB} ${LEVELDB_DYLIB}
install_name_tool -change ${OLD_SNAPPY_DYLIB} ${SNAPPY_DYLIB} ${LEVELDB_DYLIB}
Loading…
Cancel
Save