Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
Add Miniupnp submodule
Browse files Browse the repository at this point in the history
Drop miniupnp and unbound depends builds. Make sure that build variables are propageted properly to unbound and miniupnp.
Rebase to after the v0.12 release
  • Loading branch information
TheCharlatan authored and wowario committed Sep 26, 2018
1 parent dfe5f94 commit 427e74c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 55 deletions.
3 changes: 2 additions & 1 deletion cmake/FindPCSC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCSC DEFAULT_MSG PCSC_LIBRARY PCSC_INCLUDE_DIR

IF(PCSC_FOUND)
SET( PCSC_LIBRARIES ${PCSC_LIBRARY} )
SET(PCSC_STATIC_LIBRARIES ${PCSC_STATIC_LIBRARY})
ELSE(PCSC_FOUND)
SET( PCSC_LIBRARIES )
ENDIF(PCSC_FOUND)

MARK_AS_ADVANCED( PCSC_LIBRARY PCSC_INCLUDE_DIR )
MARK_AS_ADVANCED( PCSC_LIBRARY PCSC_INCLUDE_DIR PCSC_STATIC_LIBRARY)
12 changes: 0 additions & 12 deletions contrib/depends/packages/cppzmq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,7 @@ $(package)_file_name=v$($(package)_version).tar.gz
$(package)_sha256_hash=3e6b57bf49115f4ae893b1ff7848ead7267013087dc7be1ab27636a97144d373
$(package)_dependencies=zeromq

define $(package)_config_cmds
echo $(build_pefix) &&\
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix)/../ -DCMAKE_PREFIX_PATH=$(build_prefix)/../include -DZeroMQ_STATIC_LIBRARY=$(build_prefix)/lib -DPC_LIBZMQ_LIBDIR=$(build_prefix)/lib -DPC_LIBZMQ_LIBRARY_DIRS=$(build_prefix)/lib CMakeLists.txt
endef

define $(package)_build_cmds
$(MAKE)
endef

define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) &&\
echo $(host_prefix)/include/ &&\
echo $($(package)_staging_prefix_dir) &&\
mkdir $($(package)_staging_prefix_dir)/include &&\
cp zmq.hpp $($(package)_staging_prefix_dir)/include
endef
Expand Down
8 changes: 2 additions & 6 deletions contrib/depends/packages/packages.mk
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
packages:=boost openssl libevent zeromq cppzmq zlib expat ldns unbound cppzmq readline libiconv
packages:=boost openssl libevent zeromq cppzmq zlib expat ldns cppzmq readline libiconv
native_packages := native_ccache

wallet_packages=bdb

upnp_packages=miniupnpc

darwin_native_packages = native_biplist native_ds_store native_mac_alias

ifeq ($(host_os),linux)
packages += pcsc-lite
packages += unwind
endif
ifeq ($(host_os),darwin11)
package += unwind
endif
ifeq ($(host_os),mingw32)
packages += icu4c
endif
Expand Down
2 changes: 1 addition & 1 deletion contrib/depends/packages/pcsc-lite.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define $(package)_set_vars
$(package)_build_opts=CC="$($(package)_cc)"
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
$(package)_config_opts=--prefix=$(host_prefix)
$(package)_config_opts_release=--disable-debug-mode --disable-libsystemd --enable-static
$(package)_config_opts_release=--disable-debug-mode --disable-libsystemd --disable-libudev --enable-static --disable-shared --disable-libusb
$(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC"
endef

Expand Down
7 changes: 3 additions & 4 deletions contrib/depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ SET(LIBUNWIND_INCLUDE_DIR @prefix@/include)
SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a)
SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib)

SET(UNBOUND_INCLUDE_DIR @prefix@/include)
SET(UNBOUND_LIBRARIES @prefix@/lib)
SET(UNBOUND_LIBRARY @prefix@/lib/libunbound.a)
#SET(UNBOUND_INCLUDE_DIR @prefix@/include)
#SET(UNBOUND_LIBRARIES @prefix@/lib)
#SET(UNBOUND_LIBRARY @prefix@/lib/libunbound.a)

SET(ZMQ_INCLUDE_PATH @prefix@/include)
SET(ZMQ_LIB @prefix@/lib/libzmq.a)
Expand All @@ -28,7 +28,6 @@ SET(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT ON)
SET(BOOST_IGNORE_SYSTEM_PATH ON)
SET(BOOST_ROOT @prefix@)
SET(BOOST_LIBRARYDIR @prefix@/lib)
SET(Boost_COMPILER "-clang")
SET(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT OFF)
SET(Boost_NO_SYSTEM_PATHS TRUE)
SET(Boost_USE_STATIC_LIBS TRUE)
Expand Down
44 changes: 13 additions & 31 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@

find_package(Miniupnpc REQUIRED)

if(DEPENDS)
message(STATUS "Using static depends miniupnpc found at ${MINIUPNP_LIBRARIES}")
set(UPNP_STATIC true PARENT_SCOPE)
set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE)
else()
message(STATUS "Using in-tree miniupnpc")
add_subdirectory(miniupnp/miniupnpc)
set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
endif()
message(STATUS "Using in-tree miniupnpc")
add_subdirectory(miniupnp/miniupnpc)
set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external")
if(MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
elseif(NOT MSVC AND NOT DEPENDS)
elseif(NOT MSVC)
set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
Expand All @@ -59,7 +53,7 @@ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE)

find_package(Unbound)

if(NOT UNBOUND_INCLUDE_DIR OR STATIC AND NOT DEPENDS)
if(NOT UNBOUND_INCLUDE_DIR OR STATIC)
# NOTE: If STATIC is true, CMAKE_FIND_LIBRARY_SUFFIXES has been reordered.
# unbound has config tests which used OpenSSL libraries, so -ldl may need to
# be set in this case.
Expand All @@ -72,27 +66,15 @@ if(NOT UNBOUND_INCLUDE_DIR OR STATIC AND NOT DEPENDS)
set(UNBOUND_LIBRARY "unbound" PARENT_SCOPE)
set(UNBOUND_LIBRARY_DIRS "${LIBEVENT2_LIBDIR}" PARENT_SCOPE)
else()
if(DEPENDS)
message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
if(UNBOUND_LIBRARIES)
message(STATUS "Found libunbound library in ${UNBOUND_LIBRARIES}")
set(UNBOUND_STATIC true PARENT_SCOPE)
set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENTSCOPE)
set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
else()
die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
endif()
message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
if(UNBOUND_LIBRARIES)
message(STATUS "Found libunbound shared library")
set(UNBOUND_STATIC false PARENT_SCOPE)
set(UNBOUND_INCLUDE ${UNBOUND_INCLUDE_DIR} PARENT_SCOPE)
set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENT_SCOPE)
set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
else()
message(STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}")
if(UNBOUND_LIBRARIES)
message(STATUS "Found libunbound shared library")
set(UNBOUND_STATIC false PARENT_SCOPE)
set(UNBOUND_INCLUDE ${UNBOUND_INCLUDE_DIR} PARENT_SCOPE)
set(UNBOUND_LIBRARY ${UNBOUND_LIBRARIES} PARENT_SCOPE)
set(UNBOUND_LIBRARY_DIRS "" PARENT_SCOPE)
else()
die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
endif()
die("Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent")
endif()
endif()

Expand Down

0 comments on commit 427e74c

Please sign in to comment.