diff --git a/.gitattributes b/.gitattributes index 26d7549356..c9cf4a7d9c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -src/version.cpp export-subst +src/clientversion.cpp export-subst diff --git a/.gitignore b/.gitignore index 66b8164320..abb6dd1987 100644 --- a/.gitignore +++ b/.gitignore @@ -4,22 +4,39 @@ src/dash src/dashd src/dash-cli +src/dash-tx src/test/test_dash src/qt/test/test_dash-qt +# autoreconf Makefile.in aclocal.m4 autom4te.cache/ +build-aux/config.guess +build-aux/config.sub +build-aux/depcomp +build-aux/install-sh +build-aux/ltmain.sh +build-aux/m4/libtool.m4 +build-aux/m4/lt~obsolete.m4 +build-aux/m4/ltoptions.m4 +build-aux/m4/ltsugar.m4 +build-aux/m4/ltversion.m4 +build-aux/missing +build-aux/compile +build-aux/test-driver config.log config.status configure -src/dash-config.h -src/dash-config.h.in -src/build-aux/ -src/stamp-h1 +libtool +src/config/dash-config.h +src/config/dash-config.h.in +src/config/stamp-h1 share/setup.nsi share/qt/Info.plist +src/univalue/gen + src/qt/*.moc src/qt/moc_*.cpp src/qt/forms/ui_*.h @@ -28,11 +45,13 @@ src/qt/test/moc*.cpp .deps .dirstamp +.libs .*.swp *.*~* *.bak *.rej *.orig +*.pyc *.o *.o-* *.patch @@ -48,6 +67,10 @@ src/qt/test/moc*.cpp *.json.h *.raw.h +#libtool object files +*.lo +*.la + # Compilation and Qt preprocessor part *.qm Makefile @@ -57,17 +80,13 @@ Dash-Qt.app # Unit-tests Makefile.test dash-qt_test +src/test/buildenv.py # Resources cpp qrc_*.cpp # Qt creator *.pro.user -darkcoi*.config -*.creator -*.creator.user -darkcoi*.files -darkcoi*.includes # Mac specific .DS_Store @@ -85,9 +104,12 @@ linux-coverage-build linux-build win32-build qa/pull-tester/run-bitcoind-for-test.sh -qa/pull-tester/build-tests.sh +qa/pull-tester/tests-config.sh +qa/pull-tester/cache/* +qa/pull-tester/test.*/* !src/leveldb*/Makefile .cproject .project +/doc/doxygen/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..1630c1d02a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,66 @@ +# errata: +# - A travis bug causes caches to trample eachother when using the same +# compiler key (which we don't use anyway). This is worked around for now by +# replacing the "compilers" with a build name prefixed by the no-op ":" +# command. See: https://github.com/travis-ci/casher/issues/6 + +os: linux +language: cpp +env: + global: + - MAKEJOBS=-j3 + - RUN_TESTS=false + - CCACHE_SIZE=100M + - CCACHE_TEMPDIR=/tmp/.ccache-temp + - CCACHE_COMPRESS=1 + - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out + - SDK_URL=https://bitcoincore.org/depends-sources/sdks +cache: + apt: true + directories: + - depends/built + - depends/sdk-sources + - $HOME/.ccache +matrix: + fast_finish: true + include: + - compiler: ": ARM" + env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: ": bitcoind" + env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat CPPFLAGS=-DDEBUG_LOCKORDER" + - compiler: ": No wallet" + env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: ": 32-bit + dash" + env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" USE_SHELL="/bin/dash" + - compiler: ": Cross-Mac" + env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" + - compiler: ": Win64" + env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2" + - compiler: ": Win32" + env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-gui" MAKEJOBS="-j2" +install: + - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi + - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi +before_script: + - unset CC; unset CXX + - mkdir -p depends/SDKs depends/sdk-sources + - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then wget $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -O depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi + - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi + - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS +script: + - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi + - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST + - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" + - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE + - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export CCACHE_READONLY=1; fi + - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh + - ./configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) + - make distdir PACKAGE=bitcoin VERSION=$HOST + - cd bitcoin-$HOST + - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) + - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) + - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib + - if [ "$RUN_TESTS" = "true" ]; then make check; fi + - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi +after_script: + - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi diff --git a/.tx/config b/.tx/config index 7fea3a3ad6..c8b4b405cf 100644 --- a/.tx/config +++ b/.tx/config @@ -1,8 +1,7 @@ [main] host = https://www.transifex.com -[dash.tx] +[dash.qt-translation-010x] file_filter = src/qt/locale/dash_.ts source_file = src/qt/locale/dash_en.ts source_lang = en -type = QT diff --git a/Makefile.am b/Makefile.am index ae9478660e..f72960d093 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ -ACLOCAL_AMFLAGS = -I src/m4 +ACLOCAL_AMFLAGS = -I build-aux/m4 SUBDIRS = src -.PHONY: deploy +.PHONY: deploy FORCE GZIP_ENV="-9n" @@ -26,7 +26,9 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ $(top_srcdir)/contrib/macdeploy/background.png \ - $(top_srcdir)/contrib/macdeploy/DS_Store + $(top_srcdir)/contrib/macdeploy/DS_Store \ + $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \ + $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ leveldb_baseline.info test_dash_filtered.info total_coverage.info \ @@ -35,7 +37,8 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \ dist-hook: -$(MAKE) -C $(top_distdir)/src/leveldb clean - -$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf - + -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean + -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - distcheck-hook: $(MKDIR_P) $(top_distdir)/_build/src/leveldb @@ -45,7 +48,7 @@ distcheck-hook: distcleancheck: @: -$(BITCOIN_WIN_INSTALLER): $(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN) +$(BITCOIN_WIN_INSTALLER): all-recursive $(MKDIR_P) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release @@ -53,8 +56,8 @@ $(BITCOIN_WIN_INSTALLER): $(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN) @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \ echo error: could not build $@ -$(BITCOIND_BIN) $(BITCOIN_QT_BIN) $(BITCOIN_CLI_BIN): - make -C $(dir $@) $(notdir $@) +$(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE + $(MAKE) -C src $(patsubst src/%,%,$@) $(OSX_APP)/Contents/PkgInfo: $(MKDIR_P) $(@D) @@ -82,16 +85,32 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 + $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 +deploydir: $(OSX_DMG) else -$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 - $(MKDIR_P) dist/.background - $(INSTALL) contrib/macdeploy/background.png dist/.background - $(INSTALL) contrib/macdeploy/DS_Store dist/.DS_Store - cd dist; $(LN_S) /Applications Applications - $(GENISOIMAGE) -no-cache-inodes -l -probe -V "Dash-Qt" -no-pad -r -apple -o $@ dist +APP_DIST_DIR=$(top_builddir)/dist +APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.png $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications + +$(APP_DIST_DIR)/Applications: + @rm -f $@ + @cd $(@D); $(LN_S) /Applications $(@F) + +$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt + +$(OSX_DMG): $(APP_DIST_EXTRAS) + $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Dash-Qt" -no-pad -r -apple -o $@ dist + +$(APP_DIST_DIR)/.background/background.png: + $(MKDIR_P) $(@D) + $(INSTALL) $(top_srcdir)/contrib/macdeploy/background.png $@ +$(APP_DIST_DIR)/.DS_Store: + $(INSTALL) $(top_srcdir)/contrib/macdeploy/DS_Store $@ + +$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 + +deploydir: $(APP_DIST_EXTRAS) endif if TARGET_DARWIN @@ -102,6 +121,15 @@ if TARGET_WINDOWS deploy: $(BITCOIN_WIN_INSTALLER) endif +$(BITCOIN_QT_BIN): FORCE + $(MAKE) -C src qt/$(@F) + +$(BITCOIND_BIN): FORCE + $(MAKE) -C src $(@F) + +$(BITCOIN_CLI_BIN): FORCE + $(MAKE) -C src $(@F) + if USE_LCOV baseline.info: @@ -159,10 +187,10 @@ endif if USE_COMPARISON_TOOL check-local: $(MKDIR_P) qa/tmp - @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) + @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1 endif -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) +EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-dash-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) diff --git a/README.md b/README.md index df09e87816..e3e9dc8aba 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -Dash Core staging tree 0.11 +Dash Core staging tree 0.12 =============================== -http://www.dashpay.io +https://www.dashpay.io Copyright (c) 2009-2015 Bitcoin Core Developers @@ -18,7 +18,7 @@ are carried out collectively by the network. Dash Core is the name of open source software which enables the use of this currency. For more information, as well as an immediately useable, binary version of -the Dash Core software, see http://www.dashpay.io/downloads. +the Dash Core software, see https://www.dashpay.io/downloads. License @@ -27,25 +27,63 @@ License Dash Core is released under the terms of the MIT license. See [COPYING](COPYING) for more information or see http://opensource.org/licenses/MIT. +Development process +------------------- -Building process ------------------ +Developers work in their own trees, then submit pull requests when they think +their feature or bug fix is ready. -**compiling Dash from git** +If it is a simple/trivial/non-controversial change, then one of the Dash +development team members simply pulls it. -Use the autogen script to prepare the build environment. - ./autogen.sh - ./configure - make +The patch will be accepted if there is broad consensus that it is a good thing. +Developers should expect to rework and resubmit patches if the code doesn't +match the project's coding conventions (see [doc/coding.md](doc/coding.md)) or are +controversial. -**precompiled binaries** +The `master` branch is regularly built and tested, but is not guaranteed to be +completely stable. [Tags](https://github.com/dashpay/dash/tags) are created +regularly to indicate new official, stable release versions of Dash. ***TODO*** -Precompiled binaries are available at github, see -https://github.com/dashproject/dash-binaries +Testing +------- -Always verify the signatures and checksums. +Testing and code review is the bottleneck for development; we get more pull +requests than we can review and test on short notice. Please be patient and help out by testing +other people's pull requests, and remember this is a security-critical project where any mistake might cost people +lots of money. +### Automated Testing + +Developers are strongly encouraged to write unit tests for new code, and to +submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: `make check` + +Every pull request is built for both Windows and Linux on a dedicated server, +and unit and sanity tests are automatically run. The binaries produced may be +used for manual QA testing — a link to them will appear in a comment on the +pull request posted by [DashPullTester](https://github.com/dashpay/PullTester). See https://github.com/TheBlueMatt/test-scripts +for the build/test scripts. ***TODO*** + +### Manual Quality Assurance (QA) Testing + +Large changes should have a test plan, and should be tested by somebody other +than the developer who wrote the code. +See https://github.com/dashpay/QA/ for how to create a test plan. ***TODO*** + +Translations +------------ + +Changes to translations as well as new translations can be submitted to +[Bitcoin Core's Transifex page](https://www.transifex.com/projects/p/dash/). + +Translations are periodically pulled from Transifex and merged into the git repository. See the +[translation process](doc/translation_process.md) for details on how this works. + +**Important**: We do not accept translation changes as GitHub pull requests because the next +pull from Transifex would automatically overwrite them again. + +Translators should also subscribe to the [mailing list](https://groups.google.com/forum/#!forum/dash-translators). ***TODO*** Development tips and tricks --------------------------- @@ -58,7 +96,7 @@ CXXFLAGS="-g -ggdb -O0" or whatever debug flags you need. **debug.log** If the code is behaving strangely, take a look in the debug.log file in the data directory; -error and debugging message are written there. +error and debugging messages are written there. The -debug=... command-line option controls debugging; running with just -debug will turn on all categories (and give you a very large debug.log file). @@ -68,16 +106,16 @@ to see it. **testnet and regtest modes** -Run with the -testnet option to run with "play dashs" on the test network, if you +Run with the -testnet option to run with "play dash" on the test network, if you are testing multi-machine code that needs to operate across the internet. If you are testing something that can run on one machine, run with the -regtest option. -In regression test mode blocks can be created on-demand; see qa/rpc-tests/ for tests +In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests that run in -regtest mode. **DEBUG_LOCKORDER** Dash Core is a multithreaded application, and deadlocks or other multithreading bugs can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure -CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of what locks -are held, and adds warning to the debug.log file if inconsistencies are detected. +CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks +are held, and adds warnings to the debug.log file if inconsistencies are detected. diff --git a/autogen.sh b/autogen.sh index 5b883a6a4c..3e26a18305 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,4 +2,8 @@ set -e srcdir="$(dirname $0)" cd "$srcdir" -autoreconf --install --force +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then + LIBTOOLIZE="${GLIBTOOLIZE}" + export LIBTOOLIZE +fi +autoreconf --install --force --warnings=all diff --git a/src/m4/ax_boost_base.m4 b/build-aux/m4/ax_boost_base.m4 similarity index 100% rename from src/m4/ax_boost_base.m4 rename to build-aux/m4/ax_boost_base.m4 diff --git a/src/m4/ax_boost_chrono.m4 b/build-aux/m4/ax_boost_chrono.m4 similarity index 100% rename from src/m4/ax_boost_chrono.m4 rename to build-aux/m4/ax_boost_chrono.m4 diff --git a/src/m4/ax_boost_filesystem.m4 b/build-aux/m4/ax_boost_filesystem.m4 similarity index 100% rename from src/m4/ax_boost_filesystem.m4 rename to build-aux/m4/ax_boost_filesystem.m4 diff --git a/src/m4/ax_boost_program_options.m4 b/build-aux/m4/ax_boost_program_options.m4 similarity index 100% rename from src/m4/ax_boost_program_options.m4 rename to build-aux/m4/ax_boost_program_options.m4 diff --git a/src/m4/ax_boost_system.m4 b/build-aux/m4/ax_boost_system.m4 similarity index 100% rename from src/m4/ax_boost_system.m4 rename to build-aux/m4/ax_boost_system.m4 diff --git a/src/m4/ax_boost_thread.m4 b/build-aux/m4/ax_boost_thread.m4 similarity index 100% rename from src/m4/ax_boost_thread.m4 rename to build-aux/m4/ax_boost_thread.m4 diff --git a/src/m4/ax_boost_unit_test_framework.m4 b/build-aux/m4/ax_boost_unit_test_framework.m4 similarity index 100% rename from src/m4/ax_boost_unit_test_framework.m4 rename to build-aux/m4/ax_boost_unit_test_framework.m4 diff --git a/src/m4/ax_check_compile_flag.m4 b/build-aux/m4/ax_check_compile_flag.m4 similarity index 100% rename from src/m4/ax_check_compile_flag.m4 rename to build-aux/m4/ax_check_compile_flag.m4 diff --git a/src/m4/ax_check_link_flag.m4 b/build-aux/m4/ax_check_link_flag.m4 similarity index 100% rename from src/m4/ax_check_link_flag.m4 rename to build-aux/m4/ax_check_link_flag.m4 diff --git a/src/m4/ax_check_preproc_flag.m4 b/build-aux/m4/ax_check_preproc_flag.m4 similarity index 100% rename from src/m4/ax_check_preproc_flag.m4 rename to build-aux/m4/ax_check_preproc_flag.m4 diff --git a/build-aux/m4/ax_gcc_func_attribute.m4 b/build-aux/m4/ax_gcc_func_attribute.m4 new file mode 100644 index 0000000000..275ca63a2c --- /dev/null +++ b/build-aux/m4/ax_gcc_func_attribute.m4 @@ -0,0 +1,217 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) +# +# DESCRIPTION +# +# This macro checks if the compiler supports one of GCC's function +# attributes; many other compilers also provide function attributes with +# the same syntax. Compiler warnings are used to detect supported +# attributes as unsupported ones are ignored by default so quieting +# warnings when using this macro will yield false positives. +# +# The ATTRIBUTE parameter holds the name of the attribute to be checked. +# +# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_. +# +# The macro caches its result in the ax_cv_have_func_attribute_ +# variable. +# +# The macro currently supports the following function attributes: +# +# alias +# aligned +# alloc_size +# always_inline +# artificial +# cold +# const +# constructor +# deprecated +# destructor +# dllexport +# dllimport +# error +# externally_visible +# flatten +# format +# format_arg +# gnu_inline +# hot +# ifunc +# leaf +# malloc +# noclone +# noinline +# nonnull +# noreturn +# nothrow +# optimize +# pure +# unused +# used +# visibility +# warning +# warn_unused_result +# weak +# weakref +# +# Unsuppored function attributes will be tested with a prototype returning +# an int and not accepting any arguments and the result of the check might +# be wrong or meaningless so use with care. +# +# LICENSE +# +# Copyright (c) 2013 Gabriele Svelto +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 2 + +AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ + AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) + + AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ + m4_case([$1], + [alias], [ + int foo( void ) { return 0; } + int bar( void ) __attribute__(($1("foo"))); + ], + [aligned], [ + int foo( void ) __attribute__(($1(32))); + ], + [alloc_size], [ + void *foo(int a) __attribute__(($1(1))); + ], + [always_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [artificial], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [cold], [ + int foo( void ) __attribute__(($1)); + ], + [const], [ + int foo( void ) __attribute__(($1)); + ], + [constructor], [ + int foo( void ) __attribute__(($1)); + ], + [deprecated], [ + int foo( void ) __attribute__(($1(""))); + ], + [destructor], [ + int foo( void ) __attribute__(($1)); + ], + [dllexport], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [dllimport], [ + int foo( void ) __attribute__(($1)); + ], + [error], [ + int foo( void ) __attribute__(($1(""))); + ], + [externally_visible], [ + int foo( void ) __attribute__(($1)); + ], + [flatten], [ + int foo( void ) __attribute__(($1)); + ], + [format], [ + int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); + ], + [format_arg], [ + char *foo(const char *p) __attribute__(($1(1))); + ], + [gnu_inline], [ + inline __attribute__(($1)) int foo( void ) { return 0; } + ], + [hot], [ + int foo( void ) __attribute__(($1)); + ], + [ifunc], [ + int my_foo( void ) { return 0; } + static int (*resolve_foo(void))(void) { return my_foo; } + int foo( void ) __attribute__(($1("resolve_foo"))); + ], + [leaf], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [malloc], [ + void *foo( void ) __attribute__(($1)); + ], + [noclone], [ + int foo( void ) __attribute__(($1)); + ], + [noinline], [ + __attribute__(($1)) int foo( void ) { return 0; } + ], + [nonnull], [ + int foo(char *p) __attribute__(($1(1))); + ], + [noreturn], [ + void foo( void ) __attribute__(($1)); + ], + [nothrow], [ + int foo( void ) __attribute__(($1)); + ], + [optimize], [ + __attribute__(($1(3))) int foo( void ) { return 0; } + ], + [pure], [ + int foo( void ) __attribute__(($1)); + ], + [unused], [ + int foo( void ) __attribute__(($1)); + ], + [used], [ + int foo( void ) __attribute__(($1)); + ], + [visibility], [ + int foo_def( void ) __attribute__(($1("default"))); + int foo_hid( void ) __attribute__(($1("hidden"))); + ], + [warning], [ + int foo( void ) __attribute__(($1(""))); + ], + [warn_unused_result], [ + int foo( void ) __attribute__(($1)); + ], + [weak], [ + int foo( void ) __attribute__(($1)); + ], + [weakref], [ + static int foo( void ) { return 0; } + static int bar( void ) __attribute__(($1("foo"))); + ], + [ + m4_warn([syntax], [Unsupported attribute $1, the test may fail]) + int foo( void ) __attribute__(($1)); + ] + )], []) + ], + dnl GCC doesn't exit with an error if an unknown attribute is + dnl provided but only outputs a warning, so accept the attribute + dnl only if no warning were issued. + [AS_IF([test -s conftest.err], + [AS_VAR_SET([ac_var], [no])], + [AS_VAR_SET([ac_var], [yes])])], + [AS_VAR_SET([ac_var], [no])]) + ]) + + AS_IF([test yes = AS_VAR_GET([ac_var])], + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, + [Define to 1 if the system has the `$1' function attribute])], []) + + AS_VAR_POPDEF([ac_var]) +]) diff --git a/src/m4/ax_pthread.m4 b/build-aux/m4/ax_pthread.m4 similarity index 100% rename from src/m4/ax_pthread.m4 rename to build-aux/m4/ax_pthread.m4 diff --git a/src/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 similarity index 82% rename from src/m4/bitcoin_find_bdb48.m4 rename to build-aux/m4/bitcoin_find_bdb48.m4 index 72ec49b635..f3b14461eb 100644 --- a/src/m4/bitcoin_find_bdb48.m4 +++ b/build-aux/m4/bitcoin_find_bdb48.m4 @@ -12,29 +12,29 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ done for searchpath in $bdbdirlist ''; do test -n "${searchpath}" && searchpath="${searchpath}/" - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <${searchpath}db_cxx.h> - ],[ + ]],[[ #if !((DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || DB_VERSION_MAJOR > 4) #error "failed to find bdb 4.8+" #endif - ],[ + ]])],[ if test "x$bdbpath" = "xX"; then bdbpath="${searchpath}" fi ],[ continue ]) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <${searchpath}db_cxx.h> - ],[ + ]],[[ #if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8) #error "failed to find bdb 4.8" #endif - ],[ + ]])],[ bdb48path="${searchpath}" break - ]) + ],[]) done if test "x$bdbpath" = "xX"; then AC_MSG_RESULT([no]) @@ -44,7 +44,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[ AC_MSG_WARN([Found Berkeley DB other than 4.8; wallets opened by this build will not be portable!]) ],[ - AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore)]) + AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)]) ]) else BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx) @@ -60,7 +60,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ ]) done if test "x$BDB_LIBS" = "x"; then - AC_MSG_ERROR(libdb_cxx missing) + AC_MSG_ERROR([libdb_cxx missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) fi AC_SUBST(BDB_LIBS) ]) diff --git a/src/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 similarity index 76% rename from src/m4/bitcoin_qt.m4 rename to build-aux/m4/bitcoin_qt.m4 index 19775182d6..d709c78533 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -48,8 +48,8 @@ dnl CAUTION: Do not use this inside of a conditional. AC_DEFUN([BITCOIN_QT_INIT],[ dnl enable qt support AC_ARG_WITH([gui], - [AS_HELP_STRING([--with-gui], - [with GUI (no|qt4|qt5|auto. default is auto, qt4 tried first.)])], + [AS_HELP_STRING([--with-gui@<:@=no|qt4|qt5|auto@:>@], + [build dash-qt GUI (default=auto, qt4 tried first)])], [ bitcoin_qt_want_version=$withval if test x$bitcoin_qt_want_version = xyes; then @@ -62,6 +62,7 @@ AC_DEFUN([BITCOIN_QT_INIT],[ AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) + AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], []) AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], []) AC_ARG_WITH([qtdbus], @@ -69,6 +70,8 @@ AC_DEFUN([BITCOIN_QT_INIT],[ [enable DBus support (default is yes if qt is enabled and QtDBus is found)])], [use_dbus=$withval], [use_dbus=auto]) + + AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) ]) dnl Find the appropriate version of Qt libraries and includes. @@ -81,19 +84,75 @@ dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test AC_DEFUN([BITCOIN_QT_CONFIGURE],[ use_pkgconfig=$1 - if test x$use_pkgconfig == x; then + if test x$use_pkgconfig = x; then use_pkgconfig=yes fi if test x$use_pkgconfig = xyes; then - if test x$PKG_CONFIG == x; then - AC_MSG_ERROR(pkg-config not found.) - fi BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])]) else BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) fi + dnl This is ugly and complicated. Yuck. Works as follows: + dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can + dnl check a header to find out. When Qt is built statically, some plugins must + dnl be linked into the final binary as well. These plugins have changed between + dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration + dnl plugin was added. Since we can't tell if Qt4 is static or not, it is + dnl assumed for windows builds. + dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the + dnl results to QT_LIBS. + BITCOIN_QT_CHECK([ + TEMP_CPPFLAGS=$CPPFLAGS + CPPFLAGS=$QT_INCLUDES + if test x$bitcoin_qt_got_major_vers = x5; then + _BITCOIN_QT_IS_STATIC + if test x$bitcoin_cv_static_qt = xyes; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + if test x$qt_plugin_path != x; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" + fi + if test x$use_pkgconfig = xyes; then + PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) + fi + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) + if test x$TARGET_OS = xwindows; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) + AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows]) + elif test x$TARGET_OS = xlinux; then + PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static]) + AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb]) + elif test x$TARGET_OS = xdarwin; then + if test x$use_pkgconfig = xyes; then + PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"]) + fi + AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)]) + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa]) + AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa]) + fi + fi + else + if test x$TARGET_OS = xwindows; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + if test x$qt_plugin_path != x; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" + QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs" + fi + _BITCOIN_QT_CHECK_STATIC_PLUGINS([ + Q_IMPORT_PLUGIN(qcncodecs) + Q_IMPORT_PLUGIN(qjpcodecs) + Q_IMPORT_PLUGIN(qtwcodecs) + Q_IMPORT_PLUGIN(qkrcodecs) + Q_IMPORT_PLUGIN(AccessibleFactory)], + [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) + fi + fi + CPPFLAGS=$TEMP_CPPFLAGS + ]) + if test x$use_pkgconfig$qt_bin_path = xyes; then if test x$bitcoin_qt_got_major_vers = x5; then qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" @@ -106,7 +165,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path) BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes) - MOC_DEFS='-DHAVE_CONFIG_H -I$(top_srcdir)/src' + MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' case $host in *darwin*) BITCOIN_QT_CHECK([ @@ -137,7 +196,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.") fi - if test x$LUPDATE == x; then + if test x$LUPDATE = x; then AC_MSG_WARN("lupdate is required to update qt translations") fi ],[ @@ -165,17 +224,17 @@ dnl Requires: INCLUDES must be populated as necessary. dnl Output: bitcoin_cv_qt5=yes|no AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[ AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[ - AC_TRY_COMPILE( - [#include ], - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], + [[ #if QT_VERSION < 0x050000 choke me #else return 0; #endif - ], - bitcoin_cv_qt5=yes, - bitcoin_cv_qt5=no) + ]])], + [bitcoin_cv_qt5=yes], + [bitcoin_cv_qt5=no]) ])]) dnl Internal. Check if the linked version of Qt was built as static libs. @@ -185,15 +244,15 @@ dnl Output: bitcoin_cv_static_qt=yes|no dnl Output: Defines QT_STATICPLUGIN if plugins are static. AC_DEFUN([_BITCOIN_QT_IS_STATIC],[ AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[ - AC_TRY_COMPILE( - [#include ], - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include ]], + [[ #if defined(QT_STATIC) return 0; #else choke me #endif - ], + ]])], [bitcoin_cv_static_qt=yes], [bitcoin_cv_static_qt=no]) ]) @@ -211,13 +270,13 @@ AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[ AC_MSG_CHECKING(for static Qt plugins: $2) CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" LIBS="$2 $QT_LIBS $LIBS" - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #define QT_STATICPLUGIN #include - $1], - [return 0;], + $1]], + [[return 0;]])], [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"], - [AC_MSG_RESULT(no)]; BITCOIN_QT_FAIL(Could not resolve: $2)) + [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)]) LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" ]) @@ -232,10 +291,10 @@ dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ m4_ifdef([PKG_CHECK_MODULES],[ auto_priority_version=$1 - if test x$auto_priority_version == x; then + if test x$auto_priority_version = x; then auto_priority_version=qt5 fi - if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then + if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -245,14 +304,14 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[ qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" qt4_modules="QtCore QtGui QtNetwork" BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then + if test x$bitcoin_qt_want_version = xqt5 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt5 ); then PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[have_qt=no]) - elif test x$bitcoin_qt_want_version == xqt4 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt4 ); then + elif test x$bitcoin_qt_want_version = xqt4 || ( test x$bitcoin_qt_want_version = xauto && test x$auto_priority_version = xqt4 ); then PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no]) fi dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other. - if test x$have_qt == xno && test x$bitcoin_qt_want_version == xauto; then + if test x$have_qt = xno && test x$bitcoin_qt_want_version = xauto; then if test x$auto_priority_version = x$qt5; then PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no]) else @@ -299,7 +358,7 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ if test x$bitcoin_qt_want_version = xauto; then _BITCOIN_QT_CHECK_QT5 fi - if test x$bitcoin_cv_qt5 == xyes || test x$bitcoin_qt_want_version = xqt5; then + if test x$bitcoin_cv_qt5 = xyes || test x$bitcoin_qt_want_version = xqt5; then QT_LIB_PREFIX=Qt5 bitcoin_qt_got_major_vers=5 else @@ -313,62 +372,25 @@ AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ if test x$qt_lib_path != x; then LIBS="$LIBS -L$qt_lib_path" fi - if test x$qt_plugin_path != x; then - LIBS="$LIBS -L$qt_plugin_path/accessible" - if test x$bitcoin_qt_got_major_vers == x5; then - LIBS="$LIBS -L$qt_plugin_path/platforms" - else - LIBS="$LIBS -L$qt_plugin_path/codecs" - fi - fi - if test x$TARGET_OS == xwindows; then + if test x$TARGET_OS = xwindows; then AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found)) fi ]) - BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,BITCOIN_QT_FAIL(zlib not found))) - BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,BITCOIN_QT_FAIL(png not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([jpeg] ,[main],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([pcre16] ,[main],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in]))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found))) BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found))) - if test x$bitcoin_qt_got_major_vers == x5; then + if test x$bitcoin_qt_got_major_vers = x5; then BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXWidgets not found))) fi QT_LIBS="$LIBS" LIBS="$TEMP_LIBS" - dnl This is ugly and complicated. Yuck. Works as follows: - dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can - dnl check a header to find out. When Qt is built statically, some plugins must - dnl be linked into the final binary as well. These plugins have changed between - dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration - dnl plugin was added. Since we can't tell if Qt4 is static or not, it is - dnl assumed for all non-pkg-config builds. - dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the - dnl results to QT_LIBS. - BITCOIN_QT_CHECK([ - if test x$bitcoin_qt_got_major_vers == x5; then - _BITCOIN_QT_IS_STATIC - if test x$bitcoin_cv_static_qt == xyes; then - AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) - if test x$TARGET_OS == xwindows; then - _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows]) - fi - fi - else - AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) - _BITCOIN_QT_CHECK_STATIC_PLUGINS([ - Q_IMPORT_PLUGIN(qcncodecs) - Q_IMPORT_PLUGIN(qjpcodecs) - Q_IMPORT_PLUGIN(qtwcodecs) - Q_IMPORT_PLUGIN(qkrcodecs) - Q_IMPORT_PLUGIN(AccessibleFactory)], - [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets]) - fi - ]) - BITCOIN_QT_CHECK([ LIBS= if test x$qt_lib_path != x; then diff --git a/src/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 similarity index 100% rename from src/m4/bitcoin_subdir_to_include.m4 rename to build-aux/m4/bitcoin_subdir_to_include.m4 diff --git a/configure.ac b/configure.ac index 7bb856ca70..d9b2690c89 100644 --- a/configure.ac +++ b/configure.ac @@ -1,39 +1,27 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) -define(_CLIENT_VERSION_MINOR, 11) -define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 13) +define(_CLIENT_VERSION_MINOR, 12) +define(_CLIENT_VERSION_REVISION, 0) +define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) -AC_CONFIG_AUX_DIR([src/build-aux]) -AC_CONFIG_MACRO_DIR([src/m4]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_HEADERS([src/config/dash-config.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) + AC_CANONICAL_HOST + AH_TOP([#ifndef DASH_CONFIG_H]) AH_TOP([#define DASH_CONFIG_H]) AH_BOTTOM([#endif //DASH_CONFIG_H]) -# This m4 will only be used if a system copy cannot be found. This is helpful -# on systems where autotools are installed but the pkg-config macros are not in -# a default location. It is currently used for building on OSX where autotools -# are preinstalled but pkg-config comes from macports or homebrew. It should -# probably be removed when building on <= 10.6 is no longer supported. -m4_include([pkg.m4]) - dnl faketime breaks configure and is only needed for make. Disable it here. unset FAKETIME -if test "x${CXXFLAGS+set}" = "xset"; then - CXXFLAGS_overridden=yes -else - CXXFLAGS_overridden=no -fi - -dnl ============================================================== -dnl Setup for automake -dnl ============================================================== - +dnl Automake init set-up and checks AM_INIT_AUTOMAKE([no-define subdir-objects foreign]) dnl faketime messes with timestamps and causes configure to be re-run. @@ -43,6 +31,49 @@ AM_MAINTAINER_MODE([enable]) dnl make the compilation flags quiet unless V=1 is used m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl Compiler checks (here before libtool). +if test "x${CXXFLAGS+set}" = "xset"; then + CXXFLAGS_overridden=yes +else + CXXFLAGS_overridden=no +fi +AC_PROG_CXX +m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) + +dnl By default, libtool for mingw refuses to link static libs into a dll for +dnl fear of mixing pic/non-pic objects, and import/export complications. Since +dnl we have those under control, re-enable that functionality. +case $host in + *mingw*) + lt_cv_deplibs_check_method="pass_all" + ;; +esac +dnl Libtool init checks. +LT_INIT([pic-only]) + +dnl Check/return PATH for base programs. +AC_PATH_TOOL(AR, ar) +AC_PATH_TOOL(RANLIB, ranlib) +AC_PATH_TOOL(STRIP, strip) +AC_PATH_TOOL(GCOV, gcov) +AC_PATH_PROG(LCOV, lcov) +AC_PATH_PROG(JAVA, java) +AC_PATH_PROG(GENHTML, genhtml) +AC_PATH_PROG([GIT], [git]) +AC_PATH_PROG(CCACHE,ccache) +AC_PATH_PROG(XGETTEXT,xgettext) +AC_PATH_PROG(HEXDUMP,hexdump) + +# This m4 will only be used if a system copy cannot be found. This is helpful +# on systems where autotools are installed but the pkg-config macros are not in +# a default location. It is currently used for building on OSX where autotools +# are preinstalled but pkg-config comes from macports or homebrew. It should +# probably be removed when building on <= 10.6 is no longer supported. +m4_include([pkg.m4]) + +dnl pkg-config check. +PKG_PROG_PKG_CONFIG + # Enable wallet AC_ARG_ENABLE([wallet], [AS_HELP_STRING([--enable-wallet], @@ -89,6 +120,12 @@ AC_ARG_ENABLE([hardening], [use_hardening=$enableval], [use_hardening=yes]) +AC_ARG_ENABLE([reduce-exports], + [AS_HELP_STRING([--enable-reduce-exports], + [attempt to reduce exported symbols in the resulting executables (default is yes)])], + [use_reduce_exports=$enableval], + [use_reduce_exports=auto]) + AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], [use ccache for building (default is yes if ccache is found)])], @@ -109,34 +146,6 @@ AC_ARG_ENABLE([glibc-back-compat], AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], []) - -AC_CONFIG_SRCDIR([src]) -AC_CONFIG_HEADERS([src/dash-config.h]) - -dnl Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXXCPP -AC_PROG_INSTALL -AC_PROG_OBJC -AC_PROG_LN_S -m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX]) -AC_PROG_MKDIR_P -AC_PROG_SED -AC_PATH_TOOL(AR, ar) -AC_PATH_TOOL(RANLIB, ranlib) -AC_PATH_TOOL(STRIP, strip) -AC_PATH_TOOL(GCOV, gcov) -AC_PATH_PROG(LCOV, lcov) -AC_PATH_PROG(JAVA, java) -AC_PATH_PROG(GENHTML, genhtml) -AC_PATH_PROG([GIT], [git]) -AC_PATH_PROG(CCACHE,ccache) -AC_PATH_PROG(XGETTEXT,xgettext) -AC_PATH_PROG(HEXDUMP,hexdump) -PKG_PROG_PKG_CONFIG - # Enable debug AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], @@ -162,6 +171,24 @@ if test "x$CXXFLAGS_overridden" = "xno"; then fi CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" +AC_ARG_WITH([utils], + [AS_HELP_STRING([--with-utils], + [build dash-cli dash-tx (default=yes)])], + [build_bitcoin_utils=$withval], + [build_bitcoin_utils=yes]) + +AC_ARG_WITH([libs], + [AS_HELP_STRING([--with-libs], + [build libraries (default=yes)])], + [build_bitcoin_libs=$withval], + [build_bitcoin_libs=yes]) + +AC_ARG_WITH([daemon], + [AS_HELP_STRING([--with-daemon], + [build dashd daemon (default=yes)])], + [build_bitcoind=$withval], + [build_bitcoind=yes]) + AC_LANG_PUSH([C++]) use_pkgconfig=yes @@ -192,9 +219,9 @@ case $host in AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing)) AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing)) - AX_CHECK_LINK_FLAG([[-static]],[LDFLAGS="$LDFLAGS -static"]) - AX_CHECK_LINK_FLAG([[-static-libgcc]],[LDFLAGS="$LDFLAGS -static-libgcc"]) - AX_CHECK_LINK_FLAG([[-static-libstdc++]],[LDFLAGS="$LDFLAGS -static-libstdc++"]) + # -static is interpreted by libtool, where it has a different meaning. + # In libtool-speak, it's -all-static. + AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"]) AC_PATH_PROG([MAKENSIS], [makensis], none) if test x$MAKENSIS = xnone; then @@ -217,6 +244,15 @@ case $host in *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;; esac AC_SUBST(WINDOWS_BITS) + + dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. + dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override + dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are + dnl also overridden to prevent their insertion later. + dnl This should only affect dll's. + archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" + postdeps_CXX= + ;; *darwin*) TARGET_OS=darwin @@ -226,13 +262,17 @@ case $host in AC_CHECK_PROG([PORT],port, port) if test x$PORT = xport; then dnl add default macports paths - CPPFLAGS="$CPPFLAGS -isystem /opt/local/include -I/opt/local/include/db48" - LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48" + CPPFLAGS="$CPPFLAGS -isystem /opt/local/include" + LIBS="$LIBS -L/opt/local/lib" + if test -d /opt/local/include/db48; then + CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48" + LIBS="$LIBS -L/opt/local/lib/db48" + fi fi AC_CHECK_PROG([BREW],brew, brew) if test x$BREW = xbrew; then - dnl These Homebrew packages may be bottled, meaning that they won't be found + dnl These Homebrew packages may be keg-only, meaning that they won't be found dnl in expected paths because they may conflict with system files. Ask dnl Homebrew where each one is located, then adjust paths accordingly. dnl It's safe to add these paths even if the functionality is disabled by @@ -242,14 +282,16 @@ case $host in bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null` qt5_prefix=`$BREW --prefix qt5 2>/dev/null` if test x$openssl_prefix != x; then - export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi if test x$bdb_prefix != x; then CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include" LIBS="$LIBS -L$bdb_prefix/lib" fi if test x$qt5_prefix != x; then - export PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH fi fi else @@ -261,12 +303,22 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + + dnl libtool will try to strip the static lib, which is a problem for + dnl cross-builds because strip attempts to call a hard-coded ld, + dnl which may not exist in the path. Stripping the .a is not + dnl necessary, so just disable it. + old_striplib= ;; esac fi + AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"]) CPPFLAGS="$CPPFLAGS -DMAC_OSX" ;; + *linux*) + TARGET_OS=linux + ;; *) ;; esac @@ -276,7 +328,7 @@ if test x$use_comparison_tool != xno; then fi if test x$use_comparison_tool_reorg_tests != xno; then - if test x$use_comparison_tool == x; then + if test x$use_comparison_tool = x; then AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified") fi AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1) @@ -284,20 +336,20 @@ else AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0) fi -if test x$use_lcov == xyes; then - if test x$LCOV == x; then +if test x$use_lcov = xyes; then + if test x$LCOV = x; then AC_MSG_ERROR("lcov testing requested but lcov not found") fi - if test x$GCOV == x; then + if test x$GCOV = x; then AC_MSG_ERROR("lcov testing requested but gcov not found") fi - if test x$JAVA == x; then + if test x$JAVA = x; then AC_MSG_ERROR("lcov testing requested but java not found") fi - if test x$GENHTML == x; then + if test x$GENHTML = x; then AC_MSG_ERROR("lcov testing requested but genhtml not found") fi - if test x$use_comparison_tool == x; then + if test x$use_comparison_tool = x; then AC_MSG_ERROR("lcov testing requested but comparison tool was not specified") fi LCOV="$LCOV --gcov-tool=$GCOV" @@ -310,7 +362,6 @@ AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")]) dnl Check for pthread compile/link requirements AX_PTHREAD -INCLUDES="$INCLUDES $PTHREAD_CFLAGS" # The following macro will add the necessary defines to dash-config.h, but # they also need to be passed down to any subprojects. Pull the results out of @@ -333,17 +384,21 @@ fi AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"]) +AX_GCC_FUNC_ATTRIBUTE([visibility]) +AX_GCC_FUNC_ATTRIBUTE([dllexport]) +AX_GCC_FUNC_ATTRIBUTE([dllimport]) + if test x$use_glibc_compat != xno; then #__fdelt_chk's params and return type have changed from long unsigned int to long int. # See which one is present here. AC_MSG_CHECKING(__fdelt_chk type) - AC_TRY_COMPILE([#ifdef _FORTIFY_SOURCE + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE #undef _FORTIFY_SOURCE #endif #define _FORTIFY_SOURCE 2 #include - extern "C" long unsigned int __fdelt_warn(long unsigned int);],[], + extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])], [ fdelt_type="long unsigned int"], [ fdelt_type="long int"]) AC_MSG_RESULT($fdelt_type) @@ -367,6 +422,17 @@ if test x$use_hardening != xno; then AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"]) AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"]) + if test x$TARGET_OS != xwindows; then + # All windows code is PIC, forcing it on just adds useless compile warnings + AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"]) + AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"]) + fi + + case $host in + *mingw*) + AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(lib missing)) + ;; + esac CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS" CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS" @@ -379,16 +445,57 @@ if test x$TARGET_OS = xdarwin; then AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) fi -AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h]) +AC_CHECK_HEADERS([endian.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) +AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])]) +AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])]) + +AC_CHECK_DECLS([strnlen]) + +AC_CHECK_DECLS([le32toh, le64toh, htole32, htole64, be32toh, be64toh, htobe32, htobe64],,, + [#if HAVE_ENDIAN_H + #include + #endif]) dnl Check for MSG_NOSIGNAL AC_MSG_CHECKING(for MSG_NOSIGNAL) -AC_TRY_COMPILE([#include ], - [ int f = MSG_NOSIGNAL; ], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ int f = MSG_NOSIGNAL; ]])], [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ], [ AC_MSG_RESULT(no)] ) +AC_SEARCH_LIBS([clock_gettime],[rt]) + +AC_MSG_CHECKING([for visibility attribute]) +AC_LINK_IFELSE([AC_LANG_SOURCE([ + int foo_def( void ) __attribute__((visibility("default"))); + int main(){} + ])], + [ + AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.]) + use_reduce_exports=no + ] +) + +if test x$use_reduce_exports != xno; then + AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], + [ + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.]) + fi + AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.]) + use_reduce_exports=no + ]) +fi + LEVELDB_CPPFLAGS= LIBLEVELDB= LIBMEMENV= @@ -406,11 +513,24 @@ dnl Check for libminiupnpc (optional) if test x$use_upnp != xno; then AC_CHECK_HEADERS( [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], - [AC_CHECK_LIB([miniupnpc], [main],, [have_miniupnpc=no])], + [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])], [have_miniupnpc=no] ) fi +BITCOIN_QT_INIT + +dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus +BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) + +if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then + use_boost=no +else + use_boost=yes +fi + +if test x$use_boost = xyes; then + dnl Check for boost libs AX_BOOST_BASE AX_BOOST_SYSTEM @@ -419,6 +539,44 @@ AX_BOOST_PROGRAM_OPTIONS AX_BOOST_THREAD AX_BOOST_CHRONO + +if test x$use_reduce_exports != xno; then + AC_MSG_CHECKING([for working boost reduced exports]) + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + #if BOOST_VERSION >= 104900 + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + ],[: + if test x$use_reduce_exports = xauto; then + use_reduce_exports=no + else + if test x$use_reduce_exports = xyes; then + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) + fi + fi + AC_MSG_RESULT(no) + AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.]) + ]) + CPPFLAGS="$TEMP_CPPFLAGS" +fi + +elif test x$use_reduce_exports = xauto; then + use_reduce_exports=yes +fi + +if test x$use_reduce_exports != xno; then + CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" + AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) +fi + if test x$use_tests = xyes; then if test x$HEXDUMP = x; then @@ -426,6 +584,8 @@ if test x$use_tests = xyes; then fi + if test x$use_boost = xyes; then + AX_BOOST_UNIT_TEST_FRAMEWORK dnl Determine if -DBOOST_TEST_DYN_LINK is needed @@ -445,10 +605,13 @@ if test x$use_tests = xyes; then [AC_MSG_RESULT(no)]) LIBS="$TEMP_LIBS" CPPFLAGS="$TEMP_CPPFLAGS" + + fi fi +if test x$use_boost = xyes; then + BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB" -BOOST_INCLUDES="$BOOST_CPPFLAGS" dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if @@ -457,23 +620,20 @@ dnl after 1.56. dnl If neither is available, abort. dnl If sleep_for is used, boost_chrono becomes a requirement. if test x$ax_cv_boost_chrono = xyes; then -dnl Allow passing extra needed dependency libraries for boost-chrono from static gitian build -BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB $BOOST_CHRONO_EXTRALIBS" - TEMP_LIBS="$LIBS" -LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB" +LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ],[ + ]],[[ #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200) boost::this_thread::sleep_for(boost::chrono::milliseconds(0)); #else choke me #endif - ], + ]])], [boost_sleep=yes; BOOST_LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB"; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], [boost_sleep=no]) @@ -483,20 +643,20 @@ fi if test x$boost_sleep != xyes; then TEMP_LIBS="$LIBS" -LIBS="$LIBS $BOOST_LIBS" +LIBS="$BOOST_LIBS $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include - ],[ + ]],[[ #if BOOST_VERSION <= 105600 boost::this_thread::sleep(boost::posix_time::milliseconds(0)); #else choke me #endif - ], + ]])], [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], [boost_sleep=no]) LIBS="$TEMP_LIBS" @@ -507,23 +667,11 @@ if test x$boost_sleep != xyes; then AC_MSG_ERROR(No working boost sleep implementation found.) fi -AC_ARG_WITH([cli], - [AS_HELP_STRING([--with-cli], - [with CLI (default is yes)])], - [build_bitcoin_cli=$withval], - [build_bitcoin_cli=yes]) - -AC_ARG_WITH([daemon], - [AS_HELP_STRING([--with-daemon], - [with daemon (default is yes)])], - [build_bitcoind=$withval], - [build_bitcoind=yes]) - -BITCOIN_QT_INIT +fi if test x$use_pkgconfig = xyes; then - if test x$PKG_CONFIG == x; then + if test x"$PKG_CONFIG" = "x"; then AC_MSG_ERROR(pkg-config not found.) fi @@ -531,8 +679,8 @@ if test x$use_pkgconfig = xyes; then m4_ifdef( [PKG_CHECK_MODULES], [ - PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)]) - PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)]) + PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) + PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)]) BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])]) if test x$use_qr != xno; then BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) @@ -541,30 +689,42 @@ if test x$use_pkgconfig = xyes; then ) else AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing)) - AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR(libcrypto missing)) + AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing)) AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),) - AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing)) + AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing)) - BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found))) if test x$use_qr != xno; then - BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])]) + BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])]) BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)]) fi fi +CFLAGS_TEMP="$CFLAGS" +LIBS_TEMP="$LIBS" +CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS" +LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS" +AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),) +CFLAGS="$CFLAGS_TEMP" +LIBS="$LIBS_TEMP" + BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path) AC_MSG_CHECKING([whether to build dashd]) AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) AC_MSG_RESULT($build_bitcoind) -AC_MSG_CHECKING([whether to build dash-cli]) -AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes]) -AC_MSG_RESULT($build_bitcoin_cli) +AC_MSG_CHECKING([whether to build utils (dash-cli dash-tx)]) +AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) +AC_MSG_RESULT($build_bitcoin_utils) -dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus -BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) +AC_MSG_CHECKING([whether to build libraries]) +AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes]) +if test x$build_bitcoin_libs = xyes; then + AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built]) +fi +AC_MSG_RESULT($build_bitcoin_libs) AC_LANG_POP @@ -583,6 +743,9 @@ if test "x$use_ccache" != "xno"; then fi AC_MSG_RESULT($use_ccache) fi +if test "x$use_ccache" = "xyes"; then + AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"]) +fi dnl enable wallet AC_MSG_CHECKING([if wallet should be enabled]) @@ -614,7 +777,7 @@ else AC_MSG_RESULT($use_upnp_default) AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state]) if test x$TARGET_OS = xwindows; then - CPPFLAGS="$CPPFLAGS -DMINIUPNP_STATICLIB" + MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB" fi else AC_MSG_RESULT(no) @@ -634,7 +797,7 @@ if test x$bitcoin_enable_qt != xno; then dnl enable qr support AC_MSG_CHECKING([whether to build GUI with support for QR codes]) if test x$have_qrencode = xno; then - if test x$use_qr == xyes; then + if test x$use_qr = xyes; then AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode") fi AC_MSG_RESULT(no) @@ -648,7 +811,7 @@ if test x$bitcoin_enable_qt != xno; then fi fi - if test x$XGETTEXT == x; then + if test x$XGETTEXT = x; then AC_MSG_WARN("xgettext is required to update qt translations") fi @@ -669,19 +832,30 @@ else AC_MSG_RESULT([no]) fi -if test "x$use_tests$build_bitcoind$use_qt" = "xnonono"; then - AC_MSG_ERROR([No targets! Please specify at least one of: --enable-cli --enable-daemon --enable-gui or --enable-tests]) +AC_MSG_CHECKING([whether to reduce exports]) +if test x$use_reduce_exports != xno; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then + AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests]) fi AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) -AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes]) +AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes]) +AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes]) +AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes]) +AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) -AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) +AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno]) AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) +AM_CONDITIONAL([USE_LIBSECP256K1],[test x$use_libsecp256k1 = xyes]) AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version]) AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version]) @@ -696,17 +870,57 @@ AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) - +AC_SUBST(RELDFLAGS) +AC_SUBST(LIBTOOL_APP_LDFLAGS) AC_SUBST(USE_UPNP) AC_SUBST(USE_QRCODE) -AC_SUBST(INCLUDES) AC_SUBST(BOOST_LIBS) AC_SUBST(TESTDEFS) AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) -AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist]) +AC_SUBST(MINIUPNPC_CPPFLAGS) +AC_SUBST(MINIUPNPC_LIBS) +AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) -AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) +AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh]) + +dnl boost's m4 checks do something really nasty: they export these vars. As a +dnl result, they leak into secp256k1's configure and crazy things happen. +dnl Until this is fixed upstream and we've synced, we'll just un-export them. +CPPFLAGS_TEMP="$CPPFLAGS" +unset CPPFLAGS +CPPFLAGS="$CPPFLAGS_TEMP" + +LDFLAGS_TEMP="$LDFLAGS" +unset LDFLAGS +LDFLAGS="$LDFLAGS_TEMP" + +LIBS_TEMP="$LIBS" +unset LIBS +LIBS="$LIBS_TEMP" + +PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH" +unset PKG_CONFIG_PATH +PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP" + +PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR" +unset PKG_CONFIG_LIBDIR +PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" + +ac_configure_args="${ac_configure_args} --disable-shared --with-pic" +AC_CONFIG_SUBDIRS([src/secp256k1]) + AC_OUTPUT + +dnl Taken from https://wiki.debian.org/RpathIssue +case $host in + *-*-linux-gnu) + AC_MSG_RESULT([Fixing libtool for -rpath problems.]) + sed < libtool > libtool-2 \ + 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' + mv libtool-2 libtool + chmod 755 libtool + ;; +esac diff --git a/contrib/README.md b/contrib/README.md index 92d0a343db..dae975e9ef 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -19,13 +19,9 @@ Contains the script `github-merge.sh` for merging github pull requests securely ### [Linearize](/contrib/linearize) ### Construct a linear, no-fork, best version of the blockchain. -### [PyMiner](/contrib/pyminer) ### - -This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner, for study. - ### [Qos](/contrib/qos) ### -A Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. +A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. ### [Seeds](/contrib/seeds) ### Utility to generate the pnSeed[] array that is compiled into the client. diff --git a/contrib/bitcoind.bash-completion b/contrib/bitcoind.bash-completion index 03ef173c09..37ece25899 100644 --- a/contrib/bitcoind.bash-completion +++ b/contrib/bitcoind.bash-completion @@ -39,6 +39,10 @@ _bitcoind() { if ((cword > 4)); then case ${words[cword-4]} in + listtransactions) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; signrawtransaction) COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) ) return 0 @@ -52,7 +56,7 @@ _bitcoind() { _bitcoin_accounts return 0 ;; - gettxout|importprivkey) + getbalance|gettxout|importaddress|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -65,7 +69,7 @@ _bitcoind() { COMPREPLY=( $( compgen -W "add remove onetry" -- "$cur" ) ) return 0 ;; - getblock|getrawtransaction|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction) + getblock|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -115,7 +119,7 @@ _bitcoind() { # only parse help if senseful if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then - commands=$(_bitcoin_rpc help 2>/dev/null | awk '{ print $1; }') + commands=$(_bitcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') fi COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py index dcdea86bdc..38c0f69e4d 100644 --- a/contrib/bitrpc/bitrpc.py +++ b/contrib/bitrpc/bitrpc.py @@ -22,6 +22,18 @@ if cmd == "backupwallet": print access.backupwallet(path) except: print "\n---An error occurred---\n" + +elif cmd == "encryptwallet": + try: + pwd = getpass.getpass(prompt="Enter passphrase: ") + pwd2 = getpass.getpass(prompt="Repeat passphrase: ") + if pwd == pwd2: + access.encryptwallet(pwd) + print "\n---Wallet encrypted. Server stopping, restart to run with encrypted wallet---\n" + else: + print "\n---Passphrases do not match---\n" + except: + print "\n---An error occurred---\n" elif cmd == "getaccount": try: diff --git a/contrib/dash-qt.pro b/contrib/dash-qt.pro index 3f8f2f5c0e..dbcef9c200 100644 --- a/contrib/dash-qt.pro +++ b/contrib/dash-qt.pro @@ -132,7 +132,6 @@ SOURCES += \ ../src/chainparams.cpp \ ../src/checkpoints.cpp \ ../src/coins.cpp \ - ../src/core.cpp \ ../src/crypter.cpp \ ../src/cubehash.c \ ../src/dash-cli.cpp \ @@ -178,7 +177,6 @@ SOURCES += \ ../src/txdb.cpp \ ../src/txmempool.cpp \ ../src/util.cpp \ - ../src/version.cpp \ ../src/wallet.cpp \ ../src/walletdb.cpp \ ../src/test/Checkpoints_tests.cpp \ diff --git a/contrib/debian/changelog b/contrib/debian/changelog index df7a2837ea..f31f238711 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,3 +1,9 @@ +bitcoin (0.9.3-precise1) precise; urgency=medium + + * New upstream releases. + + -- Matt Corallo (BlueMatt) Fri, 26 Sep 2014 12:01:00 -0700 + bitcoin (0.9.1-precise1) precise; urgency=medium * New upstream release. diff --git a/contrib/debian/control b/contrib/debian/control index 9b6df8e717..72cfb9747c 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -1,11 +1,12 @@ -Source: bitcoin +Source: dash Section: utils Priority: optional -Maintainer: Jonas Smedegaard -Uploaders: Micah Anderson +Maintainer: Jonas Smedegaard ***TODO*** +Uploaders: Micah Anderson ***TODO*** Build-Depends: debhelper, devscripts, automake, + libtool, bash-completion, libboost-system-dev (>> 1.35) | libboost-system1.35-dev, libdb4.8++-dev, @@ -21,38 +22,37 @@ Build-Depends: debhelper, libqrencode-dev, libprotobuf-dev, protobuf-compiler Standards-Version: 3.9.2 -Homepage: http://www.bitcoin.org/ -Vcs-Git: git://github.com/bitcoin/bitcoin.git -Vcs-Browser: http://github.com/bitcoin/bitcoin +Homepage: http://www.dashpay.io/ +Vcs-Git: git://github.com/dashpay/dash.git +Vcs-Browser: http://github.com/dashpay/dash -Package: bitcoind +Package: dashd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: peer-to-peer network based digital currency - daemon - Bitcoin is a free open source peer-to-peer electronic cash system that + Dash is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending. . Full transaction history is stored locally at each client. This - requires 20+ GB of space, slowly growing. + requires 1+ GB of space, slowly growing. . + This package provides the daemon, dashd, and the CLI tool + dash-cli to interact with the daemon. - This package provides the daemon, bitcoind, and the CLI tool - bitcoin-cli to interact with the daemon. - -Package: bitcoin-qt +Package: dash-qt Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: peer-to-peer network based digital currency - Qt GUI - Bitcoin is a free open source peer-to-peer electronic cash system that + Dash is a free open source peer-to-peer electronic cash system that is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending. . Full transaction history is stored locally at each client. This - requires 20+ GB of space, slowly growing. + requires 1+ GB of space, slowly growing. . - This package provides Bitcoin-Qt, a GUI for Bitcoin based on Qt. + This package provides Dash-Qt, a GUI for Dash based on Qt. diff --git a/contrib/debian/examples/dash.conf b/contrib/debian/examples/dash.conf index c09570bb3e..be781d1bb1 100644 --- a/contrib/debian/examples/dash.conf +++ b/contrib/debian/examples/dash.conf @@ -1,79 +1,110 @@ -# dash.conf configuration file. Lines beginning with # are comments. - - +## +## dash.conf configuration file. Lines beginning with # are comments. +## + # Network-related settings: # Run on the test network instead of the real dash network. -#testnet=1 +#testnet=0 -# Connect via a socks4 proxy +# Run a regression test network +#regtest=0 + +# Connect via a SOCKS5 proxy #proxy=127.0.0.1:9050 +############################################################## +## Quick Primer on addnode vs connect ## +## Let's say for instance you use addnode=4.2.2.4 ## +## addnode will connect you to and tell you about the ## +## nodes connected to 4.2.2.4. In addition it will tell ## +## the other nodes connected to it that you exist so ## +## they can connect to you. ## +## connect will not do the above when you 'connect' to it. ## +## It will *only* connect you to 4.2.2.4 and no one else.## +## ## +## So if you're behind a firewall, or have other problems ## +## finding nodes, add some using 'addnode'. ## +## ## +## If you want to stay private, use 'connect' to only ## +## connect to "trusted" nodes. ## +## ## +## If you run multiple nodes on a LAN, there's no need for ## +## all of them to open lots of connections. Instead ## +## 'connect' them all to one node that is port forwarded ## +## and has lots of connections. ## +## Thanks goes to [Noodle] on Freenode. ## +############################################################## + # Use as many addnode= settings as you like to connect to specific peers #addnode=69.164.218.197 #addnode=10.0.0.2:9999 -# ... or use as many connect= settings as you like to connect ONLY -# to specific peers: +# Alternatively use as many connect= settings as you like to connect ONLY to specific peers #connect=69.164.218.197 #connect=10.0.0.1:9999 +# Listening mode, enabled by default except when 'connect' is being used +#listen=1 + # Maximum number of inbound+outbound connections. #maxconnections= - +# # JSON-RPC options (for controlling a running Dash/dashd process) +# -# server=1 tells Dash to accept JSON-RPC commands. -#server=1 +# server=1 tells Dash-QT and dashd to accept JSON-RPC commands +#server=0 # You must set rpcuser and rpcpassword to secure the JSON-RPC api #rpcuser=Ulysseys -#rpcpassword=YourSuperGreatPasswordNumber_385593 +#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593 -# By default, only RPC connections from localhost are allowed. Specify -# as many rpcallowip= settings as you like to allow connections from -# other hosts (and you may use * as a wildcard character): -#rpcallowip=10.1.1.34 -#rpcallowip=192.168.1.* +# How many seconds dash will wait for a complete RPC HTTP request. +# after the HTTP connection is established. +#rpctimeout=30 + +# By default, only RPC connections from localhost are allowed. +# Specify as many rpcallowip= settings as you like to allow connections from other hosts, +# either as a single IPv4/IPv6 or with a subnet specification. + +# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED, +# because the rpcpassword is transmitted over the network unencrypted. + +# server=1 tells Dash-QT to accept JSON-RPC commands. +# it is also read by dashd to determine if RPC should be enabled +#rpcallowip=10.1.1.34/255.255.255.0 +#rpcallowip=1.2.3.4/24 +#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 # Listen for RPC connections on this TCP port: -rpcport=9998 +#rpcport=9998 # You can use Dash or dashd to send commands to Dash/dashd # running on another host using this option: -rpcconnect=127.0.0.1 +#rpcconnect=127.0.0.1 # Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate # with Dash -server or dashd #rpcssl=1 # OpenSSL settings used when rpcssl=1 -rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH -rpcsslcertificatechainfile=server.cert -rpcsslprivatekeyfile=server.pem +#rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH +#rpcsslcertificatechainfile=server.cert +#rpcsslprivatekeyfile=server.pem # Miscellaneous options -# Set gen=1 to attempt to generate dashs -gen=0 - -# Use SSE instructions to try to generate dashs faster. -#4way=1 - # Pre-generate this many public/private key pairs, so wallet backups will be valid for # both prior transactions and several dozen future transactions. -keypool=100 +#keypool=100 # Pay an optional transaction fee every time you send dashs. Transactions with fees # are more likely than free transactions to be included in generated blocks, so may # be validated sooner. -paytxfee=0.00 - -# Allow direct connections for the 'pay via IP address' feature. -#allowreceivebyip=1 - +#paytxfee=0.00 # User interface options diff --git a/contrib/debian/manpages/dash-qt.1 b/contrib/debian/manpages/dash-qt.1 index 1e619fa586..18f38c95b4 100644 --- a/contrib/debian/manpages/dash-qt.1 +++ b/contrib/debian/manpages/dash-qt.1 @@ -32,10 +32,7 @@ Set database cache size in megabytes (default: 25) Specify connection timeout in milliseconds (default: 5000) .TP \fB\-proxy=\fR -Connect through socks proxy -.TP -\fB\-socks=\fR -Select the version of socks proxy to use (4\-5, default: 5) +Connect through SOCKS5 proxy .TP \fB\-tor=\fR Use proxy to reach tor hidden services (default: same as \fB\-proxy\fR) diff --git a/contrib/debian/manpages/dash.conf.5 b/contrib/debian/manpages/dash.conf.5 index e4304d86cc..319c84b445 100644 --- a/contrib/debian/manpages/dash.conf.5 +++ b/contrib/debian/manpages/dash.conf.5 @@ -2,7 +2,7 @@ .SH NAME dash.conf \- dash configuration file .SH SYNOPSIS -All command-line options (except for '\-datadir' and '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. +All command-line options (except for '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. .TP The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character. .TP diff --git a/contrib/debian/manpages/dashd.1 b/contrib/debian/manpages/dashd.1 index fe0d744fda..781c188181 100644 --- a/contrib/debian/manpages/dashd.1 +++ b/contrib/debian/manpages/dashd.1 @@ -28,7 +28,7 @@ Start minimized Specify data directory .TP \fB\-proxy=\fR -Connect through socks4 proxy +Connect through SOCKS5 proxy .TP \fB\-addnode=\fR Add a node to connect to diff --git a/contrib/devtools/github-merge.sh b/contrib/devtools/github-merge.sh index e42b71a54a..6f68496ed8 100755 --- a/contrib/devtools/github-merge.sh +++ b/contrib/devtools/github-merge.sh @@ -49,11 +49,11 @@ fi # Initialize source branches. git checkout -q "$BRANCH" if git fetch -q "$HOST":"$REPO" "+refs/pull/$PULL/*:refs/heads/pull/$PULL/*"; then - if ! git log -1q "refs/heads/pull/$PULL/head" >/dev/null 2>&1; then + if ! git log -q -1 "refs/heads/pull/$PULL/head" >/dev/null 2>&1; then echo "ERROR: Cannot find head of pull request #$PULL on $HOST:$REPO." >&2 exit 3 fi - if ! git log -1q "refs/heads/pull/$PULL/merge" >/dev/null 2>&1; then + if ! git log -q -1 "refs/heads/pull/$PULL/merge" >/dev/null 2>&1; then echo "ERROR: Cannot find merge of pull request #$PULL on $HOST:$REPO." >&2 exit 3 fi @@ -136,6 +136,9 @@ else echo "Dropping you on a shell so you can try building/testing the merged source." >&2 echo "Run 'git diff HEAD~' to show the changes being merged." >&2 echo "Type 'exit' when done." >&2 + if [[ -f /etc/debian_version ]]; then # Show pull number in prompt on Debian default prompt + export debian_chroot="$PULL" + fi bash -i read -p "Press 'm' to accept the merge. " -n 1 -r >&2 echo diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 8dd6d8f037..f3999f1c0b 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -41,6 +41,10 @@ MAX_VERSIONS = { 'GLIBCXX': (3,4,13), 'GLIBC': (2,11) } +# Ignore symbols that are exported as part of every executable +IGNORE_EXPORTS = { +'_edata', '_end', '_init', '__bss_start', '_fini' +} READELF_CMD = '/usr/bin/readelf' CPPFILT_CMD = '/usr/bin/c++filt' @@ -105,6 +109,8 @@ if __name__ == '__main__': retval = 1 # Check exported symbols for sym,version in read_symbols(filename, False): + if sym in IGNORE_EXPORTS: + continue print('%s: export of symbol %s not allowed' % (filename, cppfilt(sym))) retval = 1 diff --git a/contrib/gitian-descriptors/README.md b/contrib/gitian-descriptors/README.md index babb28b089..161852b415 100644 --- a/contrib/gitian-descriptors/README.md +++ b/contrib/gitian-descriptors/README.md @@ -27,7 +27,6 @@ Once you've got the right hardware and software: # Create base images cd gitian-builder - bin/make-base-vm --suite precise --arch i386 bin/make-base-vm --suite precise --arch amd64 cd .. diff --git a/contrib/gitian-descriptors/boost-linux.yml b/contrib/gitian-descriptors/boost-linux.yml deleted file mode 100644 index bd35346337..0000000000 --- a/contrib/gitian-descriptors/boost-linux.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: "boost" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "g++" -- "unzip" -- "pkg-config" -- "libtool" -- "faketime" -- "bsdmainutils" -- "zip" -- "libz-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "boost_1_55_0.tar.bz2" -script: | - STAGING="$HOME/install" - TEMPDIR="$HOME/tmp" - export LIBRARY_PATH="$STAGING/lib" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - # Input Integrity Check - echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c - - mkdir -p "$STAGING" - tar --warning=no-timestamp -xjf boost_1_55_0.tar.bz2 - cd boost_1_55_0 - GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) - # note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags - echo "using gcc : $GCCVERSION : g++ - : - \"-frandom-seed=boost1 -fPIC\" - ;" > user-config.jam - - ./bootstrap.sh --without-icu - - ./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS -d+2 install - - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $STAGING -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd "$STAGING" - find | sort | zip -X@ $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip diff --git a/contrib/gitian-descriptors/boost-win.yml b/contrib/gitian-descriptors/boost-win.yml deleted file mode 100644 index db5d6bab1d..0000000000 --- a/contrib/gitian-descriptors/boost-win.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -name: "boost" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "faketime" -- "zip" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "boost_1_55_0.tar.bz2" -- "boost-mingw-gas-cross-compile-2013-03-03.patch" -script: | - # Defines - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Input Integrity Check - echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c - echo "d2b7f6a1d7051faef3c9cf41a92fa3671d905ef1e1da920d07651a43299f6268 boost-mingw-gas-cross-compile-2013-03-03.patch" | shasum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar --warning=no-timestamp -xjf $INDIR/boost_1_55_0.tar.bz2 - cd boost_1_55_0 - GCCVERSION=$($HOST-g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) - echo "using gcc : $GCCVERSION : $HOST-g++ - : - $HOST-windres - $HOST-ar - -frandom-seed=boost1 - $HOST-ranlib - ;" > user-config.jam - ./bootstrap.sh --without-icu - - # Workaround: Upstream boost dev refuses to include patch that would allow Free Software cross-compile toolchain to work - # This patch was authored by the Fedora package developer and ships in Fedora's mingw32-boost. - # Please obtain the exact patch that matches the above sha256sum from one of the following mirrors. - # - # Read History: https://svn.boost.org/trac/boost/ticket/7262 - # History Mirror: http://rose.makesad.us/~paulproteus/mirrors/7262%20Boost.Context%20fails%20to%20build%20using%20MinGW.html - # - # Patch: https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch - # Patch Mirror: http://wtogami.fedorapeople.org/boost-mingw-gas-cross-compile-2013-03-03.patch - # Patch Mirror: http://mindstalk.net/host/boost-mingw-gas-cross-compile-2013-03-03.patch - # Patch Mirror: http://rose.makesad.us/~paulproteus/mirrors/boost-mingw-gas-cross-compile-2013-03-03.patch - patch -p0 < $INDIR/boost-mingw-gas-cross-compile-2013-03-03.patch - - # Bug Workaround: boost-1.54.0 broke the ability to disable zlib, still broken in 1.55 - # https://svn.boost.org/trac/boost/ticket/9156 - sed -i 's^\[ ac.check-library /zlib//zlib : /zlib//zlib^^' libs/iostreams/build/Jamfile.v2 - sed -i 's^zlib.cpp gzip.cpp \]^^' libs/iostreams/build/Jamfile.v2 - - # http://statmt.org/~s0565741/software/boost_1_52_0/libs/context/doc/html/context/requirements.html - # "For cross-compiling the lib you must specify certain additional properties at bjam command line: target-os, abi, binary-format, architecture and address-model." - ./bjam toolset=gcc binary-format=pe target-os=windows threadapi=win32 address-model=$BITS threading=multi variant=release link=static runtime-link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete --prefix="$INSTALLPREFIX" $MAKEOPTS install - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd "$INSTALLPREFIX" - find | sort | zip -X@ $OUTDIR/boost-win$BITS-1.55.0-gitian-r6.zip - done # for BITS in - diff --git a/contrib/gitian-descriptors/deps-linux.yml b/contrib/gitian-descriptors/deps-linux.yml deleted file mode 100644 index d1e37833d9..0000000000 --- a/contrib/gitian-descriptors/deps-linux.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -name: "bitcoin" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "g++" -- "unzip" -- "zip" -- "pkg-config" -- "libtool" -- "faketime" -- "bsdmainutils" -reference_datetime: "2013-06-01 00:00:00" -remotes: [] -files: -- "openssl-1.0.1k.tar.gz" -- "miniupnpc-1.9.20140701.tar.gz" -- "qrencode-3.4.3.tar.bz2" -- "protobuf-2.5.0.tar.bz2" -- "db-4.8.30.NC.tar.gz" -script: | - STAGING="$HOME/install" - TEMPDIR="$HOME/tmp" - OPTFLAGS='-O2' - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - export LIBRARY_PATH="$STAGING/lib" - # Integrity Check - echo "8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c openssl-1.0.1k.tar.gz" | sha256sum -c - echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c - echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - - # - tar xzf openssl-1.0.1k.tar.gz - cd openssl-1.0.1k - # need -fPIC to avoid relocation error in 64 bit builds - ./config no-shared no-zlib no-dso no-krb5 --openssldir=$STAGING -fPIC - # need to build OpenSSL with faketime because a timestamp is embedded into cversion.o - make - make install_sw - cd .. - # - tar xzfm miniupnpc-1.9.20140701.tar.gz - cd miniupnpc-1.9.20140701 - # miniupnpc is always built with -fPIC - INSTALLPREFIX=$STAGING make $MAKEOPTS install - rm -f $STAGING/lib/libminiupnpc.so* # no way to skip shared lib build - cd .. - # - tar xjf qrencode-3.4.3.tar.bz2 - cd qrencode-3.4.3 - unset FAKETIME # unset fake time during configure, as it does some clock sanity tests - # need --with-pic to avoid relocation error in 64 bit builds - ./configure --prefix=$STAGING --enable-static --disable-shared --with-pic --without-tools --disable-dependency-tracking - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS install - cd .. - # - tar xjf protobuf-2.5.0.tar.bz2 - cd protobuf-2.5.0 - mkdir -p $STAGING/host/bin - unset FAKETIME # unset fake time during configure, as it does some clock sanity tests - # need --with-pic to avoid relocation error in 64 bit builds - ./configure --prefix=$STAGING --bindir=$STAGING/host/bin --enable-static --disable-shared --with-pic --without-zlib - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS install - cd .. - # - tar xzf db-4.8.30.NC.tar.gz - cd db-4.8.30.NC/build_unix - # need --with-pic to avoid relocation error in 64 bit builds - ../dist/configure --prefix=$STAGING --enable-cxx --disable-shared --with-pic - # Workaround to prevent re-configuring by make; make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - make $MAKEOPTS library_build - make install_lib install_include - cd ../.. - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $STAGING -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $STAGING - find include lib bin host | sort | zip -X@ $OUTDIR/bitcoin-deps-linux${GBUILD_BITS}-gitian-r9.zip diff --git a/contrib/gitian-descriptors/deps-win.yml b/contrib/gitian-descriptors/deps-win.yml deleted file mode 100644 index 4e6ac954a6..0000000000 --- a/contrib/gitian-descriptors/deps-win.yml +++ /dev/null @@ -1,128 +0,0 @@ ---- -name: "bitcoin-deps" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "git-core" -- "zip" -- "faketime" -- "psmisc" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "openssl-1.0.1k.tar.gz" -- "db-4.8.30.NC.tar.gz" -- "miniupnpc-1.9.20140701.tar.gz" -- "zlib-1.2.8.tar.gz" -- "libpng-1.6.8.tar.gz" -- "qrencode-3.4.3.tar.bz2" -script: | - # - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Input Integrity Check - echo "8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c openssl-1.0.1k.tar.gz" | sha256sum -c - echo "12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz" | sha256sum -c - echo "26f3985bad7768b8483b793448ae49414cdc4451d0ec83e7c1944367e15f9f07 miniupnpc-1.9.20140701.tar.gz" | sha256sum -c - echo "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d zlib-1.2.8.tar.gz" | sha256sum -c - echo "32c7acf1608b9c8b71b743b9780adb7a7b347563dbfb4a5263761056da44cc96 libpng-1.6.8.tar.gz" | sha256sum -c - echo "dfd71487513c871bad485806bfd1fdb304dedc84d2b01a8fb8e0940b50597a98 qrencode-3.4.3.tar.bz2" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar xzf $INDIR/openssl-1.0.1k.tar.gz - cd openssl-1.0.1k - if [ "$BITS" == "32" ]; then - OPENSSL_TGT=mingw - else - OPENSSL_TGT=mingw64 - fi - ./Configure --cross-compile-prefix=$HOST- ${OPENSSL_TGT} no-shared no-dso --openssldir=$INSTALLPREFIX - make - make install_sw - cd .. - # - tar xzf $INDIR/db-4.8.30.NC.tar.gz - cd db-4.8.30.NC/build_unix - ../dist/configure --prefix=$INSTALLPREFIX --enable-mingw --enable-cxx --host=$HOST --disable-shared - make $MAKEOPTS library_build - make install_lib install_include - cd ../.. - # - tar xzf $INDIR/miniupnpc-1.9.20140701.tar.gz - cd miniupnpc-1.9.20140701 - echo " - --- miniupnpc-1.9/Makefile.mingw.orig 2013-09-29 18:52:51.014087958 -1000 - +++ miniupnpc-1.9/Makefile.mingw 2013-09-29 19:09:29.663318691 -1000 - @@ -67,8 +67,8 @@ - - wingenminiupnpcstrings.o: wingenminiupnpcstrings.c - - -miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings - - wingenminiupnpcstrings \$< \$@ - +miniupnpcstrings.h: miniupnpcstrings.h.in - + sed -e 's|OS/version|MSWindows/5.1.2600|' -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"VERSIONHERE\"|' \$< > \$@ - - minixml.o: minixml.c minixml.h miniupnpcstrings.h - - " | sed "s/VERSIONHERE/$(cat VERSION)/" | patch -p1 - mkdir -p dll - make -f Makefile.mingw CC=$HOST-gcc AR=$HOST-ar libminiupnpc.a - install -d $INSTALLPREFIX/include/miniupnpc - install *.h $INSTALLPREFIX/include/miniupnpc - install libminiupnpc.a $INSTALLPREFIX/lib - cd .. - # - tar xzf $INDIR/zlib-1.2.8.tar.gz - cd zlib-1.2.8 - CROSS_PREFIX=$HOST- ./configure --prefix=$INSTALLPREFIX --static - make - make install - cd .. - # - tar xzf $INDIR/libpng-1.6.8.tar.gz - cd libpng-1.6.8 - OPT="-O2" - CPPFLAGS="${OPT} -I$INSTALLPREFIX/include" CFLAGS="${OPT} -I$INSTALLPREFIX/include" LDFLAGS="${OPT} -L$INSTALLPREFIX/lib" ./configure --disable-shared --prefix=$INSTALLPREFIX --host=$HOST - make $MAKEOPTS - make install - cd .. - # - tar xjf $INDIR/qrencode-3.4.3.tar.bz2 - cd qrencode-3.4.3 - png_CFLAGS="-I$INSTALLPREFIX/include" png_LIBS="-L$INSTALLPREFIX/lib -lpng" ./configure --prefix=$INSTALLPREFIX --host=$HOST --enable-static --disable-shared --without-tools --disable-dependency-tracking - # Workaround to prevent re-configuring by make (resulting in missing m4 error); make all files have a date in the past - find . -print0 | xargs -r0 touch -t 200001010000 - make - make install - cd .. - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - find include lib | sort | zip -X@ $OUTDIR/bitcoin-deps-win$BITS-gitian-r16.zip - done # for BITS in diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 53b0663f8b..d53b5404bf 100755 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -1,86 +1,109 @@ --- -name: "dash" +name: "dash-linux-0.10" +enable_cache: true suites: - "precise" architectures: -- "i386" - "amd64" packages: -- "g++" +- "g++-multilib" - "git-core" -- "unzip" - "pkg-config" - "autoconf2.13" - "libtool" - "automake" - "faketime" - "bsdmainutils" -- "libqt4-core" -- "libqt4-gui" -- "libqt4-dbus" -- "libqt4-network" -- "libqt4-test" +- "binutils-gold" reference_datetime: "2014-01-10 00:00:00" remotes: -- "url": "https://github.com/darkcoin/darkcoin.git" +- "url": "https://github.com/dashpay/dash.git" "dir": "dash" -files: -- "bitcoin-deps-linux32-gitian-r9.zip" -- "bitcoin-deps-linux64-gitian-r9.zip" -- "boost-linux32-1.55.0-gitian-r1.zip" -- "boost-linux64-1.55.0-gitian-r1.zip" -- "qt-linux32-4.6.4-gitian-r1.tar.gz" -- "qt-linux64-4.6.4-gitian-r1.tar.gz" +files: [] script: | - STAGING="$HOME/install" - OPTFLAGS='-O2' - BINDIR="${OUTDIR}/bin/${GBUILD_BITS}" # 32/64 bit build specific output directory - TEMPDIR="$HOME/tempdir" - export TZ=UTC - export LIBRARY_PATH="$STAGING/lib" - export PATH="$STAGING/bin:$PATH" - mkdir -p ${BINDIR} - # - mkdir -p $STAGING - cd $STAGING - unzip ../build/bitcoin-deps-linux${GBUILD_BITS}-gitian-r9.zip - unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip - tar -zxf ../build/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz - cd ../build + WRAP_DIR=$HOME/wrapped + HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu" + CONFIGFLAGS="--enable-upnp-default --enable-glibc-back-compat" + FAKETIME_HOST_PROGS="" + FAKETIME_PROGS="date ar ranlib nm strip" + + export QT_RCC_TEST=1 + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE} + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + fi + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} - # Avoid exporting *any* symbols from the executable - # This avoids conflicts between the libraries statically linked into dash and any - # libraries we may link dynamically (such as Qt and OpenSSL, see issue #4094). - # It also avoids start-up overhead to not export any unnecessary symbols. - # To do this, build a linker script that marks all symbols as local. - LINKER_SCRIPT=$HOME/build/linker_version_script - echo ' - { - local: *; - };' > $LINKER_SCRIPT - function do_configure { - ./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=dash ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat - } - # cd dash + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host ./autogen.sh - do_configure + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` make dist - DISTNAME=`echo dash-*.tar.gz` + SOURCEDIST=`echo dash-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find dash-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd - # Build dynamic versions of everything - # (with static linking to boost and openssl as well a some non-OS deps) - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf ../$DISTNAME - do_configure --bindir=$BINDIR - make $MAKEOPTS - make $MAKEOPTS install-strip - make $MAKEOPTS clean + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST - # sort distribution tar file and normalize user/group/mtime information for deterministic output + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} + make install-strip + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz + cd ../../ + done mkdir -p $OUTDIR/src - rm -rf $TEMPDIR - mkdir -p $TEMPDIR - cd $TEMPDIR - tar -xvf $HOME/build/dash/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz + mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz + diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml new file mode 100644 index 0000000000..1792f9de3f --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -0,0 +1,37 @@ +--- +name: "bitcoin-dmg-signer" +suites: +- "precise" +architectures: +- "amd64" +packages: +- "libc6:i386" +- "faketime" +reference_datetime: "2013-06-01 00:00:00" +remotes: [] +files: +- "bitcoin-osx-unsigned.tar.gz" +- "signature.tar.gz" +script: | + WRAP_DIR=$HOME/wrapped + mkdir -p ${WRAP_DIR} + export PATH=`pwd`:$PATH + FAKETIME_PROGS="dmg genisoimage" + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + UNSIGNED=bitcoin-osx-unsigned.tar.gz + SIGNED=bitcoin-osx-signed.dmg + + tar -xf ${UNSIGNED} + ./detached-sig-apply.sh ${UNSIGNED} signature.tar.gz + ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o uncompressed.dmg signed-app + ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED} diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml new file mode 100644 index 0000000000..c09786a56c --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -0,0 +1,134 @@ +--- +name: "bitcoin-osx-0.10" +enable_cache: true +suites: +- "precise" +architectures: +- "amd64" +packages: +- "g++-multilib" +- "git-core" +- "pkg-config" +- "autoconf2.13" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +- "cmake" +- "libcap-dev" +- "libz-dev" +- "libbz2-dev" +reference_datetime: "2013-06-01 00:00:00" +remotes: +- "url": "https://github.com/bitcoin/bitcoin.git" + "dir": "bitcoin" +files: +- "MacOSX10.7.sdk.tar.gz" +script: | + WRAP_DIR=$HOME/wrapped + HOSTS="x86_64-apple-darwin11" + CONFIGFLAGS="--enable-upnp-default GENISOIMAGE=$WRAP_DIR/genisoimage" + FAKETIME_HOST_PROGS="" + FAKETIME_PROGS="ar ranlib date dmg genisoimage" + + export QT_RCC_TEST=1 + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE} + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + fi + + export ZERO_AR_DATE=1 + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} + + cd bitcoin + BASEPREFIX=`pwd`/depends + + mkdir -p ${BASEPREFIX}/SDKs + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.7.sdk.tar.gz + + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` + make dist + SOURCEDIST=`echo bitcoin-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd + + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST + + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} + make install-strip + + make deploydir + mkdir -p unsigned-app-${i} + cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i} + cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i} + cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i} + cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate + cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff + mv dist unsigned-app-${i} + pushd unsigned-app-${i} + find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz + popd + + make deploy + ${WRAP_DIR}/dmg dmg Bitcoin-Qt.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg + + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz + cd ../../ + done + mkdir -p $OUTDIR/src + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index e34447f34e..f1050ce961 100755 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -1,97 +1,115 @@ --- -name: "dash" +name: "dash-win-0.10" +enable_cache: true suites: - "precise" architectures: - "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" +packages: +- "g++" - "git-core" -- "unzip" -- "nsis" -- "faketime" +- "pkg-config" - "autoconf2.13" - "libtool" - "automake" -- "pkg-config" +- "faketime" - "bsdmainutils" - +- "mingw-w64" +- "g++-mingw-w64" +- "nsis" +- "zip" reference_datetime: "2014-01-10 00:00:00" remotes: -- "url": "https://github.com/darkcoin/darkcoin.git" +- "url": "https://github.com/dashpay/dash.git" "dir": "dash" -files: -- "qt-win32-5.2.0-gitian-r3.zip" -- "qt-win64-5.2.0-gitian-r3.zip" -- "boost-win32-1.55.0-gitian-r6.zip" -- "boost-win64-1.55.0-gitian-r6.zip" -- "bitcoin-deps-win32-gitian-r16.zip" -- "bitcoin-deps-win64-gitian-r16.zip" -- "protobuf-win32-2.5.0-gitian-r4.zip" -- "protobuf-win64-2.5.0-gitian-r4.zip" +files: [] script: | - # Defines - export TZ=UTC - INDIR=$HOME/build - OPTFLAGS='-O2' - TEMPDIR="$HOME/tempdir" - NEEDDIST=1 - # Qt: workaround for determinism in resource ordering - # Qt5's rcc uses a QHash to store the files for the resource. - # A security fix in QHash makes the ordering of keys to be different on every run - # (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268). - # This is good in general but qrc shouldn't be doing a traversal over a randomized container. - # The thorough solution would be to use QMap instead of QHash, but this requires patching Qt. - # For now luckily there is a test mode that forces a fixed seed. + WRAP_DIR=$HOME/wrapped + HOSTS="x86_64-w64-mingw32 i686-w64-mingw32" + CONFIGFLAGS="--enable-upnp-default" + FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip" + FAKETIME_PROGS="date makensis zip" + export QT_RCC_TEST=1 - for BITS in 32 64; do # for architectures - # - STAGING=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - BINDIR=$OUTDIR/$BITS - if [ "$BITS" == "32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - export PATH=$STAGING/host/bin:$PATH - mkdir -p $STAGING $BUILDDIR $BINDIR - # - cd $STAGING - unzip $INDIR/qt-win${BITS}-5.2.0-gitian-r3.zip - unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r16.zip - unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip - if [ "$NEEDDIST" == "1" ]; then - # Make source code archive which is architecture independent so it only needs to be done once - cd $HOME/build/dash - ./autogen.sh - ./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=dash ${OPTFLAGS}" - make dist - DISTNAME=`echo dash-*.tar.gz` - NEEDDIST=0 - fi - # Build platform-dependent executables from source archive - cd $BUILDDIR - mkdir -p distsrc - cd distsrc - tar --strip-components=1 -xf $HOME/build/dash/$DISTNAME - ./configure --enable-upnp-default --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=dash ${OPTFLAGS}" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - make $MAKEOPTS + export GZIP="-9n" + export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME"" + export TZ="UTC" + export BUILD_DIR=`pwd` + mkdir -p ${WRAP_DIR} + if test -n "$GBUILD_CACHE_ENABLED"; then + export SOURCES_PATH=${GBUILD_COMMON_CACHE} + export BASE_CACHE=${GBUILD_PACKAGE_CACHE} + mkdir -p ${BASE_CACHE} ${SOURCES_PATH} + fi + + # Create global faketime wrappers + for prog in ${FAKETIME_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${prog} + echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + + # Create per-host faketime wrappers + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + export PATH=${WRAP_DIR}:${PATH} + + cd bitcoin + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'` + make dist + SOURCEDIST=`echo dash-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd + + ORIGPATH="$PATH" + # Extract the release tarball into a dir for each host and build + for i in ${HOSTS}; do + export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH} + mkdir -p distsrc-${i} + cd distsrc-${i} + INSTALLPATH=`pwd`/installed/${DISTNAME} + mkdir -p ${INSTALLPATH} + tar --strip-components=1 -xf ../$SOURCEDIST + + ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} make deploy make install-strip - cp -f dash-*setup*.exe $BINDIR/ - unset LD_PRELOAD - unset FAKETIME - done # for BITS in - - # sort distribution tar file and normalize user/group/mtime information for deterministic output + cp -f dash-*setup*.exe $OUTDIR/ + cd installed + mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/ + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME} -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip + cd ../.. + done mkdir -p $OUTDIR/src - rm -rf $TEMPDIR - mkdir -p $TEMPDIR - cd $TEMPDIR - tar -xvf $HOME/build/dash/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME - + mv $SOURCEDIST $OUTDIR/src + mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip + mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip diff --git a/contrib/gitian-descriptors/protobuf-win.yml b/contrib/gitian-descriptors/protobuf-win.yml deleted file mode 100644 index d2fdcaa7f2..0000000000 --- a/contrib/gitian-descriptors/protobuf-win.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -name: "protobuf-win32" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "zip" -- "faketime" -reference_datetime: "2013-04-15 00:00:00" -remotes: [] -files: -- "protobuf-2.5.0.tar.bz2" -script: | - # - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - OPTFLAGS="-O2" - # Integrity Check - echo "13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 protobuf-2.5.0.tar.bz2" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - if [ "$BITS" == "32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $BUILDDIR - cd $BUILDDIR - # - tar xjf $INDIR/protobuf-2.5.0.tar.bz2 - cd protobuf-2.5.0 - # First: build a native (linux) protoc - ./configure --enable-shared=no --disable-dependency-tracking --without-zlib CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" - make - mkdir -p $INSTALLPREFIX/host/bin - cp src/protoc $INSTALLPREFIX/host/bin - # Now recompile with the mingw cross-compiler: - make distclean - ./configure --prefix=$INSTALLPREFIX --enable-shared=no --disable-dependency-tracking --without-zlib --with-protoc=$INSTALLPREFIX/host/bin/protoc --host=$HOST CXXFLAGS="-frandom-seed=11 ${OPTFLAGS}" - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - make - make install - # post-process all generated libraries to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name \*.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - find include lib host | sort | zip -X@ $OUTDIR/protobuf-win$BITS-2.5.0-gitian-r4.zip - unset LD_PRELOAD - unset FAKETIME - done # for BITS in diff --git a/contrib/gitian-descriptors/qt-linux.yml b/contrib/gitian-descriptors/qt-linux.yml deleted file mode 100644 index b163b4bb8c..0000000000 --- a/contrib/gitian-descriptors/qt-linux.yml +++ /dev/null @@ -1,264 +0,0 @@ ---- -name: "qt-linux" -suites: -- "precise" -architectures: -- "i386" -- "amd64" -packages: -- "zip" -- "unzip" -- "faketime" -- "unzip" -- "libxext-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "qt-everywhere-opensource-src-4.6.4.tar.gz" -script: | - export FAKETIME=$REFERENCE_DATETIME - export TZ=UTC - if [ "$GBUILD_BITS" == "32" ]; then - ARCH='i386-linux-gnu' - else - ARCH='x86_64-linux-gnu' - fi - # The purpose of this gitian build is not to actually build Qt, but to export - # the headers as well as pkgconfig files in a useable format so that we can - # pretend to link against an older version. The goal is to link to the - # system version of Qt 4. - # Also build development tools. - INSTALLPREFIX="$HOME/install" - # Integrity Check - echo "9ad4d46c721b53a429ed5a2eecfd3c239a9ab566562f183f99d3125f1a234250 qt-everywhere-opensource-src-4.6.4.tar.gz" | sha256sum -c - # Make install directories - mkdir -p $INSTALLPREFIX - mkdir -p $INSTALLPREFIX/include - PKGCONFIGDIR=$INSTALLPREFIX/lib/pkgconfig - mkdir -p $PKGCONFIGDIR - # - tar xzf qt-everywhere-opensource-src-4.6.4.tar.gz - cd qt-everywhere-opensource-src-4.6.4 - QTBUILDDIR=$(pwd) - sed 's/TODAY=`date +%Y-%m-%d`/TODAY=2011-01-30/' -i configure - - # Need to build 4.6-versioned host utilities as well (lrelease/qrc/lupdate/...) - ./configure -prefix $INSTALLPREFIX -confirm-license -release -opensource -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -no-script -no-scripttools -no-javascript-jit -no-webkit -no-svg -no-xmlpatterns -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-libtiff -no-opengl -nomake examples -nomake demos -nomake docs - # - make $MAKEOPTS -C src/tools install # (rcc, uic, moc) - make $MAKEOPTS -C tools/linguist/lrelease install # (lrelease) - # install includes and pkgconfig files - for DIR in src/corelib src/gui src/testlib src/dbus src/network; do - ( - cd $DIR - # extract module (QtCore/QtNetwork/...) from Makefile - MODULE=$(grep "QMAKE_TARGET *=" Makefile | cut -d = -f 2 | xargs) - # patch makefile so that not everything is build first - sed -i 's/first: all/first:/g' Makefile - make install_flat_headers install_class_headers install_targ_headers - # create and install pkgconfig descriptor - make ../../lib/pkgconfig/$MODULE.pc - sed -e "s,$QTBUILDDIR,$INSTALLPREFIX,g" ../../lib/pkgconfig/$MODULE.pc > $PKGCONFIGDIR/$MODULE.pc - # create links to existing Qt libraries - ln -sf /usr/lib/${ARCH}/lib${MODULE}.so.4 ${INSTALLPREFIX}/lib/lib${MODULE}.so - ) - done - - # Write our own configuration header, same as Ubuntu - # When we don't do this, the configuration will be without STL support (the QString from/to stdString methods) - QCONFIG=$INSTALLPREFIX/include/Qt/qconfig.h - echo ' - /* Qt Edition */ - #ifndef QT_EDITION - # define QT_EDITION QT_EDITION_OPENSOURCE - #endif - ' > $QCONFIG - - if [ "$GBUILD_BITS" == "32" ]; then - echo ' - /* Machine byte-order */ - #define Q_BIG_ENDIAN 4321 - #define Q_LITTLE_ENDIAN 1234 - #define QT_BUILD_KEY "i386 linux g++-4 full-config" - #define QT_BUILD_KEY_COMPAT "i686 Linux g++-4 full-config" - - #ifdef QT_BOOTSTRAPPED - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #else - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #endif - /* Machine Architecture */ - #ifndef QT_BOOTSTRAPPED - # define QT_ARCH_I386 - #else - # define QT_ARCH_I386 - #endif - /* Compile time features */ - #define QT_LARGEFILE_SUPPORT 64 - #define QT_POINTER_SIZE 4 - ' >> $QCONFIG - else - echo ' - /* Machine byte-order */ - #define Q_BIG_ENDIAN 4321 - #define Q_LITTLE_ENDIAN 1234 - #define QT_BUILD_KEY "x86_64 linux g++-4 full-config" - #define QT_BUILD_KEY_COMPAT "x86_64 Linux g++-4 full-config" - - #ifdef QT_BOOTSTRAPPED - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #else - #define Q_BYTE_ORDER Q_LITTLE_ENDIAN - #endif - /* Machine Architecture */ - #ifndef QT_BOOTSTRAPPED - # define QT_ARCH_X86_64 - #else - # define QT_ARCH_X86_64 - #endif - /* Compile time features */ - #define QT_LARGEFILE_SUPPORT 64 - #define QT_POINTER_SIZE 8 - ' >> $QCONFIG - fi - - echo ' - #ifndef QT_BOOTSTRAPPED - - #if defined(QT_NO_EGL) && defined(QT_EGL) - # undef QT_NO_EGL - #elif !defined(QT_NO_EGL) && !defined(QT_EGL) - # define QT_NO_EGL - #endif - - #if defined(QT_NO_GSTREAMER) && defined(QT_GSTREAMER) - # undef QT_NO_GSTREAMER - #elif !defined(QT_NO_GSTREAMER) && !defined(QT_GSTREAMER) - # define QT_NO_GSTREAMER - #endif - - #if defined(QT_NO_ICD) && defined(QT_ICD) - # undef QT_NO_ICD - #elif !defined(QT_NO_ICD) && !defined(QT_ICD) - # define QT_NO_ICD - #endif - - #if defined(QT_NO_IMAGEFORMAT_JPEG) && defined(QT_IMAGEFORMAT_JPEG) - # undef QT_NO_IMAGEFORMAT_JPEG - #elif !defined(QT_NO_IMAGEFORMAT_JPEG) && !defined(QT_IMAGEFORMAT_JPEG) - # define QT_NO_IMAGEFORMAT_JPEG - #endif - - #if defined(QT_NO_IMAGEFORMAT_MNG) && defined(QT_IMAGEFORMAT_MNG) - # undef QT_NO_IMAGEFORMAT_MNG - #elif !defined(QT_NO_IMAGEFORMAT_MNG) && !defined(QT_IMAGEFORMAT_MNG) - # define QT_NO_IMAGEFORMAT_MNG - #endif - - #if defined(QT_NO_IMAGEFORMAT_TIFF) && defined(QT_IMAGEFORMAT_TIFF) - # undef QT_NO_IMAGEFORMAT_TIFF - #elif !defined(QT_NO_IMAGEFORMAT_TIFF) && !defined(QT_IMAGEFORMAT_TIFF) - # define QT_NO_IMAGEFORMAT_TIFF - #endif - - #if defined(QT_NO_MULTIMEDIA) && defined(QT_MULTIMEDIA) - # undef QT_NO_MULTIMEDIA - #elif !defined(QT_NO_MULTIMEDIA) && !defined(QT_MULTIMEDIA) - # define QT_NO_MULTIMEDIA - #endif - - #if defined(QT_NO_OPENVG) && defined(QT_OPENVG) - # undef QT_NO_OPENVG - #elif !defined(QT_NO_OPENVG) && !defined(QT_OPENVG) - # define QT_NO_OPENVG - #endif - - #if defined(QT_NO_PHONON) && defined(QT_PHONON) - # undef QT_NO_PHONON - #elif !defined(QT_NO_PHONON) && !defined(QT_PHONON) - # define QT_NO_PHONON - #endif - - #if defined(QT_NO_PULSEAUDIO) && defined(QT_PULSEAUDIO) - # undef QT_NO_PULSEAUDIO - #elif !defined(QT_NO_PULSEAUDIO) && !defined(QT_PULSEAUDIO) - # define QT_NO_PULSEAUDIO - #endif - - #if defined(QT_NO_S60) && defined(QT_S60) - # undef QT_NO_S60 - #elif !defined(QT_NO_S60) && !defined(QT_S60) - # define QT_NO_S60 - #endif - - #if defined(QT_NO_STYLE_S60) && defined(QT_STYLE_S60) - # undef QT_NO_STYLE_S60 - #elif !defined(QT_NO_STYLE_S60) && !defined(QT_STYLE_S60) - # define QT_NO_STYLE_S60 - #endif - - #if defined(QT_NO_SXE) && defined(QT_SXE) - # undef QT_NO_SXE - #elif !defined(QT_NO_SXE) && !defined(QT_SXE) - # define QT_NO_SXE - #endif - - #if defined(QT_NO_WEBKIT) && defined(QT_WEBKIT) - # undef QT_NO_WEBKIT - #elif !defined(QT_NO_WEBKIT) && !defined(QT_WEBKIT) - # define QT_NO_WEBKIT - #endif - - #if defined(QT_NO_ZLIB) && defined(QT_ZLIB) - # undef QT_NO_ZLIB - #elif !defined(QT_NO_ZLIB) && !defined(QT_ZLIB) - # define QT_NO_ZLIB - #endif - - #if defined(QT_RUNTIME_XCURSOR) && defined(QT_NO_RUNTIME_XCURSOR) - # undef QT_RUNTIME_XCURSOR - #elif !defined(QT_RUNTIME_XCURSOR) && !defined(QT_NO_RUNTIME_XCURSOR) - # define QT_RUNTIME_XCURSOR - #endif - - #if defined(QT_RUNTIME_XFIXES) && defined(QT_NO_RUNTIME_XFIXES) - # undef QT_RUNTIME_XFIXES - #elif !defined(QT_RUNTIME_XFIXES) && !defined(QT_NO_RUNTIME_XFIXES) - # define QT_RUNTIME_XFIXES - #endif - - #if defined(QT_RUNTIME_XINERAMA) && defined(QT_NO_RUNTIME_XINERAMA) - # undef QT_RUNTIME_XINERAMA - #elif !defined(QT_RUNTIME_XINERAMA) && !defined(QT_NO_RUNTIME_XINERAMA) - # define QT_RUNTIME_XINERAMA - #endif - - #if defined(QT_RUNTIME_XINPUT) && defined(QT_NO_RUNTIME_XINPUT) - # undef QT_RUNTIME_XINPUT - #elif !defined(QT_RUNTIME_XINPUT) && !defined(QT_NO_RUNTIME_XINPUT) - # define QT_RUNTIME_XINPUT - #endif - - #if defined(QT_RUNTIME_XRANDR) && defined(QT_NO_RUNTIME_XRANDR) - # undef QT_RUNTIME_XRANDR - #elif !defined(QT_RUNTIME_XRANDR) && !defined(QT_NO_RUNTIME_XRANDR) - # define QT_RUNTIME_XRANDR - #endif - - #if defined(QT_USE_MATH_H_FLOATS) && defined(QT_NO_USE_MATH_H_FLOATS) - # undef QT_USE_MATH_H_FLOATS - #elif !defined(QT_USE_MATH_H_FLOATS) && !defined(QT_NO_USE_MATH_H_FLOATS) - # define QT_USE_MATH_H_FLOATS - #endif - - #endif // QT_BOOTSTRAPPED - - #define QT_VISIBILITY_AVAILABLE - ' >> $QCONFIG - cp $QCONFIG $INSTALLPREFIX/include/QtCore/qconfig.h - - cd $INSTALLPREFIX - # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - # Create a .tar.gz because .zip has problems with symbolic links - find | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/qt-linux${GBUILD_BITS}-4.6.4-gitian-r1.tar.gz diff --git a/contrib/gitian-descriptors/qt-win.yml b/contrib/gitian-descriptors/qt-win.yml deleted file mode 100644 index 6211d721aa..0000000000 --- a/contrib/gitian-descriptors/qt-win.yml +++ /dev/null @@ -1,92 +0,0 @@ ---- -name: "qt" -suites: -- "precise" -architectures: -- "amd64" -packages: -- "mingw-w64" -- "g++-mingw-w64" -- "zip" -- "unzip" -- "faketime" -- "libz-dev" -reference_datetime: "2011-01-30 00:00:00" -remotes: [] -files: -- "qt-everywhere-opensource-src-5.2.0.tar.gz" -- "bitcoin-deps-win32-gitian-r16.zip" -- "bitcoin-deps-win64-gitian-r16.zip" -script: | - # Defines - export TZ=UTC - INDIR=$HOME/build - TEMPDIR=$HOME/tmp - # Qt: workaround for determinism in resource ordering - # Qt5's rcc uses a QHash to store the files for the resource. - # A security fix in QHash makes the ordering of keys to be different on every run - # (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268). - # This is good in general but qrc shouldn't be doing a traversal over a randomized container. - # The thorough solution would be to use QMap instead of QHash, but this requires patching Qt. - # For now luckily there is a test mode that forces a fixed seed. - export QT_RCC_TEST=1 - # Integrity Check - echo "395ec72277c5786c65b8163ef5817fd03d0a1f524a6d47f53624baf8056f1081 qt-everywhere-opensource-src-5.2.0.tar.gz" | sha256sum -c - - for BITS in 32 64; do # for architectures - # - INSTALLPREFIX=$HOME/staging${BITS} - BUILDDIR=$HOME/build${BITS} - DEPSDIR=$HOME/deps${BITS} - if [ "$BITS" == "32" ]; then - HOST=i686-w64-mingw32 - else - HOST=x86_64-w64-mingw32 - fi - # - mkdir -p $INSTALLPREFIX $INSTALLPREFIX/host/bin $DEPSDIR $BUILDDIR - # - # Need mingw-compiled openssl from bitcoin-deps: - cd $DEPSDIR - unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r16.zip - # - cd $BUILDDIR - # - tar xzf $INDIR/qt-everywhere-opensource-src-5.2.0.tar.gz - cd qt-everywhere-opensource-src-5.2.0 - SPECNAME="win32-g++" - SPECFILE="qtbase/mkspecs/${SPECNAME}/qmake.conf" - sed 's/qt_instdate=`date +%Y-%m-%d`/qt_instdate=2011-01-30/' -i qtbase/configure - sed --posix "s|QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport|QMAKE_CFLAGS\t\t= -pipe -fno-keep-inline-dllexport -isystem /usr/$HOST/include/ -frandom-seed=qtbuild -I$DEPSDIR/include|" -i ${SPECFILE} - sed --posix "s|QMAKE_LFLAGS =|QMAKE_LFLAGS\t\t= -L$DEPSDIR/lib|" -i ${SPECFILE} - # Before we tried to pass arguments to ar (static linking) in using QMAKE_LIB, however - # qt removes the arguments for ar and provides a script which makes it impossible to pass the determinism flag - - # so rather than try to replace ar, post-process all libraries and plugins at the end. - # - # Don't load faketime while compiling Qt, qmake will get stuck in nearly infinite loops - #export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - #export FAKETIME=$REFERENCE_DATETIME - # - # Compile static libraries, and use statically linked openssl (-openssl-linked): - OPENSSL_LIBS="-L$DEPSDIR/lib -lssl -lcrypto -lgdi32" ./configure -prefix $INSTALLPREFIX -bindir $INSTALLPREFIX/host/bin -confirm-license -release -opensource -static -xplatform $SPECNAME -device-option CROSS_COMPILE="$HOST-" -no-audio-backend -no-javascript-jit -no-sql-sqlite -no-sql-odbc -no-nis -no-cups -no-iconv -no-dbus -no-gif -no-opengl -no-compile-examples -no-feature-style-windowsce -no-feature-style-windowsmobile -no-qml-debug -openssl-linked -skip qtsvg -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qtdeclarative -skip qtmultimedia -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtquick1 -skip qtquickcontrols -skip qtactiveqt -skip qtconnectivity -skip qtwinextras -skip qtxmlpatterns -skip qtscript -skip qtdoc -system-libpng -system-zlib - make $MAKEOPTS install - # post-process all generated libraries and plugins to be deterministic - # extract them to a temporary directory then re-build them deterministically - for LIB in $(find $INSTALLPREFIX -name *.a); do - rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR - $HOST-ar xv $LIB | cut -b5- > /tmp/list.txt - rm $LIB - $HOST-ar crsD $LIB $(cat /tmp/list.txt) - done - # - cd $INSTALLPREFIX - # Remove unused non-deterministic stuff - rm host/bin/qtpaths.exe lib/libQt5Bootstrap.a lib/libQt5Bootstrap.la - # as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date - export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 - export FAKETIME=$REFERENCE_DATETIME - find -print0 | xargs -r0 touch # fix up timestamps before packaging - find | sort | zip -X@ $OUTDIR/qt-win${BITS}-5.2.0-gitian-r3.zip - unset LD_PRELOAD - unset FAKETIME - done # for BITS in diff --git a/contrib/gitian-downloader/cfields-key.pgp b/contrib/gitian-downloader/cfields-key.pgp new file mode 100644 index 0000000000..6b0bd240ba --- /dev/null +++ b/contrib/gitian-downloader/cfields-key.pgp @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (GNU/Linux) + +mQINBFOHTh4BEADdKsRvmNhX+B+bcPsgMkp8ztwJA5g/rmrOlHQpKOOf4P2tAr6w +FmXCChWF9Iq3pDFQ0t0iq5rgisFPyrGVT/VToMmH+/PSLTyIdAlgkRYDMAPsMAFV +MaADH4yiAgJ3cdXtysjaNQV5O25ypqq6/obUjZJD5Enn6b/UgHe2+7LTmTNsskOx +5s/WPPht79EY1kM4JQfmDx68CsmqeSAlT6yeO3RQcLn/l46cfXiwzMO4h1hsZS1r +pgciRp0EHK9uAjF2rjqt8v4SDxwyTnwfpBBulzvH9mBf+HRXWzoTMR4sC/oOZext +hKAH/ex47BxN3HU3ftNhCK2c1xcU1UOGSjbf0RdbwuSCxxa7mktEDumvOxAk9EBB ++PDPv7jO1FBK3rsJdscYQIL0AiRyO49VfNLARa34OqUi8pOAxKBQ9plO02W1gp7a +DVBPI05TZ46Y8dTR2Bc1raAgOyxnXM7jfiQG2gSULiKAJAI4HwOiodaiiHAxDaIo +a3mtsmfN25TZUQuA0I0BvHbJvLRlVnyZm3XVOcwReKJpZJV4qRhd3XNrERZdz6ZK +cAZnyC/X+Uzo4HfnVSsJk1GpIa4seYyrVCFfHMiAA6SkgAUFbV26KCOv4rNR2GlV +l2fVhu1RKOEUJ8nRcEqf93SehRVYdI67LepIPgmIwi0KG4HhoTbIHDAKWQARAQAB +tCtDb3J5IEZpZWxkcyA8Y2ZpZWxkc0BiaXRjb2luZm91bmRhdGlvbi5vcmc+iQI4 +BBMBAgAiBQJTh04eAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAcJJH/ +6w73cBTiEADIGZSueBFmaOTJCgasKGguHns/n8P94EQBZr07rrgN99Rzp85WvDUN +Qa72wj3GNcAffN7aZlIWv4g+fjyr9AzHekjI/7iwwSYIfjfTR/xRUW7czRfKAOrK +iwpEzgv440i7PBvkS/AhNdUNkm+cJvaQUej/F2/O52qDLEpHuzvjAUUWlSeF9/oO +AjM9dfC24L5k5cVwQvH9noxk3EyuE7BuiGE5a+kKiORrtxiHeUG6GYQxuqrPucLU +fI67ETyXa0YSpYm5/O65BKMTMpmkMvv1JC2kqqsYTrO5p158CrKzq2xvpuG4ABsb +9KwICUGW31Ndr6TXwQJFa1b7VK4G1g6M1DFkVTOLJnEyOwgYxsXrV5QFpzpAOAji +6KcxNGeow1avAFYbqjjLgu9UNuq6b8du13hjkQxVs2NAP1Kd/u2ADwxQHMhZGVEC +9LIcLVSP9ShY6fR8m6fwSlJfpiV81uLNVD8KIyvp+pYTQ/FnxoPhPIwalYquBZKi +0u38igW75IzZ0fYvJgTumE/8ofSVkutVtrQb21eJclVrJGMNweTlJcJhAWdKkjDC +e6mSj8GItKV1ef+eusXSzs/wPyTaqgkELvvAOZdwUq3kobQErE5HOuPEOvcwuY96 +DcxLexirCGW5wCUq7Db0c0dUjQwzzb5OTW2jdnPVR0qxi29TnOJ2aLkCDQRTh04e +ARAAuJKpI6NTCQrjEqe9AYywN8676+fPS5bqXkyb/iub6MXeQdwpH0K42lXAaYMq +ow/0aLlvGWCHuJJGozoOWpTzQ+VPbhpdARoLCop5fYTpy8Q17ubLeeODDtr6jtDN +lmg+9PBIErIVUnUS2wNZuJRVsfwlLaU3T2v8kQnQ6AEbl/QwyWW9nB8rAWBu6Hvs +VdtcBmtHSr9xAGBGfW6rSVhTitikR4lWJPdNJxI3pLaswpLIUIQ1rssKO4glljcp +C6nhMvRkDLvDFvDP9QnmwY/A4ch5S6ANPrhOjQuu9njjQ+/ImrJTjAXqHwg5KdTc +NKxufgvi9elOQ422o0No3yKdRoRA4kdcUmqA9gNZDyX0ZTd17aNqc42Zt3aYLJ11 +bLZZp0qnfhkmhbsBZZtaLNkuF+RGPWysxY7KPMm+nHn6f3Wpr18E+T02wi02r4nS +HOQI+gppDqy3Vq3ZZNoUZynctiLZVHkqi+WYXqfD2tEn8UJKpht7jrZlNgkHFgT7 +T0/U4+JmaQ/HltE+IexAIH0GP0Jt6hmRoZimdoy8Q8NY5t/fn9CQNJm5InrHvooN +aFmZMvzGTGiTqBqnA/7k9FCUEG98LK11MsIssY8YE/F6HD69R3ISyRvhUbpFvhD8 +c6zOkEKngTWvyRevrDrDz2yoZ1+T1X350+92rbEc/8WyutcAEQEAAYkCHwQYAQIA +CQUCU4dOHgIbDAAKCRAcJJH/6w73cAakEACv4EUEjtFjqnGB0Lru5FKs1obWcf37 +c4a5yYvOw58dkEZ9hsq34qWGLT128n6R24KEG+3O4CbplAD5Kt2eAPracbPHMAn8 +TGmC+KjiGlBR5xCY9dD0fn5EbRWOa+Fdcj1DpneaqMl9vLnBbqGp7pa/MwSOc+FB +0Ms2rcGJJMNHgITfP22eCf6pvf/xq7kKbUJ3Kjqdc2hWlRMjC/OOeITdrgycfDk/ +AOzLNqk5q7bYOxna6rWDLGSkCATyQKaBTVK7wRd1VrIhI4vfFqy+BWYXyXJ0pxjS +eaCDwbWHX/KW+0qLsmHxFMAyHJPjs8LEwK/DRbmWhe1HzPcBKmpyjqlkuxPjAdSl +hP4+IBvVNLf2Kh3uFHehk9A6oCYZGe3lLfQnOxIantXF7IROTmiZZsb+08w6cIXE ++r6kWG6vP2aCVtzYNfY+2p5xfg3yMxcxENJki1WSCOq6WVf9IWFzSJu+0+eazD3L +3QpZoSX5VvT6x05C0Ay1ert0Q5MyF84Eh8mDqL4PhpWtQhZMp8SG4jqFVgrhM4sl +vWGYXGns4tbnNPiiksjBD8TTvG3+mt48sNJIpHThjdWJSZjllYG7jV8oi7HrX8M2 +LOwWWLYxHkqi9wpmrWHSmniex6ABozcqrb+EgSMnHuSd7glmOJxHToJIudJbKG5D +MrD0ofsytfy1LQ== +=DE4h +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config index b5e0561aa3..f5e6382b84 100644 --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -37,3 +37,6 @@ signers: E944AE667CF960B1004BC32FCA662BE18B877A60: name: "Andreas Schildbach" key: aschildbach + C060A6635913D98A3587D7DB1C2491FFEB0EF770: + name: "Cory Fields" + key: "cfields" diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config index 5d56db863e..06c164180d 100644 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -37,3 +37,6 @@ signers: E944AE667CF960B1004BC32FCA662BE18B877A60: name: "Andreas Schildbach" key: aschildbach + C060A6635913D98A3587D7DB1C2491FFEB0EF770: + name: "Cory Fields" + key: "cfields" diff --git a/contrib/init/README.md b/contrib/init/README.md new file mode 100644 index 0000000000..d3fa966583 --- /dev/null +++ b/contrib/init/README.md @@ -0,0 +1,10 @@ +Sample configuration files for: + +SystemD: bitcoind.service +Upstart: bitcoind.conf +OpenRC: bitcoind.openrc + bitcoind.openrcconf + +have been made available to assist packagers in creating node packages here. + +See doc/init.md for more information. diff --git a/contrib/init/bitcoind.conf b/contrib/init/bitcoind.conf new file mode 100644 index 0000000000..f9554eecde --- /dev/null +++ b/contrib/init/bitcoind.conf @@ -0,0 +1,65 @@ +description "Bitcoin Core Daemon" + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +env BITCOIND_BIN="/usr/bin/bitcoind" +env BITCOIND_USER="bitcoin" +env BITCOIND_GROUP="bitcoin" +env BITCOIND_PIDDIR="/var/run/bitcoind" +# upstart can't handle variables constructed with other variables +env BITCOIND_PIDFILE="/var/run/bitcoind/bitcoind.pid" +env BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" +env BITCOIND_DATADIR="/var/lib/bitcoind" + +expect fork + +respawn +respawn limit 5 120 +kill timeout 60 + +pre-start script + # this will catch non-existent config files + # bitcoind will check and exit with this very warning, but it can do so + # long after forking, leaving upstart to think everything started fine. + # since this is a commonly encountered case on install, just check and + # warn here. + if ! grep -qs '^rpcpassword=' "$BITCOIND_CONFIGFILE" ; then + echo "ERROR: You must set a secure rpcpassword to run bitcoind." + echo "The setting must appear in $BITCOIND_CONFIGFILE" + echo + echo "This password is security critical to securing wallets " + echo "and must not be the same as the rpcuser setting." + echo "You can generate a suitable random password using the following" + echo "command from the shell:" + echo + echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" + echo + echo "It is also recommended that you also set alertnotify so you are " + echo "notified of problems:" + echo + echo "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \ + "admin@foo.com" + echo + exit 1 + fi + + mkdir -p "$BITCOIND_PIDDIR" + chmod 0755 "$BITCOIND_PIDDIR" + chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_PIDDIR" + chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_CONFIGFILE" + chmod 0660 "$BITCOIND_CONFIGFILE" +end script + +exec start-stop-daemon \ + --start \ + --pidfile "$BITCOIND_PIDFILE" \ + --chuid $BITCOIND_USER:$BITCOIND_GROUP \ + --exec "$BITCOIND_BIN" \ + -- \ + -pid="$BITCOIND_PIDFILE" \ + -conf="$BITCOIND_CONFIGFILE" \ + -datadir="$BITCOIND_DATADIR" \ + -disablewallet \ + -daemon + diff --git a/contrib/init/bitcoind.openrc b/contrib/init/bitcoind.openrc new file mode 100644 index 0000000000..1f7758c920 --- /dev/null +++ b/contrib/init/bitcoind.openrc @@ -0,0 +1,86 @@ +#!/sbin/runscript + +# backward compatibility for existing gentoo layout +# +if [ -d "/var/lib/bitcoin/.bitcoin" ]; then + BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoin/.bitcoin" +else + BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoind" +fi + +BITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/bitcoin/bitcoin.conf} +BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind} +BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid} +BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}} +BITCOIND_USER=${BITCOIND_USER:-bitcoin} +BITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin} +BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind} + +name="Bitcoin Core Daemon" +description="Bitcoin crypto-currency p2p network daemon" + +command="/usr/bin/bitcoind" +command_args="-pid=\"${BITCOIND_PIDFILE}\" \ + -conf=\"${BITCOIND_CONFIGFILE}\" \ + -datadir=\"${BITCOIND_DATADIR}\" \ + -daemon \ + ${BITCOIND_OPTS}" + +required_files="${BITCOIND_CONFIGFILE}" +start_stop_daemon_args="-u ${BITCOIND_USER} \ + -N ${BITCOIND_NICE:-0} -w 2000" +pidfile="${BITCOIND_PIDFILE}" +retry=60 + +depend() { + need localmount net +} + +# verify +# 1) that the datadir exists and is writable (or create it) +# 2) that a directory for the pid exists and is writable +# 3) ownership and permissions on the config file +start_pre() { + checkpath \ + -d \ + --mode 0750 \ + --owner "${BITCOIND_USER}:${BITCOIND_GROUP}" \ + "${BITCOIND_DATADIR}" + + checkpath \ + -d \ + --mode 0755 \ + --owner "${BITCOIND_USER}:${BITCOIND_GROUP}" \ + "${BITCOIND_PIDDIR}" + + checkpath -f \ + -o ${BITCOIND_USER}:${BITCOIND_GROUP} \ + -m 0660 \ + ${BITCOIND_CONFIGFILE} + + checkconfig || return 1 +} + +checkconfig() +{ + if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then + eerror "" + eerror "ERROR: You must set a secure rpcpassword to run bitcoind." + eerror "The setting must appear in ${BITCOIND_CONFIGFILE}" + eerror "" + eerror "This password is security critical to securing wallets " + eerror "and must not be the same as the rpcuser setting." + eerror "You can generate a suitable random password using the following" + eerror "command from the shell:" + eerror "" + eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" + eerror "" + eerror "It is also recommended that you also set alertnotify so you are " + eerror "notified of problems:" + eerror "" + eerror "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \ + "admin@foo.com" + eerror "" + return 1 + fi +} diff --git a/contrib/init/bitcoind.openrcconf b/contrib/init/bitcoind.openrcconf new file mode 100644 index 0000000000..d8d7f58337 --- /dev/null +++ b/contrib/init/bitcoind.openrcconf @@ -0,0 +1,27 @@ +# /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind + +# Config file location +#BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" + +# What directory to write pidfile to? (created and owned by $BITCOIND_USER) +#BITCOIND_PIDDIR="/var/run/bitcoind" + +# What filename to give the pidfile +#BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/bitcoind.pid" + +# Where to write bitcoind data (be mindful that the blockchain is large) +#BITCOIND_DATADIR="/var/lib/bitcoind" + +# User and group to own bitcoind process +#BITCOIND_USER="bitcoin" +#BITCOIND_GROUP="bitcoin" + +# Path to bitcoind executable +#BITCOIND_BIN="/usr/bin/bitcoind" + +# Nice value to run bitcoind under +#BITCOIND_NICE=0 + +# Additional options (avoid -conf and -datadir, use flags above) +BITCOIND_OPTS="-disablewallet" + diff --git a/contrib/init/bitcoind.service b/contrib/init/bitcoind.service new file mode 100644 index 0000000000..9132957c38 --- /dev/null +++ b/contrib/init/bitcoind.service @@ -0,0 +1,22 @@ +[Unit] +Description=Bitcoin's distributed currency daemon +After=network.target + +[Service] +User=bitcoin +Group=bitcoin + +Type=forking +PIDFile=/var/lib/bitcoind/bitcoind.pid +ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \ +-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet + +Restart=always +PrivateTmp=true +TimeoutStopSec=60s +TimeoutStartSec=2s +StartLimitInterval=120s +StartLimitBurst=5 + +[Install] +WantedBy=multi-user.target diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index 70b9f034cd..157586e4d4 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -1,2 +1,33 @@ -### Linearize ### -Construct a linear, no-fork, best version of the blockchain. \ No newline at end of file +# Linearize +Construct a linear, no-fork, best version of the blockchain. + +## Step 1: Download hash list + + $ ./linearize-hashes.py linearize.cfg > hashlist.txt + +Required configuration file settings for linearize-hashes: +* RPC: rpcuser, rpcpassword + +Optional config file setting for linearize-hashes: +* RPC: host, port +* Block chain: min_height, max_height + +## Step 2: Copy local block data + + $ ./linearize-data.py linearize.cfg + +Required configuration file settings: +* "input": bitcoind blocks/ directory containing blkNNNNN.dat +* "hashlist": text file containing list of block hashes, linearized-hashes.py +output. +* "output_file": bootstrap.dat + or +* "output": output directory for linearized blocks/blkNNNNN.dat output + +Optional config file setting for linearize-data: +* "netmagic": network magic number +* "max_out_sz": maximum output file size (default 1000*1000*1000) +* "split_timestamp": Split files when a new month is first seen, in addition to +reaching a maximum file size. +* "file_timestamp": Set each file's last-modified time to that of the +most recent block in that file. diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg index 4246e12983..9c0824ee1f 100644 --- a/contrib/linearize/example-linearize.cfg +++ b/contrib/linearize/example-linearize.cfg @@ -1,12 +1,19 @@ -# bitcoind RPC settings +# bitcoind RPC settings (linearize-hashes) rpcuser=someuser rpcpassword=somepassword host=127.0.0.1 port=9998 -# bootstrap.dat settings -netmagic=f9beb4d9 -max_height=279000 -output=bootstrap.dat +# bootstrap.dat hashlist settings (linearize-hashes) +max_height=313000 +# bootstrap.dat input/output settings (linearize-data) +netmagic=f9beb4d9 +input=/home/example/.bitcoin/blocks +output_file=/home/example/Downloads/bootstrap.dat +hashlist=hashlist.txt +split_year=1 + +# Maxmimum size in bytes of out-of-order blocks cache in memory +out_of_order_cache_sz = 100000000 diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py new file mode 100755 index 0000000000..2dac3a614b --- /dev/null +++ b/contrib/linearize/linearize-data.py @@ -0,0 +1,299 @@ +#!/usr/bin/python +# +# linearize-data.py: Construct a linear, no-fork version of the chain. +# +# Copyright (c) 2013-2014 The Bitcoin developers +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# + +from __future__ import print_function, division +import json +import struct +import re +import os +import base64 +import httplib +import sys +import hashlib +import datetime +import time +from collections import namedtuple + +settings = {} + +def uint32(x): + return x & 0xffffffffL + +def bytereverse(x): + return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | + (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) + +def bufreverse(in_buf): + out_words = [] + for i in range(0, len(in_buf), 4): + word = struct.unpack('@I', in_buf[i:i+4])[0] + out_words.append(struct.pack('@I', bytereverse(word))) + return ''.join(out_words) + +def wordreverse(in_buf): + out_words = [] + for i in range(0, len(in_buf), 4): + out_words.append(in_buf[i:i+4]) + out_words.reverse() + return ''.join(out_words) + +def calc_hdr_hash(blk_hdr): + hash1 = hashlib.sha256() + hash1.update(blk_hdr) + hash1_o = hash1.digest() + + hash2 = hashlib.sha256() + hash2.update(hash1_o) + hash2_o = hash2.digest() + + return hash2_o + +def calc_hash_str(blk_hdr): + hash = calc_hdr_hash(blk_hdr) + hash = bufreverse(hash) + hash = wordreverse(hash) + hash_str = hash.encode('hex') + return hash_str + +def get_blk_dt(blk_hdr): + members = struct.unpack(" self.maxOutSz): + self.outF.close() + if self.setFileTime: + os.utime(outFname, (int(time.time()), highTS)) + self.outF = None + self.outFname = None + self.outFn = outFn + 1 + self.outsz = 0 + + (blkDate, blkTS) = get_blk_dt(blk_hdr) + if self.timestampSplit and (blkDate > self.lastDate): + print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str) + lastDate = blkDate + if outF: + outF.close() + if setFileTime: + os.utime(outFname, (int(time.time()), highTS)) + self.outF = None + self.outFname = None + self.outFn = self.outFn + 1 + self.outsz = 0 + + if not self.outF: + if self.fileOutput: + outFname = self.settings['output_file'] + else: + outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn) + print("Output file" + outFname) + self.outF = open(outFname, "wb") + + self.outF.write(inhdr) + self.outF.write(blk_hdr) + self.outF.write(rawblock) + self.outsz = self.outsz + len(inhdr) + len(blk_hdr) + len(rawblock) + + self.blkCountOut = self.blkCountOut + 1 + if blkTS > self.highTS: + self.highTS = blkTS + + if (self.blkCountOut % 1000) == 0: + print('%i blocks scanned, %i blocks written (of %i, %.1f%% complete)' % + (self.blkCountIn, self.blkCountOut, len(self.blkindex), 100.0 * self.blkCountOut / len(self.blkindex))) + + def inFileName(self, fn): + return "%s/blk%05d.dat" % (self.settings['input'], fn) + + def fetchBlock(self, extent): + '''Fetch block contents from disk given extents''' + with open(self.inFileName(extent.fn), "rb") as f: + f.seek(extent.offset) + return f.read(extent.size) + + def copyOneBlock(self): + '''Find the next block to be written in the input, and copy it to the output.''' + extent = self.blockExtents.pop(self.blkCountOut) + if self.blkCountOut in self.outOfOrderData: + # If the data is cached, use it from memory and remove from the cache + rawblock = self.outOfOrderData.pop(self.blkCountOut) + self.outOfOrderSize -= len(rawblock) + else: # Otherwise look up data on disk + rawblock = self.fetchBlock(extent) + + self.writeBlock(extent.inhdr, extent.blkhdr, rawblock) + + def run(self): + while self.blkCountOut < len(self.blkindex): + if not self.inF: + fname = self.inFileName(self.inFn) + print("Input file" + fname) + try: + self.inF = open(fname, "rb") + except IOError: + print("Premature end of block data") + return + + inhdr = self.inF.read(8) + if (not inhdr or (inhdr[0] == "\0")): + self.inF.close() + self.inF = None + self.inFn = self.inFn + 1 + continue + + inMagic = inhdr[:4] + if (inMagic != self.settings['netmagic']): + print("Invalid magic:" + inMagic) + return + inLenLE = inhdr[4:] + su = struct.unpack(" " + exit 1 +fi + +if [ -z "$SIGNATURE" ]; then + echo "usage: $0 " + exit 1 +fi + +rm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR} +tar -C ${TEMPDIR} -xf ${UNSIGNED} +tar -C ${TEMPDIR} -xf ${SIGNATURE} + +if [ -z "${PAGESTUFF}" ]; then + PAGESTUFF=${TEMPDIR}/pagestuff +fi + +if [ -z "${CODESIGN_ALLOCATE}" ]; then + CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate +fi + +for i in `find ${TEMPDIR} -name "*.sign"`; do + SIZE=`stat -c %s ${i}` + TARGET_FILE=`echo ${i} | sed 's/\.sign$//'` + + echo "Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}" + ${CODESIGN_ALLOCATE} -i ${TARGET_FILE} -a ${ARCH} ${SIZE} -o ${i}.tmp + + OFFSET=`${PAGESTUFF} ${i}.tmp -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + if [ -z ${QUIET} ]; then + echo "Attaching signature at offset ${OFFSET}" + fi + + dd if=$i of=${i}.tmp bs=1 seek=${OFFSET} count=${SIZE} 2>/dev/null + mv ${i}.tmp ${TARGET_FILE} + rm ${i} + echo "Success." +done +mv ${TEMPDIR}/${ROOTDIR} ${OUTDIR} +rm -rf ${TEMPDIR} +echo "Signed: ${OUTDIR}" diff --git a/contrib/macdeploy/detached-sig-create.sh b/contrib/macdeploy/detached-sig-create.sh new file mode 100755 index 0000000000..aff4f08da8 --- /dev/null +++ b/contrib/macdeploy/detached-sig-create.sh @@ -0,0 +1,46 @@ +#!/bin/sh +set -e + +ROOTDIR=dist +BUNDLE=${ROOTDIR}/Bitcoin-Qt.app +CODESIGN=codesign +TEMPDIR=sign.temp +TEMPLIST=${TEMPDIR}/signatures.txt +OUT=signature.tar.gz + +if [ ! -n "$1" ]; then + echo "usage: $0 " + echo "example: $0 -s MyIdentity" + exit 1 +fi + +rm -rf ${TEMPDIR} ${TEMPLIST} +mkdir -p ${TEMPDIR} + +${CODESIGN} -f --file-list ${TEMPLIST} "$@" "${BUNDLE}" + +for i in `grep -v CodeResources ${TEMPLIST}`; do + TARGETFILE="${BUNDLE}/`echo ${i} | sed "s|.*${BUNDLE}/||"`" + SIZE=`pagestuff $i -p | tail -2 | grep size | sed 's/[^0-9]*//g'` + OFFSET=`pagestuff $i -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + SIGNFILE="${TEMPDIR}/${TARGETFILE}.sign" + DIRNAME="`dirname ${SIGNFILE}`" + mkdir -p "${DIRNAME}" + echo "Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}" + dd if=$i of=${SIGNFILE} bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null +done + +for i in `grep CodeResources ${TEMPLIST}`; do + TARGETFILE="${BUNDLE}/`echo ${i} | sed "s|.*${BUNDLE}/||"`" + RESOURCE="${TEMPDIR}/${TARGETFILE}" + DIRNAME="`dirname "${RESOURCE}"`" + mkdir -p "${DIRNAME}" + echo "Adding resource for: "${TARGETFILE}"" + cp "${i}" "${RESOURCE}" +done + +rm ${TEMPLIST} + +tar -C ${TEMPDIR} -czf ${OUT} . +rm -rf ${TEMPDIR} +echo "Created ${OUT}" diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index e462ea0327..a3358033af 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -17,9 +17,8 @@ # along with this program. If not, see . # -import subprocess, sys, re, os, shutil, stat, os.path +import subprocess, sys, re, os, shutil, stat, os.path, time from string import Template -from time import sleep from argparse import ArgumentParser # This is ported from the original macdeployqt with modifications @@ -332,7 +331,7 @@ def deployFrameworks(frameworks, bundlePath, binaryPath, strip, verbose, deploym # Get the Qt path from one of the Qt frameworks if deploymentInfo.qtPath is None and framework.isQtFramework(): deploymentInfo.detectQtPath(framework.frameworkDirectory) - + if framework.installName.startswith("@executable_path") or framework.installName.startswith(bundlePath): if verbose >= 2: print framework.frameworkName, "already deployed, skipping." @@ -394,7 +393,7 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the script plugins only if QtScript is in use if not deploymentInfo.usesFramework("QtScript"): continue - elif pluginDirectory == "qmltooling": + elif pluginDirectory == "qmltooling" or pluginDirectory == "qml1tooling": # Deploy the qml plugins only if QtDeclarative is in use if not deploymentInfo.usesFramework("QtDeclarative"): continue @@ -402,6 +401,22 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the bearer plugins only if QtNetwork is in use if not deploymentInfo.usesFramework("QtNetwork"): continue + elif pluginDirectory == "position": + # Deploy the position plugins only if QtPositioning is in use + if not deploymentInfo.usesFramework("QtPositioning"): + continue + elif pluginDirectory == "sensors" or pluginDirectory == "sensorgestures": + # Deploy the sensor plugins only if QtSensors is in use + if not deploymentInfo.usesFramework("QtSensors"): + continue + elif pluginDirectory == "audio" or pluginDirectory == "playlistformats": + # Deploy the audio plugins only if QtMultimedia is in use + if not deploymentInfo.usesFramework("QtMultimedia"): + continue + elif pluginDirectory == "mediaservice": + # Deploy the mediaservice plugins only if QtMultimediaWidgets is in use + if not deploymentInfo.usesFramework("QtMultimediaWidgets"): + continue for pluginName in filenames: pluginPath = os.path.join(pluginDirectory, pluginName) @@ -420,6 +435,10 @@ def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): # Deploy the opengl graphicssystem plugin only if QtOpenGL is in use if not deploymentInfo.usesFramework("QtOpenGL"): continue + elif pluginPath == "accessible/libqtaccessiblequick.dylib": + # Deploy the accessible qtquick plugin only if QtQuick is in use + if not deploymentInfo.usesFramework("QtQuick"): + continue plugins.append((pluginDirectory, pluginName)) @@ -474,6 +493,7 @@ ap.add_argument("-sign", dest="sign", action="store_true", default=False, help=" ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image; if basename is not specified, a camel-cased version of the app name is used") ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fancy looking disk image using the given plist file with instructions; requires -dmg to work") ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's ressources; the language list must be separated with commas, not with whitespace") +ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files") ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument") config = ap.parse_args() @@ -492,6 +512,15 @@ if not os.path.exists(app_bundle): app_bundle_name = os.path.splitext(os.path.basename(app_bundle))[0] # ------------------------------------------------ +translations_dir = None +if config.translations_dir and config.translations_dir[0]: + if os.path.exists(config.translations_dir[0]): + translations_dir = config.translations_dir[0] + else: + if verbose >= 1: + sys.stderr.write("Error: Could not find translation dir \"%s\"\n" % (translations_dir)) + sys.exit(1) +# ------------------------------------------------ for p in config.add_resources: if verbose >= 3: @@ -512,17 +541,7 @@ if len(config.fancy) == 1: if verbose >= 1: sys.stderr.write("Error: Could not import plistlib which is required for fancy disk images.\n") sys.exit(1) - - if verbose >= 3: - print "Fancy: Importing appscript..." - try: - import appscript - except ImportError: - if verbose >= 1: - sys.stderr.write("Error: Could not import appscript which is required for fancy disk images.\n") - sys.stderr.write("Please install it e.g. with \"sudo easy_install appscript\".\n") - sys.exit(1) - + p = config.fancy[0] if verbose >= 3: print "Fancy: Loading \"%s\"..." % p @@ -625,7 +644,14 @@ if config.plugins: if len(config.add_qt_tr) == 0: add_qt_tr = [] else: - qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + if translations_dir is not None: + qt_tr_dir = translations_dir + else: + if deploymentInfo.qtPath is not None: + qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + else: + sys.stderr.write("Error: Could not find Qt translation path\n") + sys.exit(1) add_qt_tr = ["qt_%s.qm" % lng for lng in config.add_qt_tr[0].split(",")] for lng_file in add_qt_tr: p = os.path.join(qt_tr_dir, lng_file) @@ -839,7 +865,8 @@ if config.dmg is not None: if verbose >= 2: print "+ Finalizing .dmg disk image +" - + time.sleep(5) + try: runHDIUtil("convert", dmg_name + ".temp", format="UDBZ", o=dmg_name + ".dmg", ov=True) except subprocess.CalledProcessError as e: diff --git a/contrib/pyminer/README.md b/contrib/pyminer/README.md deleted file mode 100644 index 3b20f2fdea..0000000000 --- a/contrib/pyminer/README.md +++ /dev/null @@ -1,8 +0,0 @@ -### PyMiner ### - -This is a 'getwork' CPU mining client for Bitcoin. It is pure-python, and therefore very, very slow. The purpose is to provide a reference implementation of a miner, for study. - -### Other Resources ### - -- [BitcoinTalk Thread](https://bitcointalk.org/index.php?topic=3546.0) -- [Jgarzik Repo](https://github.com/jgarzik/pyminer) \ No newline at end of file diff --git a/contrib/pyminer/example-config.cfg b/contrib/pyminer/example-config.cfg deleted file mode 100644 index 53838838ea..0000000000 --- a/contrib/pyminer/example-config.cfg +++ /dev/null @@ -1,32 +0,0 @@ - -# -# RPC login details -# -host=127.0.0.1 -port=9998 - -rpcuser=myusername -rpcpass=mypass - - -# -# mining details -# - -threads=4 - -# periodic rate for requesting new work, if solution not found -scantime=60 - - -# -# misc. -# - -# not really used right now -logdir=/tmp/pyminer - -# set to 1, to enable hashmeter output -hashmeter=0 - - diff --git a/contrib/pyminer/pyminer.py b/contrib/pyminer/pyminer.py deleted file mode 100755 index 74b2304795..0000000000 --- a/contrib/pyminer/pyminer.py +++ /dev/null @@ -1,252 +0,0 @@ -#!/usr/bin/python -# -# Copyright (c) 2011 The Bitcoin developers -# Distributed under the MIT/X11 software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# - -import time -import json -import pprint -import hashlib -import struct -import re -import base64 -import httplib -import sys -from multiprocessing import Process - -ERR_SLEEP = 15 -MAX_NONCE = 1000000L - -settings = {} -pp = pprint.PrettyPrinter(indent=4) - -class BitcoinRPC: - OBJID = 1 - - def __init__(self, host, port, username, password): - authpair = "%s:%s" % (username, password) - self.authhdr = "Basic %s" % (base64.b64encode(authpair)) - self.conn = httplib.HTTPConnection(host, port, False, 30) - def rpc(self, method, params=None): - self.OBJID += 1 - obj = { 'version' : '1.1', - 'method' : method, - 'id' : self.OBJID } - if params is None: - obj['params'] = [] - else: - obj['params'] = params - self.conn.request('POST', '/', json.dumps(obj), - { 'Authorization' : self.authhdr, - 'Content-type' : 'application/json' }) - - resp = self.conn.getresponse() - if resp is None: - print "JSON-RPC: no response" - return None - - body = resp.read() - resp_obj = json.loads(body) - if resp_obj is None: - print "JSON-RPC: cannot JSON-decode body" - return None - if 'error' in resp_obj and resp_obj['error'] != None: - return resp_obj['error'] - if 'result' not in resp_obj: - print "JSON-RPC: no result in object" - return None - - return resp_obj['result'] - def getblockcount(self): - return self.rpc('getblockcount') - def getwork(self, data=None): - return self.rpc('getwork', data) - -def uint32(x): - return x & 0xffffffffL - -def bytereverse(x): - return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) | - (((x) >> 8) & 0x0000ff00) | ((x) >> 24) )) - -def bufreverse(in_buf): - out_words = [] - for i in range(0, len(in_buf), 4): - word = struct.unpack('@I', in_buf[i:i+4])[0] - out_words.append(struct.pack('@I', bytereverse(word))) - return ''.join(out_words) - -def wordreverse(in_buf): - out_words = [] - for i in range(0, len(in_buf), 4): - out_words.append(in_buf[i:i+4]) - out_words.reverse() - return ''.join(out_words) - -class Miner: - def __init__(self, id): - self.id = id - self.max_nonce = MAX_NONCE - - def work(self, datastr, targetstr): - # decode work data hex string to binary - static_data = datastr.decode('hex') - static_data = bufreverse(static_data) - - # the first 76b of 80b do not change - blk_hdr = static_data[:76] - - # decode 256-bit target value - targetbin = targetstr.decode('hex') - targetbin = targetbin[::-1] # byte-swap and dword-swap - targetbin_str = targetbin.encode('hex') - target = long(targetbin_str, 16) - - # pre-hash first 76b of block header - static_hash = hashlib.sha256() - static_hash.update(blk_hdr) - - for nonce in xrange(self.max_nonce): - - # encode 32-bit nonce value - nonce_bin = struct.pack(" Upstream RPC result:", result - - def iterate(self, rpc): - work = rpc.getwork() - if work is None: - time.sleep(ERR_SLEEP) - return - if 'data' not in work or 'target' not in work: - time.sleep(ERR_SLEEP) - return - - time_start = time.time() - - (hashes_done, nonce_bin) = self.work(work['data'], - work['target']) - - time_end = time.time() - time_diff = time_end - time_start - - self.max_nonce = long( - (hashes_done * settings['scantime']) / time_diff) - if self.max_nonce > 0xfffffffaL: - self.max_nonce = 0xfffffffaL - - if settings['hashmeter']: - print "HashMeter(%d): %d hashes, %.2f Khash/sec" % ( - self.id, hashes_done, - (hashes_done / 1000.0) / time_diff) - - if nonce_bin is not None: - self.submit_work(rpc, work['data'], nonce_bin) - - def loop(self): - rpc = BitcoinRPC(settings['host'], settings['port'], - settings['rpcuser'], settings['rpcpass']) - if rpc is None: - return - - while True: - self.iterate(rpc) - -def miner_thread(id): - miner = Miner(id) - miner.loop() - -if __name__ == '__main__': - if len(sys.argv) != 2: - print "Usage: pyminer.py CONFIG-FILE" - sys.exit(1) - - f = open(sys.argv[1]) - for line in f: - # skip comment lines - m = re.search('^\s*#', line) - if m: - continue - - # parse key=value lines - m = re.search('^(\w+)\s*=\s*(\S.*)$', line) - if m is None: - continue - settings[m.group(1)] = m.group(2) - f.close() - - if 'host' not in settings: - settings['host'] = '127.0.0.1' - if 'port' not in settings: - settings['port'] = 9998 - if 'threads' not in settings: - settings['threads'] = 1 - if 'hashmeter' not in settings: - settings['hashmeter'] = 0 - if 'scantime' not in settings: - settings['scantime'] = 30L - if 'rpcuser' not in settings or 'rpcpass' not in settings: - print "Missing username and/or password in cfg file" - sys.exit(1) - - settings['port'] = int(settings['port']) - settings['threads'] = int(settings['threads']) - settings['hashmeter'] = int(settings['hashmeter']) - settings['scantime'] = long(settings['scantime']) - - thr_list = [] - for thr_id in range(settings['threads']): - p = Process(target=miner_thread, args=(thr_id,)) - p.start() - thr_list.append(p) - time.sleep(1) # stagger threads - - print settings['threads'], "mining threads started" - - print time.asctime(), "Miner Starts - %s:%s" % (settings['host'], settings['port']) - try: - for thr_proc in thr_list: - thr_proc.join() - except KeyboardInterrupt: - pass - print time.asctime(), "Miner Stops - %s:%s" % (settings['host'], settings['port']) - diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md index f9a0c277e2..bc88201f0f 100644 --- a/contrib/seeds/README.md +++ b/contrib/seeds/README.md @@ -1,11 +1,8 @@ ### Seeds ### -Utility to generate the pnSeed[] array that is compiled into the client -(see [src/net.cpp](/src/net.cpp)). +Utility to generate the seeds.txt list that is compiled into the client +(see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and [share/seeds](/share/seeds)). -The 600 seeds compiled into the 0.8 release were created from sipa's DNS seed data, like this: +The 512 seeds compiled into the 0.10 release were created from sipa's DNS seed data, like this: - curl -s http://bitcoin.sipa.be/seeds.txt | head -1000 | makeseeds.py - -The input to makeseeds.py is assumed to be approximately sorted from most-reliable to least-reliable, -with IP:port first on each line (lines that don't match IPv4:port are ignored). + curl -s http://bitcoin.sipa.be/seeds.txt | makeseeds.py diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py index a34e3c2be7..2539707928 100755 --- a/contrib/seeds/makeseeds.py +++ b/contrib/seeds/makeseeds.py @@ -1,32 +1,118 @@ #!/usr/bin/env python # -# Generate pnSeed[] from Pieter's DNS seeder +# Generate seeds.txt from Pieter's DNS seeder # -NSEEDS=600 +NSEEDS=512 + +MAX_SEEDS_PER_ASN=2 + +MIN_BLOCKS = 200000 + +# These are hosts that have been observed to be behaving strangely (e.g. +# aggressively connecting to every node). +SUSPICIOUS_HOSTS = set([ + "130.211.129.106", "178.63.107.226", + "83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6", + "54.173.72.127", "54.174.10.182", "54.183.64.54", "54.194.231.211", + "54.66.214.167", "54.66.220.137", "54.67.33.14", "54.77.251.214", + "54.94.195.96", "54.94.200.247" +]) import re import sys -from subprocess import check_output +import dns.resolver + +PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):9999$") +PATTERN_AGENT = re.compile(r"^(\/Satoshi:0.8.6\/|\/Satoshi:0.9.(2|3)\/|\/Core:0.1(0|1|2).\d{1,2}.\d{1,2}\/)$") + +def parseline(line): + sline = line.split() + if len(sline) < 11: + return None + # Match only IPv4 + m = PATTERN_IPV4.match(sline[0]) + if m is None: + return None + # Do IPv4 sanity check + ip = 0 + for i in range(0,4): + if int(m.group(i+2)) < 0 or int(m.group(i+2)) > 255: + return None + ip = ip + (int(m.group(i+2)) << (8*(3-i))) + if ip == 0: + return None + # Skip bad results. + if sline[1] == 0: + return None + # Extract uptime %. + uptime30 = float(sline[7][:-1]) + # Extract Unix timestamp of last success. + lastsuccess = int(sline[2]) + # Extract protocol version. + version = int(sline[10]) + # Extract user agent. + agent = sline[11][1:-1] + # Extract service flags. + service = int(sline[9], 16) + # Extract blocks. + blocks = int(sline[8]) + # Construct result. + return { + 'ip': m.group(1), + 'ipnum': ip, + 'uptime': uptime30, + 'lastsuccess': lastsuccess, + 'version': version, + 'agent': agent, + 'service': service, + 'blocks': blocks, + } + +# Based on Greg Maxwell's seed_filter.py +def filterbyasn(ips, max_per_asn, max_total): + result = [] + asn_count = {} + for ip in ips: + if len(result) == max_total: + break + try: + asn = int([x.to_text() for x in dns.resolver.query('.'.join(reversed(ip['ip'].split('.'))) + '.origin.asn.cymru.com', 'TXT').response.answer][0].split('\"')[1].split(' ')[0]) + if asn not in asn_count: + asn_count[asn] = 0 + if asn_count[asn] == max_per_asn: + continue + asn_count[asn] += 1 + result.append(ip) + except: + sys.stderr.write('ERR: Could not resolve ASN for "' + ip['ip'] + '"\n') + return result def main(): lines = sys.stdin.readlines() + ips = [parseline(line) for line in lines] - ips = [] - pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):9999") - for line in lines: - m = pattern.match(line) - if m is None: - continue - ip = 0 - for i in range(0,4): - ip = ip + (int(m.group(i+1)) << (8*(i))) - if ip == 0: - continue - ips.append(ip) + # Skip entries with valid IPv4 address. + ips = [ip for ip in ips if ip is not None] + # Skip entries from suspicious hosts. + ips = [ip for ip in ips if ip['ip'] not in SUSPICIOUS_HOSTS] + # Enforce minimal number of blocks. + ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS] + # Require service bit 1. + ips = [ip for ip in ips if (ip['service'] & 1) == 1] + # Require at least 50% 30-day uptime. + ips = [ip for ip in ips if ip['uptime'] > 50] + # Require a known and recent user agent. + ips = [ip for ip in ips if PATTERN_AGENT.match(ip['agent'])] + # Sort by availability (and use last success as tie breaker) + ips.sort(key=lambda x: (x['uptime'], x['lastsuccess'], x['ip']), reverse=True) + # Look up ASNs and limit results, both per ASN and globally. + ips = filterbyasn(ips, MAX_SEEDS_PER_ASN, NSEEDS) + # Sort the results by IP address (for deterministic output). + ips.sort(key=lambda x: (x['ipnum'])) - for row in range(0, min(NSEEDS,len(ips)), 8): - print " " + ", ".join([ "0x%08x"%i for i in ips[row:row+8] ]) + "," + for ip in ips: + print ip['ip'] if __name__ == '__main__': main() diff --git a/contrib/verifysfbinaries/README.md b/contrib/verifysfbinaries/README.md index f646d1efd1..8c038865bd 100644 --- a/contrib/verifysfbinaries/README.md +++ b/contrib/verifysfbinaries/README.md @@ -1,5 +1,5 @@ ### Verify SF Binaries ### -This script attempts to download the signature file `SHA256SUMS.asc` from SourceForge. +This script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org. It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file. diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh index e92295661c..3eb4693883 100755 --- a/contrib/verifysfbinaries/verify.sh +++ b/contrib/verifysfbinaries/verify.sh @@ -1,6 +1,6 @@ #!/bin/bash -### This script attempts to download the signature file SHA256SUMS.asc from SourceForge +### This script attempts to download the signature file SHA256SUMS.asc from bitcoin.org ### It first checks if the signature passes, and then downloads the files specified in ### the file, and checks if the hashes of these files match those that are specified ### in the signature file. @@ -18,11 +18,11 @@ WORKINGDIR="/tmp/bitcoin" TMPFILE="hashes.tmp" #this URL is used if a version number is not specified as an argument to the script -SIGNATUREFILE="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/bitcoin-0.9.0rc1/SHA256SUMS.asc" +SIGNATUREFILE="https://bitcoin.org/bin/0.9.2.1/SHA256SUMS.asc" SIGNATUREFILENAME="SHA256SUMS.asc" RCSUBDIR="test/" -BASEDIR="http://downloads.sourceforge.net/project/bitcoin/Bitcoin/" +BASEDIR="https://bitcoin.org/bin/" VERSIONPREFIX="bitcoin-" RCVERSIONSTRING="rc" @@ -62,7 +62,7 @@ WGETOUT=$(wget -N "$BASEDIR$SIGNATUREFILENAME" 2>&1) #and then see if wget completed successfully if [ $? -ne 0 ]; then echo "Error: couldn't fetch signature file. Have you specified the version number in the following format?" - echo "[bitcoin-]-[rc[0-9]] (example: bitcoin-0.7.1-rc1)" + echo "[bitcoin-]-[rc[0-9]] (example: bitcoin-0.9.2-rc1)" echo "wget output:" echo "$WGETOUT"|sed 's/^/\t/g' exit 2 diff --git a/depends/funcs.mk b/depends/funcs.mk index 79015c047c..337634253f 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -31,8 +31,8 @@ define fetch_file endef define int_get_build_recipe_hash -$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)))) -$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | cut -d" " -f1 | $(build_SHA256SUM))) +$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) +$(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) endef define int_get_build_id diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 6d7a556c11..eb4779410b 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -1,8 +1,8 @@ package=openssl -$(package)_version=1.0.1j +$(package)_version=1.0.1k $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=1b60ca8789ba6f03e8ef20da2293b8dc131c39d83814e775069f02d26354edf3 +$(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" @@ -20,7 +20,7 @@ $(package)_config_opts_i686_mingw32=mingw endef define $(package)_preprocess_cmds - sed -i.old "/define DATE/d" crypto/Makefile && \ + sed -i.old "/define DATE/d" util/mkbuildinf.pl && \ sed -i.old "s|engines apps test|engines|" Makefile.org endef diff --git a/doc/Doxyfile b/doc/Doxyfile index e95f550156..563edc64b2 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -34,7 +34,7 @@ PROJECT_NAME = Dash # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.11.0.4 +PROJECT_NUMBER = 0.12.0.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/doc/README.md b/doc/README.md index dd2533a2da..2dab1a7c7a 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,10 +1,5 @@ -Dash 0.11.x BETA -==================== - -Copyright (c) 2009-2015 Bitcoin Developers - -Copyright (c) 2014-2015 Dash Developers - +Dash Core 0.12.0 +===================== Setup --------------------- @@ -12,67 +7,67 @@ Setup Running --------------------- -The following are some helpful notes on how to run Bitcoin on your native platform. +The following are some helpful notes on how to run Dash on your native platform. ### Unix -You need the Qt4 run-time libraries to run Bitcoin-Qt. On Debian or Ubuntu: +You need the Qt4 run-time libraries to run Dash-Qt. On Debian or Ubuntu: sudo apt-get install libqtgui4 Unpack the files into a directory and run: -- bin/32/bitcoin-qt (GUI, 32-bit) or bin/32/bitcoind (headless, 32-bit) -- bin/64/bitcoin-qt (GUI, 64-bit) or bin/64/bitcoind (headless, 64-bit) +- bin/32/dash-qt (GUI, 32-bit) or bin/32/dashd (headless, 32-bit) +- bin/64/dash-qt (GUI, 64-bit) or bin/64/dashd (headless, 64-bit) ### Windows -Unpack the files into a directory, and then run bitcoin-qt.exe. +Unpack the files into a directory, and then run dash-qt.exe. ### OSX -Drag Bitcoin-Qt to your applications folder, and then run Bitcoin-Qt. +Drag Dash-Qt to your applications folder, and then run Dash-Qt. ### Need Help? -* See the documentation at the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Main_Page) +* See the documentation at the [Dash Wiki](https://en.bitcoin.it/wiki/Main_Page) ***TODO*** for help and more information. -* Ask for help on [#bitcoin](http://webchat.freenode.net?channels=bitcoin) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net?channels=bitcoin). -* Ask for help on the [BitcoinTalk](https://bitcointalk.org/) forums, in the [Technical Support board](https://bitcointalk.org/index.php?board=4.0). +* Ask for help on [#dashpay](http://webchat.freenode.net?channels=dashpay) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net?channels=dashpay). +* Ask for help on the [DashTalk](https://dashtalk.org/) forums. Building --------------------- -The following are developer notes on how to build Bitcoin on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc. +The following are developer notes on how to build Dash on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc. - [OSX Build Notes](build-osx.md) - [Unix Build Notes](build-unix.md) -- [Windows Build Notes](build-msw.md) Development --------------------- -The Bitcoin repo's [root README](https://github.com/bitcoin/bitcoin/blob/master/README.md) contains relevant information on the development process and automated testing. +The Dash repo's [root README](https://github.com/dashpay/dash/blob/master/README.md) contains relevant information on the development process and automated testing. - [Coding Guidelines](coding.md) - [Multiwallet Qt Development](multiwallet-qt.md) - [Release Notes](release-notes.md) - [Release Process](release-process.md) -- [Source Code Documentation (External Link)](https://dev.visucore.com/bitcoin/doxygen/) +- [Source Code Documentation (External Link)](https://dev.visucore.com/bitcoin/doxygen/) ***TODO*** - [Translation Process](translation_process.md) - [Unit Tests](unit-tests.md) ### Resources -* Discuss on the [BitcoinTalk](https://bitcointalk.org/) forums, in the [Development & Technical Discussion board](https://bitcointalk.org/index.php?board=6.0). -* Discuss on [#bitcoin-dev](http://webchat.freenode.net/?channels=bitcoin) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net/?channels=bitcoin-dev). +* Discuss on the [DashTalk](https://dashtalk.org/) forums, in the Development & Technical Discussion board. +* Discuss on [#dashpay](http://webchat.freenode.net/?channels=dashpay) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net/?channels=dashpay). ### Miscellaneous - [Assets Attribution](assets-attribution.md) - [Files](files.md) - [Tor Support](tor.md) +- [Init Scripts (systemd/upstart/openrc)](init.md) License --------------------- Distributed under the [MIT/X11 software license](http://www.opensource.org/licenses/mit-license.php). -This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes +This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](https://www.openssl.org/). This product includes cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. diff --git a/doc/README_osx.txt b/doc/README_osx.txt index 2be56c1592..d56234f7d9 100644 --- a/doc/README_osx.txt +++ b/doc/README_osx.txt @@ -20,14 +20,6 @@ https://github.com/mingwandroid/toolchain4 In order to build a working toolchain, the following source packages are needed from Apple: cctools, dyld, and ld64. -Beware. This part is ugly. Very very very ugly. In the future, this should be -broken out into a new repository and cleaned up. Additionally, the binaries -only work when built as x86 and not x86_64. This is an especially nasty -limitation because it must be linked with the toolchain's libLTO.so, meaning -that the entire toolchain must be x86. Gitian x86_64 should not be used until -this has been fixed, because it would mean that several native dependencies -(openssl, libuuid, etc) would need to be built as x86 first. - These tools inject timestamps by default, which produce non-deterministic binaries. The ZERO_AR_DATE environment variable is used to disable that. @@ -73,3 +65,18 @@ Background images and other features can be added to DMG files by inserting a .DS_Store before creation. The easiest way to create this file is to build a DMG without one, move it to a device running OSX, customize the layout, then grab the .DS_Store file for later use. That is the approach taken here. + +As of OSX Mavericks (10.9), using an Apple-blessed key to sign binaries is a +requirement in order to satisfy the new Gatekeeper requirements. Because this +private key cannot be shared, we'll have to be a bit creative in order for the +build process to remain somewhat deterministic. Here's how it works: + +- Builders use gitian to create an unsigned release. This outputs an unsigned + dmg which users may choose to bless and run. It also outputs an unsigned app + structure in the form of a tarball, which also contains all of the tools + that have been previously (deterministically) built in order to create a + final dmg. +- The Apple keyholder uses this unsigned app to create a detached signature, + using the script that is also included there. +- Builders feed the unsigned app + detached signature back into gitian. It + uses the pre-built tools to recombine the pieces into a deterministic dmg. diff --git a/doc/README_windows.txt b/doc/README_windows.txt index a59dffef72..dedbad6b72 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -1,32 +1,23 @@ -Dash 0.11.x BETA - -Copyright (c) 2009-2015 Bitcoin Core Developers -Copyright (c) 2014-2015 Dash Core Developers - -Distributed under the MIT/X11 software license, see the accompanying -file COPYING or http://www.opensource.org/licenses/mit-license.php. -This product includes software developed by the OpenSSL Project for use in -the OpenSSL Toolkit (http://www.openssl.org/). This product includes -cryptographic software written by Eric Young (eay@cryptsoft.com). - - -Intro ------ -Bitcoin is a free open source peer-to-peer electronic cash system that is -completely decentralized, without the need for a central server or trusted -parties. Users hold the crypto keys to their own money and transact directly -with each other, with the help of a P2P network to check for double-spending. - - -Setup ------ -Unpack the files into a directory and run bitcoin-qt.exe. - -Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. -However, it downloads and stores the entire history of Bitcoin transactions; -depending on the speed of your computer and network connection, the synchronization -process can take anywhere from a few hours to a day or more. - -See the bitcoin wiki at: - https://en.bitcoin.it/wiki/Main_Page -for more help and information. +Dash Core 0.12.0 +===================== + +Intro +----- +Dash is a free open source peer-to-peer electronic cash system that is +completely decentralized, without the need for a central server or trusted +parties. Users hold the crypto keys to their own money and transact directly +with each other, with the help of a P2P network to check for double-spending. + + +Setup +----- +Unpack the files into a directory and run dash-qt.exe. + +Dash Core is the original Dash client and it builds the backbone of the network. +However, it downloads and stores the entire history of Dash transactions; +depending on the speed of your computer and network connection, the synchronization +process can take anywhere from a few hours to a day or more. + +See the dash wiki at: + https://en.bitcoin.it/wiki/Main_Page ***TODO*** +for more help and information. diff --git a/doc/REST-interface.md b/doc/REST-interface.md new file mode 100644 index 0000000000..0af650b4e8 --- /dev/null +++ b/doc/REST-interface.md @@ -0,0 +1,27 @@ +Unauthenticated REST Interface +============================== + +The REST API can be enabled with the `-rest` option. + +Supported API +------------- +`GET /rest/tx/TX-HASH.{bin|hex|json}` + +Given a transaction hash, +Returns a transaction, in binary, hex-encoded binary or JSON formats. + +`GET /rest/block/BLOCK-HASH.{bin|hex|json}` +`GET /rest/block/notxdetails/BLOCK-HASH.{bin|hex|json}` + +Given a block hash, +Returns a block, in binary, hex-encoded binary or JSON formats. + +The HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request. + +With the /notxdetails/ option JSON response will only contain the transaction hash instead of the complete transaction details. The option only affects the JSON response. + +For full TX query capability, one must enable the transaction index via "txindex=1" command line / configuration option. + +Risks +------------- +Running a webbrowser on the same node with a REST enabled bitcoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `