Merge branch 'beta' into mergemaster

# Conflicts:
#	src/main.cpp
This commit is contained in:
jl777
2018-04-16 10:16:01 +03:00
parent 9226f69ef1
commit e73b2055c6
910 changed files with 112009 additions and 11364 deletions

View File

@@ -74,9 +74,9 @@ include packages/packages.mk
rust_packages_$(NO_RUST) = $(rust_packages)
wallet_packages_$(NO_WALLET) = $(wallet_packages)
upnp_packages_$(NO_UPNP) = $(upnp_packages)
proton_packages_$(NO_PROTON) = $(proton_packages)
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(rust_packages_) $(wallet_packages_) $(upnp_packages_)
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(rust_packages_) $(proton_packages_) $(wallet_packages_)
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
all_packages = $(packages) $(native_packages)
@@ -113,7 +113,6 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
-e 's|@no_wallet@|$(NO_WALLET)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \
-e 's|@debug@|$(DEBUG)|' \
$< > $@
$(AT)touch $@

View File

@@ -33,9 +33,8 @@ The following can be set when running make: make FOO=bar
SOURCES_PATH: downloaded sources will be placed here
BASE_CACHE: built packages will be placed here
SDK_PATH: Path where sdk's can be found (used by OSX)
FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up
PRIORITY_DOWNLOAD_PATH: Try fetching source files from here before using their own URLs
NO_WALLET: Don't download/build/cache libs needed to enable the wallet
NO_UPNP: Don't download/build/cache packages needed for enabling upnp
DEBUG: disable some optimizations and enable more runtime checking
If some packages are not built, for example `make NO_WALLET=1`, the appropriate

View File

@@ -7,11 +7,19 @@ build_darwin_OTOOL: = $(shell xcrun -f otool)
build_darwin_NM: = $(shell xcrun -f nm)
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
build_darwin_SHA256SUM = shasum -a 256
build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o
#<<<<<<< HEAD
##build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o
#darwin host on darwin builder. overrides darwin host preferences.
darwin_CC= gcc-5
darwin_CXX= g++-5
#darwin_CC= gcc-5
#darwin_CXX= g++-5
#=======
build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
#darwin host on darwin builder. overrides darwin host preferences.
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++
#>>>>>>> zcash/master
darwin_AR:=$(shell xcrun -f ar)
darwin_RANLIB:=$(shell xcrun -f ranlib)
darwin_STRIP:=$(shell xcrun -f strip)

View File

@@ -1,2 +1,2 @@
build_linux_SHA256SUM = sha256sum
build_linux_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O
build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o

View File

@@ -7,20 +7,12 @@ ac_tool_prefix=${host_alias}-
if test -z $with_boost; then
with_boost=$depends_prefix
fi
# Disable comparison utility (#592)
#if test -z $with_comparison_tool; then
# with_comparison_tool=$depends_prefix/native/share/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar
#fi
if test -z $enable_wallet && test -n "@no_wallet@"; then
enable_wallet=no
fi
if test -z $with_miniupnpc && test -n "@no_upnp@"; then
with_miniupnpc=no
fi
if test x@host_os@ = xdarwin; then
BREW=no
PORT=no

View File

@@ -22,7 +22,8 @@ endef
define fetch_file
(test -f $$($(1)_source_dir)/$(4) || \
( mkdir -p $$($(1)_download_dir) && echo Fetching $(1)... && \
( $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" ) && \
( $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(PRIORITY_DOWNLOAD_PATH)/$(4)" || \
$(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" ) && \
echo "$(5) $$($(1)_download_dir)/$(4).temp" > $$($(1)_download_dir)/.$(4).hash && \
$(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \
mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \
@@ -42,6 +43,10 @@ $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_ty
$(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)))
final_build_id_long+=$($(package)_build_id_long)
#override platform specific files and hashes
$(eval $(1)_file_name=$(if $($(1)_file_name_$(host_os)),$($(1)_file_name_$(host_os)),$($(1)_file_name)))
$(eval $(1)_sha256_hash=$(if $($(1)_sha256_hash_$(host_os)),$($(1)_sha256_hash_$(host_os)),$($(1)_sha256_hash)))
#compute package-specific paths
$(1)_build_subdir?=.
$(1)_download_file?=$($(1)_file_name)
@@ -124,9 +129,9 @@ $(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(
$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig
$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH)
$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_build_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_stage_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
ifneq ($($(1)_nm),)

View File

@@ -1,9 +1,15 @@
OSX_MIN_VERSION=10.7
OSX_SDK_VERSION=10.9
OSX_MIN_VERSION=10.8
OSX_SDK_VERSION=10.11
OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk
LD64_VERSION=241.9
darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
#<<<<<<< HEAD
#LD64_VERSION=241.9
#darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
#darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
#=======
LD64_VERSION=253.9
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++
#>>>>>>> zcash/master
darwin_CFLAGS=-pipe
darwin_CXXFLAGS=$(darwin_CFLAGS)

View File

@@ -9,6 +9,12 @@ define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
endef
define $(package)_preprocess_cmds
sed -i.old 's/__atomic_compare_exchange\\(/__atomic_compare_exchange_db(/' src/dbinc/atomic.h && \
sed -i.old 's/atomic_init/atomic_init_db/' src/dbinc/atomic.h src/mp/mp_region.c src/mp/mp_mvcc.c src/mp/mp_fget.c src/mutex/mut_method.c src/mutex/mut_tas.c
endef
define $(package)_config_cmds

View File

@@ -9,7 +9,7 @@ define $(package)_set_vars
$(package)_config_opts_release=variant=release
$(package)_config_opts_debug=variant=debug
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts+=link=static -sNO_BZIP2=1 -sNO_ZLIB=1
$(package)_config_opts_linux=threadapi=pthread runtime-link=shared
$(package)_config_opts_darwin=--toolset=gcc threadapi=pthread runtime-link=shared
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
@@ -21,7 +21,7 @@ $(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_toolset_darwin=gcc
$(package)_archiver_darwin=$($(package)_ar)
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
$(package)_cxxflags=-fvisibility=hidden
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
endef

View File

@@ -4,7 +4,7 @@ package=googlemock
$(package)_version=1.7.0
$(package)_dependencies=googletest
$(package)_download_path=https://github.com/google/$(package)/archive/
$(package)_download_path=https://github.com/google/$(package)/archive
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_sha256_hash=3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232

View File

@@ -1,9 +1,9 @@
package=googletest
$(package)_version=1.7.0
$(package)_version=1.8.0
$(package)_download_path=https://github.com/google/$(package)/archive/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_sha256_hash=f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc
$(package)_sha256_hash=58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8
ifeq ($(build_os),darwin)
define $(package)_set_vars
@@ -19,11 +19,15 @@ endef
else
$(package)_install=install
define $(package)_build_cmds
$(MAKE) -C make CXXFLAGS=-fPIC gtest.a
$(MAKE) -C googlemock/make CXXFLAGS=-fPIC gmock.a && \
$(MAKE) -C googletest/make CXXFLAGS=-fPIC gtest.a
endef
endif
define $(package)_stage_cmds
$($(package)_install) -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \
cp -a ./include $($(package)_staging_dir)$(host_prefix)/include
mkdir -p $($(package)_staging_dir)$(host_prefix)/lib && \
install ./googlemock/make/gmock.a $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \
install ./googletest/make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \
cp -a ./googlemock/include $($(package)_staging_dir)$(host_prefix)/ && \
cp -a ./googletest/include $($(package)_staging_dir)$(host_prefix)/
endef

View File

@@ -1,6 +1,6 @@
package=libsnark
$(package)_version=0.1
$(package)_download_path=https://supernetorg.bintray.com/misc/
$(package)_download_path=https://supernetorg.bintray.com/misc
$(package)_file_name=$(package)-$($(package)_git_commit).tar.gz
$(package)_download_file=$(package)-$($(package)_git_commit).tar.gz
$(package)_sha256_hash=47478adc2ae88c448dc736d59dfe007de6478e41e88d2d4d2ff4135a17ee6f90

View File

@@ -1,8 +1,15 @@
package=libsodium
$(package)_version=1.0.11
$(package)_download_path=https://supernetorg.bintray.com/misc
$(package)_file_name=libsodium-1.0.11.tar.gz
$(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765
#<<<<<<< HEAD
#$(package)_version=1.0.11
#$(package)_download_path=https://supernetorg.bintray.com/misc
#$(package)_file_name=libsodium-1.0.11.tar.gz
#$(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765
#=======
$(package)_version=1.0.15
$(package)_download_path=https://download.libsodium.org/libsodium/releases/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=fb6a9e879a2f674592e4328c5d9f79f082405ee4bb05cb6e679b90afe9e178f4
#>>>>>>> zcash/master
$(package)_dependencies=
$(package)_config_opts=

View File

@@ -1,32 +0,0 @@
package=miniupnpc
$(package)_version=2.0
$(package)_download_path=http://miniupnp.free.fr/files
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=d434ceb8986efbe199c5ca53f90ed53eab290b1e6d0530b717eb6fa49d61f93b
$(package)_patches=fix-solaris-compilation.patch strlen-before-memcmp.patch patch-strlen-patch.patch
define $(package)_set_vars
$(package)_build_opts=CC="$($(package)_cc)"
$(package)_build_opts_darwin=OS=Darwin
$(package)_build_opts_mingw32=-f Makefile.mingw
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
endef
define $(package)_preprocess_cmds
mkdir dll && \
sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \
sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw && \
patch -p2 < $($(package)_patch_dir)/fix-solaris-compilation.patch && \
patch -p2 < $($(package)_patch_dir)/strlen-before-memcmp.patch && \
patch -p2 < $($(package)_patch_dir)/patch-strlen-patch.patch
endef
define $(package)_build_cmds
$(MAKE) libminiupnpc.a $($(package)_build_opts)
endef
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\
install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
install libminiupnpc.a $($(package)_staging_prefix_dir)/lib
endef

View File

@@ -85,6 +85,7 @@ $(package)_config_opts_arm_linux=linux-generic32
$(package)_config_opts_aarch64_linux=linux-generic64
$(package)_config_opts_mipsel_linux=linux-generic32
$(package)_config_opts_mips_linux=linux-generic32
$(package)_config_opts_powerpc_linux=linux-generic32
$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc
$(package)_config_opts_x86_64_mingw32=mingw64
$(package)_config_opts_i686_mingw32=mingw

View File

@@ -1,15 +1,13 @@
rust_packages := rust librustzcash
zcash_packages := libsnark libgmp libsodium
proton_packages := proton
zcash_packages := libgmp libsodium
ifeq ($(host_os),linux)
packages := boost openssl libevent zeromq $(zcash_packages) googletest googlemock
packages := boost openssl libevent zeromq $(zcash_packages) googletest #googlemock
else
packages := boost openssl libevent zeromq $(zcash_packages) googletest googlemock libcurl
packages := boost openssl libevent zeromq $(zcash_packages) libcurl googletest #googlemock
endif
native_packages := native_ccache
wallet_packages=bdb
upnp_packages=miniupnpc

View File

@@ -0,0 +1,24 @@
package=proton
$(package)_version=0.17.0
$(package)_download_path=http://apache.cs.utah.edu/qpid/proton/$($(package)_version)
$(package)_file_name=qpid-proton-$($(package)_version).tar.gz
$(package)_sha256_hash=6ffd26d3d0e495bfdb5d9fefc5349954e6105ea18cc4bb191161d27742c5a01a
$(package)_patches=minimal-build.patch
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/minimal-build.patch && \
mkdir -p build/proton-c/src
endef
define $(package)_config_cmds
cd build; cmake .. -DCMAKE_CXX_STANDARD=11 -DCMAKE_INSTALL_PREFIX=/ -DSYSINSTALL_BINDINGS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_PYTHON=OFF -DBUILD_PHP=OFF -DBUILD_JAVA=OFF -DBUILD_PERL=OFF -DBUILD_RUBY=OFF -DBUILD_JAVASCRIPT=OFF -DBUILD_GO=OFF
endef
define $(package)_build_cmds
cd build; $(MAKE) VERBOSE=1
endef
define $(package)_stage_cmds
cd build; $(MAKE) VERBOSE=1 DESTDIR=$($(package)_staging_prefix_dir) install
endef

View File

@@ -1,16 +1,23 @@
package=rust
$(package)_version=1.16.0
$(package)_download_path=https://static.rust-lang.org/dist
ifeq ($(build_os),darwin)
$(package)_file_name=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
$(package)_sha256_hash=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926
else ifeq ($(host_os),mingw32)
$(package)_file_name=rust-$($(package)_version)-i686-unknown-linux-gnu.tar.gz
$(package)_sha256_hash=b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5
else
$(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd
endif
#<<<<<<< HEAD
#ifeq ($(build_os),darwin)
#$(package)_file_name=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
#$(package)_sha256_hash=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926
#else ifeq ($(host_os),mingw32)
#$(package)_file_name=rust-$($(package)_version)-i686-unknown-linux-gnu.tar.gz
#$(package)_sha256_hash=b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5
#else
#$(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
#$(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd
#endif
#=======
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
$(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926
#>>>>>>> zcash/master
define $(package)_stage_cmds
./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig

View File

@@ -22,6 +22,7 @@ $(package)_sha256_hash=27d1e82a099228ee85a7ddb2260f40830212402c605a4a10b5e5498a7
define $(package)_set_vars
$(package)_config_opts=--without-documentation --disable-shared --disable-curve
$(package)_config_opts_linux=--with-pic
$(package)_cxxflags=-std=c++11
endef
endif

View File

@@ -1,42 +0,0 @@
From 71ce1d6dfa5424f8fe8633e23494c7638ea2c79e Mon Sep 17 00:00:00 2001
From: Thomas Bernard <miniupnp@free.fr>
Date: Thu, 10 Nov 2016 21:55:33 +0100
Subject: [PATCH] fix for Solaris 11 compilation
see #216
---
miniupnpc/Makefile | 2 ++
miniupnpc/minissdpc.c | 3 +++
2 files changed, 5 insertions(+)
diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile
index 5c23000..72cdc0f 100644
--- a/miniupnpc/Makefile
+++ b/miniupnpc/Makefile
@@ -43,10 +43,12 @@ CFLAGS += -D_NETBSD_SOURCE
endif
ifneq ($(OS), FreeBSD)
ifneq ($(OS), Darwin)
+ifneq ($(OS), SunOS)
#CFLAGS += -D_POSIX_C_SOURCE=200112L
CFLAGS += -D_XOPEN_SOURCE=600
endif
endif
+endif
#CFLAGS += -ansi
# -DNO_GETADDRINFO
INSTALL = install
diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c
index f200f07..263160e 100644
--- a/miniupnpc/minissdpc.c
+++ b/miniupnpc/minissdpc.c
@@ -73,6 +73,9 @@ struct sockaddr_un {
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
#include <sys/ioctl.h>
+#if defined(__sun)
+#include <sys/sockio.h>
+#endif
#endif
#if defined(HAS_IP_MREQN) && defined(NEED_STRUCT_IP_MREQN)

View File

@@ -1,22 +0,0 @@
From 0aa7c46227acd8ddb135c577674ad454bf2fba86 Mon Sep 17 00:00:00 2001
From: Thomas Bernard <miniupnp@free.fr>
Date: Fri, 11 Nov 2016 17:53:21 +0100
Subject: [PATCH] remove unsigned/signed comparison
---
miniupnpc/portlistingparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c
index 1bed763..07f3f87 100644
--- a/miniupnpc/portlistingparse.c
+++ b/miniupnpc/portlistingparse.c
@@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l)
pdata->curelt = PortMappingEltNone;
for(i = 0; elements[i].str; i++)
{
- if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0)
+ if(strlen(elements[i].str) == (size_t)l && memcmp(name, elements[i].str, l) == 0)
{
pdata->curelt = elements[i].code;
break;

View File

@@ -1,23 +0,0 @@
From ec1c49bb0cd5e448e6f0adee7de3a831c4869bdd Mon Sep 17 00:00:00 2001
From: Thomas Bernard <miniupnp@free.fr>
Date: Fri, 11 Nov 2016 17:24:39 +0100
Subject: [PATCH] check strlen before memcmp
1st try to fix #220
---
miniupnpc/portlistingparse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c
index 0e09278..1bed763 100644
--- a/miniupnpc/portlistingparse.c
+++ b/miniupnpc/portlistingparse.c
@@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l)
pdata->curelt = PortMappingEltNone;
for(i = 0; elements[i].str; i++)
{
- if(memcmp(name, elements[i].str, l) == 0)
+ if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0)
{
pdata->curelt = elements[i].code;
break;

View File

@@ -0,0 +1,288 @@
From 03f5fc0826115edbfca468261b70c0daf627f488 Mon Sep 17 00:00:00 2001
From: Simon <simon@bitcartel.com>
Date: Thu, 27 Apr 2017 17:15:59 -0700
Subject: [PATCH] Enable C++11, build static library and cpp bindings with minimal dependencies.
---
CMakeLists.txt | 13 +++++++------
examples/cpp/CMakeLists.txt | 1 +
proton-c/CMakeLists.txt | 32 +++++++++++++++----------------
proton-c/bindings/CMakeLists.txt | 6 +++---
proton-c/bindings/cpp/CMakeLists.txt | 24 +++++++++++------------
proton-c/bindings/cpp/docs/CMakeLists.txt | 2 +-
proton-c/docs/api/CMakeLists.txt | 2 +-
7 files changed, 41 insertions(+), 39 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b538ffd..4a5e787 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,14 +18,15 @@
#
cmake_minimum_required (VERSION 2.8.7)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
project (Proton C)
# Enable C++ now for examples and bindings subdirectories, but make it optional.
enable_language(CXX OPTIONAL)
# Enable testing
-enable_testing()
-include (CTest)
+#enable_testing()
+#include (CTest)
# Pull in local cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/Modules/")
@@ -141,7 +142,7 @@ set (BINDINGS_DIR ${LIB_INSTALL_DIR}/proton/bindings)
set (SYSINSTALL_BINDINGS OFF CACHE BOOL "If SYSINSTALL_BINDINGS is OFF then proton bindings will be installed underneath ${BINDINGS_DIR} and each user will need to modify their interpreter configuration to load the appropriate binding. If SYSINSTALL_BINDINGS is ON, then each language interpreter will be queried for the appropriate directory and proton bindings will be installed and available system wide with no additional per user configuration.")
-set (BINDING_LANGS PERL PHP PYTHON RUBY)
+#set (BINDING_LANGS PERL PHP PYTHON RUBY)
foreach (LANG ${BINDING_LANGS})
set (SYSINSTALL_${LANG} OFF CACHE BOOL "Install ${LANG} bindings into interpreter specified location.")
@@ -156,10 +157,10 @@ set (PROTON_SHARE ${SHARE_INSTALL_DIR}/proton-${PN_VERSION})
# End of variables used during install
# Check for valgrind here so tests under proton-c/ and examples/ can use it.
-find_program(VALGRIND_EXE valgrind DOC "Location of the valgrind program")
+#find_program(VALGRIND_EXE valgrind DOC "Location of the valgrind program")
mark_as_advanced (VALGRIND_EXE)
-option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON)
+#option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON)
if (ENABLE_VALGRIND)
if (NOT VALGRIND_EXE)
message(STATUS "Can't locate the valgrind command; no run-time error detection")
@@ -171,7 +172,7 @@ if (ENABLE_VALGRIND)
endif (ENABLE_VALGRIND)
add_subdirectory(proton-c)
-add_subdirectory(examples)
+#add_subdirectory(examples)
install (FILES LICENSE README.md
DESTINATION ${PROTON_SHARE})
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 304d899..f4877b4 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -17,6 +17,7 @@
# under the License.
#
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(ProtonCpp REQUIRED)
include_directories(${ProtonCpp_INCLUDE_DIRS})
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 8edb661..dc7b99c 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -22,24 +22,24 @@ include(CheckSymbolExists)
include(soversion.cmake)
-add_custom_target(docs)
-add_custom_target(doc DEPENDS docs)
+#add_custom_target(docs)
+#add_custom_target(doc DEPENDS docs)
# Set the default SSL/TLS implementation
-find_package(OpenSSL)
+#find_package(OpenSSL)
find_package(PythonInterp REQUIRED)
-find_package(SWIG)
+#find_package(SWIG)
# FindSwig.cmake "forgets" make its outputs advanced like a good citizen
mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
# See if Cyrus SASL is available
-find_library(CYRUS_SASL_LIBRARY sasl2)
-find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
-find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
+#find_library(CYRUS_SASL_LIBRARY sasl2)
+#find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
+#find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
# Find saslpasswd2 executable to generate test config
-find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db for testing")
+#find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db for testing")
mark_as_advanced(SASLPASSWD_EXE)
if(WIN32 AND NOT CYGWIN)
@@ -315,8 +315,8 @@ pn_absolute_install_dir(EXEC_PREFIX "." ${CMAKE_INSTALL_PREFIX})
pn_absolute_install_dir(LIBDIR ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX})
pn_absolute_install_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX})
-add_subdirectory(docs/api)
-add_subdirectory(../tests/tools/apps/c ../tests/tools/apps/c)
+#add_subdirectory(docs/api)
+#add_subdirectory(../tests/tools/apps/c ../tests/tools/apps/c)
# for full source distribution:
set (qpid-proton-platform-all
@@ -507,7 +507,7 @@ if (BUILD_WITH_CXX)
endif (BUILD_WITH_CXX)
add_library (
- qpid-proton-core SHARED
+ qpid-proton-core STATIC
${qpid-proton-core}
${qpid-proton-layers}
${qpid-proton-platform}
@@ -527,7 +527,7 @@ set_target_properties (
)
add_library(
- qpid-proton SHARED
+ qpid-proton STATIC
# Proton Core
${qpid-proton-core}
${qpid-proton-layers}
@@ -629,7 +629,7 @@ install (FILES
# c tests:
-add_subdirectory(src/tests)
+#add_subdirectory(src/tests)
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
# No change needed for windows already use correct separator
@@ -712,7 +712,7 @@ if (BUILD_PYTHON)
endif (BUILD_PYTHON)
-find_program(RUBY_EXE "ruby")
+#find_program(RUBY_EXE "ruby")
if (RUBY_EXE AND BUILD_RUBY)
set (rb_root "${pn_test_root}/ruby")
set (rb_src "${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby")
@@ -751,8 +751,8 @@ if (RUBY_EXE AND BUILD_RUBY)
else (DEFAULT_RUBY_TESTING)
message(STATUS "Skipping Ruby tests: missing dependencies")
endif (DEFAULT_RUBY_TESTING)
-else (RUBY_EXE)
- message (STATUS "Cannot find ruby, skipping ruby tests")
+#else (RUBY_EXE)
+# message (STATUS "Cannot find ruby, skipping ruby tests")
endif()
mark_as_advanced (RUBY_EXE RSPEC_EXE)
diff --git a/proton-c/bindings/CMakeLists.txt b/proton-c/bindings/CMakeLists.txt
index 6b88384..d1a50a5 100644
--- a/proton-c/bindings/CMakeLists.txt
+++ b/proton-c/bindings/CMakeLists.txt
@@ -19,14 +19,14 @@
# Add bindings that do not require swig here - the directory name must be the same as the binding name
# See below for swig bindings
-set(BINDINGS javascript cpp go)
+set(BINDINGS cpp)
# Prerequisites for javascript.
#
# It uses a C/C++ to JavaScript cross-compiler called emscripten (https://github.com/kripken/emscripten). Emscripten takes C/C++
# and compiles it into a highly optimisable subset of JavaScript called asm.js (http://asmjs.org/) that can be
# aggressively optimised and run at near-native speed (usually between 1.5 to 10 times slower than native C/C++).
-find_package(Emscripten)
+#find_package(Emscripten)
if (EMSCRIPTEN_FOUND)
set (DEFAULT_JAVASCRIPT ON)
endif (EMSCRIPTEN_FOUND)
@@ -37,7 +37,7 @@ if (CMAKE_CXX_COMPILER)
endif (CMAKE_CXX_COMPILER)
# Prerequisites for Go
-find_program(GO_EXE go)
+#find_program(GO_EXE go)
mark_as_advanced(GO_EXE)
if (GO_EXE)
if(WIN32)
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
index 0cc4024..796fe29 100644
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ b/proton-c/bindings/cpp/CMakeLists.txt
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include(cpp.cmake) # Compiler checks
include_directories(
@@ -89,7 +89,7 @@ set_source_files_properties (
COMPILE_FLAGS "${LTO}"
)
-add_library(qpid-proton-cpp SHARED ${qpid-proton-cpp-source})
+add_library(qpid-proton-cpp STATIC ${qpid-proton-cpp-source})
target_link_libraries (qpid-proton-cpp ${PLATFORM_LIBS} qpid-proton)
@@ -120,8 +120,8 @@ endif (MSVC)
install (DIRECTORY "include/proton" DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.hpp")
-add_subdirectory(docs)
-add_subdirectory(${CMAKE_SOURCE_DIR}/tests/tools/apps/cpp ${CMAKE_BINARY_DIR}/tests/tools/apps/cpp)
+#add_subdirectory(docs)
+#add_subdirectory(${CMAKE_SOURCE_DIR}/tests/tools/apps/cpp ${CMAKE_BINARY_DIR}/tests/tools/apps/cpp)
# Pkg config file
configure_file(
@@ -171,12 +171,12 @@ macro(add_cpp_test test)
endif ()
endmacro(add_cpp_test)
-add_cpp_test(codec_test)
+#add_cpp_test(codec_test)
#add_cpp_test(engine_test)
-add_cpp_test(thread_safe_test)
-add_cpp_test(interop_test ${CMAKE_SOURCE_DIR}/tests)
-add_cpp_test(message_test)
-add_cpp_test(scalar_test)
-add_cpp_test(value_test)
-add_cpp_test(container_test)
-add_cpp_test(url_test)
+#add_cpp_test(thread_safe_test)
+#add_cpp_test(interop_test ${CMAKE_SOURCE_DIR}/tests)
+#add_cpp_test(message_test)
+#add_cpp_test(scalar_test)
+#add_cpp_test(value_test)
+#add_cpp_test(container_test)
+#add_cpp_test(url_test)
diff --git a/proton-c/bindings/cpp/docs/CMakeLists.txt b/proton-c/bindings/cpp/docs/CMakeLists.txt
index d512d15..8576867 100644
--- a/proton-c/bindings/cpp/docs/CMakeLists.txt
+++ b/proton-c/bindings/cpp/docs/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-find_package(Doxygen)
+#find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file (
diff --git a/proton-c/docs/api/CMakeLists.txt b/proton-c/docs/api/CMakeLists.txt
index 7756e48..71ebb93 100644
--- a/proton-c/docs/api/CMakeLists.txt
+++ b/proton-c/docs/api/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-find_package(Doxygen)
+#find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in
${CMAKE_CURRENT_BINARY_DIR}/user.doxygen)
--
2.7.4