From a60f468e97a78fe5bf410e07357dc280bcf7f954 Mon Sep 17 00:00:00 2001 From: VersessCTO <53523795+VersessCTO@users.noreply.github.com> Date: Mon, 5 Aug 2019 16:47:51 +0530 Subject: [PATCH] Initial Sourcecode --- CMakeLists.txt | 544 ++ CONTRIBUTING.md | 314 + COPYING | 21 + INSTALL | 13 + Makefile.am | 274 + README.md | 6 + autogen.sh | 16 + build-aux/m4/ax_boost_base.m4 | 291 + build-aux/m4/ax_boost_chrono.m4 | 118 + build-aux/m4/ax_boost_filesystem.m4 | 119 + build-aux/m4/ax_boost_program_options.m4 | 108 + build-aux/m4/ax_boost_system.m4 | 122 + build-aux/m4/ax_boost_thread.m4 | 150 + build-aux/m4/ax_boost_unit_test_framework.m4 | 137 + build-aux/m4/ax_check_compile_flag.m4 | 74 + build-aux/m4/ax_check_link_flag.m4 | 74 + build-aux/m4/ax_check_preproc_flag.m4 | 74 + build-aux/m4/ax_cxx_compile_stdcxx.m4 | 568 ++ build-aux/m4/ax_gcc_func_attribute.m4 | 223 + build-aux/m4/ax_pthread.m4 | 485 ++ build-aux/m4/bitcoin_find_bdb48.m4 | 78 + build-aux/m4/bitcoin_qt.m4 | 530 ++ build-aux/m4/bitcoin_subdir_to_include.m4 | 18 + build-aux/m4/gmp.m4 | 16 + build-aux/m4/l_atomic.m4 | 46 + configure.ac | 1497 ++++ contrib/README.md | 56 + contrib/bitrpc/README.md | 8 + contrib/bitrpc/bitrpc.py | 337 + contrib/cmake/FindBerkeleyDB.cmake | 146 + contrib/cmake/FindGMP.cmake | 33 + contrib/cmake/FindLibEvent.cmake | 44 + contrib/cmake/FindQrcode.cmake | 37 + contrib/cmake/FindZMQ.cmake | 37 + contrib/debian/README.md | 21 + contrib/debian/changelog | 5 + contrib/debian/compat | 1 + contrib/debian/control | 64 + contrib/debian/copyright | 165 + contrib/debian/examples/versess.conf | 105 + contrib/debian/gbp.conf | 5 + contrib/debian/patches/README | 3 + contrib/debian/patches/series | 1 + contrib/debian/rules | 38 + contrib/debian/source/format | 1 + contrib/debian/versess-qt.desktop | 13 + contrib/debian/versess-qt.install | 6 + contrib/debian/versess-qt.lintian-overrides | 2 + contrib/debian/versess-qt.manpages | 1 + contrib/debian/versess-qt.protocol | 11 + contrib/debian/versessd.bash-completion | 2 + contrib/debian/versessd.examples | 1 + contrib/debian/versessd.install | 3 + contrib/debian/versessd.lintian-overrides | 2 + contrib/debian/versessd.manpages | 2 + contrib/debian/versessd.postinst | 28 + contrib/debian/versessd.postrm | 35 + contrib/debian/versessd.service | 45 + contrib/debian/watch | 5 + contrib/devtools/README.md | 210 + contrib/devtools/check-doc.py | 47 + contrib/devtools/circular-dependencies.py | 88 + contrib/devtools/clang-format-diff.py | 166 + contrib/devtools/commit-script-check.sh | 46 + contrib/devtools/copyright_header.py | 621 ++ contrib/devtools/gen-manpages.sh | 32 + contrib/devtools/git-subtree-check.sh | 95 + contrib/devtools/github-merge.py | 384 + contrib/devtools/lint-whitespace.sh | 113 + contrib/devtools/logprint-scanner.py | 102 + contrib/devtools/optimize-pngs.py | 76 + contrib/devtools/security-check.py | 215 + contrib/devtools/split-debug.sh.in | 10 + contrib/devtools/symbol-check.py | 177 + contrib/devtools/test-security-check.py | 71 + contrib/devtools/update-translations.py | 210 + contrib/filter-lcov.py | 25 + contrib/gitian-build.py | 262 + contrib/gitian-descriptors/gitian-linux.yml | 193 + .../gitian-descriptors/gitian-osx-signer.yml | 40 + contrib/gitian-descriptors/gitian-osx.yml | 170 + .../gitian-descriptors/gitian-win-signer.yml | 42 + contrib/gitian-descriptors/gitian-win.yml | 184 + contrib/gitian-keys/blondfrogs-key.gpg | 52 + contrib/gitian-keys/furszy-key.gpg | 52 + contrib/gitian-keys/fuzzbawls-key.gpg | 388 + contrib/gitian-keys/gpdionisio-key.gpg | 52 + contrib/gitian-keys/jonspock-key.gpg | 51 + contrib/gitian-keys/mrs-x-key.gpg | 52 + contrib/gitian-keys/presstab-key.gpg | 30 + contrib/gitian-keys/rejectedpromise-key.gpg | 52 + contrib/gitian-keys/s3v3nh4cks-key.gpg | 52 + contrib/gitian-keys/warrows-key.gpg | 51 + contrib/init/README.md | 12 + contrib/init/org.versess.versessd.plist | 14 + contrib/init/versessd.conf | 63 + contrib/init/versessd.init | 67 + contrib/init/versessd.openrc | 92 + contrib/init/versessd.openrcconf | 33 + contrib/init/versessd.service | 44 + contrib/install_db4.sh | 101 + contrib/linearize/README.md | 33 + contrib/linearize/example-linearize.cfg | 19 + contrib/linearize/linearize-data.py | 299 + contrib/linearize/linearize-hashes.py | 113 + contrib/macdeploy/LICENSE | 674 ++ contrib/macdeploy/README.md | 15 + contrib/macdeploy/background.svg | 34 + contrib/macdeploy/custom_dsstore.py | 59 + contrib/macdeploy/detached-sig-apply.sh | 57 + contrib/macdeploy/detached-sig-create.sh | 52 + contrib/macdeploy/extract-osx-sdk.sh | 34 + contrib/macdeploy/fancy.plist | 32 + contrib/macdeploy/macdeployqtplus | 872 ++ contrib/qos/README.md | 5 + contrib/qos/tc.sh | 41 + contrib/qt_translations.py | 22 + contrib/rpm/README.md | 185 + contrib/rpm/versess.fc | 8 + contrib/rpm/versess.if | 157 + contrib/rpm/versess.spec | 442 + contrib/rpm/versess.te | 81 + contrib/seeds/README.md | 19 + contrib/seeds/generate-seeds.py | 137 + contrib/seeds/makeseeds.py | 171 + contrib/spendfrom/README.md | 35 + contrib/spendfrom/setup.py | 9 + contrib/spendfrom/spendfrom.py | 267 + contrib/test-patches/README.md | 7 + contrib/testgen/README.md | 8 + contrib/testgen/base58.py | 104 + contrib/testgen/gen_base58_test_vectors.py | 126 + contrib/tidy_datadir.sh | 59 + contrib/valgrind.supp | 43 + contrib/verifysfbinaries/README.md | 6 + contrib/verifysfbinaries/verify.sh | 119 + contrib/versess-cli.bash-completion | 154 + contrib/versess-qt.pro | 660 ++ contrib/versess-tx.bash-completion | 57 + contrib/versessd.bash-completion | 56 + contrib/windeploy/detached-sig-create.sh | 35 + contrib/zmq/zmq_sub.py | 51 + depends/.gitignore | 12 + depends/Makefile | 197 + depends/README.md | 93 + depends/builders/darwin.mk | 22 + depends/builders/default.mk | 20 + depends/builders/linux.mk | 2 + depends/config.guess | 1476 ++++ depends/config.site.in | 106 + depends/config.sub | 1808 ++++ depends/description.md | 53 + depends/funcs.mk | 254 + depends/hosts/darwin.mk | 17 + depends/hosts/default.mk | 30 + depends/hosts/linux.mk | 31 + depends/hosts/mingw32.mk | 10 + depends/packages.md | 148 + depends/packages/bdb.mk | 32 + depends/packages/boost.mk | 45 + depends/packages/dbus.mk | 23 + depends/packages/expat.mk | 21 + depends/packages/fontconfig.mk | 28 + depends/packages/freetype.mk | 22 + depends/packages/gmp.mk | 24 + depends/packages/libX11.mk | 27 + depends/packages/libXau.mk | 27 + depends/packages/libXext.mk | 26 + depends/packages/libevent.mk | 30 + depends/packages/libxcb.mk | 36 + depends/packages/miniupnpc.mk | 28 + depends/packages/native_biplist.mk | 15 + depends/packages/native_cctools.mk | 65 + depends/packages/native_cdrkit.mk | 26 + depends/packages/native_ds_store.mk | 16 + depends/packages/native_libdmg-hfsplus.mk | 22 + depends/packages/native_mac_alias.mk | 15 + depends/packages/native_protobuf.mk | 25 + depends/packages/openssl.mk | 86 + depends/packages/packages.mk | 21 + depends/packages/protobuf.mk | 34 + depends/packages/qrencode.mk | 26 + depends/packages/qt.mk | 207 + depends/packages/xcb_proto.mk | 27 + depends/packages/xextproto.mk | 25 + depends/packages/xproto.mk | 25 + depends/packages/xtrans.mk | 26 + depends/packages/zeromq.mk | 35 + depends/packages/zlib.mk | 27 + .../native_cdrkit/cdrkit-deterministic.patch | 86 + depends/patches/qt/fix_configure_mac.patch | 50 + depends/patches/qt/fix_no_printer.patch | 19 + depends/patches/qt/fix_qt_pkgconfig.patch | 11 + depends/patches/qt/fix_rcc_determinism.patch | 15 + depends/patches/qt/fix_riscv64_arch.patch | 14 + ...0x_powerpc_mips_mipsel_architectures.patch | 17 + depends/patches/qt/mac-qmake.conf | 26 + depends/patches/qt/xkb-default.patch | 26 + .../0001-fix-build-with-older-mingw64.patch | 30 + .../0002-disable-pthread_set_name_np.patch | 35 + doc/.gitignore | 1 + doc/Doxyfile.in | 2460 ++++++ doc/README_windows.txt | 19 + doc/REST-interface.md | 92 + doc/assets-attribution.md | 103 + doc/bitcoin_logo_doxygen.png | Bin 0 -> 17454 bytes doc/build-osx.md | 210 + doc/build-unix.md | 283 + doc/build-windows.md | 151 + doc/dependencies.md | 46 + doc/developer-notes.md | 905 ++ doc/dnsseed-policy.md | 54 + doc/files.md | 22 + doc/gitian-building.md | 413 + .../create_vm_file_location_size.png | Bin 0 -> 73099 bytes doc/gitian-building/create_vm_hard_drive.png | Bin 0 -> 80962 bytes .../create_vm_hard_drive_file_type.png | Bin 0 -> 83614 bytes doc/gitian-building/create_vm_memsize.png | Bin 0 -> 54844 bytes doc/gitian-building/create_vm_page1.png | Bin 0 -> 133328 bytes .../create_vm_storage_physical_hard_drive.png | Bin 0 -> 91493 bytes .../debian_install_10_configure_clock.png | Bin 0 -> 4355 bytes .../debian_install_11_partition_disks.png | Bin 0 -> 5212 bytes .../debian_install_12_choose_disk.png | Bin 0 -> 3372 bytes .../debian_install_13_partition_scheme.png | Bin 0 -> 4355 bytes .../debian_install_14_finish.png | Bin 0 -> 6013 bytes .../debian_install_15_write_changes.png | Bin 0 -> 4551 bytes .../debian_install_16_choose_a_mirror.png | Bin 0 -> 6640 bytes .../debian_install_17_choose_a_mirror2.png | Bin 0 -> 5552 bytes .../debian_install_18_proxy_settings.png | Bin 0 -> 4017 bytes .../debian_install_19_software_selection.png | Bin 0 -> 4795 bytes .../debian_install_1_boot_menu.png | Bin 0 -> 86145 bytes .../debian_install_20_install_grub.png | Bin 0 -> 5436 bytes .../debian_install_21_finish_installation.png | Bin 0 -> 3549 bytes .../debian_install_2_select_a_language.png | Bin 0 -> 9943 bytes .../debian_install_3_select_location.png | Bin 0 -> 6324 bytes .../debian_install_4_configure_keyboard.png | Bin 0 -> 5495 bytes ...debian_install_5_configure_the_network.png | Bin 0 -> 4110 bytes .../debian_install_6_domain_name.png | Bin 0 -> 3928 bytes ...debian_install_6a_set_up_root_password.png | Bin 0 -> 7075 bytes .../debian_install_7_set_up_user_fullname.png | Bin 0 -> 4977 bytes .../debian_install_8_set_up_username.png | Bin 0 -> 4005 bytes .../debian_install_9_user_password.png | Bin 0 -> 3170 bytes doc/gitian-building/network_settings.png | Bin 0 -> 60793 bytes doc/gitian-building/port_forwarding_rules.png | Bin 0 -> 14613 bytes doc/gitian-building/select_startup_disk.png | Bin 0 -> 87579 bytes doc/img/bootstrap1.png | Bin 0 -> 56149 bytes doc/img/bootstrap2.png | Bin 0 -> 35412 bytes doc/img/bootstrap4.png | Bin 0 -> 105723 bytes doc/img/bootstrap5.png | Bin 0 -> 20558 bytes doc/init.md | 145 + doc/man/Makefile.am | 13 + doc/man/versess-cli.1 | 78 + doc/man/versess-qt.1 | 593 ++ doc/man/versess-tx.1 | 100 + doc/man/versessd.1 | 572 ++ doc/release-notes.md | 159 + doc/release-process.md | 292 + doc/tor.md | 132 + doc/translation_process.md | 109 + doc/translation_strings_policy.md | 99 + doc/travis-ci.txt | 42 + doc/zmq.md | 110 + libbitcoinconsensus.pc.in | 11 + share/certs/BitcoinFoundation_Apple_Cert.pem | 37 + share/certs/BitcoinFoundation_Comodo_Cert.pem | 37 + share/certs/PrivateKeyNotes.md | 46 + share/genbuild.sh | 60 + share/pixmaps/addressbook16.bmp | Bin 0 -> 1334 bytes share/pixmaps/addressbook16mask.bmp | Bin 0 -> 126 bytes share/pixmaps/addressbook20.bmp | Bin 0 -> 1478 bytes share/pixmaps/addressbook20mask.bmp | Bin 0 -> 142 bytes share/pixmaps/check.ico | Bin 0 -> 766 bytes share/pixmaps/favicon.ico | Bin 0 -> 4286 bytes share/pixmaps/nsis-header.bmp | Bin 0 -> 19574 bytes share/pixmaps/nsis-wizard.bmp | Bin 0 -> 132634 bytes share/pixmaps/send16.bmp | Bin 0 -> 1334 bytes share/pixmaps/send16mask.bmp | Bin 0 -> 126 bytes share/pixmaps/send16masknoshadow.bmp | Bin 0 -> 126 bytes share/pixmaps/send20.bmp | Bin 0 -> 1478 bytes share/pixmaps/send20mask.bmp | Bin 0 -> 142 bytes share/pixmaps/versess-bc.ico | Bin 0 -> 67646 bytes share/pixmaps/versess.ico | Bin 0 -> 67646 bytes share/pixmaps/versess128.png | Bin 0 -> 6021 bytes share/pixmaps/versess128.xpm | 256 + share/pixmaps/versess16.png | Bin 0 -> 999 bytes share/pixmaps/versess16.xpm | 53 + share/pixmaps/versess256.png | Bin 0 -> 10914 bytes share/pixmaps/versess256.xpm | 467 ++ share/pixmaps/versess32.png | Bin 0 -> 1355 bytes share/pixmaps/versess32.xpm | 92 + share/pixmaps/versess64.png | Bin 0 -> 2726 bytes share/pixmaps/versess64.xpm | 145 + share/qt/Info.plist.in | 106 + share/qt/extract_strings_qt.py | 83 + share/qt/img/reload.png | Bin 0 -> 10085 bytes share/qt/img/reload.xcf | Bin 0 -> 25292 bytes share/qt/make_spinner.py | 38 + share/qt/make_windows_icon.sh | 17 + share/qt/protobuf.pri | 35 + share/rpcauth/README.md | 14 + share/rpcauth/rpcauth.py | 47 + share/setup.nsi.in | 177 + share/ui.rc | 15 + src/.clang-format | 52 + src/Makefile.am | 592 ++ src/Makefile.leveldb.include | 149 + src/Makefile.qt.include | 452 + src/Makefile.qttest.include | 56 + src/Makefile.test.include | 147 + src/activemasternode.cpp | 481 ++ src/activemasternode.h | 73 + src/addrman.cpp | 504 ++ src/addrman.h | 579 ++ src/alert.cpp | 254 + src/alert.h | 117 + src/allocators.cpp | 66 + src/allocators.h | 267 + src/amount.cpp | 33 + src/amount.h | 53 + src/base58.cpp | 329 + src/base58.h | 175 + src/bip38.cpp | 280 + src/bip38.h | 41 + src/blocksignature.cpp | 91 + src/blocksignature.h | 17 + src/bloom.cpp | 247 + src/bloom.h | 108 + src/chain.cpp | 81 + src/chain.h | 606 ++ src/chainparams.cpp | 465 ++ src/chainparams.h | 230 + src/chainparamsbase.cpp | 131 + src/chainparamsbase.h | 67 + src/chainparamsseeds.h | 32 + src/checkpoints.cpp | 103 + src/checkpoints.h | 46 + src/checkqueue.h | 213 + src/clientversion.cpp | 113 + src/clientversion.h | 56 + src/coincontrol.h | 94 + src/coins.cpp | 282 + src/coins.h | 485 ++ src/compat.h | 106 + src/compat/byteswap.h | 66 + src/compat/endian.h | 241 + src/compat/glibc_compat.cpp | 78 + src/compat/glibc_sanity.cpp | 70 + src/compat/glibcxx_sanity.cpp | 61 + src/compat/sanity.h | 11 + src/compat/strnlen.cpp | 18 + src/compressor.cpp | 182 + src/compressor.h | 131 + src/concurrentqueue.h | 52 + src/config/.empty | 0 src/core_io.h | 35 + src/core_read.cpp | 141 + src/core_write.cpp | 137 + src/crypter.cpp | 452 + src/crypter.h | 208 + src/crypto/aes_helper.c | 392 + src/crypto/blake.c | 1120 +++ src/crypto/bmw.c | 965 +++ src/crypto/common.h | 116 + src/crypto/cubehash.c | 723 ++ src/crypto/echo.c | 1031 +++ src/crypto/groestl.c | 3124 +++++++ src/crypto/hmac_sha256.cpp | 34 + src/crypto/hmac_sha256.h | 32 + src/crypto/hmac_sha512.cpp | 34 + src/crypto/hmac_sha512.h | 32 + src/crypto/jh.c | 1116 +++ src/crypto/keccak.c | 1824 +++++ src/crypto/luffa.c | 1426 ++++ src/crypto/rfc6979_hmac_sha256.cpp | 47 + src/crypto/rfc6979_hmac_sha256.h | 36 + src/crypto/ripemd160.cpp | 292 + src/crypto/ripemd160.h | 28 + src/crypto/scrypt.cpp | 384 + src/crypto/scrypt.h | 9 + src/crypto/sha1.cpp | 199 + src/crypto/sha1.h | 28 + src/crypto/sha256.cpp | 189 + src/crypto/sha256.h | 28 + src/crypto/sha512.cpp | 207 + src/crypto/sha512.h | 28 + src/crypto/shavite.c | 1764 ++++ src/crypto/simd.c | 1799 ++++ src/crypto/skein.c | 1254 +++ src/crypto/sph_blake.h | 327 + src/crypto/sph_bmw.h | 328 + src/crypto/sph_cubehash.h | 292 + src/crypto/sph_echo.h | 320 + src/crypto/sph_groestl.h | 329 + src/crypto/sph_jh.h | 298 + src/crypto/sph_keccak.h | 293 + src/crypto/sph_luffa.h | 296 + src/crypto/sph_shavite.h | 314 + src/crypto/sph_simd.h | 309 + src/crypto/sph_skein.h | 298 + src/crypto/sph_types.h | 1976 +++++ src/denomination_functions.cpp | 438 + src/denomination_functions.h | 28 + src/genwit.cpp | 68 + src/genwit.h | 62 + src/guiinterface.h | 126 + src/hash.cpp | 87 + src/hash.h | 410 + src/httprpc.cpp | 199 + src/httprpc.h | 37 + src/httpserver.cpp | 670 ++ src/httpserver.h | 147 + src/init.cpp | 1987 +++++ src/init.h | 44 + src/invalid.cpp | 91 + src/invalid.h | 26 + src/invalid_outpoints.json.h | 6797 +++++++++++++++ src/invalid_serials.json.h | 1193 +++ src/kernel.cpp | 471 ++ src/kernel.h | 50 + src/key.cpp | 382 + src/key.h | 185 + src/keystore.cpp | 151 + src/keystore.h | 95 + src/leveldb/.gitignore | 13 + src/leveldb/.travis.yml | 13 + src/leveldb/AUTHORS | 12 + src/leveldb/CONTRIBUTING.md | 36 + src/leveldb/LICENSE | 27 + src/leveldb/Makefile | 424 + src/leveldb/NEWS | 17 + src/leveldb/README.md | 174 + src/leveldb/TODO | 14 + src/leveldb/WINDOWS.md | 39 + src/leveldb/build_detect_platform | 259 + src/leveldb/db/autocompact_test.cc | 118 + src/leveldb/db/builder.cc | 88 + src/leveldb/db/builder.h | 34 + src/leveldb/db/c.cc | 595 ++ src/leveldb/db/c_test.c | 390 + src/leveldb/db/corruption_test.cc | 374 + src/leveldb/db/db_bench.cc | 1020 +++ src/leveldb/db/db_impl.cc | 1568 ++++ src/leveldb/db/db_impl.h | 211 + src/leveldb/db/db_iter.cc | 317 + src/leveldb/db/db_iter.h | 28 + src/leveldb/db/db_test.cc | 2158 +++++ src/leveldb/db/dbformat.cc | 140 + src/leveldb/db/dbformat.h | 230 + src/leveldb/db/dbformat_test.cc | 112 + src/leveldb/db/dumpfile.cc | 225 + src/leveldb/db/fault_injection_test.cc | 554 ++ src/leveldb/db/filename.cc | 144 + src/leveldb/db/filename.h | 85 + src/leveldb/db/filename_test.cc | 123 + src/leveldb/db/leveldbutil.cc | 65 + src/leveldb/db/log_format.h | 35 + src/leveldb/db/log_reader.cc | 284 + src/leveldb/db/log_reader.h | 113 + src/leveldb/db/log_test.cc | 591 ++ src/leveldb/db/log_writer.cc | 112 + src/leveldb/db/log_writer.h | 54 + src/leveldb/db/memtable.cc | 145 + src/leveldb/db/memtable.h | 88 + src/leveldb/db/recovery_test.cc | 324 + src/leveldb/db/repair.cc | 461 ++ src/leveldb/db/skiplist.h | 384 + src/leveldb/db/skiplist_test.cc | 378 + src/leveldb/db/snapshot.h | 67 + src/leveldb/db/table_cache.cc | 127 + src/leveldb/db/table_cache.h | 61 + src/leveldb/db/version_edit.cc | 266 + src/leveldb/db/version_edit.h | 107 + src/leveldb/db/version_edit_test.cc | 46 + src/leveldb/db/version_set.cc | 1535 ++++ src/leveldb/db/version_set.h | 398 + src/leveldb/db/version_set_test.cc | 179 + src/leveldb/db/write_batch.cc | 147 + src/leveldb/db/write_batch_internal.h | 50 + src/leveldb/db/write_batch_test.cc | 120 + src/leveldb/doc/bench/db_bench_sqlite3.cc | 718 ++ src/leveldb/doc/bench/db_bench_tree_db.cc | 528 ++ src/leveldb/doc/benchmark.html | 459 ++ src/leveldb/doc/impl.md | 170 + src/leveldb/doc/index.md | 523 ++ src/leveldb/doc/log_format.md | 75 + src/leveldb/doc/table_format.md | 107 + src/leveldb/helpers/memenv/memenv.cc | 401 + src/leveldb/helpers/memenv/memenv.h | 20 + src/leveldb/helpers/memenv/memenv_test.cc | 241 + src/leveldb/include/leveldb/c.h | 290 + src/leveldb/include/leveldb/cache.h | 110 + src/leveldb/include/leveldb/comparator.h | 63 + src/leveldb/include/leveldb/db.h | 163 + src/leveldb/include/leveldb/dumpfile.h | 25 + src/leveldb/include/leveldb/env.h | 360 + src/leveldb/include/leveldb/filter_policy.h | 70 + src/leveldb/include/leveldb/iterator.h | 100 + src/leveldb/include/leveldb/options.h | 213 + src/leveldb/include/leveldb/slice.h | 109 + src/leveldb/include/leveldb/status.h | 112 + src/leveldb/include/leveldb/table.h | 85 + src/leveldb/include/leveldb/table_builder.h | 92 + src/leveldb/include/leveldb/write_batch.h | 64 + src/leveldb/issues/issue178_test.cc | 92 + src/leveldb/issues/issue200_test.cc | 59 + src/leveldb/port/README | 10 + src/leveldb/port/atomic_pointer.h | 245 + src/leveldb/port/port.h | 21 + src/leveldb/port/port_example.h | 145 + src/leveldb/port/port_posix.cc | 67 + src/leveldb/port/port_posix.h | 161 + src/leveldb/port/port_posix_sse.cc | 110 + src/leveldb/port/port_win.cc | 158 + src/leveldb/port/port_win.h | 177 + src/leveldb/port/thread_annotations.h | 60 + src/leveldb/port/win/stdint.h | 24 + src/leveldb/table/block.cc | 268 + src/leveldb/table/block.h | 44 + src/leveldb/table/block_builder.cc | 109 + src/leveldb/table/block_builder.h | 57 + src/leveldb/table/filter_block.cc | 111 + src/leveldb/table/filter_block.h | 68 + src/leveldb/table/filter_block_test.cc | 128 + src/leveldb/table/format.cc | 144 + src/leveldb/table/format.h | 108 + src/leveldb/table/iterator.cc | 67 + src/leveldb/table/iterator_wrapper.h | 66 + src/leveldb/table/merger.cc | 197 + src/leveldb/table/merger.h | 26 + src/leveldb/table/table.cc | 285 + src/leveldb/table/table_builder.cc | 270 + src/leveldb/table/table_test.cc | 876 ++ src/leveldb/table/two_level_iterator.cc | 182 + src/leveldb/table/two_level_iterator.h | 34 + src/leveldb/util/arena.cc | 68 + src/leveldb/util/arena.h | 68 + src/leveldb/util/arena_test.cc | 68 + src/leveldb/util/bloom.cc | 95 + src/leveldb/util/bloom_test.cc | 162 + src/leveldb/util/cache.cc | 405 + src/leveldb/util/cache_test.cc | 226 + src/leveldb/util/coding.cc | 194 + src/leveldb/util/coding.h | 104 + src/leveldb/util/coding_test.cc | 196 + src/leveldb/util/comparator.cc | 81 + src/leveldb/util/crc32c.cc | 354 + src/leveldb/util/crc32c.h | 45 + src/leveldb/util/crc32c_test.cc | 72 + src/leveldb/util/env.cc | 100 + src/leveldb/util/env_posix.cc | 706 ++ src/leveldb/util/env_posix_test.cc | 66 + src/leveldb/util/env_posix_test_helper.h | 28 + src/leveldb/util/env_test.cc | 106 + src/leveldb/util/env_win.cc | 901 ++ src/leveldb/util/filter_policy.cc | 11 + src/leveldb/util/hash.cc | 52 + src/leveldb/util/hash.h | 19 + src/leveldb/util/hash_test.cc | 54 + src/leveldb/util/histogram.cc | 139 + src/leveldb/util/histogram.h | 42 + src/leveldb/util/logging.cc | 72 + src/leveldb/util/logging.h | 43 + src/leveldb/util/mutexlock.h | 41 + src/leveldb/util/options.cc | 30 + src/leveldb/util/posix_logger.h | 98 + src/leveldb/util/random.h | 64 + src/leveldb/util/status.cc | 75 + src/leveldb/util/testharness.cc | 77 + src/leveldb/util/testharness.h | 138 + src/leveldb/util/testutil.cc | 51 + src/leveldb/util/testutil.h | 63 + src/leveldbwrapper.cpp | 88 + src/leveldbwrapper.h | 173 + src/libzerocoin/Accumulator.cpp | 149 + src/libzerocoin/Accumulator.h | 160 + .../AccumulatorProofOfKnowledge.cpp | 145 + src/libzerocoin/AccumulatorProofOfKnowledge.h | 97 + src/libzerocoin/Coin.cpp | 303 + src/libzerocoin/Coin.h | 182 + src/libzerocoin/CoinSpend.cpp | 172 + src/libzerocoin/CoinSpend.h | 183 + src/libzerocoin/Commitment.cpp | 175 + src/libzerocoin/Commitment.h | 109 + src/libzerocoin/Denominations.cpp | 118 + src/libzerocoin/Denominations.h | 42 + src/libzerocoin/LICENSE | 19 + src/libzerocoin/ParamGeneration.cpp | 659 ++ src/libzerocoin/ParamGeneration.h | 56 + src/libzerocoin/Params.cpp | 49 + src/libzerocoin/Params.h | 221 + .../SerialNumberSignatureOfKnowledge.cpp | 179 + .../SerialNumberSignatureOfKnowledge.h | 77 + src/libzerocoin/SpendType.h | 20 + src/libzerocoin/ZerocoinDefines.h | 42 + src/libzerocoin/bignum.cpp | 64 + src/libzerocoin/bignum.h | 350 + src/libzerocoin/bignum_gmp.cpp | 352 + src/libzerocoin/bignum_openssl.cpp | 509 ++ src/libzerocoin/documentation/Doxyfile | 1870 +++++ .../documentation/manual/intro.tex | 3 + .../documentation/manual/manual.pdf | Bin 0 -> 73684 bytes .../documentation/manual/manual.tex | 19 + .../documentation/manual/using.tex | 14 + src/libzerocoin/paramgen.cpp | 130 + src/libzerocoin/zerocoin.pc.in | 11 + src/lightzversthread.cpp | 117 + src/lightzversthread.h | 71 + src/limitedmap.h | 94 + src/main.cpp | 7134 ++++++++++++++++ src/main.h | 655 ++ src/masternode-budget.cpp | 2332 ++++++ src/masternode-budget.h | 608 ++ src/masternode-payments.cpp | 859 ++ src/masternode-payments.h | 302 + src/masternode-sync.cpp | 405 + src/masternode-sync.h | 80 + src/masternode.cpp | 840 ++ src/masternode.h | 339 + src/masternodeconfig.cpp | 106 + src/masternodeconfig.h | 122 + src/masternodeman.cpp | 1173 +++ src/masternodeman.h | 163 + src/merkleblock.cpp | 156 + src/merkleblock.h | 155 + src/miner.cpp | 850 ++ src/miner.h | 37 + src/mruset.h | 69 + src/net.cpp | 2333 ++++++ src/net.h | 773 ++ src/netbase.cpp | 1471 ++++ src/netbase.h | 228 + src/noui.cpp | 55 + src/noui.h | 10 + src/obfuscation-relay.cpp | 117 + src/obfuscation-relay.h | 52 + src/obfuscation.cpp | 706 ++ src/obfuscation.h | 377 + src/obj-test/.gitignore | 2 + src/obj/.gitignore | 2 + src/pow.cpp | 155 + src/pow.h | 33 + src/primitives/block.cpp | 148 + src/primitives/block.h | 209 + src/primitives/transaction.cpp | 322 + src/primitives/transaction.h | 342 + src/protocol.cpp | 162 + src/protocol.h | 184 + src/pubkey.cpp | 311 + src/pubkey.h | 267 + src/qt/CMakeLists.txt | 195 + src/qt/addressbookpage.cpp | 300 + src/qt/addressbookpage.h | 90 + src/qt/addresstablemodel.cpp | 458 ++ src/qt/addresstablemodel.h | 98 + src/qt/askpassphrasedialog.cpp | 254 + src/qt/askpassphrasedialog.h | 70 + src/qt/bantablemodel.cpp | 186 + src/qt/bantablemodel.h | 75 + src/qt/bip38tooldialog.cpp | 277 + src/qt/bip38tooldialog.h | 54 + src/qt/bitcoinaddressvalidator.cpp | 92 + src/qt/bitcoinaddressvalidator.h | 35 + src/qt/bitcoinamountfield.cpp | 304 + src/qt/bitcoinamountfield.h | 74 + src/qt/bitcoingui.cpp | 1394 ++++ src/qt/bitcoingui.h | 290 + src/qt/bitcoinunits.cpp | 287 + src/qt/bitcoinunits.h | 134 + src/qt/blockexplorer.cpp | 591 ++ src/qt/blockexplorer.h | 60 + src/qt/clientmodel.cpp | 336 + src/qt/clientmodel.h | 124 + src/qt/coincontroldialog.cpp | 896 ++ src/qt/coincontroldialog.h | 117 + src/qt/coincontroltreewidget.cpp | 30 + src/qt/coincontroltreewidget.h | 22 + src/qt/csvmodelwriter.cpp | 86 + src/qt/csvmodelwriter.h | 47 + src/qt/editaddressdialog.cpp | 140 + src/qt/editaddressdialog.h | 60 + src/qt/forms/addressbookpage.ui | 196 + src/qt/forms/askpassphrasedialog.ui | 176 + src/qt/forms/bip38tooldialog.ui | 483 ++ src/qt/forms/blockexplorer.ui | 174 + src/qt/forms/coincontroldialog.ui | 540 ++ src/qt/forms/editaddressdialog.ui | 112 + src/qt/forms/governancepage.ui | 340 + src/qt/forms/helpmessagedialog.ui | 136 + src/qt/forms/intro.ui | 266 + src/qt/forms/masternodelist.ui | 323 + src/qt/forms/multisenddialog.ui | 325 + src/qt/forms/multisigdialog.ui | 821 ++ src/qt/forms/obfuscationconfig.ui | 188 + src/qt/forms/openuridialog.ui | 118 + src/qt/forms/optionsdialog.ui | 740 ++ src/qt/forms/overviewpage.ui | 973 +++ src/qt/forms/privacydialog.ui | 2560 ++++++ src/qt/forms/receivecoinsdialog.ui | 517 ++ src/qt/forms/receiverequestdialog.ui | 168 + src/qt/forms/rpcconsole.ui | 1671 ++++ src/qt/forms/sendcoinsdialog.ui | 1717 ++++ src/qt/forms/sendcoinsentry.ui | 1236 +++ src/qt/forms/signverifymessagedialog.ui | 369 + src/qt/forms/transactiondescdialog.ui | 74 + src/qt/forms/zverscontroldialog.ui | 240 + src/qt/governancepage.cpp | 149 + src/qt/governancepage.h | 71 + src/qt/guiconstants.h | 62 + src/qt/guiutil.cpp | 931 +++ src/qt/guiutil.h | 248 + src/qt/intro.cpp | 283 + src/qt/intro.h | 81 + src/qt/locale/versess_bg.ts | 5336 ++++++++++++ src/qt/locale/versess_ca.ts | 1906 +++++ src/qt/locale/versess_cs.ts | 2358 ++++++ src/qt/locale/versess_da.ts | 5374 ++++++++++++ src/qt/locale/versess_de.ts | 5351 ++++++++++++ src/qt/locale/versess_en.ts | 7272 +++++++++++++++++ src/qt/locale/versess_en_GB.ts | 5478 +++++++++++++ src/qt/locale/versess_en_US.ts | 5149 ++++++++++++ src/qt/locale/versess_eo.ts | 2478 ++++++ src/qt/locale/versess_es.ts | 5402 ++++++++++++ src/qt/locale/versess_es_ES.ts | 658 ++ src/qt/locale/versess_fi.ts | 2555 ++++++ src/qt/locale/versess_fr_FR.ts | 5641 +++++++++++++ src/qt/locale/versess_hi_IN.ts | 322 + src/qt/locale/versess_hr.ts | 1590 ++++ src/qt/locale/versess_hr_HR.ts | 5356 ++++++++++++ src/qt/locale/versess_it.ts | 2317 ++++++ src/qt/locale/versess_ja.ts | 275 + src/qt/locale/versess_ko_KR.ts | 5354 ++++++++++++ src/qt/locale/versess_lt_LT.ts | 3163 +++++++ src/qt/locale/versess_nl.ts | 5471 +++++++++++++ src/qt/locale/versess_pl.ts | 5407 ++++++++++++ src/qt/locale/versess_pt.ts | 1179 +++ src/qt/locale/versess_pt_BR.ts | 3916 +++++++++ src/qt/locale/versess_ro_RO.ts | 191 + src/qt/locale/versess_ru.ts | 5353 ++++++++++++ src/qt/locale/versess_sk.ts | 1259 +++ src/qt/locale/versess_sv.ts | 5555 +++++++++++++ src/qt/locale/versess_tr.ts | 4226 ++++++++++ src/qt/locale/versess_uk.ts | 379 + src/qt/locale/versess_vi.ts | 211 + src/qt/locale/versess_zh_CN.ts | 1547 ++++ src/qt/locale/versess_zh_TW.ts | 947 +++ src/qt/macdockiconhandler.h | 44 + src/qt/macdockiconhandler.mm | 128 + src/qt/macnotificationhandler.h | 32 + src/qt/macnotificationhandler.mm | 79 + src/qt/masternodelist.cpp | 328 + src/qt/masternodelist.h | 76 + src/qt/multisenddialog.cpp | 229 + src/qt/multisenddialog.h | 42 + src/qt/multisigdialog.cpp | 1069 +++ src/qt/multisigdialog.h | 72 + src/qt/networkstyle.cpp | 45 + src/qt/networkstyle.h | 33 + src/qt/notificator.cpp | 266 + src/qt/notificator.h | 77 + src/qt/openuridialog.cpp | 51 + src/qt/openuridialog.h | 37 + src/qt/optionsdialog.cpp | 337 + src/qt/optionsdialog.h | 68 + src/qt/optionsmodel.cpp | 497 ++ src/qt/optionsmodel.h | 114 + src/qt/overviewpage.cpp | 341 + src/qt/overviewpage.h | 72 + src/qt/paymentrequest.proto | 46 + src/qt/paymentrequestplus.cpp | 208 + src/qt/paymentrequestplus.h | 52 + src/qt/paymentserver.cpp | 693 ++ src/qt/paymentserver.h | 139 + src/qt/peertablemodel.cpp | 233 + src/qt/peertablemodel.h | 82 + src/qt/platformstyle.cpp | 141 + src/qt/platformstyle.h | 56 + src/qt/privacydialog.cpp | 829 ++ src/qt/privacydialog.h | 114 + src/qt/proposalframe.cpp | 317 + src/qt/proposalframe.h | 55 + src/qt/qvalidatedlineedit.cpp | 96 + src/qt/qvalidatedlineedit.h | 39 + src/qt/qvaluecombobox.cpp | 32 + src/qt/qvaluecombobox.h | 37 + src/qt/receivecoinsdialog.cpp | 302 + src/qt/receivecoinsdialog.h | 85 + src/qt/receiverequestdialog.cpp | 189 + src/qt/receiverequestdialog.h | 73 + src/qt/recentrequeststablemodel.cpp | 232 + src/qt/recentrequeststablemodel.h | 111 + src/qt/res/css/default.css | 1628 ++++ src/qt/res/icons/abstainvote.png | Bin 0 -> 413 bytes src/qt/res/icons/add.png | Bin 0 -> 6144 bytes src/qt/res/icons/address-book.png | Bin 0 -> 4530 bytes src/qt/res/icons/automint_active.png | Bin 0 -> 5699 bytes src/qt/res/icons/automint_inactive.png | Bin 0 -> 5682 bytes src/qt/res/icons/bitcoin.icns | Bin 0 -> 46903 bytes src/qt/res/icons/bitcoin.ico | Bin 0 -> 10739 bytes src/qt/res/icons/bitcoin.png | Bin 0 -> 12848 bytes src/qt/res/icons/bitcoin_regtest.png | Bin 0 -> 12848 bytes src/qt/res/icons/bitcoin_testnet.ico | Bin 0 -> 8122 bytes src/qt/res/icons/bitcoin_testnet.png | Bin 0 -> 12273 bytes src/qt/res/icons/bittrex.png | Bin 0 -> 12369 bytes src/qt/res/icons/browse.png | Bin 0 -> 5641 bytes src/qt/res/icons/clock1.png | Bin 0 -> 4435 bytes src/qt/res/icons/clock2.png | Bin 0 -> 4483 bytes src/qt/res/icons/clock3.png | Bin 0 -> 4521 bytes src/qt/res/icons/clock4.png | Bin 0 -> 4559 bytes src/qt/res/icons/clock5.png | Bin 0 -> 4591 bytes src/qt/res/icons/configure.png | Bin 0 -> 3107 bytes src/qt/res/icons/connect0_16.png | Bin 0 -> 6720 bytes src/qt/res/icons/connect1_16.png | Bin 0 -> 5567 bytes src/qt/res/icons/connect2_16.png | Bin 0 -> 5756 bytes src/qt/res/icons/connect3_16.png | Bin 0 -> 5989 bytes src/qt/res/icons/connect4_16.png | Bin 0 -> 6243 bytes src/qt/res/icons/debugwindow.png | Bin 0 -> 4867 bytes src/qt/res/icons/edit.png | Bin 0 -> 6490 bytes src/qt/res/icons/editcopy.png | Bin 0 -> 5417 bytes src/qt/res/icons/editpaste.png | Bin 0 -> 4491 bytes src/qt/res/icons/explorer.png | Bin 0 -> 4847 bytes src/qt/res/icons/export.png | Bin 0 -> 4483 bytes src/qt/res/icons/eye.png | Bin 0 -> 4938 bytes src/qt/res/icons/eye_minus.png | Bin 0 -> 5121 bytes src/qt/res/icons/eye_plus.png | Bin 0 -> 5288 bytes src/qt/res/icons/filesave.png | Bin 0 -> 6678 bytes src/qt/res/icons/history.png | Bin 0 -> 4051 bytes src/qt/res/icons/import.png | Bin 0 -> 4872 bytes src/qt/res/icons/info.png | Bin 0 -> 3124 bytes src/qt/res/icons/key.png | Bin 0 -> 5245 bytes src/qt/res/icons/lock_closed.png | Bin 0 -> 4265 bytes src/qt/res/icons/lock_open.png | Bin 0 -> 3418 bytes src/qt/res/icons/masternodes.png | Bin 0 -> 6344 bytes src/qt/res/icons/notsynced.png | Bin 0 -> 4914 bytes src/qt/res/icons/novote.png | Bin 0 -> 529 bytes src/qt/res/icons/onion.png | Bin 0 -> 4395 bytes src/qt/res/icons/overview.png | Bin 0 -> 7883 bytes src/qt/res/icons/privacy.png | Bin 0 -> 8852 bytes src/qt/res/icons/qrcode.png | Bin 0 -> 133 bytes src/qt/res/icons/quit.png | Bin 0 -> 3807 bytes src/qt/res/icons/receive.png | Bin 0 -> 5066 bytes src/qt/res/icons/receive_dark.png | Bin 0 -> 5502 bytes src/qt/res/icons/remove.png | Bin 0 -> 4981 bytes src/qt/res/icons/send.png | Bin 0 -> 5103 bytes src/qt/res/icons/send_dark.png | Bin 0 -> 5497 bytes src/qt/res/icons/staking_active.png | Bin 0 -> 4891 bytes src/qt/res/icons/staking_inactive.png | Bin 0 -> 4863 bytes src/qt/res/icons/synced.png | Bin 0 -> 4952 bytes src/qt/res/icons/trade.png | Bin 0 -> 6490 bytes src/qt/res/icons/transaction0.png | Bin 0 -> 4487 bytes src/qt/res/icons/transaction0_dark.png | Bin 0 -> 208 bytes src/qt/res/icons/transaction2.png | Bin 0 -> 5707 bytes src/qt/res/icons/transaction_conflicted.png | Bin 0 -> 4481 bytes src/qt/res/icons/tx_inout.png | Bin 0 -> 15290 bytes src/qt/res/icons/tx_input.png | Bin 0 -> 6045 bytes src/qt/res/icons/tx_mined.png | Bin 0 -> 6278 bytes src/qt/res/icons/tx_output.png | Bin 0 -> 6088 bytes src/qt/res/icons/unit_mversess.png | Bin 0 -> 3104 bytes src/qt/res/icons/unit_tmversess.png | Bin 0 -> 3195 bytes src/qt/res/icons/unit_tuversess.png | Bin 0 -> 3171 bytes src/qt/res/icons/unit_tversess.png | Bin 0 -> 3089 bytes src/qt/res/icons/unit_uversess.png | Bin 0 -> 3136 bytes src/qt/res/icons/unit_versess.png | Bin 0 -> 3097 bytes src/qt/res/icons/yesvote.png | Bin 0 -> 623 bytes src/qt/res/images/about.png | Bin 0 -> 6493 bytes src/qt/res/images/downArrow.png | Bin 0 -> 3195 bytes src/qt/res/images/downArrow_dark.png | Bin 0 -> 3195 bytes src/qt/res/images/downArrow_small.png | Bin 0 -> 3021 bytes src/qt/res/images/downArrow_small_dark.png | Bin 0 -> 3033 bytes src/qt/res/images/leftArrow_small.png | Bin 0 -> 3030 bytes src/qt/res/images/leftArrow_small_dark.png | Bin 0 -> 3030 bytes src/qt/res/images/qtreeview_selected.png | Bin 0 -> 3265 bytes src/qt/res/images/rightArrow_small.png | Bin 0 -> 3026 bytes src/qt/res/images/rightArrow_small_dark.png | Bin 0 -> 3026 bytes src/qt/res/images/splash.png | Bin 0 -> 112925 bytes src/qt/res/images/splash_testnet.png | Bin 0 -> 75889 bytes src/qt/res/images/upArrow_small.png | Bin 0 -> 3034 bytes src/qt/res/images/upArrow_small_dark.png | Bin 0 -> 3034 bytes src/qt/res/images/vers.png | Bin 0 -> 146169 bytes src/qt/res/images/versess_logo_horizontal.png | Bin 0 -> 7137 bytes src/qt/res/images/walletFrame.png | Bin 0 -> 79693 bytes src/qt/res/images/walletFrame_bg.png | Bin 0 -> 79693 bytes src/qt/res/movies/spinner-000.png | Bin 0 -> 958 bytes src/qt/res/movies/spinner-001.png | Bin 0 -> 887 bytes src/qt/res/movies/spinner-002.png | Bin 0 -> 893 bytes src/qt/res/movies/spinner-003.png | Bin 0 -> 914 bytes src/qt/res/movies/spinner-004.png | Bin 0 -> 898 bytes src/qt/res/movies/spinner-005.png | Bin 0 -> 896 bytes src/qt/res/movies/spinner-006.png | Bin 0 -> 915 bytes src/qt/res/movies/spinner-007.png | Bin 0 -> 967 bytes src/qt/res/movies/spinner-008.png | Bin 0 -> 943 bytes src/qt/res/movies/spinner-009.png | Bin 0 -> 964 bytes src/qt/res/movies/spinner-010.png | Bin 0 -> 913 bytes src/qt/res/movies/spinner-011.png | Bin 0 -> 931 bytes src/qt/res/movies/spinner-012.png | Bin 0 -> 918 bytes src/qt/res/movies/spinner-013.png | Bin 0 -> 923 bytes src/qt/res/movies/spinner-014.png | Bin 0 -> 898 bytes src/qt/res/movies/spinner-015.png | Bin 0 -> 878 bytes src/qt/res/movies/spinner-016.png | Bin 0 -> 896 bytes src/qt/res/movies/spinner-017.png | Bin 0 -> 923 bytes src/qt/res/movies/spinner-018.png | Bin 0 -> 889 bytes src/qt/res/movies/spinner-019.png | Bin 0 -> 911 bytes src/qt/res/movies/spinner-020.png | Bin 0 -> 922 bytes src/qt/res/movies/spinner-021.png | Bin 0 -> 910 bytes src/qt/res/movies/spinner-022.png | Bin 0 -> 912 bytes src/qt/res/movies/spinner-023.png | Bin 0 -> 894 bytes src/qt/res/movies/spinner-024.png | Bin 0 -> 953 bytes src/qt/res/movies/spinner-025.png | Bin 0 -> 936 bytes src/qt/res/movies/spinner-026.png | Bin 0 -> 948 bytes src/qt/res/movies/spinner-027.png | Bin 0 -> 941 bytes src/qt/res/movies/spinner-028.png | Bin 0 -> 964 bytes src/qt/res/movies/spinner-029.png | Bin 0 -> 956 bytes src/qt/res/movies/spinner-030.png | Bin 0 -> 907 bytes src/qt/res/movies/spinner-031.png | Bin 0 -> 894 bytes src/qt/res/movies/spinner-032.png | Bin 0 -> 896 bytes src/qt/res/movies/spinner-033.png | Bin 0 -> 940 bytes src/qt/res/movies/spinner-034.png | Bin 0 -> 945 bytes src/qt/res/src/bitcoin.svg | 58 + src/qt/res/src/clock1.svg | 261 + src/qt/res/src/clock2.svg | 262 + src/qt/res/src/clock3.svg | 261 + src/qt/res/src/clock4.svg | 261 + src/qt/res/src/clock5.svg | 262 + src/qt/res/src/clock_green.svg | 262 + src/qt/res/src/inout.svg | 122 + src/qt/res/src/questionmark.svg | 159 + src/qt/res/versess-qt-res.rc | 38 + src/qt/rpcconsole.cpp | 1071 +++ src/qt/rpcconsole.h | 160 + src/qt/sendcoinsdialog.cpp | 961 +++ src/qt/sendcoinsdialog.h | 109 + src/qt/sendcoinsentry.cpp | 247 + src/qt/sendcoinsentry.h | 73 + src/qt/signverifymessagedialog.cpp | 254 + src/qt/signverifymessagedialog.h | 54 + src/qt/splashscreen.cpp | 175 + src/qt/splashscreen.h | 49 + src/qt/test/paymentrequestdata.h | 311 + src/qt/test/paymentservertests.cpp | 135 + src/qt/test/paymentservertests.h | 35 + src/qt/test/test_main.cpp | 64 + src/qt/test/uritests.cpp | 68 + src/qt/test/uritests.h | 19 + src/qt/trafficgraphwidget.cpp | 176 + src/qt/trafficgraphwidget.h | 50 + src/qt/transactiondesc.cpp | 324 + src/qt/transactiondesc.h | 31 + src/qt/transactiondescdialog.cpp | 33 + src/qt/transactiondescdialog.h | 34 + src/qt/transactionfilterproxy.cpp | 128 + src/qt/transactionfilterproxy.h | 76 + src/qt/transactionrecord.cpp | 421 + src/qt/transactionrecord.h | 157 + src/qt/transactiontablemodel.cpp | 751 ++ src/qt/transactiontablemodel.h | 112 + src/qt/transactionview.cpp | 614 ++ src/qt/transactionview.h | 123 + src/qt/utilitydialog.cpp | 184 + src/qt/utilitydialog.h | 55 + src/qt/versess.cpp | 648 ++ src/qt/versess.qrc | 119 + src/qt/versess_locale.qrc | 37 + src/qt/versessstrings.cpp | 503 ++ src/qt/walletframe.cpp | 257 + src/qt/walletframe.h | 99 + src/qt/walletmodel.cpp | 776 ++ src/qt/walletmodel.h | 303 + src/qt/walletmodeltransaction.cpp | 67 + src/qt/walletmodeltransaction.h | 45 + src/qt/walletview.cpp | 444 + src/qt/walletview.h | 144 + src/qt/winshutdownmonitor.cpp | 69 + src/qt/winshutdownmonitor.h | 27 + src/qt/zverscontroldialog.cpp | 235 + src/qt/zverscontroldialog.h | 69 + src/random.cpp | 138 + src/random.h | 49 + src/rest.cpp | 622 ++ src/reverse_iterate.h | 38 + src/reverselock.h | 36 + src/rpc/blockchain.cpp | 1658 ++++ src/rpc/budget.cpp | 953 +++ src/rpc/client.cpp | 203 + src/rpc/client.h | 19 + src/rpc/masternode.cpp | 964 +++ src/rpc/mining.cpp | 772 ++ src/rpc/misc.cpp | 618 ++ src/rpc/net.cpp | 579 ++ src/rpc/protocol.cpp | 130 + src/rpc/protocol.h | 93 + src/rpc/rawtransaction.cpp | 875 ++ src/rpc/server.cpp | 649 ++ src/rpc/server.h | 337 + src/scheduler.cpp | 134 + src/scheduler.h | 85 + src/script/bitcoinconsensus.cpp | 98 + src/script/bitcoinconsensus.h | 68 + src/script/interpreter.cpp | 1221 +++ src/script/interpreter.h | 131 + src/script/script.cpp | 322 + src/script/script.h | 630 ++ src/script/script_error.cpp | 75 + src/script/script_error.h | 61 + src/script/sigcache.cpp | 88 + src/script/sigcache.h | 26 + src/script/sign.cpp | 280 + src/script/sign.h | 32 + src/script/standard.cpp | 331 + src/script/standard.h | 97 + src/secp256k1/.gitignore | 50 + src/secp256k1/.travis.yml | 69 + src/secp256k1/COPYING | 19 + src/secp256k1/Makefile.am | 183 + src/secp256k1/README.md | 61 + src/secp256k1/TODO | 3 + src/secp256k1/autogen.sh | 3 + .../build-aux/m4/ax_jni_include_dir.m4 | 145 + .../build-aux/m4/ax_prog_cc_for_build.m4 | 125 + src/secp256k1/build-aux/m4/bitcoin_secp.m4 | 68 + src/secp256k1/configure.ac | 494 ++ src/secp256k1/contrib/lax_der_parsing.c | 150 + src/secp256k1/contrib/lax_der_parsing.h | 91 + .../contrib/lax_der_privatekey_parsing.c | 113 + .../contrib/lax_der_privatekey_parsing.h | 90 + src/secp256k1/include/secp256k1.h | 654 ++ src/secp256k1/include/secp256k1_ecdh.h | 55 + src/secp256k1/include/secp256k1_recovery.h | 110 + src/secp256k1/libsecp256k1.pc.in | 13 + src/secp256k1/obj/.gitignore | 0 src/secp256k1/sage/group_prover.sage | 322 + src/secp256k1/sage/secp256k1.sage | 306 + src/secp256k1/sage/weierstrass_prover.sage | 264 + src/secp256k1/src/asm/field_10x26_arm.s | 919 +++ src/secp256k1/src/basic-config.h | 33 + src/secp256k1/src/bench.h | 82 + src/secp256k1/src/bench_ecdh.c | 54 + src/secp256k1/src/bench_ecmult.c | 196 + src/secp256k1/src/bench_internal.c | 367 + src/secp256k1/src/bench_recover.c | 60 + src/secp256k1/src/bench_sign.c | 56 + src/secp256k1/src/bench_verify.c | 112 + src/secp256k1/src/ecdsa.h | 21 + src/secp256k1/src/ecdsa_impl.h | 313 + src/secp256k1/src/eckey.h | 25 + src/secp256k1/src/eckey_impl.h | 100 + src/secp256k1/src/ecmult.h | 47 + src/secp256k1/src/ecmult_const.h | 17 + src/secp256k1/src/ecmult_const_impl.h | 257 + src/secp256k1/src/ecmult_gen.h | 43 + src/secp256k1/src/ecmult_gen_impl.h | 210 + src/secp256k1/src/ecmult_impl.h | 1027 +++ src/secp256k1/src/field.h | 132 + src/secp256k1/src/field_10x26.h | 48 + src/secp256k1/src/field_10x26_impl.h | 1161 +++ src/secp256k1/src/field_5x52.h | 47 + src/secp256k1/src/field_5x52_asm_impl.h | 502 ++ src/secp256k1/src/field_5x52_impl.h | 496 ++ src/secp256k1/src/field_5x52_int128_impl.h | 277 + src/secp256k1/src/field_impl.h | 315 + src/secp256k1/src/gen_context.c | 74 + src/secp256k1/src/group.h | 147 + src/secp256k1/src/group_impl.h | 706 ++ src/secp256k1/src/hash.h | 41 + src/secp256k1/src/hash_impl.h | 282 + .../src/java/org/bitcoin/NativeSecp256k1.java | 446 + .../java/org/bitcoin/NativeSecp256k1Test.java | 226 + .../java/org/bitcoin/NativeSecp256k1Util.java | 45 + .../java/org/bitcoin/Secp256k1Context.java | 51 + .../src/java/org_bitcoin_NativeSecp256k1.c | 379 + .../src/java/org_bitcoin_NativeSecp256k1.h | 119 + .../src/java/org_bitcoin_Secp256k1Context.c | 15 + .../src/java/org_bitcoin_Secp256k1Context.h | 22 + .../src/modules/ecdh/Makefile.am.include | 8 + src/secp256k1/src/modules/ecdh/main_impl.h | 67 + src/secp256k1/src/modules/ecdh/tests_impl.h | 132 + .../src/modules/recovery/Makefile.am.include | 8 + .../src/modules/recovery/main_impl.h | 193 + .../src/modules/recovery/tests_impl.h | 393 + src/secp256k1/src/num.h | 74 + src/secp256k1/src/num_gmp.h | 20 + src/secp256k1/src/num_gmp_impl.h | 288 + src/secp256k1/src/num_impl.h | 24 + src/secp256k1/src/scalar.h | 106 + src/secp256k1/src/scalar_4x64.h | 19 + src/secp256k1/src/scalar_4x64_impl.h | 949 +++ src/secp256k1/src/scalar_8x32.h | 19 + src/secp256k1/src/scalar_8x32_impl.h | 721 ++ src/secp256k1/src/scalar_impl.h | 333 + src/secp256k1/src/scalar_low.h | 15 + src/secp256k1/src/scalar_low_impl.h | 114 + src/secp256k1/src/scratch.h | 39 + src/secp256k1/src/scratch_impl.h | 86 + src/secp256k1/src/secp256k1.c | 597 ++ src/secp256k1/src/testrand.h | 38 + src/secp256k1/src/testrand_impl.h | 110 + src/secp256k1/src/tests.c | 5086 ++++++++++++ src/secp256k1/src/tests_exhaustive.c | 511 ++ src/secp256k1/src/util.h | 121 + src/serialize.h | 940 +++ src/spork.cpp | 291 + src/spork.h | 124 + src/sporkdb.cpp | 26 + src/sporkdb.h | 29 + src/stakeinput.cpp | 273 + src/stakeinput.h | 98 + src/streams.h | 575 ++ src/support/cleanse.cpp | 39 + src/support/cleanse.h | 13 + src/swifttx.cpp | 576 ++ src/swifttx.h | 115 + src/sync.cpp | 182 + src/sync.h | 289 + src/test/Checkpoints_tests.cpp | 41 + src/test/DoS_tests.cpp | 200 + src/test/README.md | 57 + src/test/accounting_tests.cpp | 142 + src/test/addrman_tests.cpp | 520 ++ src/test/alert_tests.cpp | 192 + src/test/allocator_tests.cpp | 120 + src/test/arith_uint256_tests.cpp | 569 ++ src/test/base32_tests.cpp | 25 + src/test/base58_tests.cpp | 275 + src/test/base64_tests.cpp | 25 + src/test/benchmark_zerocoin.cpp | 417 + src/test/bip32_tests.cpp | 121 + src/test/bloom_tests.cpp | 465 ++ src/test/budget_tests.cpp | 34 + src/test/checkblock_tests.cpp | 70 + src/test/coins_tests.cpp | 179 + src/test/compress_tests.cpp | 65 + src/test/crypto_tests.cpp | 286 + src/test/data/README.md | 12 + src/test/data/alertTests.raw | Bin 0 -> 1279 bytes src/test/data/base58_encode_decode.json | 14 + src/test/data/base58_keys_invalid.json | 152 + src/test/data/base58_keys_valid.json | 452 + src/test/data/script_invalid.json | 824 ++ src/test/data/script_valid.json | 960 +++ src/test/data/sig_canonical.json | 7 + src/test/data/sig_noncanonical.json | 22 + src/test/data/sighash.json | 502 ++ src/test/data/tx_invalid.json | 169 + src/test/data/tx_valid.json | 224 + src/test/getarg_tests.cpp | 163 + src/test/hash_tests.cpp | 50 + src/test/key_tests.cpp | 192 + src/test/libzerocoin_tests.cpp | 496 ++ src/test/main_tests.cpp | 53 + src/test/mempool_tests.cpp | 102 + src/test/miner_tests.cpp | 271 + src/test/mruset_tests.cpp | 99 + src/test/multisig_tests.cpp | 323 + src/test/netbase_tests.cpp | 240 + src/test/pmt_tests.cpp | 111 + src/test/reverselock_tests.cpp | 65 + src/test/rpc_tests.cpp | 270 + src/test/rpc_wallet_tests.cpp | 187 + src/test/sanity_tests.cpp | 20 + src/test/scheduler_tests.cpp | 124 + src/test/script_P2SH_tests.cpp | 381 + src/test/script_tests.cpp | 974 +++ src/test/scriptnum_tests.cpp | 201 + src/test/serialize_tests.cpp | 166 + src/test/sighash_tests.cpp | 214 + src/test/sigopcount_tests.cpp | 68 + src/test/skiplist_tests.cpp | 105 + src/test/test_versess.cpp | 101 + src/test/test_versess.h | 35 + src/test/test_zerocoin.cpp | 29 + src/test/timedata_tests.cpp | 39 + src/test/torcontrol_tests.cpp | 200 + src/test/transaction_tests.cpp | 400 + src/test/tutorial_zerocoin.cpp | 285 + src/test/uint256_tests.cpp | 837 ++ src/test/univalue_tests.cpp | 320 + src/test/util_tests.cpp | 430 + src/test/zerocoin_bignum_tests.cpp | 92 + src/test/zerocoin_chain_tests.cpp | 8 + src/test/zerocoin_coinspend_tests.cpp | 94 + src/test/zerocoin_denomination_tests.cpp | 523 ++ src/test/zerocoin_implementation_tests.cpp | 512 ++ src/test/zerocoin_transactions_tests.cpp | 121 + src/threadsafety.h | 55 + src/timedata.cpp | 107 + src/timedata.h | 76 + src/tinyformat.h | 1008 +++ src/torcontrol.cpp | 784 ++ src/torcontrol.h | 26 + src/txdb.cpp | 425 + src/txdb.h | 99 + src/txmempool.cpp | 739 ++ src/txmempool.h | 186 + src/uint256.cpp | 377 + src/uint256.h | 414 + src/uint512.h | 46 + src/undo.h | 79 + src/univalue/.gitignore | 32 + src/univalue/.travis.yml | 52 + src/univalue/COPYING | 19 + src/univalue/Makefile.am | 115 + src/univalue/README.md | 32 + src/univalue/TODO | 10 + src/univalue/autogen.sh | 9 + src/univalue/build-aux/m4/.gitignore | 1 + src/univalue/configure.ac | 69 + src/univalue/gen/gen.cpp | 84 + src/univalue/include/univalue.h | 296 + src/univalue/lib/.gitignore | 2 + src/univalue/lib/univalue.cpp | 359 + src/univalue/lib/univalue_escapes.h | 262 + src/univalue/lib/univalue_read.cpp | 454 + src/univalue/lib/univalue_utffilter.h | 119 + src/univalue/lib/univalue_write.cpp | 115 + src/univalue/pc/libunivalue-uninstalled.pc.in | 9 + src/univalue/pc/libunivalue.pc.in | 10 + src/univalue/test/.gitignore | 8 + src/univalue/test/fail1.json | 1 + src/univalue/test/fail10.json | 1 + src/univalue/test/fail11.json | 1 + src/univalue/test/fail12.json | 1 + src/univalue/test/fail13.json | 1 + src/univalue/test/fail14.json | 1 + src/univalue/test/fail15.json | 1 + src/univalue/test/fail16.json | 1 + src/univalue/test/fail17.json | 1 + src/univalue/test/fail18.json | 1 + src/univalue/test/fail19.json | 1 + src/univalue/test/fail2.json | 1 + src/univalue/test/fail20.json | 1 + src/univalue/test/fail21.json | 1 + src/univalue/test/fail22.json | 1 + src/univalue/test/fail23.json | 1 + src/univalue/test/fail24.json | 1 + src/univalue/test/fail25.json | 1 + src/univalue/test/fail26.json | 1 + src/univalue/test/fail27.json | 2 + src/univalue/test/fail28.json | 2 + src/univalue/test/fail29.json | 1 + src/univalue/test/fail3.json | 1 + src/univalue/test/fail30.json | 1 + src/univalue/test/fail31.json | 1 + src/univalue/test/fail32.json | 1 + src/univalue/test/fail33.json | 1 + src/univalue/test/fail34.json | 1 + src/univalue/test/fail35.json | 1 + src/univalue/test/fail36.json | 1 + src/univalue/test/fail37.json | 1 + src/univalue/test/fail38.json | 1 + src/univalue/test/fail39.json | 1 + src/univalue/test/fail4.json | 1 + src/univalue/test/fail40.json | 1 + src/univalue/test/fail41.json | 1 + src/univalue/test/fail42.json | Bin 0 -> 37 bytes src/univalue/test/fail44.json | 1 + src/univalue/test/fail5.json | 1 + src/univalue/test/fail6.json | 1 + src/univalue/test/fail7.json | 1 + src/univalue/test/fail8.json | 1 + src/univalue/test/fail9.json | 1 + src/univalue/test/no_nul.cpp | 8 + src/univalue/test/object.cpp | 365 + src/univalue/test/pass1.json | 58 + src/univalue/test/pass2.json | 1 + src/univalue/test/pass3.json | 6 + src/univalue/test/round1.json | 1 + src/univalue/test/round2.json | 1 + src/univalue/test/round3.json | 1 + src/univalue/test/round4.json | 1 + src/univalue/test/round5.json | 1 + src/univalue/test/round6.json | 1 + src/univalue/test/round7.json | 1 + src/univalue/test/test_json.cpp | 24 + src/univalue/test/unitester.cpp | 170 + src/util.cpp | 820 ++ src/util.h | 250 + src/utilmoneystr.cpp | 80 + src/utilmoneystr.h | 21 + src/utilstrencodings.cpp | 591 ++ src/utilstrencodings.h | 143 + src/utiltime.cpp | 88 + src/utiltime.h | 23 + src/validationinterface.cpp | 61 + src/validationinterface.h | 80 + src/versess-cli-res.rc | 35 + src/versess-cli.cpp | 322 + src/versess-tx-res.rc | 35 + src/versess-tx.cpp | 643 ++ src/versessd-res.rc | 35 + src/versessd.cpp | 169 + src/version.h | 44 + src/wallet/db.cpp | 461 ++ src/wallet/db.h | 316 + src/wallet/rpcdump.cpp | 547 ++ src/wallet/rpcwallet.cpp | 2607 ++++++ src/wallet/test/wallet_tests.cpp | 308 + src/wallet/wallet.cpp | 3963 +++++++++ src/wallet/wallet.h | 1203 +++ src/wallet/wallet_ismine.cpp | 101 + src/wallet/wallet_ismine.h | 33 + src/wallet/walletdb.cpp | 1770 ++++ src/wallet/walletdb.h | 213 + src/zmq/zmqabstractnotifier.cpp | 27 + src/zmq/zmqabstractnotifier.h | 45 + src/zmq/zmqconfig.h | 24 + src/zmq/zmqnotificationinterface.cpp | 178 + src/zmq/zmqnotificationinterface.h | 38 + src/zmq/zmqpublishnotifier.cpp | 214 + src/zmq/zmqpublishnotifier.h | 67 + src/zvers/accumulatorcheckpoints.cpp | 86 + src/zvers/accumulatorcheckpoints.h | 22 + src/zvers/accumulatorcheckpoints.json.h | 61 + src/zvers/accumulatormap.cpp | 106 + src/zvers/accumulatormap.h | 28 + src/zvers/accumulators.cpp | 847 ++ src/zvers/accumulators.h | 94 + src/zvers/deterministicmint.cpp | 46 + src/zvers/deterministicmint.h | 68 + src/zvers/mintpool.cpp | 110 + src/zvers/mintpool.h | 54 + src/zvers/witness.cpp | 110 + src/zvers/witness.h | 83 + src/zvers/zerocoin.cpp | 79 + src/zvers/zerocoin.h | 257 + src/zvers/zversmodule.cpp | 129 + src/zvers/zversmodule.h | 92 + src/zvers/zverstracker.cpp | 528 ++ src/zvers/zverstracker.h | 58 + src/zvers/zverswallet.cpp | 488 ++ src/zvers/zverswallet.h | 50 + src/zverschain.cpp | 391 + src/zverschain.h | 42 + test/README.md | 187 + test/config.ini.in | 19 + test/functional/README.md | 177 + test/functional/combine_logs.py | 114 + test/functional/combined_log_template.html | 40 + test/functional/create_cache.py | 28 + test/functional/example_test.py | 222 + test/functional/fake_stake/base_test.py | 435 + test/functional/fake_stake/util.py | 143 + test/functional/feature_block.py | 1292 +++ test/functional/feature_cltv.py | 154 + test/functional/feature_config_args.py | 49 + test/functional/feature_fee_estimation.py | 262 + test/functional/feature_help.py | 46 + test/functional/feature_minchainwork.py | 89 + test/functional/feature_notifications.py | 86 + test/functional/feature_nulldummy.py | 132 + test/functional/feature_proxy.py | 201 + test/functional/feature_reindex.py | 37 + test/functional/feature_uacomment.py | 35 + test/functional/interface_bitcoin_cli.py | 58 + test/functional/interface_http.py | 108 + test/functional/interface_rest.py | 326 + test/functional/interface_zmq.py | 128 + test/functional/mempool_limit.py | 54 + test/functional/mempool_persist.py | 117 + test/functional/mempool_reorg.py | 96 + test/functional/mempool_resurrect.py | 68 + test/functional/mempool_spend_coinbase.py | 53 + test/functional/mining_basic.py | 134 + .../mining_getblocktemplate_longpoll.py | 71 + .../mining_prioritisetransaction.py | 147 + test/functional/p2p_disconnect_ban.py | 107 + test/functional/p2p_feefilter.py | 93 + test/functional/p2p_fingerprint.py | 152 + test/functional/p2p_invalid_block.py | 119 + test/functional/p2p_invalid_tx.py | 74 + test/functional/p2p_leak.py | 153 + test/functional/p2p_mempool.py | 35 + test/functional/p2p_pos_doublespend.py | 54 + test/functional/p2p_pos_fakestake.py | 58 + test/functional/p2p_pos_fakestake_accepted.py | 60 + test/functional/p2p_sendheaders.py | 607 ++ test/functional/p2p_timeouts.py | 75 + test/functional/p2p_unrequested_blocks.py | 323 + test/functional/p2p_zpos_fakestake.py | 106 + .../functional/p2p_zpos_fakestake_accepted.py | 117 + test/functional/rpc_bind.py | 107 + test/functional/rpc_bip38.py | 27 + test/functional/rpc_blockchain.py | 109 + test/functional/rpc_decodescript.py | 179 + test/functional/rpc_deprecated.py | 27 + test/functional/rpc_fundrawtransaction.py | 664 ++ test/functional/rpc_getchaintips.py | 62 + test/functional/rpc_invalidateblock.py | 64 + test/functional/rpc_listtransactions.py | 86 + test/functional/rpc_net.py | 94 + test/functional/rpc_rawtransaction.py | 346 + test/functional/rpc_signmessage.py | 38 + test/functional/rpc_signrawtransaction.py | 104 + test/functional/rpc_users.py | 153 + test/functional/test_framework/__init__.py | 0 test/functional/test_framework/address.py | 69 + test/functional/test_framework/authproxy.py | 178 + test/functional/test_framework/bignum.py | 97 + test/functional/test_framework/blockstore.py | 170 + test/functional/test_framework/blocktools.py | 83 + test/functional/test_framework/comptool.py | 397 + test/functional/test_framework/coverage.py | 109 + test/functional/test_framework/key.py | 232 + test/functional/test_framework/messages.py | 1313 +++ test/functional/test_framework/mininode.py | 444 + test/functional/test_framework/netutil.py | 156 + test/functional/test_framework/script.py | 647 ++ test/functional/test_framework/siphash.py | 63 + test/functional/test_framework/socks5.py | 159 + .../test_framework/test_framework.py | 486 ++ test/functional/test_framework/test_node.py | 286 + test/functional/test_framework/util.py | 588 ++ test/functional/test_runner.py | 551 ++ test/functional/wallet_abandonconflict.py | 160 + test/functional/wallet_accounts.py | 202 + test/functional/wallet_backup.py | 205 + test/functional/wallet_basic.py | 319 + test/functional/wallet_bumpfee.py | 300 + test/functional/wallet_disable.py | 29 + test/functional/wallet_dump.py | 93 + test/functional/wallet_encryption.py | 86 + test/functional/wallet_import_rescan.py | 187 + test/functional/wallet_importmulti.py | 451 + test/functional/wallet_keypool.py | 79 + test/functional/wallet_keypool_topup.py | 74 + test/functional/wallet_listreceivedby.py | 124 + test/functional/wallet_listsinceblock.py | 278 + .../wallet_resendwallettransactions.py | 29 + test/functional/wallet_txn_clone.py | 159 + test/functional/wallet_txn_doublespend.py | 147 + test/functional/wallet_zapwallettxes.py | 70 + test/functional/zerocoin_publicSpend_reorg.py | 208 + .../functional/zerocoin_valid_public_spend.py | 102 + test/functional/zerocoin_wrapped_serials.py | 108 + test/util/bitcoin-util-test.py | 180 + test/util/data/bitcoin-util-test.json | 148 + test/util/data/blanktxv1.hex | 1 + test/util/data/blanktxv1.json | 11 + test/util/data/tt-delin1-out.hex | 1 + test/util/data/tt-delin1-out.json | 217 + test/util/data/tt-delout1-out.hex | 1 + test/util/data/tt-delout1-out.json | 213 + test/util/data/tt-locktime317000-out.hex | 1 + test/util/data/tt-locktime317000-out.json | 226 + test/util/data/tx394b54bb.hex | 1 + test/util/data/txcreate1.hex | 1 + test/util/data/txcreate1.json | 64 + test/util/data/txcreate2.hex | 1 + test/util/data/txcreate2.json | 20 + test/util/data/txcreatescript1.hex | 1 + test/util/data/txcreatescript1.json | 20 + test/util/data/txcreatesign.hex | 1 + test/util/data/txcreatesign.json | 36 + test/util/rpcauth-test.py | 48 + 1451 files changed, 398016 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 CONTRIBUTING.md create mode 100644 COPYING create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 README.md create mode 100644 autogen.sh create mode 100644 build-aux/m4/ax_boost_base.m4 create mode 100644 build-aux/m4/ax_boost_chrono.m4 create mode 100644 build-aux/m4/ax_boost_filesystem.m4 create mode 100644 build-aux/m4/ax_boost_program_options.m4 create mode 100644 build-aux/m4/ax_boost_system.m4 create mode 100644 build-aux/m4/ax_boost_thread.m4 create mode 100644 build-aux/m4/ax_boost_unit_test_framework.m4 create mode 100644 build-aux/m4/ax_check_compile_flag.m4 create mode 100644 build-aux/m4/ax_check_link_flag.m4 create mode 100644 build-aux/m4/ax_check_preproc_flag.m4 create mode 100644 build-aux/m4/ax_cxx_compile_stdcxx.m4 create mode 100644 build-aux/m4/ax_gcc_func_attribute.m4 create mode 100644 build-aux/m4/ax_pthread.m4 create mode 100644 build-aux/m4/bitcoin_find_bdb48.m4 create mode 100644 build-aux/m4/bitcoin_qt.m4 create mode 100644 build-aux/m4/bitcoin_subdir_to_include.m4 create mode 100644 build-aux/m4/gmp.m4 create mode 100644 build-aux/m4/l_atomic.m4 create mode 100644 configure.ac create mode 100644 contrib/README.md create mode 100644 contrib/bitrpc/README.md create mode 100644 contrib/bitrpc/bitrpc.py create mode 100644 contrib/cmake/FindBerkeleyDB.cmake create mode 100644 contrib/cmake/FindGMP.cmake create mode 100644 contrib/cmake/FindLibEvent.cmake create mode 100644 contrib/cmake/FindQrcode.cmake create mode 100644 contrib/cmake/FindZMQ.cmake create mode 100644 contrib/debian/README.md create mode 100644 contrib/debian/changelog create mode 100644 contrib/debian/compat create mode 100644 contrib/debian/control create mode 100644 contrib/debian/copyright create mode 100644 contrib/debian/examples/versess.conf create mode 100644 contrib/debian/gbp.conf create mode 100644 contrib/debian/patches/README create mode 100644 contrib/debian/patches/series create mode 100644 contrib/debian/rules create mode 100644 contrib/debian/source/format create mode 100644 contrib/debian/versess-qt.desktop create mode 100644 contrib/debian/versess-qt.install create mode 100644 contrib/debian/versess-qt.lintian-overrides create mode 100644 contrib/debian/versess-qt.manpages create mode 100644 contrib/debian/versess-qt.protocol create mode 100644 contrib/debian/versessd.bash-completion create mode 100644 contrib/debian/versessd.examples create mode 100644 contrib/debian/versessd.install create mode 100644 contrib/debian/versessd.lintian-overrides create mode 100644 contrib/debian/versessd.manpages create mode 100644 contrib/debian/versessd.postinst create mode 100644 contrib/debian/versessd.postrm create mode 100644 contrib/debian/versessd.service create mode 100644 contrib/debian/watch create mode 100644 contrib/devtools/README.md create mode 100644 contrib/devtools/check-doc.py create mode 100644 contrib/devtools/circular-dependencies.py create mode 100644 contrib/devtools/clang-format-diff.py create mode 100644 contrib/devtools/commit-script-check.sh create mode 100644 contrib/devtools/copyright_header.py create mode 100644 contrib/devtools/gen-manpages.sh create mode 100644 contrib/devtools/git-subtree-check.sh create mode 100644 contrib/devtools/github-merge.py create mode 100644 contrib/devtools/lint-whitespace.sh create mode 100644 contrib/devtools/logprint-scanner.py create mode 100644 contrib/devtools/optimize-pngs.py create mode 100644 contrib/devtools/security-check.py create mode 100644 contrib/devtools/split-debug.sh.in create mode 100644 contrib/devtools/symbol-check.py create mode 100644 contrib/devtools/test-security-check.py create mode 100644 contrib/devtools/update-translations.py create mode 100644 contrib/filter-lcov.py create mode 100644 contrib/gitian-build.py create mode 100644 contrib/gitian-descriptors/gitian-linux.yml create mode 100644 contrib/gitian-descriptors/gitian-osx-signer.yml create mode 100644 contrib/gitian-descriptors/gitian-osx.yml create mode 100644 contrib/gitian-descriptors/gitian-win-signer.yml create mode 100644 contrib/gitian-descriptors/gitian-win.yml create mode 100644 contrib/gitian-keys/blondfrogs-key.gpg create mode 100644 contrib/gitian-keys/furszy-key.gpg create mode 100644 contrib/gitian-keys/fuzzbawls-key.gpg create mode 100644 contrib/gitian-keys/gpdionisio-key.gpg create mode 100644 contrib/gitian-keys/jonspock-key.gpg create mode 100644 contrib/gitian-keys/mrs-x-key.gpg create mode 100644 contrib/gitian-keys/presstab-key.gpg create mode 100644 contrib/gitian-keys/rejectedpromise-key.gpg create mode 100644 contrib/gitian-keys/s3v3nh4cks-key.gpg create mode 100644 contrib/gitian-keys/warrows-key.gpg create mode 100644 contrib/init/README.md create mode 100644 contrib/init/org.versess.versessd.plist create mode 100644 contrib/init/versessd.conf create mode 100644 contrib/init/versessd.init create mode 100644 contrib/init/versessd.openrc create mode 100644 contrib/init/versessd.openrcconf create mode 100644 contrib/init/versessd.service create mode 100644 contrib/install_db4.sh create mode 100644 contrib/linearize/README.md create mode 100644 contrib/linearize/example-linearize.cfg create mode 100644 contrib/linearize/linearize-data.py create mode 100644 contrib/linearize/linearize-hashes.py create mode 100644 contrib/macdeploy/LICENSE create mode 100644 contrib/macdeploy/README.md create mode 100644 contrib/macdeploy/background.svg create mode 100644 contrib/macdeploy/custom_dsstore.py create mode 100644 contrib/macdeploy/detached-sig-apply.sh create mode 100644 contrib/macdeploy/detached-sig-create.sh create mode 100644 contrib/macdeploy/extract-osx-sdk.sh create mode 100644 contrib/macdeploy/fancy.plist create mode 100644 contrib/macdeploy/macdeployqtplus create mode 100644 contrib/qos/README.md create mode 100644 contrib/qos/tc.sh create mode 100644 contrib/qt_translations.py create mode 100644 contrib/rpm/README.md create mode 100644 contrib/rpm/versess.fc create mode 100644 contrib/rpm/versess.if create mode 100644 contrib/rpm/versess.spec create mode 100644 contrib/rpm/versess.te create mode 100644 contrib/seeds/README.md create mode 100644 contrib/seeds/generate-seeds.py create mode 100644 contrib/seeds/makeseeds.py create mode 100644 contrib/spendfrom/README.md create mode 100644 contrib/spendfrom/setup.py create mode 100644 contrib/spendfrom/spendfrom.py create mode 100644 contrib/test-patches/README.md create mode 100644 contrib/testgen/README.md create mode 100644 contrib/testgen/base58.py create mode 100644 contrib/testgen/gen_base58_test_vectors.py create mode 100644 contrib/tidy_datadir.sh create mode 100644 contrib/valgrind.supp create mode 100644 contrib/verifysfbinaries/README.md create mode 100644 contrib/verifysfbinaries/verify.sh create mode 100644 contrib/versess-cli.bash-completion create mode 100644 contrib/versess-qt.pro create mode 100644 contrib/versess-tx.bash-completion create mode 100644 contrib/versessd.bash-completion create mode 100644 contrib/windeploy/detached-sig-create.sh create mode 100644 contrib/zmq/zmq_sub.py create mode 100644 depends/.gitignore create mode 100644 depends/Makefile create mode 100644 depends/README.md create mode 100644 depends/builders/darwin.mk create mode 100644 depends/builders/default.mk create mode 100644 depends/builders/linux.mk create mode 100644 depends/config.guess create mode 100644 depends/config.site.in create mode 100644 depends/config.sub create mode 100644 depends/description.md create mode 100644 depends/funcs.mk create mode 100644 depends/hosts/darwin.mk create mode 100644 depends/hosts/default.mk create mode 100644 depends/hosts/linux.mk create mode 100644 depends/hosts/mingw32.mk create mode 100644 depends/packages.md create mode 100644 depends/packages/bdb.mk create mode 100644 depends/packages/boost.mk create mode 100644 depends/packages/dbus.mk create mode 100644 depends/packages/expat.mk create mode 100644 depends/packages/fontconfig.mk create mode 100644 depends/packages/freetype.mk create mode 100644 depends/packages/gmp.mk create mode 100644 depends/packages/libX11.mk create mode 100644 depends/packages/libXau.mk create mode 100644 depends/packages/libXext.mk create mode 100644 depends/packages/libevent.mk create mode 100644 depends/packages/libxcb.mk create mode 100644 depends/packages/miniupnpc.mk create mode 100644 depends/packages/native_biplist.mk create mode 100644 depends/packages/native_cctools.mk create mode 100644 depends/packages/native_cdrkit.mk create mode 100644 depends/packages/native_ds_store.mk create mode 100644 depends/packages/native_libdmg-hfsplus.mk create mode 100644 depends/packages/native_mac_alias.mk create mode 100644 depends/packages/native_protobuf.mk create mode 100644 depends/packages/openssl.mk create mode 100644 depends/packages/packages.mk create mode 100644 depends/packages/protobuf.mk create mode 100644 depends/packages/qrencode.mk create mode 100644 depends/packages/qt.mk create mode 100644 depends/packages/xcb_proto.mk create mode 100644 depends/packages/xextproto.mk create mode 100644 depends/packages/xproto.mk create mode 100644 depends/packages/xtrans.mk create mode 100644 depends/packages/zeromq.mk create mode 100644 depends/packages/zlib.mk create mode 100644 depends/patches/native_cdrkit/cdrkit-deterministic.patch create mode 100644 depends/patches/qt/fix_configure_mac.patch create mode 100644 depends/patches/qt/fix_no_printer.patch create mode 100644 depends/patches/qt/fix_qt_pkgconfig.patch create mode 100644 depends/patches/qt/fix_rcc_determinism.patch create mode 100644 depends/patches/qt/fix_riscv64_arch.patch create mode 100644 depends/patches/qt/fix_s390x_powerpc_mips_mipsel_architectures.patch create mode 100644 depends/patches/qt/mac-qmake.conf create mode 100644 depends/patches/qt/xkb-default.patch create mode 100644 depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch create mode 100644 depends/patches/zeromq/0002-disable-pthread_set_name_np.patch create mode 100644 doc/.gitignore create mode 100644 doc/Doxyfile.in create mode 100644 doc/README_windows.txt create mode 100644 doc/REST-interface.md create mode 100644 doc/assets-attribution.md create mode 100644 doc/bitcoin_logo_doxygen.png create mode 100644 doc/build-osx.md create mode 100644 doc/build-unix.md create mode 100644 doc/build-windows.md create mode 100644 doc/dependencies.md create mode 100644 doc/developer-notes.md create mode 100644 doc/dnsseed-policy.md create mode 100644 doc/files.md create mode 100644 doc/gitian-building.md create mode 100644 doc/gitian-building/create_vm_file_location_size.png create mode 100644 doc/gitian-building/create_vm_hard_drive.png create mode 100644 doc/gitian-building/create_vm_hard_drive_file_type.png create mode 100644 doc/gitian-building/create_vm_memsize.png create mode 100644 doc/gitian-building/create_vm_page1.png create mode 100644 doc/gitian-building/create_vm_storage_physical_hard_drive.png create mode 100644 doc/gitian-building/debian_install_10_configure_clock.png create mode 100644 doc/gitian-building/debian_install_11_partition_disks.png create mode 100644 doc/gitian-building/debian_install_12_choose_disk.png create mode 100644 doc/gitian-building/debian_install_13_partition_scheme.png create mode 100644 doc/gitian-building/debian_install_14_finish.png create mode 100644 doc/gitian-building/debian_install_15_write_changes.png create mode 100644 doc/gitian-building/debian_install_16_choose_a_mirror.png create mode 100644 doc/gitian-building/debian_install_17_choose_a_mirror2.png create mode 100644 doc/gitian-building/debian_install_18_proxy_settings.png create mode 100644 doc/gitian-building/debian_install_19_software_selection.png create mode 100644 doc/gitian-building/debian_install_1_boot_menu.png create mode 100644 doc/gitian-building/debian_install_20_install_grub.png create mode 100644 doc/gitian-building/debian_install_21_finish_installation.png create mode 100644 doc/gitian-building/debian_install_2_select_a_language.png create mode 100644 doc/gitian-building/debian_install_3_select_location.png create mode 100644 doc/gitian-building/debian_install_4_configure_keyboard.png create mode 100644 doc/gitian-building/debian_install_5_configure_the_network.png create mode 100644 doc/gitian-building/debian_install_6_domain_name.png create mode 100644 doc/gitian-building/debian_install_6a_set_up_root_password.png create mode 100644 doc/gitian-building/debian_install_7_set_up_user_fullname.png create mode 100644 doc/gitian-building/debian_install_8_set_up_username.png create mode 100644 doc/gitian-building/debian_install_9_user_password.png create mode 100644 doc/gitian-building/network_settings.png create mode 100644 doc/gitian-building/port_forwarding_rules.png create mode 100644 doc/gitian-building/select_startup_disk.png create mode 100644 doc/img/bootstrap1.png create mode 100644 doc/img/bootstrap2.png create mode 100644 doc/img/bootstrap4.png create mode 100644 doc/img/bootstrap5.png create mode 100644 doc/init.md create mode 100644 doc/man/Makefile.am create mode 100644 doc/man/versess-cli.1 create mode 100644 doc/man/versess-qt.1 create mode 100644 doc/man/versess-tx.1 create mode 100644 doc/man/versessd.1 create mode 100644 doc/release-notes.md create mode 100644 doc/release-process.md create mode 100644 doc/tor.md create mode 100644 doc/translation_process.md create mode 100644 doc/translation_strings_policy.md create mode 100644 doc/travis-ci.txt create mode 100644 doc/zmq.md create mode 100644 libbitcoinconsensus.pc.in create mode 100644 share/certs/BitcoinFoundation_Apple_Cert.pem create mode 100644 share/certs/BitcoinFoundation_Comodo_Cert.pem create mode 100644 share/certs/PrivateKeyNotes.md create mode 100644 share/genbuild.sh create mode 100644 share/pixmaps/addressbook16.bmp create mode 100644 share/pixmaps/addressbook16mask.bmp create mode 100644 share/pixmaps/addressbook20.bmp create mode 100644 share/pixmaps/addressbook20mask.bmp create mode 100644 share/pixmaps/check.ico create mode 100644 share/pixmaps/favicon.ico create mode 100644 share/pixmaps/nsis-header.bmp create mode 100644 share/pixmaps/nsis-wizard.bmp create mode 100644 share/pixmaps/send16.bmp create mode 100644 share/pixmaps/send16mask.bmp create mode 100644 share/pixmaps/send16masknoshadow.bmp create mode 100644 share/pixmaps/send20.bmp create mode 100644 share/pixmaps/send20mask.bmp create mode 100644 share/pixmaps/versess-bc.ico create mode 100644 share/pixmaps/versess.ico create mode 100644 share/pixmaps/versess128.png create mode 100644 share/pixmaps/versess128.xpm create mode 100644 share/pixmaps/versess16.png create mode 100644 share/pixmaps/versess16.xpm create mode 100644 share/pixmaps/versess256.png create mode 100644 share/pixmaps/versess256.xpm create mode 100644 share/pixmaps/versess32.png create mode 100644 share/pixmaps/versess32.xpm create mode 100644 share/pixmaps/versess64.png create mode 100644 share/pixmaps/versess64.xpm create mode 100644 share/qt/Info.plist.in create mode 100644 share/qt/extract_strings_qt.py create mode 100644 share/qt/img/reload.png create mode 100644 share/qt/img/reload.xcf create mode 100644 share/qt/make_spinner.py create mode 100644 share/qt/make_windows_icon.sh create mode 100644 share/qt/protobuf.pri create mode 100644 share/rpcauth/README.md create mode 100644 share/rpcauth/rpcauth.py create mode 100644 share/setup.nsi.in create mode 100644 share/ui.rc create mode 100644 src/.clang-format create mode 100644 src/Makefile.am create mode 100644 src/Makefile.leveldb.include create mode 100644 src/Makefile.qt.include create mode 100644 src/Makefile.qttest.include create mode 100644 src/Makefile.test.include create mode 100644 src/activemasternode.cpp create mode 100644 src/activemasternode.h create mode 100644 src/addrman.cpp create mode 100644 src/addrman.h create mode 100644 src/alert.cpp create mode 100644 src/alert.h create mode 100644 src/allocators.cpp create mode 100644 src/allocators.h create mode 100644 src/amount.cpp create mode 100644 src/amount.h create mode 100644 src/base58.cpp create mode 100644 src/base58.h create mode 100644 src/bip38.cpp create mode 100644 src/bip38.h create mode 100644 src/blocksignature.cpp create mode 100644 src/blocksignature.h create mode 100644 src/bloom.cpp create mode 100644 src/bloom.h create mode 100644 src/chain.cpp create mode 100644 src/chain.h create mode 100644 src/chainparams.cpp create mode 100644 src/chainparams.h create mode 100644 src/chainparamsbase.cpp create mode 100644 src/chainparamsbase.h create mode 100644 src/chainparamsseeds.h create mode 100644 src/checkpoints.cpp create mode 100644 src/checkpoints.h create mode 100644 src/checkqueue.h create mode 100644 src/clientversion.cpp create mode 100644 src/clientversion.h create mode 100644 src/coincontrol.h create mode 100644 src/coins.cpp create mode 100644 src/coins.h create mode 100644 src/compat.h create mode 100644 src/compat/byteswap.h create mode 100644 src/compat/endian.h create mode 100644 src/compat/glibc_compat.cpp create mode 100644 src/compat/glibc_sanity.cpp create mode 100644 src/compat/glibcxx_sanity.cpp create mode 100644 src/compat/sanity.h create mode 100644 src/compat/strnlen.cpp create mode 100644 src/compressor.cpp create mode 100644 src/compressor.h create mode 100644 src/concurrentqueue.h create mode 100644 src/config/.empty create mode 100644 src/core_io.h create mode 100644 src/core_read.cpp create mode 100644 src/core_write.cpp create mode 100644 src/crypter.cpp create mode 100644 src/crypter.h create mode 100644 src/crypto/aes_helper.c create mode 100644 src/crypto/blake.c create mode 100644 src/crypto/bmw.c create mode 100644 src/crypto/common.h create mode 100644 src/crypto/cubehash.c create mode 100644 src/crypto/echo.c create mode 100644 src/crypto/groestl.c create mode 100644 src/crypto/hmac_sha256.cpp create mode 100644 src/crypto/hmac_sha256.h create mode 100644 src/crypto/hmac_sha512.cpp create mode 100644 src/crypto/hmac_sha512.h create mode 100644 src/crypto/jh.c create mode 100644 src/crypto/keccak.c create mode 100644 src/crypto/luffa.c create mode 100644 src/crypto/rfc6979_hmac_sha256.cpp create mode 100644 src/crypto/rfc6979_hmac_sha256.h create mode 100644 src/crypto/ripemd160.cpp create mode 100644 src/crypto/ripemd160.h create mode 100644 src/crypto/scrypt.cpp create mode 100644 src/crypto/scrypt.h create mode 100644 src/crypto/sha1.cpp create mode 100644 src/crypto/sha1.h create mode 100644 src/crypto/sha256.cpp create mode 100644 src/crypto/sha256.h create mode 100644 src/crypto/sha512.cpp create mode 100644 src/crypto/sha512.h create mode 100644 src/crypto/shavite.c create mode 100644 src/crypto/simd.c create mode 100644 src/crypto/skein.c create mode 100644 src/crypto/sph_blake.h create mode 100644 src/crypto/sph_bmw.h create mode 100644 src/crypto/sph_cubehash.h create mode 100644 src/crypto/sph_echo.h create mode 100644 src/crypto/sph_groestl.h create mode 100644 src/crypto/sph_jh.h create mode 100644 src/crypto/sph_keccak.h create mode 100644 src/crypto/sph_luffa.h create mode 100644 src/crypto/sph_shavite.h create mode 100644 src/crypto/sph_simd.h create mode 100644 src/crypto/sph_skein.h create mode 100644 src/crypto/sph_types.h create mode 100644 src/denomination_functions.cpp create mode 100644 src/denomination_functions.h create mode 100644 src/genwit.cpp create mode 100644 src/genwit.h create mode 100644 src/guiinterface.h create mode 100644 src/hash.cpp create mode 100644 src/hash.h create mode 100644 src/httprpc.cpp create mode 100644 src/httprpc.h create mode 100644 src/httpserver.cpp create mode 100644 src/httpserver.h create mode 100644 src/init.cpp create mode 100644 src/init.h create mode 100644 src/invalid.cpp create mode 100644 src/invalid.h create mode 100644 src/invalid_outpoints.json.h create mode 100644 src/invalid_serials.json.h create mode 100644 src/kernel.cpp create mode 100644 src/kernel.h create mode 100644 src/key.cpp create mode 100644 src/key.h create mode 100644 src/keystore.cpp create mode 100644 src/keystore.h create mode 100644 src/leveldb/.gitignore create mode 100644 src/leveldb/.travis.yml create mode 100644 src/leveldb/AUTHORS create mode 100644 src/leveldb/CONTRIBUTING.md create mode 100644 src/leveldb/LICENSE create mode 100644 src/leveldb/Makefile create mode 100644 src/leveldb/NEWS create mode 100644 src/leveldb/README.md create mode 100644 src/leveldb/TODO create mode 100644 src/leveldb/WINDOWS.md create mode 100644 src/leveldb/build_detect_platform create mode 100644 src/leveldb/db/autocompact_test.cc create mode 100644 src/leveldb/db/builder.cc create mode 100644 src/leveldb/db/builder.h create mode 100644 src/leveldb/db/c.cc create mode 100644 src/leveldb/db/c_test.c create mode 100644 src/leveldb/db/corruption_test.cc create mode 100644 src/leveldb/db/db_bench.cc create mode 100644 src/leveldb/db/db_impl.cc create mode 100644 src/leveldb/db/db_impl.h create mode 100644 src/leveldb/db/db_iter.cc create mode 100644 src/leveldb/db/db_iter.h create mode 100644 src/leveldb/db/db_test.cc create mode 100644 src/leveldb/db/dbformat.cc create mode 100644 src/leveldb/db/dbformat.h create mode 100644 src/leveldb/db/dbformat_test.cc create mode 100644 src/leveldb/db/dumpfile.cc create mode 100644 src/leveldb/db/fault_injection_test.cc create mode 100644 src/leveldb/db/filename.cc create mode 100644 src/leveldb/db/filename.h create mode 100644 src/leveldb/db/filename_test.cc create mode 100644 src/leveldb/db/leveldbutil.cc create mode 100644 src/leveldb/db/log_format.h create mode 100644 src/leveldb/db/log_reader.cc create mode 100644 src/leveldb/db/log_reader.h create mode 100644 src/leveldb/db/log_test.cc create mode 100644 src/leveldb/db/log_writer.cc create mode 100644 src/leveldb/db/log_writer.h create mode 100644 src/leveldb/db/memtable.cc create mode 100644 src/leveldb/db/memtable.h create mode 100644 src/leveldb/db/recovery_test.cc create mode 100644 src/leveldb/db/repair.cc create mode 100644 src/leveldb/db/skiplist.h create mode 100644 src/leveldb/db/skiplist_test.cc create mode 100644 src/leveldb/db/snapshot.h create mode 100644 src/leveldb/db/table_cache.cc create mode 100644 src/leveldb/db/table_cache.h create mode 100644 src/leveldb/db/version_edit.cc create mode 100644 src/leveldb/db/version_edit.h create mode 100644 src/leveldb/db/version_edit_test.cc create mode 100644 src/leveldb/db/version_set.cc create mode 100644 src/leveldb/db/version_set.h create mode 100644 src/leveldb/db/version_set_test.cc create mode 100644 src/leveldb/db/write_batch.cc create mode 100644 src/leveldb/db/write_batch_internal.h create mode 100644 src/leveldb/db/write_batch_test.cc create mode 100644 src/leveldb/doc/bench/db_bench_sqlite3.cc create mode 100644 src/leveldb/doc/bench/db_bench_tree_db.cc create mode 100644 src/leveldb/doc/benchmark.html create mode 100644 src/leveldb/doc/impl.md create mode 100644 src/leveldb/doc/index.md create mode 100644 src/leveldb/doc/log_format.md create mode 100644 src/leveldb/doc/table_format.md create mode 100644 src/leveldb/helpers/memenv/memenv.cc create mode 100644 src/leveldb/helpers/memenv/memenv.h create mode 100644 src/leveldb/helpers/memenv/memenv_test.cc create mode 100644 src/leveldb/include/leveldb/c.h create mode 100644 src/leveldb/include/leveldb/cache.h create mode 100644 src/leveldb/include/leveldb/comparator.h create mode 100644 src/leveldb/include/leveldb/db.h create mode 100644 src/leveldb/include/leveldb/dumpfile.h create mode 100644 src/leveldb/include/leveldb/env.h create mode 100644 src/leveldb/include/leveldb/filter_policy.h create mode 100644 src/leveldb/include/leveldb/iterator.h create mode 100644 src/leveldb/include/leveldb/options.h create mode 100644 src/leveldb/include/leveldb/slice.h create mode 100644 src/leveldb/include/leveldb/status.h create mode 100644 src/leveldb/include/leveldb/table.h create mode 100644 src/leveldb/include/leveldb/table_builder.h create mode 100644 src/leveldb/include/leveldb/write_batch.h create mode 100644 src/leveldb/issues/issue178_test.cc create mode 100644 src/leveldb/issues/issue200_test.cc create mode 100644 src/leveldb/port/README create mode 100644 src/leveldb/port/atomic_pointer.h create mode 100644 src/leveldb/port/port.h create mode 100644 src/leveldb/port/port_example.h create mode 100644 src/leveldb/port/port_posix.cc create mode 100644 src/leveldb/port/port_posix.h create mode 100644 src/leveldb/port/port_posix_sse.cc create mode 100644 src/leveldb/port/port_win.cc create mode 100644 src/leveldb/port/port_win.h create mode 100644 src/leveldb/port/thread_annotations.h create mode 100644 src/leveldb/port/win/stdint.h create mode 100644 src/leveldb/table/block.cc create mode 100644 src/leveldb/table/block.h create mode 100644 src/leveldb/table/block_builder.cc create mode 100644 src/leveldb/table/block_builder.h create mode 100644 src/leveldb/table/filter_block.cc create mode 100644 src/leveldb/table/filter_block.h create mode 100644 src/leveldb/table/filter_block_test.cc create mode 100644 src/leveldb/table/format.cc create mode 100644 src/leveldb/table/format.h create mode 100644 src/leveldb/table/iterator.cc create mode 100644 src/leveldb/table/iterator_wrapper.h create mode 100644 src/leveldb/table/merger.cc create mode 100644 src/leveldb/table/merger.h create mode 100644 src/leveldb/table/table.cc create mode 100644 src/leveldb/table/table_builder.cc create mode 100644 src/leveldb/table/table_test.cc create mode 100644 src/leveldb/table/two_level_iterator.cc create mode 100644 src/leveldb/table/two_level_iterator.h create mode 100644 src/leveldb/util/arena.cc create mode 100644 src/leveldb/util/arena.h create mode 100644 src/leveldb/util/arena_test.cc create mode 100644 src/leveldb/util/bloom.cc create mode 100644 src/leveldb/util/bloom_test.cc create mode 100644 src/leveldb/util/cache.cc create mode 100644 src/leveldb/util/cache_test.cc create mode 100644 src/leveldb/util/coding.cc create mode 100644 src/leveldb/util/coding.h create mode 100644 src/leveldb/util/coding_test.cc create mode 100644 src/leveldb/util/comparator.cc create mode 100644 src/leveldb/util/crc32c.cc create mode 100644 src/leveldb/util/crc32c.h create mode 100644 src/leveldb/util/crc32c_test.cc create mode 100644 src/leveldb/util/env.cc create mode 100644 src/leveldb/util/env_posix.cc create mode 100644 src/leveldb/util/env_posix_test.cc create mode 100644 src/leveldb/util/env_posix_test_helper.h create mode 100644 src/leveldb/util/env_test.cc create mode 100644 src/leveldb/util/env_win.cc create mode 100644 src/leveldb/util/filter_policy.cc create mode 100644 src/leveldb/util/hash.cc create mode 100644 src/leveldb/util/hash.h create mode 100644 src/leveldb/util/hash_test.cc create mode 100644 src/leveldb/util/histogram.cc create mode 100644 src/leveldb/util/histogram.h create mode 100644 src/leveldb/util/logging.cc create mode 100644 src/leveldb/util/logging.h create mode 100644 src/leveldb/util/mutexlock.h create mode 100644 src/leveldb/util/options.cc create mode 100644 src/leveldb/util/posix_logger.h create mode 100644 src/leveldb/util/random.h create mode 100644 src/leveldb/util/status.cc create mode 100644 src/leveldb/util/testharness.cc create mode 100644 src/leveldb/util/testharness.h create mode 100644 src/leveldb/util/testutil.cc create mode 100644 src/leveldb/util/testutil.h create mode 100644 src/leveldbwrapper.cpp create mode 100644 src/leveldbwrapper.h create mode 100644 src/libzerocoin/Accumulator.cpp create mode 100644 src/libzerocoin/Accumulator.h create mode 100644 src/libzerocoin/AccumulatorProofOfKnowledge.cpp create mode 100644 src/libzerocoin/AccumulatorProofOfKnowledge.h create mode 100644 src/libzerocoin/Coin.cpp create mode 100644 src/libzerocoin/Coin.h create mode 100644 src/libzerocoin/CoinSpend.cpp create mode 100644 src/libzerocoin/CoinSpend.h create mode 100644 src/libzerocoin/Commitment.cpp create mode 100644 src/libzerocoin/Commitment.h create mode 100644 src/libzerocoin/Denominations.cpp create mode 100644 src/libzerocoin/Denominations.h create mode 100644 src/libzerocoin/LICENSE create mode 100644 src/libzerocoin/ParamGeneration.cpp create mode 100644 src/libzerocoin/ParamGeneration.h create mode 100644 src/libzerocoin/Params.cpp create mode 100644 src/libzerocoin/Params.h create mode 100644 src/libzerocoin/SerialNumberSignatureOfKnowledge.cpp create mode 100644 src/libzerocoin/SerialNumberSignatureOfKnowledge.h create mode 100644 src/libzerocoin/SpendType.h create mode 100644 src/libzerocoin/ZerocoinDefines.h create mode 100644 src/libzerocoin/bignum.cpp create mode 100644 src/libzerocoin/bignum.h create mode 100644 src/libzerocoin/bignum_gmp.cpp create mode 100644 src/libzerocoin/bignum_openssl.cpp create mode 100644 src/libzerocoin/documentation/Doxyfile create mode 100644 src/libzerocoin/documentation/manual/intro.tex create mode 100644 src/libzerocoin/documentation/manual/manual.pdf create mode 100644 src/libzerocoin/documentation/manual/manual.tex create mode 100644 src/libzerocoin/documentation/manual/using.tex create mode 100644 src/libzerocoin/paramgen.cpp create mode 100644 src/libzerocoin/zerocoin.pc.in create mode 100644 src/lightzversthread.cpp create mode 100644 src/lightzversthread.h create mode 100644 src/limitedmap.h create mode 100644 src/main.cpp create mode 100644 src/main.h create mode 100644 src/masternode-budget.cpp create mode 100644 src/masternode-budget.h create mode 100644 src/masternode-payments.cpp create mode 100644 src/masternode-payments.h create mode 100644 src/masternode-sync.cpp create mode 100644 src/masternode-sync.h create mode 100644 src/masternode.cpp create mode 100644 src/masternode.h create mode 100644 src/masternodeconfig.cpp create mode 100644 src/masternodeconfig.h create mode 100644 src/masternodeman.cpp create mode 100644 src/masternodeman.h create mode 100644 src/merkleblock.cpp create mode 100644 src/merkleblock.h create mode 100644 src/miner.cpp create mode 100644 src/miner.h create mode 100644 src/mruset.h create mode 100644 src/net.cpp create mode 100644 src/net.h create mode 100644 src/netbase.cpp create mode 100644 src/netbase.h create mode 100644 src/noui.cpp create mode 100644 src/noui.h create mode 100644 src/obfuscation-relay.cpp create mode 100644 src/obfuscation-relay.h create mode 100644 src/obfuscation.cpp create mode 100644 src/obfuscation.h create mode 100644 src/obj-test/.gitignore create mode 100644 src/obj/.gitignore create mode 100644 src/pow.cpp create mode 100644 src/pow.h create mode 100644 src/primitives/block.cpp create mode 100644 src/primitives/block.h create mode 100644 src/primitives/transaction.cpp create mode 100644 src/primitives/transaction.h create mode 100644 src/protocol.cpp create mode 100644 src/protocol.h create mode 100644 src/pubkey.cpp create mode 100644 src/pubkey.h create mode 100644 src/qt/CMakeLists.txt create mode 100644 src/qt/addressbookpage.cpp create mode 100644 src/qt/addressbookpage.h create mode 100644 src/qt/addresstablemodel.cpp create mode 100644 src/qt/addresstablemodel.h create mode 100644 src/qt/askpassphrasedialog.cpp create mode 100644 src/qt/askpassphrasedialog.h create mode 100644 src/qt/bantablemodel.cpp create mode 100644 src/qt/bantablemodel.h create mode 100644 src/qt/bip38tooldialog.cpp create mode 100644 src/qt/bip38tooldialog.h create mode 100644 src/qt/bitcoinaddressvalidator.cpp create mode 100644 src/qt/bitcoinaddressvalidator.h create mode 100644 src/qt/bitcoinamountfield.cpp create mode 100644 src/qt/bitcoinamountfield.h create mode 100644 src/qt/bitcoingui.cpp create mode 100644 src/qt/bitcoingui.h create mode 100644 src/qt/bitcoinunits.cpp create mode 100644 src/qt/bitcoinunits.h create mode 100644 src/qt/blockexplorer.cpp create mode 100644 src/qt/blockexplorer.h create mode 100644 src/qt/clientmodel.cpp create mode 100644 src/qt/clientmodel.h create mode 100644 src/qt/coincontroldialog.cpp create mode 100644 src/qt/coincontroldialog.h create mode 100644 src/qt/coincontroltreewidget.cpp create mode 100644 src/qt/coincontroltreewidget.h create mode 100644 src/qt/csvmodelwriter.cpp create mode 100644 src/qt/csvmodelwriter.h create mode 100644 src/qt/editaddressdialog.cpp create mode 100644 src/qt/editaddressdialog.h create mode 100644 src/qt/forms/addressbookpage.ui create mode 100644 src/qt/forms/askpassphrasedialog.ui create mode 100644 src/qt/forms/bip38tooldialog.ui create mode 100644 src/qt/forms/blockexplorer.ui create mode 100644 src/qt/forms/coincontroldialog.ui create mode 100644 src/qt/forms/editaddressdialog.ui create mode 100644 src/qt/forms/governancepage.ui create mode 100644 src/qt/forms/helpmessagedialog.ui create mode 100644 src/qt/forms/intro.ui create mode 100644 src/qt/forms/masternodelist.ui create mode 100644 src/qt/forms/multisenddialog.ui create mode 100644 src/qt/forms/multisigdialog.ui create mode 100644 src/qt/forms/obfuscationconfig.ui create mode 100644 src/qt/forms/openuridialog.ui create mode 100644 src/qt/forms/optionsdialog.ui create mode 100644 src/qt/forms/overviewpage.ui create mode 100644 src/qt/forms/privacydialog.ui create mode 100644 src/qt/forms/receivecoinsdialog.ui create mode 100644 src/qt/forms/receiverequestdialog.ui create mode 100644 src/qt/forms/rpcconsole.ui create mode 100644 src/qt/forms/sendcoinsdialog.ui create mode 100644 src/qt/forms/sendcoinsentry.ui create mode 100644 src/qt/forms/signverifymessagedialog.ui create mode 100644 src/qt/forms/transactiondescdialog.ui create mode 100644 src/qt/forms/zverscontroldialog.ui create mode 100644 src/qt/governancepage.cpp create mode 100644 src/qt/governancepage.h create mode 100644 src/qt/guiconstants.h create mode 100644 src/qt/guiutil.cpp create mode 100644 src/qt/guiutil.h create mode 100644 src/qt/intro.cpp create mode 100644 src/qt/intro.h create mode 100644 src/qt/locale/versess_bg.ts create mode 100644 src/qt/locale/versess_ca.ts create mode 100644 src/qt/locale/versess_cs.ts create mode 100644 src/qt/locale/versess_da.ts create mode 100644 src/qt/locale/versess_de.ts create mode 100644 src/qt/locale/versess_en.ts create mode 100644 src/qt/locale/versess_en_GB.ts create mode 100644 src/qt/locale/versess_en_US.ts create mode 100644 src/qt/locale/versess_eo.ts create mode 100644 src/qt/locale/versess_es.ts create mode 100644 src/qt/locale/versess_es_ES.ts create mode 100644 src/qt/locale/versess_fi.ts create mode 100644 src/qt/locale/versess_fr_FR.ts create mode 100644 src/qt/locale/versess_hi_IN.ts create mode 100644 src/qt/locale/versess_hr.ts create mode 100644 src/qt/locale/versess_hr_HR.ts create mode 100644 src/qt/locale/versess_it.ts create mode 100644 src/qt/locale/versess_ja.ts create mode 100644 src/qt/locale/versess_ko_KR.ts create mode 100644 src/qt/locale/versess_lt_LT.ts create mode 100644 src/qt/locale/versess_nl.ts create mode 100644 src/qt/locale/versess_pl.ts create mode 100644 src/qt/locale/versess_pt.ts create mode 100644 src/qt/locale/versess_pt_BR.ts create mode 100644 src/qt/locale/versess_ro_RO.ts create mode 100644 src/qt/locale/versess_ru.ts create mode 100644 src/qt/locale/versess_sk.ts create mode 100644 src/qt/locale/versess_sv.ts create mode 100644 src/qt/locale/versess_tr.ts create mode 100644 src/qt/locale/versess_uk.ts create mode 100644 src/qt/locale/versess_vi.ts create mode 100644 src/qt/locale/versess_zh_CN.ts create mode 100644 src/qt/locale/versess_zh_TW.ts create mode 100644 src/qt/macdockiconhandler.h create mode 100644 src/qt/macdockiconhandler.mm create mode 100644 src/qt/macnotificationhandler.h create mode 100644 src/qt/macnotificationhandler.mm create mode 100644 src/qt/masternodelist.cpp create mode 100644 src/qt/masternodelist.h create mode 100644 src/qt/multisenddialog.cpp create mode 100644 src/qt/multisenddialog.h create mode 100644 src/qt/multisigdialog.cpp create mode 100644 src/qt/multisigdialog.h create mode 100644 src/qt/networkstyle.cpp create mode 100644 src/qt/networkstyle.h create mode 100644 src/qt/notificator.cpp create mode 100644 src/qt/notificator.h create mode 100644 src/qt/openuridialog.cpp create mode 100644 src/qt/openuridialog.h create mode 100644 src/qt/optionsdialog.cpp create mode 100644 src/qt/optionsdialog.h create mode 100644 src/qt/optionsmodel.cpp create mode 100644 src/qt/optionsmodel.h create mode 100644 src/qt/overviewpage.cpp create mode 100644 src/qt/overviewpage.h create mode 100644 src/qt/paymentrequest.proto create mode 100644 src/qt/paymentrequestplus.cpp create mode 100644 src/qt/paymentrequestplus.h create mode 100644 src/qt/paymentserver.cpp create mode 100644 src/qt/paymentserver.h create mode 100644 src/qt/peertablemodel.cpp create mode 100644 src/qt/peertablemodel.h create mode 100644 src/qt/platformstyle.cpp create mode 100644 src/qt/platformstyle.h create mode 100644 src/qt/privacydialog.cpp create mode 100644 src/qt/privacydialog.h create mode 100644 src/qt/proposalframe.cpp create mode 100644 src/qt/proposalframe.h create mode 100644 src/qt/qvalidatedlineedit.cpp create mode 100644 src/qt/qvalidatedlineedit.h create mode 100644 src/qt/qvaluecombobox.cpp create mode 100644 src/qt/qvaluecombobox.h create mode 100644 src/qt/receivecoinsdialog.cpp create mode 100644 src/qt/receivecoinsdialog.h create mode 100644 src/qt/receiverequestdialog.cpp create mode 100644 src/qt/receiverequestdialog.h create mode 100644 src/qt/recentrequeststablemodel.cpp create mode 100644 src/qt/recentrequeststablemodel.h create mode 100644 src/qt/res/css/default.css create mode 100644 src/qt/res/icons/abstainvote.png create mode 100644 src/qt/res/icons/add.png create mode 100644 src/qt/res/icons/address-book.png create mode 100644 src/qt/res/icons/automint_active.png create mode 100644 src/qt/res/icons/automint_inactive.png create mode 100644 src/qt/res/icons/bitcoin.icns create mode 100644 src/qt/res/icons/bitcoin.ico create mode 100644 src/qt/res/icons/bitcoin.png create mode 100644 src/qt/res/icons/bitcoin_regtest.png create mode 100644 src/qt/res/icons/bitcoin_testnet.ico create mode 100644 src/qt/res/icons/bitcoin_testnet.png create mode 100644 src/qt/res/icons/bittrex.png create mode 100644 src/qt/res/icons/browse.png create mode 100644 src/qt/res/icons/clock1.png create mode 100644 src/qt/res/icons/clock2.png create mode 100644 src/qt/res/icons/clock3.png create mode 100644 src/qt/res/icons/clock4.png create mode 100644 src/qt/res/icons/clock5.png create mode 100644 src/qt/res/icons/configure.png create mode 100644 src/qt/res/icons/connect0_16.png create mode 100644 src/qt/res/icons/connect1_16.png create mode 100644 src/qt/res/icons/connect2_16.png create mode 100644 src/qt/res/icons/connect3_16.png create mode 100644 src/qt/res/icons/connect4_16.png create mode 100644 src/qt/res/icons/debugwindow.png create mode 100644 src/qt/res/icons/edit.png create mode 100644 src/qt/res/icons/editcopy.png create mode 100644 src/qt/res/icons/editpaste.png create mode 100644 src/qt/res/icons/explorer.png create mode 100644 src/qt/res/icons/export.png create mode 100644 src/qt/res/icons/eye.png create mode 100644 src/qt/res/icons/eye_minus.png create mode 100644 src/qt/res/icons/eye_plus.png create mode 100644 src/qt/res/icons/filesave.png create mode 100644 src/qt/res/icons/history.png create mode 100644 src/qt/res/icons/import.png create mode 100644 src/qt/res/icons/info.png create mode 100644 src/qt/res/icons/key.png create mode 100644 src/qt/res/icons/lock_closed.png create mode 100644 src/qt/res/icons/lock_open.png create mode 100644 src/qt/res/icons/masternodes.png create mode 100644 src/qt/res/icons/notsynced.png create mode 100644 src/qt/res/icons/novote.png create mode 100644 src/qt/res/icons/onion.png create mode 100644 src/qt/res/icons/overview.png create mode 100644 src/qt/res/icons/privacy.png create mode 100644 src/qt/res/icons/qrcode.png create mode 100644 src/qt/res/icons/quit.png create mode 100644 src/qt/res/icons/receive.png create mode 100644 src/qt/res/icons/receive_dark.png create mode 100644 src/qt/res/icons/remove.png create mode 100644 src/qt/res/icons/send.png create mode 100644 src/qt/res/icons/send_dark.png create mode 100644 src/qt/res/icons/staking_active.png create mode 100644 src/qt/res/icons/staking_inactive.png create mode 100644 src/qt/res/icons/synced.png create mode 100644 src/qt/res/icons/trade.png create mode 100644 src/qt/res/icons/transaction0.png create mode 100644 src/qt/res/icons/transaction0_dark.png create mode 100644 src/qt/res/icons/transaction2.png create mode 100644 src/qt/res/icons/transaction_conflicted.png create mode 100644 src/qt/res/icons/tx_inout.png create mode 100644 src/qt/res/icons/tx_input.png create mode 100644 src/qt/res/icons/tx_mined.png create mode 100644 src/qt/res/icons/tx_output.png create mode 100644 src/qt/res/icons/unit_mversess.png create mode 100644 src/qt/res/icons/unit_tmversess.png create mode 100644 src/qt/res/icons/unit_tuversess.png create mode 100644 src/qt/res/icons/unit_tversess.png create mode 100644 src/qt/res/icons/unit_uversess.png create mode 100644 src/qt/res/icons/unit_versess.png create mode 100644 src/qt/res/icons/yesvote.png create mode 100644 src/qt/res/images/about.png create mode 100644 src/qt/res/images/downArrow.png create mode 100644 src/qt/res/images/downArrow_dark.png create mode 100644 src/qt/res/images/downArrow_small.png create mode 100644 src/qt/res/images/downArrow_small_dark.png create mode 100644 src/qt/res/images/leftArrow_small.png create mode 100644 src/qt/res/images/leftArrow_small_dark.png create mode 100644 src/qt/res/images/qtreeview_selected.png create mode 100644 src/qt/res/images/rightArrow_small.png create mode 100644 src/qt/res/images/rightArrow_small_dark.png create mode 100644 src/qt/res/images/splash.png create mode 100644 src/qt/res/images/splash_testnet.png create mode 100644 src/qt/res/images/upArrow_small.png create mode 100644 src/qt/res/images/upArrow_small_dark.png create mode 100644 src/qt/res/images/vers.png create mode 100644 src/qt/res/images/versess_logo_horizontal.png create mode 100644 src/qt/res/images/walletFrame.png create mode 100644 src/qt/res/images/walletFrame_bg.png create mode 100644 src/qt/res/movies/spinner-000.png create mode 100644 src/qt/res/movies/spinner-001.png create mode 100644 src/qt/res/movies/spinner-002.png create mode 100644 src/qt/res/movies/spinner-003.png create mode 100644 src/qt/res/movies/spinner-004.png create mode 100644 src/qt/res/movies/spinner-005.png create mode 100644 src/qt/res/movies/spinner-006.png create mode 100644 src/qt/res/movies/spinner-007.png create mode 100644 src/qt/res/movies/spinner-008.png create mode 100644 src/qt/res/movies/spinner-009.png create mode 100644 src/qt/res/movies/spinner-010.png create mode 100644 src/qt/res/movies/spinner-011.png create mode 100644 src/qt/res/movies/spinner-012.png create mode 100644 src/qt/res/movies/spinner-013.png create mode 100644 src/qt/res/movies/spinner-014.png create mode 100644 src/qt/res/movies/spinner-015.png create mode 100644 src/qt/res/movies/spinner-016.png create mode 100644 src/qt/res/movies/spinner-017.png create mode 100644 src/qt/res/movies/spinner-018.png create mode 100644 src/qt/res/movies/spinner-019.png create mode 100644 src/qt/res/movies/spinner-020.png create mode 100644 src/qt/res/movies/spinner-021.png create mode 100644 src/qt/res/movies/spinner-022.png create mode 100644 src/qt/res/movies/spinner-023.png create mode 100644 src/qt/res/movies/spinner-024.png create mode 100644 src/qt/res/movies/spinner-025.png create mode 100644 src/qt/res/movies/spinner-026.png create mode 100644 src/qt/res/movies/spinner-027.png create mode 100644 src/qt/res/movies/spinner-028.png create mode 100644 src/qt/res/movies/spinner-029.png create mode 100644 src/qt/res/movies/spinner-030.png create mode 100644 src/qt/res/movies/spinner-031.png create mode 100644 src/qt/res/movies/spinner-032.png create mode 100644 src/qt/res/movies/spinner-033.png create mode 100644 src/qt/res/movies/spinner-034.png create mode 100644 src/qt/res/src/bitcoin.svg create mode 100644 src/qt/res/src/clock1.svg create mode 100644 src/qt/res/src/clock2.svg create mode 100644 src/qt/res/src/clock3.svg create mode 100644 src/qt/res/src/clock4.svg create mode 100644 src/qt/res/src/clock5.svg create mode 100644 src/qt/res/src/clock_green.svg create mode 100644 src/qt/res/src/inout.svg create mode 100644 src/qt/res/src/questionmark.svg create mode 100644 src/qt/res/versess-qt-res.rc create mode 100644 src/qt/rpcconsole.cpp create mode 100644 src/qt/rpcconsole.h create mode 100644 src/qt/sendcoinsdialog.cpp create mode 100644 src/qt/sendcoinsdialog.h create mode 100644 src/qt/sendcoinsentry.cpp create mode 100644 src/qt/sendcoinsentry.h create mode 100644 src/qt/signverifymessagedialog.cpp create mode 100644 src/qt/signverifymessagedialog.h create mode 100644 src/qt/splashscreen.cpp create mode 100644 src/qt/splashscreen.h create mode 100644 src/qt/test/paymentrequestdata.h create mode 100644 src/qt/test/paymentservertests.cpp create mode 100644 src/qt/test/paymentservertests.h create mode 100644 src/qt/test/test_main.cpp create mode 100644 src/qt/test/uritests.cpp create mode 100644 src/qt/test/uritests.h create mode 100644 src/qt/trafficgraphwidget.cpp create mode 100644 src/qt/trafficgraphwidget.h create mode 100644 src/qt/transactiondesc.cpp create mode 100644 src/qt/transactiondesc.h create mode 100644 src/qt/transactiondescdialog.cpp create mode 100644 src/qt/transactiondescdialog.h create mode 100644 src/qt/transactionfilterproxy.cpp create mode 100644 src/qt/transactionfilterproxy.h create mode 100644 src/qt/transactionrecord.cpp create mode 100644 src/qt/transactionrecord.h create mode 100644 src/qt/transactiontablemodel.cpp create mode 100644 src/qt/transactiontablemodel.h create mode 100644 src/qt/transactionview.cpp create mode 100644 src/qt/transactionview.h create mode 100644 src/qt/utilitydialog.cpp create mode 100644 src/qt/utilitydialog.h create mode 100644 src/qt/versess.cpp create mode 100644 src/qt/versess.qrc create mode 100644 src/qt/versess_locale.qrc create mode 100644 src/qt/versessstrings.cpp create mode 100644 src/qt/walletframe.cpp create mode 100644 src/qt/walletframe.h create mode 100644 src/qt/walletmodel.cpp create mode 100644 src/qt/walletmodel.h create mode 100644 src/qt/walletmodeltransaction.cpp create mode 100644 src/qt/walletmodeltransaction.h create mode 100644 src/qt/walletview.cpp create mode 100644 src/qt/walletview.h create mode 100644 src/qt/winshutdownmonitor.cpp create mode 100644 src/qt/winshutdownmonitor.h create mode 100644 src/qt/zverscontroldialog.cpp create mode 100644 src/qt/zverscontroldialog.h create mode 100644 src/random.cpp create mode 100644 src/random.h create mode 100644 src/rest.cpp create mode 100644 src/reverse_iterate.h create mode 100644 src/reverselock.h create mode 100644 src/rpc/blockchain.cpp create mode 100644 src/rpc/budget.cpp create mode 100644 src/rpc/client.cpp create mode 100644 src/rpc/client.h create mode 100644 src/rpc/masternode.cpp create mode 100644 src/rpc/mining.cpp create mode 100644 src/rpc/misc.cpp create mode 100644 src/rpc/net.cpp create mode 100644 src/rpc/protocol.cpp create mode 100644 src/rpc/protocol.h create mode 100644 src/rpc/rawtransaction.cpp create mode 100644 src/rpc/server.cpp create mode 100644 src/rpc/server.h create mode 100644 src/scheduler.cpp create mode 100644 src/scheduler.h create mode 100644 src/script/bitcoinconsensus.cpp create mode 100644 src/script/bitcoinconsensus.h create mode 100644 src/script/interpreter.cpp create mode 100644 src/script/interpreter.h create mode 100644 src/script/script.cpp create mode 100644 src/script/script.h create mode 100644 src/script/script_error.cpp create mode 100644 src/script/script_error.h create mode 100644 src/script/sigcache.cpp create mode 100644 src/script/sigcache.h create mode 100644 src/script/sign.cpp create mode 100644 src/script/sign.h create mode 100644 src/script/standard.cpp create mode 100644 src/script/standard.h create mode 100644 src/secp256k1/.gitignore create mode 100644 src/secp256k1/.travis.yml create mode 100644 src/secp256k1/COPYING create mode 100644 src/secp256k1/Makefile.am create mode 100644 src/secp256k1/README.md create mode 100644 src/secp256k1/TODO create mode 100644 src/secp256k1/autogen.sh create mode 100644 src/secp256k1/build-aux/m4/ax_jni_include_dir.m4 create mode 100644 src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4 create mode 100644 src/secp256k1/build-aux/m4/bitcoin_secp.m4 create mode 100644 src/secp256k1/configure.ac create mode 100644 src/secp256k1/contrib/lax_der_parsing.c create mode 100644 src/secp256k1/contrib/lax_der_parsing.h create mode 100644 src/secp256k1/contrib/lax_der_privatekey_parsing.c create mode 100644 src/secp256k1/contrib/lax_der_privatekey_parsing.h create mode 100644 src/secp256k1/include/secp256k1.h create mode 100644 src/secp256k1/include/secp256k1_ecdh.h create mode 100644 src/secp256k1/include/secp256k1_recovery.h create mode 100644 src/secp256k1/libsecp256k1.pc.in create mode 100644 src/secp256k1/obj/.gitignore create mode 100644 src/secp256k1/sage/group_prover.sage create mode 100644 src/secp256k1/sage/secp256k1.sage create mode 100644 src/secp256k1/sage/weierstrass_prover.sage create mode 100644 src/secp256k1/src/asm/field_10x26_arm.s create mode 100644 src/secp256k1/src/basic-config.h create mode 100644 src/secp256k1/src/bench.h create mode 100644 src/secp256k1/src/bench_ecdh.c create mode 100644 src/secp256k1/src/bench_ecmult.c create mode 100644 src/secp256k1/src/bench_internal.c create mode 100644 src/secp256k1/src/bench_recover.c create mode 100644 src/secp256k1/src/bench_sign.c create mode 100644 src/secp256k1/src/bench_verify.c create mode 100644 src/secp256k1/src/ecdsa.h create mode 100644 src/secp256k1/src/ecdsa_impl.h create mode 100644 src/secp256k1/src/eckey.h create mode 100644 src/secp256k1/src/eckey_impl.h create mode 100644 src/secp256k1/src/ecmult.h create mode 100644 src/secp256k1/src/ecmult_const.h create mode 100644 src/secp256k1/src/ecmult_const_impl.h create mode 100644 src/secp256k1/src/ecmult_gen.h create mode 100644 src/secp256k1/src/ecmult_gen_impl.h create mode 100644 src/secp256k1/src/ecmult_impl.h create mode 100644 src/secp256k1/src/field.h create mode 100644 src/secp256k1/src/field_10x26.h create mode 100644 src/secp256k1/src/field_10x26_impl.h create mode 100644 src/secp256k1/src/field_5x52.h create mode 100644 src/secp256k1/src/field_5x52_asm_impl.h create mode 100644 src/secp256k1/src/field_5x52_impl.h create mode 100644 src/secp256k1/src/field_5x52_int128_impl.h create mode 100644 src/secp256k1/src/field_impl.h create mode 100644 src/secp256k1/src/gen_context.c create mode 100644 src/secp256k1/src/group.h create mode 100644 src/secp256k1/src/group_impl.h create mode 100644 src/secp256k1/src/hash.h create mode 100644 src/secp256k1/src/hash_impl.h create mode 100644 src/secp256k1/src/java/org/bitcoin/NativeSecp256k1.java create mode 100644 src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Test.java create mode 100644 src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Util.java create mode 100644 src/secp256k1/src/java/org/bitcoin/Secp256k1Context.java create mode 100644 src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c create mode 100644 src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h create mode 100644 src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c create mode 100644 src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h create mode 100644 src/secp256k1/src/modules/ecdh/Makefile.am.include create mode 100644 src/secp256k1/src/modules/ecdh/main_impl.h create mode 100644 src/secp256k1/src/modules/ecdh/tests_impl.h create mode 100644 src/secp256k1/src/modules/recovery/Makefile.am.include create mode 100644 src/secp256k1/src/modules/recovery/main_impl.h create mode 100644 src/secp256k1/src/modules/recovery/tests_impl.h create mode 100644 src/secp256k1/src/num.h create mode 100644 src/secp256k1/src/num_gmp.h create mode 100644 src/secp256k1/src/num_gmp_impl.h create mode 100644 src/secp256k1/src/num_impl.h create mode 100644 src/secp256k1/src/scalar.h create mode 100644 src/secp256k1/src/scalar_4x64.h create mode 100644 src/secp256k1/src/scalar_4x64_impl.h create mode 100644 src/secp256k1/src/scalar_8x32.h create mode 100644 src/secp256k1/src/scalar_8x32_impl.h create mode 100644 src/secp256k1/src/scalar_impl.h create mode 100644 src/secp256k1/src/scalar_low.h create mode 100644 src/secp256k1/src/scalar_low_impl.h create mode 100644 src/secp256k1/src/scratch.h create mode 100644 src/secp256k1/src/scratch_impl.h create mode 100644 src/secp256k1/src/secp256k1.c create mode 100644 src/secp256k1/src/testrand.h create mode 100644 src/secp256k1/src/testrand_impl.h create mode 100644 src/secp256k1/src/tests.c create mode 100644 src/secp256k1/src/tests_exhaustive.c create mode 100644 src/secp256k1/src/util.h create mode 100644 src/serialize.h create mode 100644 src/spork.cpp create mode 100644 src/spork.h create mode 100644 src/sporkdb.cpp create mode 100644 src/sporkdb.h create mode 100644 src/stakeinput.cpp create mode 100644 src/stakeinput.h create mode 100644 src/streams.h create mode 100644 src/support/cleanse.cpp create mode 100644 src/support/cleanse.h create mode 100644 src/swifttx.cpp create mode 100644 src/swifttx.h create mode 100644 src/sync.cpp create mode 100644 src/sync.h create mode 100644 src/test/Checkpoints_tests.cpp create mode 100644 src/test/DoS_tests.cpp create mode 100644 src/test/README.md create mode 100644 src/test/accounting_tests.cpp create mode 100644 src/test/addrman_tests.cpp create mode 100644 src/test/alert_tests.cpp create mode 100644 src/test/allocator_tests.cpp create mode 100644 src/test/arith_uint256_tests.cpp create mode 100644 src/test/base32_tests.cpp create mode 100644 src/test/base58_tests.cpp create mode 100644 src/test/base64_tests.cpp create mode 100644 src/test/benchmark_zerocoin.cpp create mode 100644 src/test/bip32_tests.cpp create mode 100644 src/test/bloom_tests.cpp create mode 100644 src/test/budget_tests.cpp create mode 100644 src/test/checkblock_tests.cpp create mode 100644 src/test/coins_tests.cpp create mode 100644 src/test/compress_tests.cpp create mode 100644 src/test/crypto_tests.cpp create mode 100644 src/test/data/README.md create mode 100644 src/test/data/alertTests.raw create mode 100644 src/test/data/base58_encode_decode.json create mode 100644 src/test/data/base58_keys_invalid.json create mode 100644 src/test/data/base58_keys_valid.json create mode 100644 src/test/data/script_invalid.json create mode 100644 src/test/data/script_valid.json create mode 100644 src/test/data/sig_canonical.json create mode 100644 src/test/data/sig_noncanonical.json create mode 100644 src/test/data/sighash.json create mode 100644 src/test/data/tx_invalid.json create mode 100644 src/test/data/tx_valid.json create mode 100644 src/test/getarg_tests.cpp create mode 100644 src/test/hash_tests.cpp create mode 100644 src/test/key_tests.cpp create mode 100644 src/test/libzerocoin_tests.cpp create mode 100644 src/test/main_tests.cpp create mode 100644 src/test/mempool_tests.cpp create mode 100644 src/test/miner_tests.cpp create mode 100644 src/test/mruset_tests.cpp create mode 100644 src/test/multisig_tests.cpp create mode 100644 src/test/netbase_tests.cpp create mode 100644 src/test/pmt_tests.cpp create mode 100644 src/test/reverselock_tests.cpp create mode 100644 src/test/rpc_tests.cpp create mode 100644 src/test/rpc_wallet_tests.cpp create mode 100644 src/test/sanity_tests.cpp create mode 100644 src/test/scheduler_tests.cpp create mode 100644 src/test/script_P2SH_tests.cpp create mode 100644 src/test/script_tests.cpp create mode 100644 src/test/scriptnum_tests.cpp create mode 100644 src/test/serialize_tests.cpp create mode 100644 src/test/sighash_tests.cpp create mode 100644 src/test/sigopcount_tests.cpp create mode 100644 src/test/skiplist_tests.cpp create mode 100644 src/test/test_versess.cpp create mode 100644 src/test/test_versess.h create mode 100644 src/test/test_zerocoin.cpp create mode 100644 src/test/timedata_tests.cpp create mode 100644 src/test/torcontrol_tests.cpp create mode 100644 src/test/transaction_tests.cpp create mode 100644 src/test/tutorial_zerocoin.cpp create mode 100644 src/test/uint256_tests.cpp create mode 100644 src/test/univalue_tests.cpp create mode 100644 src/test/util_tests.cpp create mode 100644 src/test/zerocoin_bignum_tests.cpp create mode 100644 src/test/zerocoin_chain_tests.cpp create mode 100644 src/test/zerocoin_coinspend_tests.cpp create mode 100644 src/test/zerocoin_denomination_tests.cpp create mode 100644 src/test/zerocoin_implementation_tests.cpp create mode 100644 src/test/zerocoin_transactions_tests.cpp create mode 100644 src/threadsafety.h create mode 100644 src/timedata.cpp create mode 100644 src/timedata.h create mode 100644 src/tinyformat.h create mode 100644 src/torcontrol.cpp create mode 100644 src/torcontrol.h create mode 100644 src/txdb.cpp create mode 100644 src/txdb.h create mode 100644 src/txmempool.cpp create mode 100644 src/txmempool.h create mode 100644 src/uint256.cpp create mode 100644 src/uint256.h create mode 100644 src/uint512.h create mode 100644 src/undo.h create mode 100644 src/univalue/.gitignore create mode 100644 src/univalue/.travis.yml create mode 100644 src/univalue/COPYING create mode 100644 src/univalue/Makefile.am create mode 100644 src/univalue/README.md create mode 100644 src/univalue/TODO create mode 100644 src/univalue/autogen.sh create mode 100644 src/univalue/build-aux/m4/.gitignore create mode 100644 src/univalue/configure.ac create mode 100644 src/univalue/gen/gen.cpp create mode 100644 src/univalue/include/univalue.h create mode 100644 src/univalue/lib/.gitignore create mode 100644 src/univalue/lib/univalue.cpp create mode 100644 src/univalue/lib/univalue_escapes.h create mode 100644 src/univalue/lib/univalue_read.cpp create mode 100644 src/univalue/lib/univalue_utffilter.h create mode 100644 src/univalue/lib/univalue_write.cpp create mode 100644 src/univalue/pc/libunivalue-uninstalled.pc.in create mode 100644 src/univalue/pc/libunivalue.pc.in create mode 100644 src/univalue/test/.gitignore create mode 100644 src/univalue/test/fail1.json create mode 100644 src/univalue/test/fail10.json create mode 100644 src/univalue/test/fail11.json create mode 100644 src/univalue/test/fail12.json create mode 100644 src/univalue/test/fail13.json create mode 100644 src/univalue/test/fail14.json create mode 100644 src/univalue/test/fail15.json create mode 100644 src/univalue/test/fail16.json create mode 100644 src/univalue/test/fail17.json create mode 100644 src/univalue/test/fail18.json create mode 100644 src/univalue/test/fail19.json create mode 100644 src/univalue/test/fail2.json create mode 100644 src/univalue/test/fail20.json create mode 100644 src/univalue/test/fail21.json create mode 100644 src/univalue/test/fail22.json create mode 100644 src/univalue/test/fail23.json create mode 100644 src/univalue/test/fail24.json create mode 100644 src/univalue/test/fail25.json create mode 100644 src/univalue/test/fail26.json create mode 100644 src/univalue/test/fail27.json create mode 100644 src/univalue/test/fail28.json create mode 100644 src/univalue/test/fail29.json create mode 100644 src/univalue/test/fail3.json create mode 100644 src/univalue/test/fail30.json create mode 100644 src/univalue/test/fail31.json create mode 100644 src/univalue/test/fail32.json create mode 100644 src/univalue/test/fail33.json create mode 100644 src/univalue/test/fail34.json create mode 100644 src/univalue/test/fail35.json create mode 100644 src/univalue/test/fail36.json create mode 100644 src/univalue/test/fail37.json create mode 100644 src/univalue/test/fail38.json create mode 100644 src/univalue/test/fail39.json create mode 100644 src/univalue/test/fail4.json create mode 100644 src/univalue/test/fail40.json create mode 100644 src/univalue/test/fail41.json create mode 100644 src/univalue/test/fail42.json create mode 100644 src/univalue/test/fail44.json create mode 100644 src/univalue/test/fail5.json create mode 100644 src/univalue/test/fail6.json create mode 100644 src/univalue/test/fail7.json create mode 100644 src/univalue/test/fail8.json create mode 100644 src/univalue/test/fail9.json create mode 100644 src/univalue/test/no_nul.cpp create mode 100644 src/univalue/test/object.cpp create mode 100644 src/univalue/test/pass1.json create mode 100644 src/univalue/test/pass2.json create mode 100644 src/univalue/test/pass3.json create mode 100644 src/univalue/test/round1.json create mode 100644 src/univalue/test/round2.json create mode 100644 src/univalue/test/round3.json create mode 100644 src/univalue/test/round4.json create mode 100644 src/univalue/test/round5.json create mode 100644 src/univalue/test/round6.json create mode 100644 src/univalue/test/round7.json create mode 100644 src/univalue/test/test_json.cpp create mode 100644 src/univalue/test/unitester.cpp create mode 100644 src/util.cpp create mode 100644 src/util.h create mode 100644 src/utilmoneystr.cpp create mode 100644 src/utilmoneystr.h create mode 100644 src/utilstrencodings.cpp create mode 100644 src/utilstrencodings.h create mode 100644 src/utiltime.cpp create mode 100644 src/utiltime.h create mode 100644 src/validationinterface.cpp create mode 100644 src/validationinterface.h create mode 100644 src/versess-cli-res.rc create mode 100644 src/versess-cli.cpp create mode 100644 src/versess-tx-res.rc create mode 100644 src/versess-tx.cpp create mode 100644 src/versessd-res.rc create mode 100644 src/versessd.cpp create mode 100644 src/version.h create mode 100644 src/wallet/db.cpp create mode 100644 src/wallet/db.h create mode 100644 src/wallet/rpcdump.cpp create mode 100644 src/wallet/rpcwallet.cpp create mode 100644 src/wallet/test/wallet_tests.cpp create mode 100644 src/wallet/wallet.cpp create mode 100644 src/wallet/wallet.h create mode 100644 src/wallet/wallet_ismine.cpp create mode 100644 src/wallet/wallet_ismine.h create mode 100644 src/wallet/walletdb.cpp create mode 100644 src/wallet/walletdb.h create mode 100644 src/zmq/zmqabstractnotifier.cpp create mode 100644 src/zmq/zmqabstractnotifier.h create mode 100644 src/zmq/zmqconfig.h create mode 100644 src/zmq/zmqnotificationinterface.cpp create mode 100644 src/zmq/zmqnotificationinterface.h create mode 100644 src/zmq/zmqpublishnotifier.cpp create mode 100644 src/zmq/zmqpublishnotifier.h create mode 100644 src/zvers/accumulatorcheckpoints.cpp create mode 100644 src/zvers/accumulatorcheckpoints.h create mode 100644 src/zvers/accumulatorcheckpoints.json.h create mode 100644 src/zvers/accumulatormap.cpp create mode 100644 src/zvers/accumulatormap.h create mode 100644 src/zvers/accumulators.cpp create mode 100644 src/zvers/accumulators.h create mode 100644 src/zvers/deterministicmint.cpp create mode 100644 src/zvers/deterministicmint.h create mode 100644 src/zvers/mintpool.cpp create mode 100644 src/zvers/mintpool.h create mode 100644 src/zvers/witness.cpp create mode 100644 src/zvers/witness.h create mode 100644 src/zvers/zerocoin.cpp create mode 100644 src/zvers/zerocoin.h create mode 100644 src/zvers/zversmodule.cpp create mode 100644 src/zvers/zversmodule.h create mode 100644 src/zvers/zverstracker.cpp create mode 100644 src/zvers/zverstracker.h create mode 100644 src/zvers/zverswallet.cpp create mode 100644 src/zvers/zverswallet.h create mode 100644 src/zverschain.cpp create mode 100644 src/zverschain.h create mode 100644 test/README.md create mode 100644 test/config.ini.in create mode 100644 test/functional/README.md create mode 100644 test/functional/combine_logs.py create mode 100644 test/functional/combined_log_template.html create mode 100644 test/functional/create_cache.py create mode 100644 test/functional/example_test.py create mode 100644 test/functional/fake_stake/base_test.py create mode 100644 test/functional/fake_stake/util.py create mode 100644 test/functional/feature_block.py create mode 100644 test/functional/feature_cltv.py create mode 100644 test/functional/feature_config_args.py create mode 100644 test/functional/feature_fee_estimation.py create mode 100644 test/functional/feature_help.py create mode 100644 test/functional/feature_minchainwork.py create mode 100644 test/functional/feature_notifications.py create mode 100644 test/functional/feature_nulldummy.py create mode 100644 test/functional/feature_proxy.py create mode 100644 test/functional/feature_reindex.py create mode 100644 test/functional/feature_uacomment.py create mode 100644 test/functional/interface_bitcoin_cli.py create mode 100644 test/functional/interface_http.py create mode 100644 test/functional/interface_rest.py create mode 100644 test/functional/interface_zmq.py create mode 100644 test/functional/mempool_limit.py create mode 100644 test/functional/mempool_persist.py create mode 100644 test/functional/mempool_reorg.py create mode 100644 test/functional/mempool_resurrect.py create mode 100644 test/functional/mempool_spend_coinbase.py create mode 100644 test/functional/mining_basic.py create mode 100644 test/functional/mining_getblocktemplate_longpoll.py create mode 100644 test/functional/mining_prioritisetransaction.py create mode 100644 test/functional/p2p_disconnect_ban.py create mode 100644 test/functional/p2p_feefilter.py create mode 100644 test/functional/p2p_fingerprint.py create mode 100644 test/functional/p2p_invalid_block.py create mode 100644 test/functional/p2p_invalid_tx.py create mode 100644 test/functional/p2p_leak.py create mode 100644 test/functional/p2p_mempool.py create mode 100644 test/functional/p2p_pos_doublespend.py create mode 100644 test/functional/p2p_pos_fakestake.py create mode 100644 test/functional/p2p_pos_fakestake_accepted.py create mode 100644 test/functional/p2p_sendheaders.py create mode 100644 test/functional/p2p_timeouts.py create mode 100644 test/functional/p2p_unrequested_blocks.py create mode 100644 test/functional/p2p_zpos_fakestake.py create mode 100644 test/functional/p2p_zpos_fakestake_accepted.py create mode 100644 test/functional/rpc_bind.py create mode 100644 test/functional/rpc_bip38.py create mode 100644 test/functional/rpc_blockchain.py create mode 100644 test/functional/rpc_decodescript.py create mode 100644 test/functional/rpc_deprecated.py create mode 100644 test/functional/rpc_fundrawtransaction.py create mode 100644 test/functional/rpc_getchaintips.py create mode 100644 test/functional/rpc_invalidateblock.py create mode 100644 test/functional/rpc_listtransactions.py create mode 100644 test/functional/rpc_net.py create mode 100644 test/functional/rpc_rawtransaction.py create mode 100644 test/functional/rpc_signmessage.py create mode 100644 test/functional/rpc_signrawtransaction.py create mode 100644 test/functional/rpc_users.py create mode 100644 test/functional/test_framework/__init__.py create mode 100644 test/functional/test_framework/address.py create mode 100644 test/functional/test_framework/authproxy.py create mode 100644 test/functional/test_framework/bignum.py create mode 100644 test/functional/test_framework/blockstore.py create mode 100644 test/functional/test_framework/blocktools.py create mode 100644 test/functional/test_framework/comptool.py create mode 100644 test/functional/test_framework/coverage.py create mode 100644 test/functional/test_framework/key.py create mode 100644 test/functional/test_framework/messages.py create mode 100644 test/functional/test_framework/mininode.py create mode 100644 test/functional/test_framework/netutil.py create mode 100644 test/functional/test_framework/script.py create mode 100644 test/functional/test_framework/siphash.py create mode 100644 test/functional/test_framework/socks5.py create mode 100644 test/functional/test_framework/test_framework.py create mode 100644 test/functional/test_framework/test_node.py create mode 100644 test/functional/test_framework/util.py create mode 100644 test/functional/test_runner.py create mode 100644 test/functional/wallet_abandonconflict.py create mode 100644 test/functional/wallet_accounts.py create mode 100644 test/functional/wallet_backup.py create mode 100644 test/functional/wallet_basic.py create mode 100644 test/functional/wallet_bumpfee.py create mode 100644 test/functional/wallet_disable.py create mode 100644 test/functional/wallet_dump.py create mode 100644 test/functional/wallet_encryption.py create mode 100644 test/functional/wallet_import_rescan.py create mode 100644 test/functional/wallet_importmulti.py create mode 100644 test/functional/wallet_keypool.py create mode 100644 test/functional/wallet_keypool_topup.py create mode 100644 test/functional/wallet_listreceivedby.py create mode 100644 test/functional/wallet_listsinceblock.py create mode 100644 test/functional/wallet_resendwallettransactions.py create mode 100644 test/functional/wallet_txn_clone.py create mode 100644 test/functional/wallet_txn_doublespend.py create mode 100644 test/functional/wallet_zapwallettxes.py create mode 100644 test/functional/zerocoin_publicSpend_reorg.py create mode 100644 test/functional/zerocoin_valid_public_spend.py create mode 100644 test/functional/zerocoin_wrapped_serials.py create mode 100644 test/util/bitcoin-util-test.py create mode 100644 test/util/data/bitcoin-util-test.json create mode 100644 test/util/data/blanktxv1.hex create mode 100644 test/util/data/blanktxv1.json create mode 100644 test/util/data/tt-delin1-out.hex create mode 100644 test/util/data/tt-delin1-out.json create mode 100644 test/util/data/tt-delout1-out.hex create mode 100644 test/util/data/tt-delout1-out.json create mode 100644 test/util/data/tt-locktime317000-out.hex create mode 100644 test/util/data/tt-locktime317000-out.json create mode 100644 test/util/data/tx394b54bb.hex create mode 100644 test/util/data/txcreate1.hex create mode 100644 test/util/data/txcreate1.json create mode 100644 test/util/data/txcreate2.hex create mode 100644 test/util/data/txcreate2.json create mode 100644 test/util/data/txcreatescript1.hex create mode 100644 test/util/data/txcreatescript1.json create mode 100644 test/util/data/txcreatesign.hex create mode 100644 test/util/data/txcreatesign.json create mode 100644 test/util/rpcauth-test.py diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3c2abf5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,544 @@ +cmake_minimum_required(VERSION 3.10) +project(Versess) + +set(BDB_VER "4.8.30") +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/contrib/cmake") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ") +include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + message(STATUS "Compiling on macOS") + list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/qt5) + list(APPEND CMAKE_PREFIX_PATH /usr/local/opt/openssl) + list(APPEND CMAKE_PREFIX_PATH /usr/local/Cellar/berkeley-db@4) + set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/") + set(ENV{CPPFLAGS} "-I${OPENSSL_ROOT_DIR}/include") + set(ENV{LDFLAGS} "-L${OPENSSL_ROOT_DIR}/lib") + set(BerkeleyDB_ROOT_DIR "/usr/local/Cellar/berkeley-db@4/${BDB_VER}/") +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + file(READ "/proc/version" _SYS_VERSION) + string(REGEX MATCH "Microsoft" _SYSTEM_VERSION_PARSED "${_SYS_VERSION}") + if(${_SYSTEM_VERSION_PARSED} MATCHES "Microsoft") + message(STATUS "Compiling on WSL") + set(ENV{triple} x86_64-w64-mingw32) + set(ENV{target} Windows) + execute_process( + COMMAND make HOST=x86_64-w64-mingw32 -j16 + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/depends + ) + file(REMOVE ${CMAKE_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CMakeCXXCompiler.cmake) + file(REMOVE ${CMAKE_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CMakeCCompiler.cmake) + set(CMAKE_C_COMPILER /usr/bin/$ENV{triple}-gcc) + set(CMAKE_CXX_COMPILER /usr/bin/$ENV{triple}-g++) + set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}) + set(BOOST_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}/include/) + set(BOOST_LIBRARYDIR ${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}/lib) + set(Boost_USE_STATIC_RUNTIME ON) + set(Boost_THREADAPI "win32") + else() + message(STATUS "Compiling on Linux") + list(APPEND CMAKE_PREFIX_PATH /usr/lib/x86_64-linux-gnu/cmake/Qt5) + set(Qt5core_DIR "/usr/lib/x86_64-linux-gnu/cmake/Qt5/QtCore") + include_directories("/usr/include") + include_directories("/usr/include/x86_64-linux-gnu") + add_definitions("-D__BYTE_ORDER -D__LITTLE_ENDIAN") + endif() +endif() + +# Find Dependencies +find_package(BerkeleyDB ${BDB_VER} REQUIRED) +if (BerkeleyDB_FOUND) + if(NOT ${BerkeleyDB_VERSION} MATCHES "${BDB_VER}") + message(WARNING "BerkeleyDB version other than ${BDB_VER} found!") + set(BDB_CONFIGURE_FLAGS "--with-incompatible-bdb") + endif() + include_directories( ${BerkeleyDB_INCLUDE_DIRS} ) + link_directories( ${BerkeleyDB_ROOT_DIR}/lib ) +endif () + +find_package(OpenSSL REQUIRED) +if (OPENSSL_FOUND) + message(STATUS "Found OpenSSL (${OPENSSL_VERSION}): ${OPENSSL_LIBRARIES}") + include_directories( ${OPENSSL_INCLUDE_DIR} ) +endif() + +find_package(LibEvent REQUIRED) +if (LibEvent_FOUND) + include_directories ( ${LibEvent_INCLUDE_DIR} ) + link_directories ( ${LibEvent_LIBRARY_DIRS} ) +endif() + +find_package(GMP) +if (GMP_FOUND) + include_directories ( ${GMP_INCLUDE_DIR} ) + link_directories ( ${GMP_LIBRARY_DIRS} ) +else() + message(WARNING "GMP not found, falling back to OpenSSL for bignum!") + set(BIGNUM_CONFIGURE_FLAGS "--with-zerocoin-bignum=openssl") +endif() + +find_package(ZMQ) +if (ZMQ_Found) + include_directories ( ${ZMQ_INCLUDE_DIR} ) + link_directories ( ${ZMQ_LIB_DIRS} ) +endif() + +find_package(Boost COMPONENTS system filesystem thread program_options REQUIRED) +include_directories( ${Boost_INCLUDE_DIRS} ) +link_directories ( ${Boost_LIBRARY_DIRS} ) + +# run autogen.sh if missing header files from configure on Linux/Mac +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/configure") +else() + execute_process( + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/autogen.sh + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() + +# run configure if versess_config.h doesn't exist +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/config/versess-config.h") +else() + execute_process( + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure ${BDB_CONFIGURE_FLAGS} ${BIGNUM_CONFIGURE_FLAGS} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() +add_definitions(-DHAVE_CONFIG_H) + +ExternalProject_Add ( + libunivalue + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/univalue + CONFIGURE_COMMAND "" + BUILD_COMMAND make + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "" + ) + +ExternalProject_Add ( + libsecp256k1 + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/secp256k1 + CONFIGURE_COMMAND "" + BUILD_COMMAND make + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "" +) + +link_directories( + ${CMAKE_SOURCE_DIR}/src/univalue/.libs + ${CMAKE_SOURCE_DIR}/src/secp256k1/.libs +) + +include_directories( + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/compat + ${CMAKE_SOURCE_DIR}/src/config + ${CMAKE_SOURCE_DIR}/src/obj + ${CMAKE_SOURCE_DIR}/src/leveldb + ${CMAKE_SOURCE_DIR}/src/leveldb/include + ${CMAKE_SOURCE_DIR}/src/leveldb/helpers/memenv + ${CMAKE_SOURCE_DIR}/src/secp256k1 + ${CMAKE_SOURCE_DIR}/src/secp256k1/include + ${CMAKE_SOURCE_DIR}/src/univalue/include +) + +set(libleveldb_a_headers + ${CMAKE_CURRENT_SOURCE_DIR}/src/config/versess-config.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/atomic_pointer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_example.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_posix.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/win/stdint.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_win.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/thread_annotations.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/db.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/options.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/comparator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/filter_policy.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/slice.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/table_builder.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/env.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/c.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/iterator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/cache.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/dumpfile.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/table.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/write_batch.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/include/leveldb/status.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/log_format.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/memtable.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/version_set.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/write_batch_internal.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/filename.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/version_edit.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/dbformat.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/builder.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/log_writer.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/db_iter.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/skiplist.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/db_impl.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/table_cache.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/snapshot.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/log_reader.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/filter_block.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/block_builder.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/block.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/two_level_iterator.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/merger.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/format.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/iterator_wrapper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/crc32c.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/env_posix_test_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/arena.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/random.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/posix_logger.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/hash.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/histogram.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/coding.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/testutil.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/mutexlock.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/logging.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/testharness.h + ) + +set(libleveldb_a_sources + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/builder.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/c.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/dbformat.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/db_impl.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/db_iter.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/dumpfile.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/filename.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/log_reader.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/log_writer.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/memtable.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/repair.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/table_cache.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/version_edit.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/version_set.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db/write_batch.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/block_builder.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/block.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/filter_block.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/format.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/iterator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/merger.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/table_builder.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/table.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/table/two_level_iterator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/arena.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/bloom.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/cache.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/coding.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/comparator.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/crc32c.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/env.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/env_posix.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/filter_policy.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/hash.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/histogram.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/logging.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/options.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/status.cc + ) + +set(libleveldb_cpp_flags) +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(libleveldb_cpp_flags -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1) + list(APPEND libleveldb_a_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util/env_win.cc) + list(APPEND libleveldb_a_srouces ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_win.cc) +else() + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(libleveldb_cpp_flags -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX) + else() + set(libleveldb_cpp_flags -DOS_LINUX -DLEVELDB_PLATFORM_POSIX) + endif() + list(APPEND libleveldb_a_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_posix.cc) +endif() + +add_library(leveldb STATIC ${libleveldb_a_headers} ${libleveldb_a_sources}) +target_compile_definitions(leveldb PUBLIC ${libleveldb_cpp_flags} -DLEVELDB_ATOMIC_PRESENT -D__STDC_LIMIT_MACROS) +target_compile_options(leveldb PUBLIC -I${CMAKE_CURRENT_SOURCE_DIR}/src/compat) + +set(libmemenv_a_sources + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/helpers/memenv/memenv.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/helpers/memenv/memenv.h + ) +add_library(memenv STATIC ${libmemenv_a_sources}) +target_compile_definitions(memenv PUBLIC ${libleveldb_cpp_flags}) + +set(libleveldb_sse42_a_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port/port_posix_sse.cc) +add_library(leveldb_sse42 ${libleveldb_sse42_a_sources}) + +link_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb ) + +file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h) +file(GLOB CRYPTO_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/*.h) +file(GLOB PRIMITIVE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/primitives/*.h) +file(GLOB ZMQ_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/zmq/*.h) +file(GLOB SCRIPT_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/script/*.h) +file(GLOB RPC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/rpc/*.h) +file(GLOB COMPAT_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/compat/*.h) + +source_group("BitcoinHeaders" FILES + ${HEADERS} + ${CRYPTO_HEADERS} + ${PRIMITIVE_HEADERS} + ${ZMQ_HEADERS} + ${SCRIPT_HEADERS} + ${RPC_HEADERS} + ${COMPAT_HEADERS} + ./src/support/cleanse.h + ) + +set(SERVER_SOURCES + ./src/addrman.cpp + ./src/alert.cpp + ./src/bloom.cpp + ./src/blocksignature.cpp + ./src/chain.cpp + ./src/checkpoints.cpp + ./src/httprpc.cpp + ./src/httpserver.cpp + ./src/init.cpp + ./src/leveldbwrapper.cpp + ./src/main.cpp + ./src/merkleblock.cpp + ./src/miner.cpp + ./src/net.cpp + ./src/noui.cpp + ./src/pow.cpp + ./src/rest.cpp + ./src/rpc/blockchain.cpp + ./src/rpc/masternode.cpp + ./src/rpc/budget.cpp + ./src/rpc/mining.cpp + ./src/rpc/misc.cpp + ./src/rpc/net.cpp + ./src/rpc/rawtransaction.cpp + ./src/rpc/server.cpp + ./src/script/sigcache.cpp + ./src/sporkdb.cpp + ./src/timedata.cpp + ./src/torcontrol.cpp + ./src/txdb.cpp + ./src/txmempool.cpp + ./src/validationinterface.cpp + ./src/zverschain.cpp + ) +add_library(SERVER_A STATIC ${BitcoinHeaders} ${SERVER_SOURCES}) + +if (ZMQ_FOUND) + set(ZMQ_SOURCES + ./src/zmq/zmqabstractnotifier.cpp + ./src/zmq/zmqnotificationinterface.cpp + ./src/zmq/zmqpublishnotifier.cpp + ) + add_library(ZMQ_A STATIC ${BitcoinHeaders} ${ZMQ_SOURCES}) +endif() + +set(WALLET_SOURCES + ./src/activemasternode.cpp + ./src/bip38.cpp + ./src/denomination_functions.cpp + ./src/obfuscation.cpp + ./src/obfuscation-relay.cpp + ./src/wallet/db.cpp + ./src/crypter.cpp + ./src/swifttx.cpp + ./src/masternode.cpp + ./src/masternode-budget.cpp + ./src/masternode-payments.cpp + ./src/masternode-sync.cpp + ./src/masternodeconfig.cpp + ./src/masternodeman.cpp + ./src/zvers/mintpool.cpp + ./src/wallet/rpcdump.cpp + ./src/zvers/deterministicmint.cpp + ./src/zvers/zerocoin.cpp + ./src/wallet/rpcwallet.cpp + ./src/kernel.cpp + ./src/wallet/wallet.cpp + ./src/wallet/wallet_ismine.cpp + ./src/wallet/walletdb.cpp + ./src/zvers/zverswallet.cpp + ./src/zvers/zverstracker.cpp + ./src/zvers/zversmodule.cpp + ./src/stakeinput.cpp + ./src/genwit.cpp + ./src/lightzversthread.cpp + ) +add_library(WALLET_A STATIC ${BitcoinHeaders} ${WALLET_SOURCES}) + +set(BITCOIN_CRYPTO_SOURCES + ./src/crypto/sha1.cpp + ./src/crypto/sha256.cpp + ./src/crypto/sha512.cpp + ./src/crypto/hmac_sha256.cpp + ./src/crypto/rfc6979_hmac_sha256.cpp + ./src/crypto/hmac_sha512.cpp + ./src/crypto/scrypt.cpp + ./src/crypto/ripemd160.cpp + ./src/crypto/aes_helper.c + ./src/crypto/blake.c + ./src/crypto/bmw.c + ./src/crypto/groestl.c + ./src/crypto/jh.c + ./src/crypto/keccak.c + ./src/crypto/skein.c + ./src/crypto/common.h + ./src/crypto/sha256.h + ./src/crypto/sha512.h + ./src/crypto/hmac_sha256.h + ./src/crypto/rfc6979_hmac_sha256.h + ./src/crypto/hmac_sha512.h + ./src/crypto/scrypt.h + ./src/crypto/sha1.h + ./src/crypto/ripemd160.h + ./src/crypto/sph_blake.h + ./src/crypto/sph_bmw.h + ./src/crypto/sph_groestl.h + ./src/crypto/sph_jh.h + ./src/crypto/sph_keccak.h + ./src/crypto/sph_skein.h + ./src/crypto/sph_types.h + ) +add_library(BITCOIN_CRYPTO_A STATIC ${BITCOIN_CRYPTO_SOURCES}) + +set(ZEROCOIN_SOURCES + ./src/libzerocoin/Accumulator.h + ./src/libzerocoin/AccumulatorProofOfKnowledge.h + ./src/libzerocoin/bignum.h + ./src/libzerocoin/bignum.cpp + ./src/libzerocoin/Coin.h + ./src/libzerocoin/CoinSpend.h + ./src/libzerocoin/Commitment.h + ./src/libzerocoin/Denominations.h + ./src/libzerocoin/ParamGeneration.h + ./src/libzerocoin/Params.h + ./src/libzerocoin/SerialNumberSignatureOfKnowledge.h + ./src/libzerocoin/SpendType.h + ./src/libzerocoin/ZerocoinDefines.h + ./src/libzerocoin/Accumulator.cpp + ./src/libzerocoin/AccumulatorProofOfKnowledge.cpp + ./src/libzerocoin/Coin.cpp + ./src/libzerocoin/Denominations.cpp + ./src/libzerocoin/CoinSpend.cpp + ./src/libzerocoin/Commitment.cpp + ./src/libzerocoin/ParamGeneration.cpp + ./src/libzerocoin/Params.cpp + ./src/libzerocoin/SerialNumberSignatureOfKnowledge.cpp + ) +if(GMP_FOUND) + list(APPEND ZEROCOIN_SOURCES ./src/libzerocoin/bignum_gmp.cpp) +else() + list(APPEND ZEROCOIN_SOURCES ./src/libzerocoin/bignum_openssl.cpp) +endif() +add_library(ZEROCOIN_A STATIC ${ZEROCOIN_SOURCES}) + +set(COMMON_SOURCES + ./src/zvers/accumulators.cpp + ./src/zvers/accumulatorcheckpoints.cpp + ./src/zvers/accumulatormap.cpp + ./src/zvers/witness.cpp + ./src/allocators.cpp + ./src/amount.cpp + ./src/base58.cpp + ./src/bip38.cpp + ./src/chainparams.cpp + ./src/coins.cpp + ./src/compressor.cpp + ./src/primitives/block.cpp + ./src/zvers/deterministicmint.cpp + ./src/primitives/transaction.cpp + ./src/zvers/zerocoin.cpp + ./src/core_read.cpp + ./src/core_write.cpp + ./src/hash.cpp + ./src/invalid.cpp + ./src/key.cpp + ./src/keystore.cpp + ./src/netbase.cpp + ./src/protocol.cpp + ./src/pubkey.cpp + ./src/scheduler.cpp + ./src/script/interpreter.cpp + ./src/script/script.cpp + ./src/script/sign.cpp + ./src/script/standard.cpp + ./src/script/script_error.cpp + ./src/spork.cpp + ./src/sporkdb.cpp + ) +add_library(COMMON_A STATIC ${BitcoinHeaders} ${COMMON_SOURCES}) + +set(UTIL_SOURCES + ./src/allocators.cpp + ./src/compat/strnlen.cpp + ./src/compat/glibc_sanity.cpp + ./src/compat/glibcxx_sanity.cpp + ./src/chainparamsbase.cpp + ./src/clientversion.cpp + ./src/random.cpp + ./src/rpc/protocol.cpp + ./src/sync.cpp + ./src/uint256.cpp + ./src/util.cpp + ./src/utilstrencodings.cpp + ./src/utilmoneystr.cpp + ./src/utiltime.cpp + ./src/support/cleanse.cpp + ) +add_library(UTIL_A STATIC ${BitcoinHeaders} ${UTIL_SOURCES}) + +set(CLI_SOURCES ./src/rpc/client.cpp) +add_library(CLI_A STATIC ${BitcoinHeaders} ${CLI_SOURCES}) + +add_executable(versess-cli ${CMAKE_CURRENT_SOURCE_DIR}/src/versess-cli.cpp) +add_dependencies(versess-cli libunivalue) +target_link_libraries(versess-cli + CLI_A + univalue + UTIL_A + BITCOIN_CRYPTO_A + ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBEVENT_LIB} + ) + +add_executable(versess-tx ${CMAKE_CURRENT_SOURCE_DIR}/src/versess-tx.cpp) +add_dependencies(versess-tx libunivalue libsecp256k1) +target_link_libraries(versess-tx + univalue + COMMON_A + ZEROCOIN_A + UTIL_A + BITCOIN_CRYPTO_A + secp256k1 + ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${LIBEVENT_LIB} + ) +if(GMP_FOUND) + target_link_libraries(versess-tx ${GMP_LIBRARY}) +endif() + +add_executable(versessd ${CMAKE_CURRENT_SOURCE_DIR}/src/versessd.cpp) +add_dependencies(versessd libunivalue libsecp256k1 leveldb leveldb_sse42 memenv) +target_link_libraries(versessd + SERVER_A + COMMON_A + univalue + ZEROCOIN_A + UTIL_A + WALLET_A + BITCOIN_CRYPTO_A + leveldb leveldb_sse42 memenv secp256k1 + ${BerkeleyDB_LIBRARIES} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${LIBEVENT_LIB} miniupnpc pthread + ) +if(GMP_FOUND) + target_link_libraries(versessd ${GMP_LIBRARY}) +endif() +if(ZMQ_FOUND) + target_link_libraries(versessd ZMQ_A ${ZMQ_LIB}) +endif () + + +add_subdirectory(src/qt) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d6c8af4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,314 @@ +Contributing to Versess Coin +============================ + +The Versess Coin project operates an open contributor model where anyone is +welcome to contribute towards development in the form of peer review, testing +and patches. This document explains the practical process and guidelines for +contributing. + +Firstly in terms of structure, there is no particular concept of "Core +developers" in the sense of privileged people. Open source often naturally +revolves around meritocracy where longer term contributors gain more trust from +the developer community. However, some hierarchy is necessary for practical +purposes. As such there are repository "maintainers" who are responsible for +merging pull requests as well as a "lead maintainer" who is responsible for the +release cycle, overall merging, moderation and appointment of maintainers. + + +Contributor Workflow +-------------------- + +The codebase is maintained using the "contributor workflow" where everyone +without exception contributes patch proposals using "pull requests". This +facilitates social contribution, easy testing and peer review. + +To contribute a patch, the workflow is as follows: + + 1. Fork repository + 2. Create topic branch + 3. Commit patches + +The project coding conventions in the [developer notes](doc/developer-notes.md) +must be adhered to. + +In general [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention) +and diffs should be easy to read. For this reason do not mix any formatting +fixes or code moves with actual code changes. + +Commit messages should be verbose by default consisting of a short subject line +(50 chars max), a blank line and detailed explanatory text as separate +paragraph(s), unless the title alone is self-explanatory (like "Corrected typo +in init.cpp") in which case a single title line is sufficient. Commit messages should be +helpful to people reading your code in the future, so explain the reasoning for +your decisions. Further explanation [here](https://chris.beams.io/posts/git-commit/). + +If a particular commit references another issue, please add the reference. For +example: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords +will cause the corresponding issue to be closed when the pull request is merged. + +Commit messages should never contain any `@` mentions. + +Please refer to the [Git manual](https://git-scm.com/doc) for more information +about Git. + + - Push changes to your fork + - Create pull request + +The title of the pull request should be prefixed by the component or area that +the pull request affects. Valid areas as: + + - *Consensus* for changes to consensus critical code + - *Docs* for changes to the documentation + - *Qt* for changes to versess-qt + - *Minting* for changes to the minting code + - *Net* or *P2P* for changes to the peer-to-peer network code + - *RPC/REST* for changes to the RPC or REST APIs + - *Scripts and tools* for changes to the scripts and tools + - *Tests* for changes to the versess unit tests or QA tests + - *Trivial* should **only** be used for PRs that do not change generated + executable code. Notably, refactors (change of function arguments and code + reorganization) and changes in behavior should **not** be marked as trivial. + Examples of trivial PRs are changes to: + - comments + - whitespace + - variable names + - logging and messages + - *Utils and libraries* for changes to the utils and libraries + - *Wallet* for changes to the wallet code + +Examples: + + Consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG + Net: Automatically create hidden service, listen on Tor + Qt: Add feed bump button + Trivial: Fix typo in init.cpp + +Note that translations should not be submitted as pull requests, please see +[Translation Process](https://github.com/versess-project/versess/blob/master/doc/translation_process.md) +for more information on helping with translations. + +If a pull request is not to be considered for merging (yet), please +prefix the title with [WIP] or use [Tasks Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) +in the body of the pull request to indicate tasks are pending. + +The body of the pull request should contain enough description about what the +patch does together with any justification/reasoning. You should include +references to any discussions (for example other tickets or mailing list +discussions). + +At this stage one should expect comments and review from other contributors. You +can add more commits to your pull request by committing them locally and pushing +to your fork until you have satisfied all feedback. + +Note: Code review is a burdensome but important part of the development process, and as such, certain types of pull requests are rejected. In general, if the **improvements** do not warrant the **review effort** required, the PR has a high chance of being rejected. It is up to the PR author to convince the reviewers that the changes warrant the review effort, and if reviewers are "Concept NAK'ing" the PR, the author may need to present arguments and/or do research backing their suggested changes. + +Squashing Commits +--------------------------- +If your pull request is accepted for merging, you may be asked by a maintainer +to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits +before it will be merged. The basic squashing workflow is shown below. + + git checkout your_branch_name + git rebase -i HEAD~n + # n is normally the number of commits in the pull request. + # Set commits (except the one in the first line) from 'pick' to 'squash', save and quit. + # On the next screen, edit/refine commit messages. + # Save and quit. + git push -f # (force push to GitHub) + +Please update the resulting commit message if needed, it should read as a +coherent message. In most cases this means that you should not just list the +interim commits. + +If you have problems with squashing (or other workflows with `git`), you can +alternatively enable "Allow edits from maintainers" in the right GitHub +sidebar and ask for help in the pull request. + +Please refrain from creating several pull requests for the same change. +Use the pull request that is already open (or was created earlier) to amend +changes. This preserves the discussion and review that happened earlier for +the respective change set. + +The length of time required for peer review is unpredictable and will vary from +pull request to pull request. + +Rebasing Pull Requests +------------------------- +It may become necessary for a pull request to be rebased after other pull requests have been +merged. This is typically due to mutually exclusive changes (conflicts) between your pull +request and the current `master` branch. + +When a rebase is needed, a comment will be added to the pull request indicating this need. +Rather than simply merge the `master` branch into your pull request (which results in an +ugly and confusing merge commit), it is better to use git's rebase feature. The basic +workflow is as follows: + + # replace 'origin' with the remote name for the main project repo in the example + git checkout your_branch_name + git fetch origin + git pull --rebase origin master + +This will "rewind" your branch commits, pull any new commits from `master`, then attempt to +re-apply your commits on top of the new HEAD. If any conflicts are found, the process will +pause and allow you to resolve any conflicts. Once conflicts have been resolved: + + git rebase --continue + +Repeat as necessary until there are no more conflicts and your git tree is in a clean state. +The final step is to push your rebased branch back up to github: + + git push -f # force pushes the branch to github + +Pull Request Philosophy +----------------------- + +Patchsets should always be focused. For example, a pull request could add a +feature, fix a bug, or refactor code; but not a mixture. Please also avoid super +pull requests which attempt to do too much, are overly large, or overly complex +as this makes review difficult. + + +### Features + +When adding a new feature, thought must be given to the long term technical debt +and maintenance that feature may require after inclusion. Before proposing a new +feature that will require maintenance, please consider if you are willing to +maintain it (including bug fixing). If features get orphaned with no maintainer +in the future, they may be removed by the Repository Maintainer. + + +### Refactoring + +Refactoring is a necessary part of any software project's evolution. The +following guidelines cover refactoring pull requests for the project. + +There are three categories of refactoring, code only moves, code style fixes, +code refactoring. In general refactoring pull requests should not mix these +three kinds of activity in order to make refactoring pull requests easy to +review and uncontroversial. In all cases, refactoring PRs must not change the +behaviour of code within the pull request (bugs must be preserved as is). + +Project maintainers aim for a quick turnaround on refactoring pull requests, so +where possible keep them short, uncomplex and easy to verify. + +Pull requests that refactor the code should not be made by new contributors. It +requires a certain level of experience to know where the code belongs and to +understand the full ramification (including rebase effort of open pull requests). + +Trivial pull requests or pull requests that refactor the code with no clear +benefits may be immediately closed by the maintainers to reduce unnecessary +workload on reviewing. + + +"Decision Making" Process +------------------------- + +The following applies to code changes to the Versess Coin project, and is not to be +confused with overall Versess Network Protocol consensus changes. + +Whether a pull request is merged into Versess Coin rests with the project merge +maintainers and ultimately the project lead. + +Maintainers will take into consideration if a patch is in line with the general +principles of the project; meets the minimum standards for inclusion; and will +judge the general consensus of contributors. + +In general, all pull requests must: + + - Have a clear use case, fix a demonstrable bug or serve the greater good of + the project (for example refactoring for modularisation); + - Be well peer reviewed; + - follow code style guidelines; + +Patches that change Versess consensus rules are considerably more involved than +normal because they affect the entire ecosystem and so must be preceded by +extensive discussions and clear detailing. While each case will be different, +one should be prepared to expend more time and effort than for other kinds of +patches because of increased peer review and consensus building requirements. + + +### Peer Review + +Anyone may participate in peer review which is expressed by comments in the pull +request. Typically reviewers will review the code for obvious errors, as well as +test out the patchset and opine on the technical merits of the patch. Project +maintainers take into account the peer review when determining if there is +consensus to merge a pull request (remember that discussions may have been +spread out over GitHub, forums, email, and Discord discussions). The following +language is used within pull-request comments: + + - (t)ACK means "I have tested the code and I agree it should be merged", involving + change-specific manual testing in addition to running the unit and functional + tests, and in case it is not obvious how the manual testing was done, it should + be described; + - NACK means "I disagree this should be merged", and must be accompanied by + sound technical justification (or in certain cases of copyright/patent/licensing + issues, legal justification). NACKs without accompanying reasoning may be + disregarded; + - utACK means "I have not tested the code, but I have reviewed it and it looks + OK, I agree it can be merged"; + - Concept ACK means "I agree in the general principle of this pull request"; + - Nit refers to trivial, often non-blocking issues. + +Reviewers should include the commit hash which they reviewed in their comments. + +Project maintainers reserve the right to weigh the opinions of peer reviewers +using common sense judgement and also may weight based on meritocracy: Those +that have demonstrated a deeper commitment and understanding towards the project +(over time) or have clear domain expertise may naturally have more weight, as +one would expect in all walks of life. + +Where a patchset affects consensus critical code, the bar will be set much +higher in terms of discussion and peer review requirements, keeping in mind that +mistakes could be very costly to the wider community. This includes refactoring +of consensus critical code. + +Where a patchset proposes to change the Versess consensus, it must have been +discussed extensively on the forums and Discord, be accompanied by a widely +discussed Proposal and have a generally widely perceived technical consensus of being +a worthwhile change based on the judgement of the maintainers. + +### Finding Reviewers + +As most reviewers are themselves developers with their own projects, the review +process can be quite lengthy, and some amount of patience is required. If you find +that you've been waiting for a pull request to be given attention for several +months, there may be a number of reasons for this, some of which you can do something +about: + + - It may be because of a feature freeze due to an upcoming release. During this time, + only bug fixes are taken into consideration. If your pull request is a new feature, + it will not be prioritized until the release is over. Wait for release. + - It may be because the changes you are suggesting do not appeal to people. Rather than + nits and critique, which require effort and means they care enough to spend time on your + contribution, thundering silence is a good sign of widespread (mild) dislike of a given change + (because people don't assume *others* won't actually like the proposal). Don't take + that personally, though! Instead, take another critical look at what you are suggesting + and see if it: changes too much, is too broad, doesn't adhere to the + [developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc. + Identify and address any of the issues you find. Then ask e.g. on Discord if someone could give + their opinion on the concept itself. + - It may be because your code is too complex for all but a few people. And those people + may not have realized your pull request even exists. A great way to find people who + are qualified and care about the code you are touching is the + [Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply + find the person touching the code you are touching before you and see if you can find + them and give them a nudge. Don't be incessant about the nudging though. + - Finally, if all else fails, ask on Discord or elsewhere for someone to give your pull request + a look. If you think you've been waiting an unreasonably long amount of time (month+) for + no particular reason (few lines changed, etc), this is totally fine. Try to return the favor + when someone else is asking for feedback on their code, and universe balances out. + + +Release Policy +-------------- + +The project leader is the release manager for each Versess Coin release. + +Copyright +--------- + +By contributing to this repository, you agree to license your work under the +MIT license unless specified otherwise in `contrib/debian/copyright` or at +the top of the file itself. Any work contributed where you are not the original +author must contain its license header with the original author(s) and source. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5abd90a --- /dev/null +++ b/COPYING @@ -0,0 +1,21 @@ +Copyright (c) 2009-2015 Bitcoin Developers +Copyright (c) 2014-2015 Dash Developers +Copyright (c) 2015-2019 Versess Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..74481d1 --- /dev/null +++ b/INSTALL @@ -0,0 +1,13 @@ +Building Versess + +Use the autogen script to prepare the build environment. + + ./autogen.sh + ./configure + make + +Always verify the signatures and checksums. + +See doc/build-*.md for instructions on building versessd, +the intended-for-services, no-graphical-interface, reference +implementation of Versess. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..c6531d8 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,274 @@ +# Copyright (c) 2013-2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +ACLOCAL_AMFLAGS = -I build-aux/m4 +SUBDIRS = src +if ENABLE_MAN +SUBDIRS += doc/man +endif +.PHONY: deploy FORCE + +export PYTHONPATH + +if BUILD_BITCOIN_LIBS +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libbitcoinconsensus.pc +endif + +BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT) +BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT) +BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT) +BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT) + +empty := +space := $(empty) $(empty) + +OSX_APP=Versess-Qt.app +OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) +OSX_DMG = $(OSX_VOLNAME).dmg +OSX_BACKGROUND_SVG=background.svg +OSX_BACKGROUND_IMAGE=background.tiff +OSX_BACKGROUND_IMAGE_DPIS=36 72 +OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py +OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus +OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist +OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns +OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed +OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW + +DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md) +DIST_CONTRIB = $(top_srcdir)/contrib/versess-cli.bash-completion \ + $(top_srcdir)/contrib/versess-tx.bash-completion \ + $(top_srcdir)/contrib/versessd.bash-completion \ + $(top_srcdir)/contrib/init \ + $(top_srcdir)/contrib/install_db4.sh + +DIST_SHARE = \ + $(top_srcdir)/share/genbuild.sh \ + $(top_srcdir)/share/rpcauth + +BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \ + $(top_srcdir)/contrib/devtools/security-check.py + +WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/versess.ico \ + $(top_srcdir)/share/pixmaps/nsis-header.bmp \ + $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \ + $(top_srcdir)/doc/README_windows.txt + +LINUX_PACKAGING = $(top_srcdir)/share/pixmaps/versess16.xpm \ + $(top_srcdir)/share/pixmaps/versess32.xpm \ + $(top_srcdir)/share/pixmaps/versess128.png + +OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ + $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \ + $(OSX_DSSTORE_GEN) \ + $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \ + $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh + +COVERAGE_INFO = baseline.info \ + test_versess_filtered.info total_coverage.info \ + baseline_filtered.info functional_test.info functional_test_filtered.info \ + test_versess_coverage.info test_versess.info + +dist-hook: + -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - + +$(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 + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release + @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \ + echo error: could not build $@ + @echo built $@ + +$(OSX_APP)/Contents/PkgInfo: + $(MKDIR_P) $(@D) + @echo "APPL????" > $@ + +$(OSX_APP)/Contents/Resources/empty.lproj: + $(MKDIR_P) $(@D) + @touch $@ + +$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST) + $(MKDIR_P) $(@D) + $(INSTALL_DATA) $< $@ + +$(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS) + $(MKDIR_P) $(@D) + $(INSTALL_DATA) $< $@ + +$(OSX_APP)/Contents/MacOS/Versess-Qt: all-recursive + $(MKDIR_P) $(@D) + STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $@ + +$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: + $(MKDIR_P) $(@D) + echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@ + +OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \ + $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \ + $(OSX_APP)/Contents/MacOS/Versess-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings + +osx_volname: + echo $(OSX_VOLNAME) >$@ + +if BUILD_DARWIN +$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE) + $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME) + +$(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@ +$(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@ +$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png + tiffutil -cathidpicheck $^ -out $@ + +deploydir: $(OSX_DMG) +else +APP_DIST_DIR=$(top_builddir)/dist +APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(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/Versess-Qt + +$(OSX_DMG): $(APP_DIST_EXTRAS) + $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist + +dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@ +OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE)) +$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES) + $(MKDIR_P) $(@D) + $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@ + +$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN) + $(PYTHON) $< "$@" "$(OSX_VOLNAME)" + +$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Versess-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) + INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(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 +appbundle: $(OSX_APP_BUILT) +deploy: $(OSX_DMG) +endif +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 +LCOV_FILTER_PATTERN=-p "/usr/include/" -p "/usr/lib/" -p "src/leveldb/" -p "src/univalue" -p "src/secp256k1" + +baseline.info: + $(LCOV) -c -i -d $(abs_builddir)/src -o $@ + +baseline_filtered.info: baseline.info + $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ + $(LCOV) -a $@ $(LCOV_OPTS) -o $@ + +test_versess.info: baseline_filtered.info + $(MAKE) -C src/ check + $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_versess -o $@ + $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src + +test_versess_filtered.info: test_versess.info + $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ + $(LCOV) -a $@ $(LCOV_OPTS) -o $@ + +functional_test.info: test_versess_filtered.info + -@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS) + $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@ + $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src + +functional_test_filtered.info: functional_test.info + $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ + $(LCOV) -a $@ $(LCOV_OPTS) -o $@ + +test_versess_coverage.info: baseline_filtered.info test_versess_filtered.info + $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_versess_filtered.info -o $@ + +total_coverage.info: test_versess_filtered.info functional_test_filtered.info + $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_versess_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt + +test_versess.coverage/.dirstamp: test_versess_coverage.info + $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D) + @touch $@ + +total.coverage/.dirstamp: total_coverage.info + $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D) + @touch $@ + +cov: test_versess.coverage/.dirstamp total.coverage/.dirstamp + +endif + +dist_noinst_SCRIPTS = autogen.sh + +EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(LINUX_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) + +EXTRA_DIST += \ + test/functional + +EXTRA_DIST += \ + test/util/bitcoin-util-test.py \ + test/util/data/bitcoin-util-test.json \ + test/util/data/blanktxv1.hex \ + test/util/data/blanktxv1.json \ + test/util/data/tt-delin1-out.hex \ + test/util/data/tt-delin1-out.json \ + test/util/data/tt-delout1-out.hex \ + test/util/data/tt-delout1-out.json \ + test/util/data/tt-locktime317000-out.hex \ + test/util/data/tt-locktime317000-out.json \ + test/util/data/tx394b54bb.hex \ + test/util/data/txcreate1.hex \ + test/util/data/txcreate1.json \ + test/util/data/txcreate2.hex \ + test/util/data/txcreate2.json \ + test/util/data/txcreatescript1.hex \ + test/util/data/txcreatescript1.json \ + test/util/data/txcreatesign.hex \ + test/util/data/txcreatesign.json \ + test/util/rpcauth-test.py + +CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) + +.INTERMEDIATE: $(COVERAGE_INFO) + +DISTCHECK_CONFIGURE_FLAGS = --enable-man + +doc/doxygen/.stamp: doc/Doxyfile FORCE + $(MKDIR_P) $(@D) + $(DOXYGEN) $^ + $(AM_V_at) touch $@ + +if HAVE_DOXYGEN +docs: doc/doxygen/.stamp +else +docs: + @echo "error: doxygen not found" +endif + +clean-docs: + rm -rf doc/doxygen + +clean-local: clean-docs + rm -rf coverage_percent.txt test_versess.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP) + rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bfcb62 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +### Versess Coin: + + + + + \ No newline at end of file diff --git a/autogen.sh b/autogen.sh new file mode 100644 index 0000000..0c05626 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Copyright (c) 2013-2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +set -e +srcdir="$(dirname $0)" +cd "$srcdir" +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then + LIBTOOLIZE="${GLIBTOOLIZE}" + export LIBTOOLIZE +fi +which autoreconf >/dev/null || \ + (echo "configuration failed, please install autoconf first" && exit 1) +autoreconf --install --force --warnings=all diff --git a/build-aux/m4/ax_boost_base.m4 b/build-aux/m4/ax_boost_base.m4 new file mode 100644 index 0000000..650c94f --- /dev/null +++ b/build-aux/m4/ax_boost_base.m4 @@ -0,0 +1,291 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# DESCRIPTION +# +# Test for the Boost C++ libraries of a particular version (or newer) +# +# If no path to the installed boost library is given the macro searchs +# under /usr, /usr/local, /opt and /opt/local and evaluates the +# $BOOST_ROOT environment variable. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) +# +# And sets: +# +# HAVE_BOOST +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# Copyright (c) 2009 Peter Adolphs +# +# 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 27 + +AC_DEFUN([AX_BOOST_BASE], +[ +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], + [use Boost library from a standard location (ARG=yes), + from the specified location (ARG=), + or disable it (ARG=no) + @<:@ARG=yes@:>@ ])], + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ac_boost_path="" + else + want_boost="yes" + ac_boost_path="$withval" + fi + ], + [want_boost="yes"]) + + +AC_ARG_WITH([boost-libdir], + AS_HELP_STRING([--with-boost-libdir=LIB_DIR], + [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), + [ + if test -d "$withval" + then + ac_boost_lib_path="$withval" + else + AC_MSG_ERROR(--with-boost-libdir expected directory name) + fi + ], + [ac_boost_lib_path=""] +) + +if test "x$want_boost" = "xyes"; then + boost_lib_version_req=ifelse([$1], ,1.20.0,$1) + boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` + boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$boost_lib_version_req_sub_minor" = "x" ; then + boost_lib_version_req_sub_minor="0" + fi + WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` + AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) + succeeded=no + + dnl On 64-bit systems check for system libraries in both lib64 and lib. + dnl The former is specified by FHS, but e.g. Debian does not adhere to + dnl this (as it rises problems for generic multi-arch support). + dnl The last entry in the list is chosen by default when no libraries + dnl are found, e.g. when only header-only libraries are installed! + libsubdirs="lib" + ax_arch=`uname -m` + case $ax_arch in + x86_64) + libsubdirs="lib64 libx32 lib lib64" + ;; + ppc64|s390x|sparc64|aarch64|ppc64le) + libsubdirs="lib64 lib lib64" + ;; + esac + + dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give + dnl them priority over the other paths since, if libs are found there, they + dnl are almost assuredly the ones desired. + AC_REQUIRE([AC_CANONICAL_HOST]) + libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" + + case ${host_cpu} in + i?86) + libsubdirs="lib/i386-${host_os} $libsubdirs" + ;; + esac + + dnl some arches may advertise a cpu type that doesn't line up with their + dnl prefix's cpu type. For example, uname may report armv7l while libs are + dnl installed to /usr/lib/arm-linux-gnueabihf. Try getting the compiler's + dnl value for an extra chance of finding the correct path. + libsubdirs="lib/`$CXX -dumpmachine 2>/dev/null` $libsubdirs" + + dnl first we check the system location for boost libraries + dnl this location ist chosen if boost libraries are installed with the --layout=system option + dnl or if you install boost with RPM + if test "$ac_boost_path" != ""; then + BOOST_CPPFLAGS="-I$ac_boost_path/include" + for ac_boost_path_tmp in $libsubdirs; do + if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then + BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" + break + fi + done + elif test "$cross_compiling" != yes; then + for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + for libsubdir in $libsubdirs ; do + if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" + BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" + break; + fi + done + fi + + dnl overwrite ld flags if we have required special directory with + dnl --with-boost-libdir parameter + if test "$ac_boost_lib_path" != ""; then + BOOST_LDFLAGS="-L$ac_boost_lib_path" + fi + + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_REQUIRE([AC_PROG_CXX]) + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + + + + dnl if we found no boost with system layout we search for boost libraries + dnl built and installed without the --layout=system option or for a staged(not installed) version + if test "x$succeeded" != "xyes"; then + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + BOOST_CPPFLAGS= + BOOST_LDFLAGS= + _version=0 + if test "$ac_boost_path" != ""; then + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + fi + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" + done + dnl if nothing found search for layout used in Windows distributions + if test -z "$BOOST_CPPFLAGS"; then + if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then + BOOST_CPPFLAGS="-I$ac_boost_path" + fi + fi + fi + else + if test "$cross_compiling" != yes; then + for ac_boost_path in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + best_path=$ac_boost_path + fi + done + fi + done + + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" + if test "$ac_boost_lib_path" = ""; then + for libsubdir in $libsubdirs ; do + if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$best_path/$libsubdir" + fi + fi + + if test "x$BOOST_ROOT" != "x"; then + for libsubdir in $libsubdirs ; do + if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then + version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` + stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` + stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` + V_CHECK=`expr $stage_version_shorten \>\= $_version` + if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then + AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) + BOOST_CPPFLAGS="-I$BOOST_ROOT" + BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" + fi + fi + fi + fi + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + fi + + if test "$succeeded" != "yes" ; then + if test "$_version" = "0" ; then + AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) + else + AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) + fi + # execute ACTION-IF-NOT-FOUND (if present): + ifelse([$3], , :, [$3]) + else + AC_SUBST(BOOST_CPPFLAGS) + AC_SUBST(BOOST_LDFLAGS) + AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) + # execute ACTION-IF-FOUND (if present): + ifelse([$2], , :, [$2]) + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" +fi + +]) diff --git a/build-aux/m4/ax_boost_chrono.m4 b/build-aux/m4/ax_boost_chrono.m4 new file mode 100644 index 0000000..6ea77b9 --- /dev/null +++ b/build-aux/m4/ax_boost_chrono.m4 @@ -0,0 +1,118 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_CHRONO +# +# DESCRIPTION +# +# Test for Chrono library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_CHRONO_LIB) +# +# And sets: +# +# HAVE_BOOST_CHRONO +# +# LICENSE +# +# Copyright (c) 2012 Xiyue Deng +# +# 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 4 + +AC_DEFUN([AX_BOOST_CHRONO], +[ + AC_ARG_WITH([boost-chrono], + AS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@], + [use the Chrono library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-chrono=boost_chrono-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_chrono_lib="" + else + want_boost="yes" + ax_boost_user_chrono_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_BUILD]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::Chrono library is available, + ax_cv_boost_chrono, + [AC_LANG_PUSH([C++]) + CXXFLAGS_SAVE=$CXXFLAGS + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[boost::chrono::system_clock::time_point* time = new boost::chrono::system_clock::time_point; delete time;]])], + ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no) + CXXFLAGS=$CXXFLAGS_SAVE + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_chrono" = "xyes"; then + AC_SUBST(BOOST_CPPFLAGS) + + AC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + + LDFLAGS_SAVE=$LDFLAGS + if test "x$ax_boost_user_chrono_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_chrono.*\)\.so.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_chrono.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], + [link_chrono="no"]) + done + if test "x$link_chrono" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_chrono.*\)\.dll.*$;\1;' -e 's;^\(boost_chrono.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], + [link_chrono="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_CHRONO_LIB="-l$ax_lib"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono="yes"; break], + [link_chrono="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the library!) + fi + if test "x$link_chrono" = "xno"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_boost_filesystem.m4 b/build-aux/m4/ax_boost_filesystem.m4 new file mode 100644 index 0000000..f5c9d56 --- /dev/null +++ b/build-aux/m4/ax_boost_filesystem.m4 @@ -0,0 +1,119 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_FILESYSTEM +# +# DESCRIPTION +# +# Test for Filesystem library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. Further documentation is +# available at . +# +# This macro calls: +# +# AC_SUBST(BOOST_FILESYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_FILESYSTEM +# +# LICENSE +# +# Copyright (c) 2009 Thomas Porschberg +# Copyright (c) 2009 Michael Tindal +# Copyright (c) 2009 Roman Rybalko +# +# 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 26 + +AC_DEFUN([AX_BOOST_FILESYSTEM], +[ + AC_ARG_WITH([boost-filesystem], + AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@], + [use the Filesystem library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_filesystem_lib="" + else + want_boost="yes" + ax_boost_user_filesystem_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + LIBS_SAVED=$LIBS + LIBS="$LIBS $BOOST_SYSTEM_LIB" + export LIBS + + AC_CACHE_CHECK(whether the Boost::Filesystem library is available, + ax_cv_boost_filesystem, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[using namespace boost::filesystem; + path my_path( "foo/bar/data.txt" ); + return 0;]])], + ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_filesystem" = "xyes"; then + AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + ax_lib= + if test "x$ax_boost_user_filesystem_lib" = "x"; then + for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + if test "x$link_filesystem" != "xyes"; then + for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + fi + else + for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], + [link_filesystem="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the boost_filesystem library!) + fi + if test "x$link_filesystem" != "xyes"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + LIBS="$LIBS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_boost_program_options.m4 b/build-aux/m4/ax_boost_program_options.m4 new file mode 100644 index 0000000..2bdb593 --- /dev/null +++ b/build-aux/m4/ax_boost_program_options.m4 @@ -0,0 +1,108 @@ +# ============================================================================ +# http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html +# ============================================================================ +# +# SYNOPSIS +# +# AX_BOOST_PROGRAM_OPTIONS +# +# DESCRIPTION +# +# Test for program options library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. Further documentation is +# available at . +# +# This macro calls: +# +# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) +# +# And sets: +# +# HAVE_BOOST_PROGRAM_OPTIONS +# +# LICENSE +# +# Copyright (c) 2009 Thomas Porschberg +# +# 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 24 + +AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], +[ + AC_ARG_WITH([boost-program-options], + AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@], + [use the program options library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_program_options_lib="" + else + want_boost="yes" + ax_boost_user_program_options_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + export want_boost + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + AC_CACHE_CHECK([whether the Boost::Program_Options library is available], + ax_cv_boost_program_options, + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include + ]], + [[boost::program_options::error err("Error message"); + return 0;]])], + ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no) + AC_LANG_POP([C++]) + ]) + if test "$ax_cv_boost_program_options" = yes; then + AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + if test "x$ax_boost_user_program_options_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.dylib.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], + [link_program_options="no"]) + done + if test "x$link_program_options" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], + [link_program_options="no"]) + done + fi + else + for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do + AC_CHECK_LIB($ax_lib, main, + [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], + [link_program_options="no"]) + done + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the boost_program_options library!) + fi + if test "x$link_program_options" != "xyes"; then + AC_MSG_ERROR([Could not link against [$ax_lib] !]) + fi + fi + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_boost_system.m4 b/build-aux/m4/ax_boost_system.m4 new file mode 100644 index 0000000..1c05450 --- /dev/null +++ b/build-aux/m4/ax_boost_system.m4 @@ -0,0 +1,122 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_SYSTEM +# +# DESCRIPTION +# +# Test for System library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_SYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_SYSTEM +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Daniel Casimiro +# +# 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 18 + +AC_DEFUN([AX_BOOST_SYSTEM], +[ + AC_ARG_WITH([boost-system], + AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@], + [use the System library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-system=boost_system-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_system_lib="" + else + want_boost="yes" + ax_boost_user_system_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_BUILD]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::System library is available, + ax_cv_boost_system, + [AC_LANG_PUSH([C++]) + CXXFLAGS_SAVE=$CXXFLAGS + CXXFLAGS= + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[boost::system::error_category *a = 0;]])], + ax_cv_boost_system=yes, ax_cv_boost_system=no) + CXXFLAGS=$CXXFLAGS_SAVE + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_system" = "xyes"; then + AC_SUBST(BOOST_CPPFLAGS) + + AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + + LDFLAGS_SAVE=$LDFLAGS + if test "x$ax_boost_user_system_lib" = "x"; then + ax_lib= + for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + if test "x$link_system" != "xyes"; then + for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break], + [link_system="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the boost_system library!) + fi + if test "x$link_system" = "xno"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_boost_thread.m4 b/build-aux/m4/ax_boost_thread.m4 new file mode 100644 index 0000000..9f0bd0b --- /dev/null +++ b/build-aux/m4/ax_boost_thread.m4 @@ -0,0 +1,150 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_THREAD +# +# DESCRIPTION +# +# Test for Thread library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_THREAD_LIB) +# +# And sets: +# +# HAVE_BOOST_THREAD +# +# LICENSE +# +# Copyright (c) 2009 Thomas Porschberg +# Copyright (c) 2009 Michael Tindal +# +# 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 27 + +AC_DEFUN([AX_BOOST_THREAD], +[ + AC_ARG_WITH([boost-thread], + AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@], + [use the Thread library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-thread=boost_thread-gcc-mt ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_thread_lib="" + else + want_boost="yes" + ax_boost_user_thread_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_BUILD]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::Thread library is available, + ax_cv_boost_thread, + [AC_LANG_PUSH([C++]) + CXXFLAGS_SAVE=$CXXFLAGS + + if test "x$host_os" = "xsolaris" ; then + CXXFLAGS="-pthreads $CXXFLAGS" + elif test "x$host_os" = "xmingw32" ; then + CXXFLAGS="-mthreads $CXXFLAGS" + else + CXXFLAGS="-pthread $CXXFLAGS" + fi + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[boost::thread_group thrds; + return 0;]])], + ax_cv_boost_thread=yes, ax_cv_boost_thread=no) + CXXFLAGS=$CXXFLAGS_SAVE + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_thread" = "xyes"; then + if test "x$host_os" = "xsolaris" ; then + BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" + elif test "x$host_os" = "xmingw32" ; then + BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" + else + BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" + fi + + AC_SUBST(BOOST_CPPFLAGS) + + AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + + LDFLAGS_SAVE=$LDFLAGS + case "x$host_os" in + *bsd* ) + LDFLAGS="-pthread $LDFLAGS" + break; + ;; + esac + if test "x$ax_boost_user_thread_lib" = "x"; then + ax_lib= + for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], + [link_thread="no"]) + done + if test "x$link_thread" != "xyes"; then + for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], + [link_thread="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do + AC_CHECK_LIB($ax_lib, exit, + [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], + [link_thread="no"]) + done + + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the boost_thread library!) + fi + if test "x$link_thread" = "xno"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + else + case "x$host_os" in + *bsd* ) + BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" + break; + ;; + esac + + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_boost_unit_test_framework.m4 b/build-aux/m4/ax_boost_unit_test_framework.m4 new file mode 100644 index 0000000..3d8e93e --- /dev/null +++ b/build-aux/m4/ax_boost_unit_test_framework.m4 @@ -0,0 +1,137 @@ +# ================================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_boost_unit_test_framework.html +# ================================================================================= +# +# SYNOPSIS +# +# AX_BOOST_UNIT_TEST_FRAMEWORK +# +# DESCRIPTION +# +# Test for Unit_Test_Framework library from the Boost C++ libraries. The +# macro requires a preceding call to AX_BOOST_BASE. Further documentation +# is available at . +# +# This macro calls: +# +# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) +# +# And sets: +# +# HAVE_BOOST_UNIT_TEST_FRAMEWORK +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# +# 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 21 + +AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK], +[ + AC_ARG_WITH([boost-unit-test-framework], + AS_HELP_STRING([--with-boost-unit-test-framework@<:@=special-lib@:>@], + [use the Unit_Test_Framework library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_unit_test_framework_lib="" + else + want_boost="yes" + ax_boost_user_unit_test_framework_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::Unit_Test_Framework library is available, + ax_cv_boost_unit_test_framework, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [[using boost::unit_test::test_suite; + test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); if (test == NULL) { return 1; } else { return 0; }]])], + ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no) + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then + AC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_Test_Framework library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + + if test "x$ax_boost_user_unit_test_framework_lib" = "x"; then + saved_ldflags="${LDFLAGS}" + for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.so* $BOOSTLIBDIR/libboost_unit_test_framework*.dylib* $BOOSTLIBDIR/libboost_unit_test_framework*.a* 2>/dev/null` ; do + if test -r $monitor_library ; then + libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a.*$;\1;'` + ax_lib=${libextension} + link_unit_test_framework="yes" + else + link_unit_test_framework="no" + fi + + if test "x$link_unit_test_framework" = "xyes"; then + BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" + AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) + break + fi + done + if test "x$link_unit_test_framework" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.dll* $BOOSTLIBDIR/boost_unit_test_framework*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_unit_test_framework.*\)\.dll.*$;\1;' -e 's;^\(boost_unit_test_framework.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework="yes"; break], + [link_unit_test_framework="no"]) + done + fi + else + link_unit_test_framework="no" + saved_ldflags="${LDFLAGS}" + for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do + if test "x$link_unit_test_framework" = "xyes"; then + break; + fi + for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.so* $BOOSTLIBDIR/lib${ax_lib}.a* 2>/dev/null` ; do + if test -r $unittest_library ; then + libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\(boost_unit_test_framework.*\)\.so.*$;\1;' -e 's;^lib\(boost_unit_test_framework.*\)\.a*$;\1;'` + ax_lib=${libextension} + link_unit_test_framework="yes" + else + link_unit_test_framework="no" + fi + + if test "x$link_unit_test_framework" = "xyes"; then + BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" + AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) + break + fi + done + done + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the library!) + fi + if test "x$link_unit_test_framework" != "xyes"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/build-aux/m4/ax_check_compile_flag.m4 b/build-aux/m4/ax_check_compile_flag.m4 new file mode 100644 index 0000000..ca36397 --- /dev/null +++ b/build-aux/m4/ax_check_compile_flag.m4 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff --git a/build-aux/m4/ax_check_link_flag.m4 b/build-aux/m4/ax_check_link_flag.m4 new file mode 100644 index 0000000..eb01a6c --- /dev/null +++ b/build-aux/m4/ax_check_link_flag.m4 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the linker or gives an error. +# (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_LINK_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_LINK_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl +AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $4 $1" + AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + LDFLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_LINK_FLAGS diff --git a/build-aux/m4/ax_check_preproc_flag.m4 b/build-aux/m4/ax_check_preproc_flag.m4 new file mode 100644 index 0000000..ca1d5ee --- /dev/null +++ b/build-aux/m4/ax_check_preproc_flag.m4 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's +# preprocessor or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the preprocessor's default +# flags when the check is done. The check is thus made with the flags: +# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the +# preprocessor to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_PREPROC_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_PREPROC_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ + ax_check_save_flags=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $4 $1" + AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + CPPFLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_PREPROC_FLAGS diff --git a/build-aux/m4/ax_cxx_compile_stdcxx.m4 b/build-aux/m4/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 0000000..f147cee --- /dev/null +++ b/build-aux/m4/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,568 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# 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 4 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [], + [$1], [14], [], + [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + m4_if([$4], [], [ax_cxx_compile_cxx$1_try_default=true], + [$4], [default], [ax_cxx_compile_cxx$1_try_default=true], + [$4], [nodefault], [ax_cxx_compile_cxx$1_try_default=false], + [m4_fatal([invalid fourth argument `$4' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + + m4_if([$4], [nodefault], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=gnu++$1 -std=gnu++0x; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_seperators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) 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 0000000..c788ca9 --- /dev/null +++ b/build-aux/m4/ax_gcc_func_attribute.m4 @@ -0,0 +1,223 @@ +# =========================================================================== +# 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 +# constructor_priority for constructor attribute with priority +# 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 3 + +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_priority], [ + int foo( void ) __attribute__((__constructor__(65535/2))); + ], + [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"))); + int foo_int( void ) __attribute__(($1("internal"))); + int foo_pro( void ) __attribute__(($1("protected"))); + ], + [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/build-aux/m4/ax_pthread.m4 b/build-aux/m4/ax_pthread.m4 new file mode 100644 index 0000000..4c4051e --- /dev/null +++ b/build-aux/m4/ax_pthread.m4 @@ -0,0 +1,485 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 23 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -mt,pthread) + AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 new file mode 100644 index 0000000..ea9c795 --- /dev/null +++ b/build-aux/m4/bitcoin_find_bdb48.m4 @@ -0,0 +1,78 @@ +dnl Copyright (c) 2013-2015 The Bitcoin Core developers +dnl Distributed under the MIT software license, see the accompanying +dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. + +AC_DEFUN([BITCOIN_FIND_BDB48],[ + AC_ARG_VAR(BDB_CFLAGS, [C compiler flags for BerkeleyDB, bypasses autodetection]) + AC_ARG_VAR(BDB_LIBS, [Linker flags for BerkeleyDB, bypasses autodetection]) + + if test "x$BDB_CFLAGS" = "x"; then + AC_MSG_CHECKING([for Berkeley DB C++ headers]) + BDB_CPPFLAGS= + bdbpath=X + bdb48path=X + bdbdirlist= + for _vn in 4.8 48 4 5 5.3 ''; do + for _pfx in b lib ''; do + bdbdirlist="$bdbdirlist ${_pfx}db${_vn}" + done + done + for searchpath in $bdbdirlist ''; do + test -n "${searchpath}" && searchpath="${searchpath}/" + 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_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]) + AC_MSG_ERROR([libdb_cxx headers missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) + elif test "x$bdb48path" = "xX"; then + BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx) + 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 or --disable-wallet to disable wallet functionality)]) + ]) + else + BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx) + bdbpath="${bdb48path}" + fi + else + BDB_CPPFLAGS=${BDB_CFLAGS} + fi + AC_SUBST(BDB_CPPFLAGS) + + if test "x$BDB_LIBS" = "x"; then + # TODO: Ideally this could find the library version and make sure it matches the headers being used + for searchlib in db_cxx-4.8 db_cxx db4_cxx; do + AC_CHECK_LIB([$searchlib],[main],[ + BDB_LIBS="-l${searchlib}" + break + ]) + done + if test "x$BDB_LIBS" = "x"; then + AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) + fi + fi + AC_SUBST(BDB_LIBS) +]) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 new file mode 100644 index 0000000..3954cb6 --- /dev/null +++ b/build-aux/m4/bitcoin_qt.m4 @@ -0,0 +1,530 @@ +dnl Copyright (c) 2013-2016 The Bitcoin Core developers +dnl Distributed under the MIT software license, see the accompanying +dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. + +dnl Helper for cases where a qt dependency is not met. +dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit. +AC_DEFUN([BITCOIN_QT_FAIL],[ + if test "x$bitcoin_qt_want_version" = xauto && test "x$bitcoin_qt_force" != xyes; then + if test "x$bitcoin_enable_qt" != xno; then + AC_MSG_WARN([$1; versess-qt frontend will not be built]) + fi + bitcoin_enable_qt=no + bitcoin_enable_qt_test=no + else + AC_MSG_ERROR([$1]) + fi +]) + +AC_DEFUN([BITCOIN_QT_CHECK],[ + if test "x$bitcoin_enable_qt" != xno && test "x$bitcoin_qt_want_version" != xno; then + true + $1 + else + true + $2 + fi +]) + +dnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing]) +dnl Helper for finding the path of programs needed for Qt. +dnl Inputs: $1: Variable to be set +dnl Inputs: $2: List of programs to search for +dnl Inputs: $3: Look for $2 here before $PATH +dnl Inputs: $4: If "yes", don't fail if $2 is not found. +dnl Output: $1 is set to the path of $2 if found. $2 are searched in order. +AC_DEFUN([BITCOIN_QT_PATH_PROGS],[ + BITCOIN_QT_CHECK([ + if test "x$3" != x; then + AC_PATH_PROGS($1,$2,,$3) + else + AC_PATH_PROGS($1,$2) + fi + if test "x$$1" = x && test "x$4" != xyes; then + BITCOIN_QT_FAIL([$1 not found]) + fi + ]) +]) + +dnl Initialize qt input. +dnl This must be called before any other BITCOIN_QT* macros to ensure that +dnl input variables are set correctly. +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@<:@=no|qt5|auto@:>@], + [build versess-qt GUI (default=auto)])], + [ + bitcoin_qt_want_version=$withval + if test "x$bitcoin_qt_want_version" = xyes; then + bitcoin_qt_force=yes + bitcoin_qt_want_version=auto + fi + ], + [bitcoin_qt_want_version=auto]) + + 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], + [AS_HELP_STRING([--with-qtdbus], + [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. +dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes. +dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be +dnl tried first. +dnl Outputs: See _BITCOIN_QT_FIND_LIBS_* +dnl Outputs: Sets variables for all qt-related tools. +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 + use_pkgconfig=yes + fi + + if test "x$use_pkgconfig" = xyes; then + BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG]) + else + BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG]) + fi + + dnl This is ugly and complicated. Yuck. Works as follows: + dnl For Qt5, we can check a header to find out whether Qt is build + dnl statically. When Qt is built statically, some plugins must be linked into + dnl the final binary as well. + dnl With Qt5, languages moved into core and the WindowsIntegration plugin was + dnl added. + 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 + TEMP_CXXFLAGS=$CXXFLAGS + CPPFLAGS="$QT_INCLUDES $CPPFLAGS" + CXXFLAGS="$PIC_FLAGS $CXXFLAGS" + _BITCOIN_QT_IS_STATIC + if test "x$bitcoin_cv_static_qt" = xyes; then + _BITCOIN_QT_FIND_STATIC_PLUGINS + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static]) + AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if QT_VERSION >= 0x050400 + choke + #endif + ]])], + [bitcoin_cv_need_acc_widget=yes], + [bitcoin_cv_need_acc_widget=no]) + ]) + if test "x$bitcoin_cv_need_acc_widget" = xyes; then + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets]) + fi + _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal]) + AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists]) + 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 + _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 + 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 + CPPFLAGS=$TEMP_CPPFLAGS + CXXFLAGS=$TEMP_CXXFLAGS + ]) + + if test "x$use_pkgconfig$qt_bin_path" = xyes; then + qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`" + fi + + if test "x$use_hardening" != xno; then + BITCOIN_QT_CHECK([ + AC_MSG_CHECKING(whether -fPIE can be used with this Qt config) + TEMP_CPPFLAGS=$CPPFLAGS + TEMP_CXXFLAGS=$CXXFLAGS + CPPFLAGS="$QT_INCLUDES $CPPFLAGS" + CXXFLAGS="$PIE_FLAGS $CXXFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if defined(QT_REDUCE_RELOCATIONS) + choke + #endif + ]])], + [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIE_FLAGS ], + [ AC_MSG_RESULT(no); QT_PIE_FLAGS=$PIC_FLAGS] + ) + CPPFLAGS=$TEMP_CPPFLAGS + CXXFLAGS=$TEMP_CXXFLAGS + ]) + else + BITCOIN_QT_CHECK([ + AC_MSG_CHECKING(whether -fPIC is needed with this Qt config) + TEMP_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$QT_INCLUDES $CPPFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if defined(QT_REDUCE_RELOCATIONS) + choke + #endif + ]])], + [ AC_MSG_RESULT(no)], + [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIC_FLAGS] + ) + CPPFLAGS=$TEMP_CPPFLAGS + ]) + fi + + BITCOIN_QT_PATH_PROGS([MOC], [moc-qt5 moc5 moc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([UIC], [uic-qt5 uic5 uic], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt5 rcc5 rcc], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease5 lrelease], $qt_bin_path) + BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes) + + MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' + case $host in + *darwin*) + BITCOIN_QT_CHECK([ + MOC_DEFS="${MOC_DEFS} -DQ_OS_MAC" + base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit" + AX_CHECK_LINK_FLAG([[$base_frameworks]],[QT_LIBS="$QT_LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)]) + ]) + ;; + *mingw*) + BITCOIN_QT_CHECK([ + AX_CHECK_LINK_FLAG([[-mwindows]],[QT_LDFLAGS="$QT_LDFLAGS -mwindows"],[AC_MSG_WARN(-mwindows linker support not detected)]) + ]) + esac + + + dnl enable qt support + AC_MSG_CHECKING(whether to build ]AC_PACKAGE_NAME[ GUI) + BITCOIN_QT_CHECK([ + bitcoin_enable_qt=yes + bitcoin_enable_qt_test=yes + if test "x$have_qt_test" = xno; then + bitcoin_enable_qt_test=no + fi + bitcoin_enable_qt_dbus=no + if test "x$use_dbus" != xno && test "x$have_qt_dbus" = xyes; then + bitcoin_enable_qt_dbus=yes + fi + 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 + AC_MSG_WARN([lupdate is required to update qt translations]) + fi + ],[ + bitcoin_enable_qt=no + ]) + AC_MSG_RESULT([$bitcoin_enable_qt (Qt5)]) + + AC_SUBST(QT_PIE_FLAGS) + AC_SUBST(QT_INCLUDES) + AC_SUBST(QT_LIBS) + AC_SUBST(QT_LDFLAGS) + AC_SUBST(QT_DBUS_INCLUDES) + AC_SUBST(QT_DBUS_LIBS) + AC_SUBST(QT_TEST_INCLUDES) + AC_SUBST(QT_TEST_LIBS) + AC_SUBST(QT_SELECT, qt5) + AC_SUBST(MOC_DEFS) +]) + +dnl All macros below are internal and should _not_ be used from the main +dnl configure.ac. +dnl ---- + +dnl Internal. Check if the included version of Qt is Qt5. +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_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if QT_VERSION < 0x050000 || QT_VERSION_MAJOR < 5 + choke + #endif + ]])], + [bitcoin_cv_qt5=yes], + [bitcoin_cv_qt5=no]) +])]) + +dnl Internal. Check if the included version of Qt is greater than Qt58. +dnl Requires: INCLUDES must be populated as necessary. +dnl Output: bitcoin_cv_qt5=yes|no +AC_DEFUN([_BITCOIN_QT_CHECK_QT58],[ + AC_CACHE_CHECK(for > Qt 5.7, bitcoin_cv_qt58,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if QT_VERSION_MINOR < 8 + choke + #endif + ]])], + [bitcoin_cv_qt58=yes], + [bitcoin_cv_qt58=no]) +])]) + + +dnl Internal. Check if the linked version of Qt was built as static libs. +dnl Requires: Qt5. +dnl Requires: INCLUDES and LIBS must be populated as necessary. +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_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION OR QT_VERSION_STR + # include + #endif + ]], + [[ + #if !defined(QT_STATIC) + choke + #endif + ]])], + [bitcoin_cv_static_qt=yes], + [bitcoin_cv_static_qt=no]) + ]) + if test "x$bitcoin_cv_static_qt" = xyes; then + AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins]) + fi +]) + +dnl Internal. Check if the link-requirements for static plugins are met. +dnl Requires: INCLUDES and LIBS must be populated as necessary. +dnl Inputs: $1: A series of Q_IMPORT_PLUGIN(). +dnl Inputs: $2: The libraries that resolve $1. +dnl Output: QT_LIBS is prepended or configure exits. +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_LINK_IFELSE([AC_LANG_PROGRAM([[ + #define QT_STATICPLUGIN + #include + $1]], + [[return 0;]])], + [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"], + [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)]) + LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" +]) + +dnl Internal. Find paths necessary for linking qt static plugins +dnl Inputs: qt_plugin_path. optional. +dnl Outputs: QT_LIBS is appended +AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[ + if test "x$qt_plugin_path" != x; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" + if test -d "$qt_plugin_path/accessible"; then + QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" + fi + if test "x$use_pkgconfig" = xyes; then + : dnl + m4_ifdef([PKG_CHECK_MODULES],[ + if test x$bitcoin_cv_qt58 = xno; then + PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"]) + else + PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport], [QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport], [QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport], [QT_LIBS="-lQt5ThemeSupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport], [QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport], [QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTFB], [Qt5FbSupport], [QT_LIBS="-lQt5FbSupport $QT_LIBS"]) + fi + if test "x$TARGET_OS" = xlinux; then + PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"]) + if ${PKG_CONFIG} --exists "Qt5Core >= 5.5" 2>/dev/null; then + PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"]) + fi + elif test "x$TARGET_OS" = xdarwin; then + PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport], [QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport], [QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"]) + PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport], [QT_LIBS="-lQt5CglSupport $QT_LIBS"]) + fi + ]) + else + if test "x$TARGET_OS" = xwindows; then + AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #ifndef QT_VERSION + # include + #endif + ]], + [[ + #if QT_VERSION < 0x050600 || QT_VERSION_MINOR < 6 + choke + #endif + ]])], + [bitcoin_cv_need_platformsupport=yes], + [bitcoin_cv_need_platformsupport=no]) + ]) + if test "x$bitcoin_cv_need_platformsupport" = xyes; then + if test x$bitcoin_cv_qt58 = xno; then + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXPlatformSupport not found))) + else + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FontDatabaseSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXFontDatabaseSupport not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}EventDispatcherSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXEventDispatcherSupport not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}ThemeSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXThemeSupport not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}FbSupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXFbSupport not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}DeviceDiscoverySupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXDeviceDiscoverySupport not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}AccessibilitySupport],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXAccessibilitySupport not found))) + QT_LIBS="$QT_LIBS -lversion -ldwmapi -luxtheme" + fi + fi + fi + fi + fi +]) + +dnl Internal. Find Qt libraries using pkg-config. +dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check +dnl first. +dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version +dnl first. +dnl Outputs: All necessary QT_* variables are set. +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],[ + QT_LIB_PREFIX=Qt5 + qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets" + BITCOIN_QT_CHECK([ + PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES="$QT5_CFLAGS"; QT_LIBS="$QT5_LIBS" have_qt=yes],[have_qt=no]) + + if test "x$have_qt" != xyes; then + have_qt=no + BITCOIN_QT_FAIL([Qt dependencies not found]) + fi + ]) + BITCOIN_QT_CHECK([ + PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no]) + if test "x$use_dbus" != xno; then + PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no]) + fi + ]) + ]) + true; dnl +]) + +dnl Internal. Find Qt libraries without using pkg-config. Version is deduced +dnl from the discovered headers. +dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use. +dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5. +dnl Outputs: All necessary QT_* variables are set. +dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. +AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[ + TEMP_CPPFLAGS="$CPPFLAGS" + TEMP_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$PIC_FLAGS $CXXFLAGS" + TEMP_LIBS="$LIBS" + BITCOIN_QT_CHECK([ + if test "x$qt_include_path" != x; then + QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus" + CPPFLAGS="$QT_INCLUDES $CPPFLAGS" + fi + ]) + + BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))]) + BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))]) + BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))]) + + BITCOIN_QT_CHECK([ + if test "x$bitcoin_qt_want_version" = xauto; then + _BITCOIN_QT_CHECK_QT5 + _BITCOIN_QT_CHECK_QT58 + fi + QT_LIB_PREFIX=Qt5 + ]) + + BITCOIN_QT_CHECK([ + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="$LIBS -L$qt_lib_path" + fi + + 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],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([jpeg_create_decompress] ,[qtjpeg jpeg],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in]))) + if test x$bitcoin_cv_qt58 = xno; then + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre16_exec], [qtpcre pcre16],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in]))) + else + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtlibpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in]))) + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre2_match_16], [qtpcre2 libqtpcre2],,AC_MSG_WARN([libqtpcre2 not found. Assuming qt has it built-in]))) + fi + BITCOIN_QT_CHECK(AC_SEARCH_LIBS([hb_ot_tags_from_script] ,[qtharfbuzzng qtharfbuzz harfbuzz],,AC_MSG_WARN([libharfbuzz not found. Assuming qt has it built-in or support is disabled]))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found))) + BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found))) + QT_LIBS="$LIBS" + LIBS="$TEMP_LIBS" + + BITCOIN_QT_CHECK([ + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="-L$qt_lib_path" + fi + AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no) + AC_CHECK_HEADER([QTest],, have_qt_test=no) + QT_TEST_LIBS="$LIBS" + if test "x$use_dbus" != xno; then + LIBS= + if test "x$qt_lib_path" != x; then + LIBS="-L$qt_lib_path" + fi + AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no) + AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no) + QT_DBUS_LIBS="$LIBS" + fi + ]) + CPPFLAGS="$TEMP_CPPFLAGS" + CXXFLAGS="$TEMP_CXXFLAGS" + LIBS="$TEMP_LIBS" +]) + diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 new file mode 100644 index 0000000..7841042 --- /dev/null +++ b/build-aux/m4/bitcoin_subdir_to_include.m4 @@ -0,0 +1,18 @@ +dnl Copyright (c) 2013-2014 The Bitcoin Core developers +dnl Distributed under the MIT software license, see the accompanying +dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. + +dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE]) +dnl SUBDIRECTORY-NAME must end with a path separator +AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ + if test "x$2" = "x"; then + AC_MSG_RESULT([default]) + else + echo "#include <$2$3.h>" >conftest.cpp + newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] + AC_MSG_RESULT([${newinclpath}]) + if test "x${newinclpath}" != "x"; then + eval "$1=\"\$$1\"' -I${newinclpath}'" + fi + fi +]) diff --git a/build-aux/m4/gmp.m4 b/build-aux/m4/gmp.m4 new file mode 100644 index 0000000..38c0ac1 --- /dev/null +++ b/build-aux/m4/gmp.m4 @@ -0,0 +1,16 @@ +dnl Copyright (c) 2018 The Versess Coin developers +dnl Distributed under the MIT software license, see the accompanying +dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. + +dnl +AC_DEFUN([GMP_CHECK],[ +if test x"$has_gmp" != x"yes"; then + AC_CHECK_HEADER(gmp.h,[ + AC_CHECK_LIB(gmp, __gmpz_init,[ + has_gmp=yes; + LIBS="$LIBS -lgmp"; + AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed]) + ]) + ]) +fi +]) diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4 new file mode 100644 index 0000000..75c43f9 --- /dev/null +++ b/build-aux/m4/l_atomic.m4 @@ -0,0 +1,46 @@ +dnl Copyright (c) 2015 Tim Kosse +dnl Copying and distribution of this file, with or without modification, are +dnl permitted in any medium without royalty provided the copyright notice +dnl and this notice are preserved. This file is offered as-is, without any +dnl warranty. + +# Some versions of gcc/libstdc++ require linking with -latomic if +# using the C++ atomic library. +# +# Sourced from http://bugs.debian.org/797228 + +m4_define([_CHECK_ATOMIC_testbody], [[ + #include + #include + + int main() { + std::atomic a{}; + + int64_t v = 5; + int64_t r = a.fetch_add(v); + return static_cast(r); + } +]]) + +AC_DEFUN([CHECK_ATOMIC], [ + + AC_LANG_PUSH(C++) + + AC_MSG_CHECKING([whether std::atomic can be used without link library]) + + AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + LIBS="$LIBS -latomic" + AC_MSG_CHECKING([whether std::atomic needs -latomic]) + AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_FAILURE([cannot figure out how to use std::atomic]) + ]) + ]) + + AC_LANG_POP +]) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..b339bb7 --- /dev/null +++ b/configure.ac @@ -0,0 +1,1497 @@ +dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) +AC_PREREQ([2.60]) +define(_CLIENT_VERSION_MAJOR, 1) +define(_CLIENT_VERSION_MINOR, 0) +define(_CLIENT_VERSION_REVISION, 0) +define(_CLIENT_VERSION_BUILD, 0) +define(_CLIENT_VERSION_IS_RELEASE, true) +define(_COPYRIGHT_YEAR, 2019) +AC_INIT([Versess Coin],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.versess.org],[versess]) +AC_CONFIG_SRCDIR([src/main.cpp]) +AC_CONFIG_HEADERS([src/config/versess-config.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([build-aux/m4]) + +BITCOIN_DAEMON_NAME=versessd +BITCOIN_GUI_NAME=versess-qt +BITCOIN_CLI_NAME=versess-cli +BITCOIN_TX_NAME=versess-tx + +dnl Unless the user specified ARFLAGS, force it to be cr +AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to if not set]) +if test "x${ARFLAGS+set}" != "xset"; then + ARFLAGS="cr" +fi + +AC_CANONICAL_HOST + +AH_TOP([#ifndef VERS_CONFIG_H]) +AH_TOP([#define VERS_CONFIG_H]) +AH_BOTTOM([#endif //VERS_CONFIG_H]) + +dnl faketime breaks configure and is only needed for make. Disable it here. +unset FAKETIME + +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. +dnl --disable-maintainer-mode can be used to bypass this. +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 + +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 Require C++11 compiler (no GNU extensions) +AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault]) +dnl Check if -latomic is required for +CHECK_ATOMIC + +dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures +dnl that we get the same -std flags for both. +m4_ifdef([AC_PROG_OBJCXX],[ +if test "x${OBJCXX+set}" = "x"; then + OBJCXX="${CXX}" +fi +AC_PROG_OBJCXX +]) + +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) +dnl Python 3.5 is specified in .python-version and should be used if available, see doc/dependencies.md +AC_PATH_PROGS([PYTHON], [python3.5 python3.6 python3.7 python3.8 python3 python]) +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) +AC_PATH_TOOL(READELF, readelf) +AC_PATH_TOOL(CPPFILT, c++filt) +AC_PATH_TOOL(OBJCOPY, objcopy) +AC_PATH_PROG(DOXYGEN, doxygen) +if test -z "$DOXYGEN"; then + AC_MSG_WARN([Doxygen not found]) +fi +AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) + +AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files) + +# Enable wallet +AC_ARG_ENABLE([wallet], + [AS_HELP_STRING([--disable-wallet], + [disable wallet (enabled by default)])], + [enable_wallet=$enableval], + [enable_wallet=yes]) + +AC_ARG_WITH([miniupnpc], + [AS_HELP_STRING([--with-miniupnpc], + [enable UPNP (default is yes if libminiupnpc is found)])], + [use_upnp=$withval], + [use_upnp=auto]) + +AC_ARG_ENABLE([upnp-default], + [AS_HELP_STRING([--enable-upnp-default], + [if UPNP is enabled, turn it on at startup (default is no)])], + [use_upnp_default=$enableval], + [use_upnp_default=no]) + +AC_ARG_ENABLE(tests, + AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]), + [use_tests=$enableval], + [use_tests=yes]) + +AC_ARG_ENABLE(gui-tests, + AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]), + [use_gui_tests=$enableval], + [use_gui_tests=$use_tests]) + +AC_ARG_ENABLE(bench, + AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]), + [use_bench=$enableval], + [use_bench=no]) + +AC_ARG_ENABLE([extended-functional-tests], + AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]), + [use_extended_functional_tests=$enableval], + [use_extended_functional_tests=no]) + +AC_ARG_WITH([qrencode], + [AS_HELP_STRING([--with-qrencode], + [enable QR code support (default is yes if qt is enabled and libqrencode is found)])], + [use_qr=$withval], + [use_qr=auto]) + +AC_ARG_ENABLE([hardening], + [AS_HELP_STRING([--disable-hardening], + [do not attempt to harden the resulting executables (default is to harden when possible)])], + [use_hardening=$enableval], + [use_hardening=auto]) + +AC_ARG_ENABLE([reduce-exports], + [AS_HELP_STRING([--enable-reduce-exports], + [attempt to reduce exported symbols in the resulting executables (default is no)])], + [use_reduce_exports=$enableval], + [use_reduce_exports=no]) + +AC_ARG_ENABLE([ccache], + [AS_HELP_STRING([--disable-ccache], + [do not use ccache for building (default is to use if found)])], + [use_ccache=$enableval], + [use_ccache=auto]) + +AC_ARG_ENABLE([lcov], + [AS_HELP_STRING([--enable-lcov], + [enable lcov testing (default is no)])], + [use_lcov=$enableval], + [use_lcov=no]) + +AC_ARG_ENABLE([lcov-branch-coverage], + [AS_HELP_STRING([--enable-lcov-branch-coverage], + [enable lcov testing branch coverage (default is no)])], + [use_lcov_branch=yes], + [use_lcov_branch=no]) + +AC_ARG_ENABLE([glibc-back-compat], + [AS_HELP_STRING([--enable-glibc-back-compat], + [enable backwards compatibility with glibc])], + [use_glibc_compat=$enableval], + [use_glibc_compat=no]) + +AC_ARG_ENABLE([asm], + [AS_HELP_STRING([--enable-asm], + [Enable assembly routines (default is yes)])], + [use_asm=$enableval], + [use_asm=yes]) + +if test "x$use_asm" = xyes; then + AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines]) +fi + +AC_ARG_WITH([system-univalue], + [AS_HELP_STRING([--with-system-univalue], + [Build with system UniValue (default is no)])], + [system_univalue=$withval], + [system_univalue=no] +) +AC_ARG_ENABLE([zmq], + [AS_HELP_STRING([--disable-zmq], + [disable ZMQ notifications])], + [use_zmq=$enableval], + [use_zmq=yes]) + +AC_ARG_WITH([zerocoin-bignum], + [AS_HELP_STRING([--with-zerocoin-bignum=gmp|openssl|auto], + [Specify Bignum Implementation. Default is auto])], + [req_bignum=$withval], + [req_bignum=auto]) + +AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], []) + +AC_ARG_ENABLE(man, + [AS_HELP_STRING([--disable-man], + [do not install man pages (default is to install)])],, + enable_man=yes) +AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no) + +# Enable debug +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [use debug compiler flags and macros (default is no)])], + [enable_debug=$enableval], + [enable_debug=no]) + +# Enable different -fsanitize options +AC_ARG_WITH([sanitizers], + [AS_HELP_STRING([--with-sanitizers], + [comma separated list of extra sanitizers to build with (default is none enabled)])], + [use_sanitizers=$withval]) + +# Enable gprof profiling +AC_ARG_ENABLE([gprof], + [AS_HELP_STRING([--enable-gprof], + [use gprof profiling compiler flags (default is no)])], + [enable_gprof=$enableval], + [enable_gprof=no]) + +# Turn warnings into errors +AC_ARG_ENABLE([werror], + [AS_HELP_STRING([--enable-werror], + [Treat certain compiler warnings as errors (default is no)])], + [enable_werror=$enableval], + [enable_werror=no]) + +AC_LANG_PUSH([C++]) +AX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR="-Werror"],[CXXFLAG_WERROR=""]) + +if test "x$enable_debug" = xyes; then + # Clear default -g -O2 flags + if test "x$CXXFLAGS_overridden" = xno; then + CXXFLAGS="" + fi + # Prefer -Og, fall back to -O0 if that is unavailable. + AX_CHECK_COMPILE_FLAG( + [-Og], + [[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -Og"]], + [AX_CHECK_COMPILE_FLAG([-O0],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"]],,[[$CXXFLAG_WERROR]])], + [[$CXXFLAG_WERROR]]) + + # Prefer -g3, fall back to -g if that is unavailable. + AX_CHECK_COMPILE_FLAG( + [-g3], + [[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g3"]], + [AX_CHECK_COMPILE_FLAG([-g],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g"]],,[[$CXXFLAG_WERROR]])], + [[$CXXFLAG_WERROR]]) + + AX_CHECK_PREPROC_FLAG([-DDEBUG],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"]],,[[$CXXFLAG_WERROR]]) + AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"]],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-ftrapv],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"],,[[$CXXFLAG_WERROR]]) +fi + +if test x$use_sanitizers != x; then + # First check if the compiler accepts flags. If an incompatible pair like + # -fsanitize=address,thread is used here, this check will fail. This will also + # fail if a bad argument is passed, e.g. -fsanitize=undfeined + AX_CHECK_COMPILE_FLAG( + [[-fsanitize=$use_sanitizers]], + [[SANITIZER_CXXFLAGS=-fsanitize=$use_sanitizers]], + [AC_MSG_ERROR([compiler did not accept requested flags])]) + + # Some compilers (e.g. GCC) require additional libraries like libasan, + # libtsan, libubsan, etc. Make sure linking still works with the sanitize + # flag. This is a separate check so we can give a better error message when + # the sanitize flags are supported by the compiler but the actual sanitizer + # libs are missing. + AX_CHECK_LINK_FLAG( + [[-fsanitize=$use_sanitizers]], + [[SANITIZER_LDFLAGS=-fsanitize=$use_sanitizers]], + [AC_MSG_ERROR([linker did not accept requested flags, you are missing required libraries])]) +fi + +ERROR_CXXFLAGS= +if test "x$enable_werror" = "xyes"; then + if test "x$CXXFLAG_WERROR" = "x"; then + AC_MSG_ERROR("enable-werror set but -Werror is not usable") + fi + AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Werror=thread-safety-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=thread-safety-analysis"],,[[$CXXFLAG_WERROR]]) +fi + +if test "x$CXXFLAGS_overridden" = "xno"; then + AX_CHECK_COMPILE_FLAG([-Wall],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wextra],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wformat],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wvla],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety-analysis"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"],,[[$CXXFLAG_WERROR]]) + + ## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all + ## unknown options if any other warning is produced. Test the -Wfoo case, and + ## set the -Wno-foo case if it works. + AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]]) +fi + +# Check for optional instruction set support. Enabling these does _not_ imply that all code will +# be compiled with them, rather that specific objects/libs may use them after checking for runtime +# compatibility. +AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]]) +AX_CHECK_COMPILE_FLAG([-msse4.1],[[SSE41_CXXFLAGS="-msse4.1"]],,[[$CXXFLAG_WERROR]]) +AX_CHECK_COMPILE_FLAG([-mavx -mavx2],[[AVX2_CXXFLAGS="-mavx -mavx2"]],,[[$CXXFLAG_WERROR]]) +AX_CHECK_COMPILE_FLAG([-msse4 -msha],[[SHANI_CXXFLAGS="-msse4 -msha"]],,[[$CXXFLAG_WERROR]]) + +TEMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS" +AC_MSG_CHECKING(for assembler crc32 support) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #if defined(_MSC_VER) + #include + #elif defined(__GNUC__) && defined(__SSE4_2__) + #include + #endif + ]],[[ + uint64_t l = 0; + l = _mm_crc32_u8(l, 0); + l = _mm_crc32_u32(l, 0); + l = _mm_crc32_u64(l, 0); + return l; + ]])], + [ AC_MSG_RESULT(yes); enable_hwcrc32=yes], + [ AC_MSG_RESULT(no)] +) +CXXFLAGS="$TEMP_CXXFLAGS" + +TEMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $SSE41_CXXFLAGS" +AC_MSG_CHECKING(for SSE4.1 intrinsics) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]],[[ + __m128i l = _mm_set1_epi32(0); + return _mm_extract_epi32(l, 3); + ]])], + [ AC_MSG_RESULT(yes); enable_sse41=yes; AC_DEFINE(ENABLE_SSE41, 1, [Define this symbol to build code that uses SSE4.1 intrinsics]) ], + [ AC_MSG_RESULT(no)] +) +CXXFLAGS="$TEMP_CXXFLAGS" + +TEMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $AVX2_CXXFLAGS" +AC_MSG_CHECKING(for AVX2 intrinsics) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]],[[ + __m256i l = _mm256_set1_epi32(0); + return _mm256_extract_epi32(l, 7); + ]])], + [ AC_MSG_RESULT(yes); enable_avx2=yes; AC_DEFINE(ENABLE_AVX2, 1, [Define this symbol to build code that uses AVX2 intrinsics]) ], + [ AC_MSG_RESULT(no)] +) +CXXFLAGS="$TEMP_CXXFLAGS" + +TEMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $SHANI_CXXFLAGS" +AC_MSG_CHECKING(for SHA-NI intrinsics) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]],[[ + __m128i i = _mm_set1_epi32(0); + __m128i j = _mm_set1_epi32(1); + __m128i k = _mm_set1_epi32(2); + return _mm_extract_epi32(_mm_sha256rnds2_epu32(i, i, k), 0); + ]])], + [ AC_MSG_RESULT(yes); enable_shani=yes; AC_DEFINE(ENABLE_SHANI, 1, [Define this symbol to build code that uses SHA-NI intrinsics]) ], + [ AC_MSG_RESULT(no)] +) +CXXFLAGS="$TEMP_CXXFLAGS" + +CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" + +AC_ARG_WITH([utils], + [AS_HELP_STRING([--with-utils], + [build versess-cli versess-tx (default=yes)])], + [build_bitcoin_utils=$withval], + [build_bitcoin_utils=yes]) + +AC_ARG_WITH([libs], + [AS_HELP_STRING([--with-libs], + [build libraries (default=no)])], + [build_bitcoin_libs=$withval], + [build_bitcoin_libs=no]) + +AC_ARG_WITH([daemon], + [AS_HELP_STRING([--with-daemon], + [build versessd daemon (default=yes)])], + [build_bitcoind=$withval], + [build_bitcoind=yes]) + +use_pkgconfig=yes +case $host in + *mingw*) + + #pkgconfig does more harm than good with MinGW + use_pkgconfig=no + + TARGET_OS=windows + AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(libmingwthrd missing)) + AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(libkernel32 missing)) + AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing)) + AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(libgdi32 missing)) + AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(libcomdlg32 missing)) + AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(libwinspool missing)) + AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(libwinmm missing)) + AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(libshell32 missing)) + AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(libcomctl32 missing)) + AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(libole32 missing)) + AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(liboleaut32 missing)) + AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(libuuid missing)) + AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(librpcrt4 missing)) + AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(libadvapi32 missing)) + AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(libws2_32 missing)) + AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(libmswsock missing)) + AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(libshlwapi missing)) + AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(libiphlpapi missing)) + AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(libcrypt32 missing)) + + # -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 + AC_MSG_WARN("makensis not found. Cannot create installer.") + fi + + AC_PATH_TOOL(WINDRES, windres, none) + if test x$WINDRES = xnone; then + AC_MSG_ERROR("windres not found") + fi + + CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB" + LEVELDB_TARGET_FLAGS="-DOS_WINDOWS" + if test "x$CXXFLAGS_overridden" = "xno"; then + CXXFLAGS="$CXXFLAGS -w" + fi + case $host in + i?86-*) WINDOWS_BITS=32 ;; + x86_64-*) WINDOWS_BITS=64 ;; + *) 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 + LEVELDB_TARGET_FLAGS="-DOS_MACOSX" + if test x$cross_compiling != xyes; then + BUILD_OS=darwin + AC_CHECK_PROG([PORT],port, port) + if test x$PORT = xport; then + dnl add default macports paths + 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_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) + AC_CHECK_PROG([BREW],brew, brew) + if test x$BREW = xbrew; then + 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 + dnl the user (--without-wallet or --without-gui for example). + + openssl_prefix=`$BREW --prefix openssl 2>/dev/null` + bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null` + qt5_prefix=`$BREW --prefix qt5 2>/dev/null` + if test x$openssl_prefix != x; then + 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 + PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" + export PKG_CONFIG_PATH + fi + fi + else + case $build_os in + *darwin*) + BUILD_OS=darwin + ;; + *) + AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) + AC_PATH_TOOL([OTOOL], [otool], otool) + AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) + AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert) + AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp) + + 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" + OBJCXXFLAGS="$CXXFLAGS" + ;; + *android*) + dnl make sure android stays above linux for hosts like *linux-android* + LEVELDB_TARGET_FLAGS="-DOS_ANDROID" + ;; + *linux*) + TARGET_OS=linux + LEVELDB_TARGET_FLAGS="-DOS_LINUX" + ;; + *kfreebsd*) + LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD" + ;; + *freebsd*) + LEVELDB_TARGET_FLAGS="-DOS_FREEBSD" + ;; + *openbsd*) + LEVELDB_TARGET_FLAGS="-DOS_OPENBSD" + ;; + *netbsd*) + LEVELDB_TARGET_FLAGS="-DOS_NETBSD" + ;; + *dragonfly*) + LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD" + ;; + *solaris*) + LEVELDB_TARGET_FLAGS="-DOS_SOLARIS" + ;; + *hpux*) + LEVELDB_TARGET_FLAGS="-DOS_HPUX" + ;; + *) + AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.) + ;; +esac + +if test x$use_pkgconfig = xyes; then + m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)]) + m4_ifdef([PKG_PROG_PKG_CONFIG], [ + PKG_PROG_PKG_CONFIG + if test x"$PKG_CONFIG" = "x"; then + AC_MSG_ERROR(pkg-config not found.) + fi + ]) +fi + +if test x$use_extended_functional_tests != xno; then + AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended) +fi + +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 + AC_MSG_ERROR("lcov testing requested but gcov not found") + fi + if test x$PYTHON = x; then + AC_MSG_ERROR("lcov testing requested but python not found") + fi + if test x$GENHTML = x; then + AC_MSG_ERROR("lcov testing requested but genhtml not found") + fi + LCOV="$LCOV --gcov-tool=$GCOV" + AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"], + [AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")]) + AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"], + [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")]) + AC_DEFINE(USE_COVERAGE, 1, [Define this symbol if coverage is enabled]) + CXXFLAGS="$CXXFLAGS -Og" +fi + +if test x$use_lcov_branch != xno; then + AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1") +fi + +dnl Check for endianness +AC_C_BIGENDIAN + +dnl Check for pthread compile/link requirements +AX_PTHREAD + +# The following macro will add the necessary defines to versess-config.h, but +# they also need to be passed down to any subprojects. Pull the results out of +# the cache and add them to CPPFLAGS. +AC_SYS_LARGEFILE +# detect POSIX or GNU variant of strerror_r +AC_FUNC_STRERROR_R + +if test x$ac_cv_sys_file_offset_bits != x && + test x$ac_cv_sys_file_offset_bits != xno && + test x$ac_cv_sys_file_offset_bits != xunknown; then + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" +fi + +if test x$ac_cv_sys_large_files != x && + test x$ac_cv_sys_large_files != xno && + test x$ac_cv_sys_large_files != xunknown; then + CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files" +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 + + #glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link + #in anyway for back-compat. + AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing)) + + #__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_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);]],[[]])], + [ fdelt_type="long unsigned int"], + [ fdelt_type="long int"]) + AC_MSG_RESULT($fdelt_type) + AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk]) + AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"]) + AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"]) +else + AC_SEARCH_LIBS([clock_gettime],[rt]) +fi + +if test "x$enable_gprof" = xyes; then + dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense, + dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force + dnl -pie by default, in which case it needs to be turned off with -no-pie. + + if test x$use_hardening = xyes; then + AC_MSG_ERROR(gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof) + fi + use_hardening=no + AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"], + [AC_MSG_ERROR(gprof profiling requested but not available)], [[$CXXFLAG_WERROR]]) + + AX_CHECK_LINK_FLAG([[-no-pie]], [GPROF_LDFLAGS="-no-pie"]) + AX_CHECK_LINK_FLAG([[-pg]],[GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"], + [AC_MSG_ERROR(gprof profiling requested but not available)], [[$GPROF_LDFLAGS]]) +fi + +if test x$TARGET_OS != xwindows; then + # All windows code is PIC, forcing it on just adds useless compile warnings + AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"]) +fi + +if test x$use_hardening != xno; then + use_hardening=yes + AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) + AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) + + AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ + AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ + HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" + ]) + HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2" + ]) + + AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"]) + AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"]) + AX_CHECK_LINK_FLAG([[-Wl,--high-entropy-va]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"]) + 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"]) + AX_CHECK_LINK_FLAG([[-fPIE -pie]], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"],, [[$CXXFLAG_WERROR]]) + + case $host in + *mingw*) + AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(libssp missing)) + ;; + esac +fi + +dnl this flag screws up non-darwin gcc even when the check fails. special-case it. +if test x$TARGET_OS = xdarwin; then + AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"]) +fi + +AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h]) + +AC_CHECK_DECLS([strnlen]) + +# Check for daemon(3), unrelated to --with-daemon (although used by it) +AC_CHECK_DECLS([daemon]) + +AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,, + [#if HAVE_ENDIAN_H + #include + #elif HAVE_SYS_ENDIAN_H + #include + #endif]) + +AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,, + [#if HAVE_BYTESWAP_H + #include + #endif]) + +AC_CHECK_DECLS([__builtin_clz, __builtin_clzl, __builtin_clzll]) + +dnl Check for malloc_info (for memory statistics information in getmemoryinfo) +AC_MSG_CHECKING(for getmemoryinfo) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ int f = malloc_info(0, NULL); ]])], + [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOC_INFO, 1,[Define this symbol if you have malloc_info]) ], + [ AC_MSG_RESULT(no)] +) + +dnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas) +AC_MSG_CHECKING(for mallopt M_ARENA_MAX) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ mallopt(M_ARENA_MAX, 1); ]])], + [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOPT_ARENA_MAX, 1,[Define this symbol if you have mallopt with M_ARENA_MAX]) ], + [ AC_MSG_RESULT(no)] +) + +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-reduce-exports.]) + fi + ] +) + +TEMP_LDFLAGS="$LDFLAGS" +LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" +AC_MSG_CHECKING([for thread_local support]) +AC_LINK_IFELSE([AC_LANG_SOURCE([ + #include + static thread_local int foo = 0; + static void run_thread() { foo++;} + int main(){ + for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();} + return foo; + } + ])], + [ + AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.]) + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ] +) +LDFLAGS="$TEMP_LDFLAGS" + +# Check for reduced exports +if test x$use_reduce_exports = xyes; then + AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], + [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])]) +fi + +LEVELDB_CPPFLAGS= +LIBLEVELDB= +LIBMEMENV= +AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) +AC_SUBST(LEVELDB_CPPFLAGS) +AC_SUBST(LIBLEVELDB) +AC_SUBST(LIBMEMENV) + +if test x$enable_wallet != xno; then + dnl Check for libdb_cxx only if wallet enabled + BITCOIN_FIND_BDB48 +fi + +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], [upnpDiscover], [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]) + +if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then + use_boost=no +else + use_boost=yes +fi + +if test x$use_boost = xyes; then + +dnl Minimum required Boost version +define(MINIMUM_REQUIRED_BOOST, 1.47.0) + +dnl Check for boost libs +AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST]) +if test x$want_boost = xno; then + AC_MSG_ERROR([[only libbitcoinconsensus can be built without boost]]) +fi +AX_BOOST_SYSTEM +AX_BOOST_FILESYSTEM +AX_BOOST_PROGRAM_OPTIONS +AX_BOOST_THREAD +AX_BOOST_CHRONO + +dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic +dnl counter implementations. In 1.63 and later the std::atomic approach is default. +m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro +BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS" + +if test x$use_reduce_exports = xyes; 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) + ],[ + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.]) + ]) + CPPFLAGS="$TEMP_CPPFLAGS" +fi +fi + +if test x$use_reduce_exports = xyes; 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 + AC_MSG_ERROR(hexdump is required for tests) + fi + + + if test x$use_boost = xyes; then + + AX_BOOST_UNIT_TEST_FRAMEWORK + + dnl Determine if -DBOOST_TEST_DYN_LINK is needed + AC_MSG_CHECKING([for dynamic linked boost test]) + TEMP_LIBS="$LIBS" + LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB" + TEMP_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define BOOST_TEST_DYN_LINK + #define BOOST_TEST_MAIN + #include + + ])], + [AC_MSG_RESULT(yes)] + [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"], + [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_CHRONO_LIB" + + +dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums +dnl using c++98 constructs. Unfortunately, this implementation detail leaked into +dnl the abi. This was fixed in 1.57. + +dnl When building against that installed version using c++11, the headers pick up +dnl on the native c++11 scoped enum support and enable it, however it will fail to +dnl link. This can be worked around by disabling c++11 scoped enums if linking will +dnl fail. +dnl BOOST_NO_SCOPED_ENUMS was changed to BOOST_NO_CXX11_SCOPED_ENUMS in 1.51. + +TEMP_LIBS="$LIBS" +LIBS="$BOOST_LIBS $LIBS" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +AC_MSG_CHECKING([for mismatched boost c++11 scoped enums]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #if !defined(BOOST_NO_SCOPED_ENUMS) && !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && BOOST_VERSION < 105700 + #define BOOST_NO_SCOPED_ENUMS + #define BOOST_NO_CXX11_SCOPED_ENUMS + #define CHECK + #endif + #include + ]],[[ + #if defined(CHECK) + boost::filesystem::copy_file("foo", "bar"); + #else + choke; + #endif + ]])], + [AC_MSG_RESULT(mismatched); BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS"], [AC_MSG_RESULT(ok)]) +LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_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 +dnl a working version is available, else fall back to sleep. sleep was removed +dnl after 1.56. +dnl If neither is available, abort. +TEMP_LIBS="$LIBS" +LIBS="$BOOST_LIBS $LIBS" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +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; + AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], + [boost_sleep=no]) +LIBS="$TEMP_LIBS" +CPPFLAGS="$TEMP_CPPFLAGS" + +if test x$boost_sleep != xyes; then +TEMP_LIBS="$LIBS" +LIBS="$BOOST_LIBS $LIBS" +TEMP_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +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" +CPPFLAGS="$TEMP_CPPFLAGS" +fi + +if test x$boost_sleep != xyes; then + AC_MSG_ERROR(No working boost sleep implementation found.) +fi + +fi + +if test x$use_pkgconfig = xyes; then + : dnl + m4_ifdef( + [PKG_CHECK_MODULES], + [ + 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])]) + fi + if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then + PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)]) + if test x$TARGET_OS != xwindows; then + PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)]) + fi + fi + + if test "x$use_zmq" = "xyes"; then + PKG_CHECK_MODULES([ZMQ],[libzmq >= 4], + [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])], + [AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions]) + AC_MSG_WARN([libzmq version 4.x or greater not found, disabling]) + use_zmq=no]) + else + AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions]) + fi + ] + ) +else + AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers 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],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing)) + + if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then + AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),) + AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing)) + if test x$TARGET_OS != xwindows; then + AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing)) + fi + fi + + if test "x$use_zmq" = "xyes"; then + AC_CHECK_HEADER([zmq.h], + [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])], + [AC_MSG_WARN([zmq.h not found, disabling zmq support]) + use_zmq=no + AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])]) + AC_CHECK_LIB([zmq],[zmq_ctx_shutdown],ZMQ_LIBS=-lzmq, + [AC_MSG_WARN([libzmq >= 4.0 not found, disabling zmq support]) + use_zmq=no + AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])]) + else + AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions]) + fi + + if test "x$use_zmq" = "xyes"; then + dnl Assume libzmq was built for static linking + case $host in + *mingw*) + ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC" + ;; + esac + fi + + 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],[QR_LIBS=-lqrencode], [have_qrencode=no])]) + BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)]) + fi +fi + +save_CXXFLAGS="${CXXFLAGS}" +CXXFLAGS="${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}" +AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT +#include +]) +CXXFLAGS="${save_CXXFLAGS}" + +AC_CHECK_LIB([crypto],[RAND_egd],[],[ + AC_ARG_WITH([unsupported-ssl], + [AS_HELP_STRING([--with-unsupported-ssl],[Build with system SSL (default is no; DANGEROUS; NOT SUPPORTED; You should use OpenSSL 1.0)])], + [AC_MSG_WARN([Detected unsupported SSL version: This is NOT supported, and may break consensus compatibility!])], + [AC_MSG_ERROR([Detected unsupported SSL version: This is NOT supported, and may break consensus compatibility!])] + ) +]) + +dnl univalue check + +need_bundled_univalue=yes + +if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then + need_bundled_univalue=no +else + +if test x$system_univalue != xno ; then + found_univalue=no + if test x$use_pkgconfig = xyes; then + : #NOP + m4_ifdef( + [PKG_CHECK_MODULES], + [ + PKG_CHECK_MODULES([UNIVALUE],[libunivalue >= 1.0.4],[found_univalue=yes],[true]) + ] + ) + else + AC_CHECK_HEADER([univalue.h],[ + AC_CHECK_LIB([univalue], [main],[ + UNIVALUE_LIBS=-lunivalue + found_univalue=yes + ],[true]) + ],[true]) + fi + + if test x$found_univalue = xyes ; then + system_univalue=yes + need_bundled_univalue=no + elif test x$system_univalue = xyes ; then + AC_MSG_ERROR([univalue not found]) + else + system_univalue=no + fi +fi + +if test x$need_bundled_univalue = xyes ; then + UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include' + UNIVALUE_LIBS='univalue/libunivalue.la' +fi + +fi + +AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes]) +AC_SUBST(UNIVALUE_CFLAGS) +AC_SUBST(UNIVALUE_LIBS) + +BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path) + +AC_MSG_CHECKING([whether to build versessd]) +AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) +AC_MSG_RESULT($build_bitcoind) + +AC_MSG_CHECKING([whether to build utils (versess-cli versess-tx)]) +AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) +AC_MSG_RESULT($build_bitcoin_utils) + +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]) + AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in]) +fi +AC_MSG_RESULT($build_bitcoin_libs) + +AC_LANG_POP + +if test "x$use_ccache" != "xno"; then + AC_MSG_CHECKING(if ccache should be used) + if test x$CCACHE = x; then + if test "x$use_ccache" = "xyes"; then + AC_MSG_ERROR([ccache not found.]); + else + use_ccache=no + fi + else + use_ccache=yes + CC="$ac_cv_path_CCACHE $CC" + CXX="$ac_cv_path_CCACHE $CXX" + 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 bignum value +set_bignum=$req_bignum +case $req_bignum in +auto) + GMP_CHECK + if test x"$has_gmp" != x"yes"; then + AC_MSG_ERROR([gmp bignum automatically selected but libgmp is not available. Use depends, + install libgmp or select an other bignum implementation (ONLY gmp is fully SUPPORTED)]) + else + set_bignum=gmp + fi + ;; +gmp) + GMP_CHECK + if test x"$has_gmp" != x"yes"; then + AC_MSG_ERROR([gmp bignum explicitly requested but libgmp is not available]) + fi + ;; +openssl) + AC_MSG_WARN([openssl bignum explicitly requested. This is DEPRECATED.]) + ;; +*) + AC_MSG_ERROR([invalid bignum implementation selection]) + ;; +esac + +dnl enable wallet +AC_MSG_CHECKING([if wallet should be enabled]) +if test x$enable_wallet != xno; then + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions]) + +else + AC_MSG_RESULT(no) +fi + +dnl enable upnp support +AC_MSG_CHECKING([whether to build with support for UPnP]) +if test x$have_miniupnpc = xno; then + if test x$use_upnp = xyes; then + AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc") + fi + AC_MSG_RESULT(no) +else + if test x$use_upnp != xno; then + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([whether to build with UPnP enabled by default]) + use_upnp=yes + upnp_setting=0 + if test x$use_upnp_default != xno; then + use_upnp_default=yes + upnp_setting=1 + fi + 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 + MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB" + fi + else + AC_MSG_RESULT(no) + fi +fi + +dnl these are only used when qt is enabled +BUILD_TEST_QT="" +if test x$bitcoin_enable_qt != xno; then + dnl enable dbus support + AC_MSG_CHECKING([whether to build GUI with support for D-Bus]) + if test x$bitcoin_enable_qt_dbus != xno; then + AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in]) + fi + AC_MSG_RESULT($bitcoin_enable_qt_dbus) + + 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 + AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode") + fi + AC_MSG_RESULT(no) + else + if test x$use_qr != xno; then + AC_MSG_RESULT(yes) + AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in]) + use_qr=yes + else + AC_MSG_RESULT(no) + fi + fi + + if test x$XGETTEXT = x; then + AC_MSG_WARN("xgettext is required to update qt translations") + fi + + AC_MSG_CHECKING([whether to build test_versess-qt]) + if test x$use_gui_tests$bitcoin_enable_qt_test = xyesyes; then + AC_MSG_RESULT([yes]) + BUILD_TEST_QT="yes" + else + AC_MSG_RESULT([no]) + fi +fi + +AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"]) + +# select bignum implementation +case $set_bignum in +gmp) + AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation]) + ;; +openssl) + AC_DEFINE(USE_NUM_OPENSSL, 1, [Define this symbol to use openssl implementation]) + ;; +*) + AC_MSG_ERROR([invalid bignum implementation]) + ;; +esac + +AM_CONDITIONAL([USE_NUM_GMP], [test "x$set_bignum" = "xgmp"]) +AM_CONDITIONAL([USE_NUM_OPENSSL], [test "x$set_bignum" = "xopenssl"]) + +AC_MSG_CHECKING([whether to build test_versess]) +if test x$use_tests = xyes; then + AC_MSG_RESULT([yes]) + BUILD_TEST="yes" +else + AC_MSG_RESULT([no]) + BUILD_TEST="" +fi + +AC_MSG_CHECKING([whether to reduce exports]) +if test x$use_reduce_exports = xyes; 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_bench$use_tests = xnononononono; then + AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench 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_TESTS],[test x$BUILD_TEST = xno]) +AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes]) +AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes]) +AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes]) +AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) +AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes]) +AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) +AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes]) +AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes]) +AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes]) +AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes]) +AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes]) +AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes]) + +AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version]) +AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version]) +AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision]) +AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build]) +AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release]) +AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release]) +AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR) +AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR) +AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION) +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(BITCOIN_DAEMON_NAME) +AC_SUBST(BITCOIN_GUI_NAME) +AC_SUBST(BITCOIN_CLI_NAME) +AC_SUBST(BITCOIN_TX_NAME) + +AC_SUBST(RELDFLAGS) +AC_SUBST(DEBUG_CPPFLAGS) +AC_SUBST(WARN_CXXFLAGS) +AC_SUBST(NOWARN_CXXFLAGS) +AC_SUBST(DEBUG_CXXFLAGS) +AC_SUBST(COMPAT_LDFLAGS) +AC_SUBST(ERROR_CXXFLAGS) +AC_SUBST(GPROF_CXXFLAGS) +AC_SUBST(GPROF_LDFLAGS) +AC_SUBST(HARDENED_CXXFLAGS) +AC_SUBST(HARDENED_CPPFLAGS) +AC_SUBST(HARDENED_LDFLAGS) +AC_SUBST(PIC_FLAGS) +AC_SUBST(PIE_FLAGS) +AC_SUBST(SANITIZER_CXXFLAGS) +AC_SUBST(SANITIZER_LDFLAGS) +AC_SUBST(SSE42_CXXFLAGS) +AC_SUBST(SSE41_CXXFLAGS) +AC_SUBST(AVX2_CXXFLAGS) +AC_SUBST(SHANI_CXXFLAGS) +AC_SUBST(LIBTOOL_APP_LDFLAGS) +AC_SUBST(USE_UPNP) +AC_SUBST(USE_QRCODE) +AC_SUBST(BOOST_LIBS) +AC_SUBST(TESTDEFS) +AC_SUBST(LEVELDB_TARGET_FLAGS) +AC_SUBST(MINIUPNPC_CPPFLAGS) +AC_SUBST(MINIUPNPC_LIBS) +AC_SUBST(CRYPTO_LIBS) +AC_SUBST(SSL_LIBS) +AC_SUBST(EVENT_LIBS) +AC_SUBST(EVENT_PTHREADS_LIBS) +AC_SUBST(ZMQ_LIBS) +AC_SUBST(PROTOBUF_LIBS) +AC_SUBST(QR_LIBS) +AC_SUBST(USE_NUM_GMP) +AC_SUBST(USE_NUM_OPENSSL) +AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini]) +AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) +AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])]) +AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py]) +AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py]) +AC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py]) +AC_CONFIG_LINKS([test/util/rpcauth-test.py:test/util/rpcauth-test.py]) + +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" + +if test x$need_bundled_univalue = xyes; then + AC_CONFIG_SUBDIRS([src/univalue]) +fi + +ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery --disable-jni" +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 + +dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows +case ${OS} in + *Windows*) + sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/config.ini > test/config-2.ini + mv test/config-2.ini test/config.ini + ;; +esac + +echo +echo "Options used to compile and link:" +echo " with wallet = $enable_wallet" +echo " with gui / qt = $bitcoin_enable_qt" +if test x$bitcoin_enable_qt != xno; then + echo " with qr = $use_qr" +fi +echo " with zmq = $use_zmq" +echo " with bignum = $set_bignum" +echo " with test = $use_tests" +echo " with bench = $use_bench" +echo " with upnp = $use_upnp" +echo " use asm = $use_asm" +echo " sanitizers = $use_sanitizers" +echo " debug enabled = $enable_debug" +echo " gprof enabled = $enable_gprof" +echo " werror = $enable_werror" +echo +echo " target os = $TARGET_OS" +echo " build os = $BUILD_OS" +echo +echo " CC = $CC" +echo " CFLAGS = $CFLAGS" +echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS" +echo " CXX = $CXX" +echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS" +echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS" +echo " ARFLAGS = $ARFLAGS" +echo " PIC_FLAGS = $PIC_FLAGS" +echo " QT_PIE_FLAGS = $QT_PIE_FLAGS" +echo diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 0000000..dae975e --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,56 @@ +Wallet Tools +--------------------- + +### [BitRPC](/contrib/bitrpc) ### +Allows for sending of all standard Bitcoin commands via RPC rather than as command line args. + +### [SpendFrom](/contrib/spendfrom) ### + +Use the raw transactions API to send coins received on a particular +address (or addresses). + +Repository Tools +--------------------- + +### [Developer tools](/contrib/devtools) ### +Specific tools for developers working on this repository. +Contains the script `github-merge.sh` for merging github pull requests securely and signing them using GPG. + +### [Linearize](/contrib/linearize) ### +Construct a linear, no-fork, best version of the blockchain. + +### [Qos](/contrib/qos) ### + +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. + +Build Tools and Keys +--------------------- + +### [Debian](/contrib/debian) ### +Contains files used to package bitcoind/bitcoin-qt +for Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here. + +### [Gitian-descriptors](/contrib/gitian-descriptors) ### +Gavin's notes on getting gitian builds up and running using KVM. + +### [Gitian-downloader](/contrib/gitian-downloader) +Various PGP files of core developers. + +### [MacDeploy](/contrib/macdeploy) ### +Scripts and notes for Mac builds. + +Test and Verify Tools +--------------------- + +### [TestGen](/contrib/testgen) ### +Utilities to generate test vectors for the data-driven Bitcoin tests. + +### [Test Patches](/contrib/test-patches) ### +These patches are applied when the automated pull-tester +tests each pull and when master is tested using jenkins. + +### [Verify SF Binaries](/contrib/verifysfbinaries) ### +This script attempts to download and verify the signature file SHA256SUMS.asc from SourceForge. diff --git a/contrib/bitrpc/README.md b/contrib/bitrpc/README.md new file mode 100644 index 0000000..f5ef2f0 --- /dev/null +++ b/contrib/bitrpc/README.md @@ -0,0 +1,8 @@ +### BitRPC +Allows for sending of all standard Bitcoin commands via RPC rather than as command line args. + +### Looking for Wallet Tools? +BitRPC.py is able to do the exact same thing as `walletchangepass.py` and `walletunlock.py`. Their respective commands in BitRPC.py are: + + bitrpc.py walletpassphrasechange + bitrpc.py walletpassphrase \ No newline at end of file diff --git a/contrib/bitrpc/bitrpc.py b/contrib/bitrpc/bitrpc.py new file mode 100644 index 0000000..23b734a --- /dev/null +++ b/contrib/bitrpc/bitrpc.py @@ -0,0 +1,337 @@ +from jsonrpc import ServiceProxy +import sys +import string +import getpass + +# ===== BEGIN USER SETTINGS ===== +# if you do not set these you will be prompted for a password for every command +rpcuser = "" +rpcpass = "" +# ====== END USER SETTINGS ====== + + +if rpcpass == "": + access = ServiceProxy("http://127.0.0.1:13810") +else: + access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:13810") +cmd = sys.argv[1].lower() + +if cmd == "backupwallet": + try: + path = raw_input("Enter destination path/filename: ") + 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: + addr = raw_input("Enter a Bitcoin address: ") + print access.getaccount(addr) + except: + print "\n---An error occurred---\n" + +elif cmd == "getaccountaddress": + try: + acct = raw_input("Enter an account name: ") + print access.getaccountaddress(acct) + except: + print "\n---An error occurred---\n" + +elif cmd == "getaddressesbyaccount": + try: + acct = raw_input("Enter an account name: ") + print access.getaddressesbyaccount(acct) + except: + print "\n---An error occurred---\n" + +elif cmd == "getbalance": + try: + acct = raw_input("Enter an account (optional): ") + mc = raw_input("Minimum confirmations (optional): ") + try: + print access.getbalance(acct, mc) + except: + print access.getbalance() + except: + print "\n---An error occurred---\n" + +elif cmd == "getblockbycount": + try: + height = raw_input("Height: ") + print access.getblockbycount(height) + except: + print "\n---An error occurred---\n" + +elif cmd == "getblockcount": + try: + print access.getblockcount() + except: + print "\n---An error occurred---\n" + +elif cmd == "getblocknumber": + try: + print access.getblocknumber() + except: + print "\n---An error occurred---\n" + +elif cmd == "getconnectioncount": + try: + print access.getconnectioncount() + except: + print "\n---An error occurred---\n" + +elif cmd == "getdifficulty": + try: + print access.getdifficulty() + except: + print "\n---An error occurred---\n" + +elif cmd == "getgenerate": + try: + print access.getgenerate() + except: + print "\n---An error occurred---\n" + +elif cmd == "gethashespersec": + try: + print access.gethashespersec() + except: + print "\n---An error occurred---\n" + +elif cmd == "getinfo": + try: + print access.getinfo() + except: + print "\n---An error occurred---\n" + +elif cmd == "getnewaddress": + try: + acct = raw_input("Enter an account name: ") + try: + print access.getnewaddress(acct) + except: + print access.getnewaddress() + except: + print "\n---An error occurred---\n" + +elif cmd == "getreceivedbyaccount": + try: + acct = raw_input("Enter an account (optional): ") + mc = raw_input("Minimum confirmations (optional): ") + try: + print access.getreceivedbyaccount(acct, mc) + except: + print access.getreceivedbyaccount() + except: + print "\n---An error occurred---\n" + +elif cmd == "getreceivedbyaddress": + try: + addr = raw_input("Enter a Bitcoin address (optional): ") + mc = raw_input("Minimum confirmations (optional): ") + try: + print access.getreceivedbyaddress(addr, mc) + except: + print access.getreceivedbyaddress() + except: + print "\n---An error occurred---\n" + +elif cmd == "gettransaction": + try: + txid = raw_input("Enter a transaction ID: ") + print access.gettransaction(txid) + except: + print "\n---An error occurred---\n" + +elif cmd == "getwork": + try: + data = raw_input("Data (optional): ") + try: + print access.gettransaction(data) + except: + print access.gettransaction() + except: + print "\n---An error occurred---\n" + +elif cmd == "help": + try: + cmd = raw_input("Command (optional): ") + try: + print access.help(cmd) + except: + print access.help() + except: + print "\n---An error occurred---\n" + +elif cmd == "listaccounts": + try: + mc = raw_input("Minimum confirmations (optional): ") + try: + print access.listaccounts(mc) + except: + print access.listaccounts() + except: + print "\n---An error occurred---\n" + +elif cmd == "listreceivedbyaccount": + try: + mc = raw_input("Minimum confirmations (optional): ") + incemp = raw_input("Include empty? (true/false, optional): ") + try: + print access.listreceivedbyaccount(mc, incemp) + except: + print access.listreceivedbyaccount() + except: + print "\n---An error occurred---\n" + +elif cmd == "listreceivedbyaddress": + try: + mc = raw_input("Minimum confirmations (optional): ") + incemp = raw_input("Include empty? (true/false, optional): ") + try: + print access.listreceivedbyaddress(mc, incemp) + except: + print access.listreceivedbyaddress() + except: + print "\n---An error occurred---\n" + +elif cmd == "listtransactions": + try: + acct = raw_input("Account (optional): ") + count = raw_input("Number of transactions (optional): ") + frm = raw_input("Skip (optional):") + try: + print access.listtransactions(acct, count, frm) + except: + print access.listtransactions() + except: + print "\n---An error occurred---\n" + +elif cmd == "move": + try: + frm = raw_input("From: ") + to = raw_input("To: ") + amt = raw_input("Amount:") + mc = raw_input("Minimum confirmations (optional): ") + comment = raw_input("Comment (optional): ") + try: + print access.move(frm, to, amt, mc, comment) + except: + print access.move(frm, to, amt) + except: + print "\n---An error occurred---\n" + +elif cmd == "sendfrom": + try: + frm = raw_input("From: ") + to = raw_input("To: ") + amt = raw_input("Amount:") + mc = raw_input("Minimum confirmations (optional): ") + comment = raw_input("Comment (optional): ") + commentto = raw_input("Comment-to (optional): ") + try: + print access.sendfrom(frm, to, amt, mc, comment, commentto) + except: + print access.sendfrom(frm, to, amt) + except: + print "\n---An error occurred---\n" + +elif cmd == "sendmany": + try: + frm = raw_input("From: ") + to = raw_input("To (in format address1:amount1,address2:amount2,...): ") + mc = raw_input("Minimum confirmations (optional): ") + comment = raw_input("Comment (optional): ") + try: + print access.sendmany(frm,to,mc,comment) + except: + print access.sendmany(frm,to) + except: + print "\n---An error occurred---\n" + +elif cmd == "sendtoaddress": + try: + to = raw_input("To (in format address1:amount1,address2:amount2,...): ") + amt = raw_input("Amount:") + comment = raw_input("Comment (optional): ") + commentto = raw_input("Comment-to (optional): ") + try: + print access.sendtoaddress(to,amt,comment,commentto) + except: + print access.sendtoaddress(to,amt) + except: + print "\n---An error occurred---\n" + +elif cmd == "setaccount": + try: + addr = raw_input("Address: ") + acct = raw_input("Account:") + print access.setaccount(addr,acct) + except: + print "\n---An error occurred---\n" + +elif cmd == "setgenerate": + try: + gen= raw_input("Generate? (true/false): ") + cpus = raw_input("Max processors/cores (-1 for unlimited, optional):") + try: + print access.setgenerate(gen, cpus) + except: + print access.setgenerate(gen) + except: + print "\n---An error occurred---\n" + +elif cmd == "settxfee": + try: + amt = raw_input("Amount:") + print access.settxfee(amt) + except: + print "\n---An error occurred---\n" + +elif cmd == "stop": + try: + print access.stop() + except: + print "\n---An error occurred---\n" + +elif cmd == "validateaddress": + try: + addr = raw_input("Address: ") + print access.validateaddress(addr) + except: + print "\n---An error occurred---\n" + +elif cmd == "walletpassphrase": + try: + pwd = getpass.getpass(prompt="Enter wallet passphrase: ") + access.walletpassphrase(pwd, 60) + print "\n---Wallet unlocked---\n" + except: + print "\n---An error occurred---\n" + +elif cmd == "walletpassphrasechange": + try: + pwd = getpass.getpass(prompt="Enter old wallet passphrase: ") + pwd2 = getpass.getpass(prompt="Enter new wallet passphrase: ") + access.walletpassphrasechange(pwd, pwd2) + print + print "\n---Passphrase changed---\n" + except: + print + print "\n---An error occurred---\n" + print + +else: + print "Command not found or not supported" diff --git a/contrib/cmake/FindBerkeleyDB.cmake b/contrib/cmake/FindBerkeleyDB.cmake new file mode 100644 index 0000000..1b5188c --- /dev/null +++ b/contrib/cmake/FindBerkeleyDB.cmake @@ -0,0 +1,146 @@ +# Author: sum01 +# Git: https://github.com/sum01/FindBerkeleyDB +# Read the README.md for the full info. + +# Allow user to pass a path instead of guessing +if(BerkeleyDB_ROOT_DIR) + set(_BERKELEYDB_PATHS "${BerkeleyDB_ROOT_DIR}") +elseif(CMAKE_SYSTEM_NAME MATCHES ".*[wW]indows.*") + # MATCHES is used to work on any devies with windows in the name + # Shameless copy-paste from FindOpenSSL.cmake v3.8 + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) + list(APPEND _BERKELEYDB_HINTS "${_programfiles}") + + # There's actually production release and version numbers in the file path. + # For example, if they're on v6.2.32: C:/Program Files/Oracle/Berkeley DB 12cR1 6.2.32/ + # But this still works to find it, so I'm guessing it can accept partial path matches. + + foreach(_TARGET_BERKELEYDB_PATH "Oracle/Berkeley DB" "Berkeley DB") + list(APPEND _BERKELEYDB_PATHS + "${_programfiles}/${_TARGET_BERKELEYDB_PATH}" + "C:/Program Files (x86)/${_TARGET_BERKELEYDB_PATH}" + "C:/Program Files/${_TARGET_BERKELEYDB_PATH}" + "C:/${_TARGET_BERKELEYDB_PATH}" + ) + endforeach() +else() + # Paths for anything other than Windows + # Cellar/berkeley-db is for macOS from homebrew installation + list(APPEND _BERKELEYDB_PATHS + "/usr/local/Cellar/berkeley-db@4" + "/usr/local/Cellar/berkeley-db" + "/opt" + "/opt/local" + "/usr/local" + ) +endif() + +# Find includes path +find_path(BerkeleyDB_INCLUDE_DIRS + db_cxx.h + PATHS "${_BERKELEYDB_PATHS}" + PATH_SUFFIXES "include" "includes" + ) + +# Checks if the version file exists, save the version file to a var, and fail if there's no version file +if(BerkeleyDB_INCLUDE_DIRS) + # Read the version file db.h into a variable + file(READ "${BerkeleyDB_INCLUDE_DIRS}/db.h" _BERKELEYDB_DB_HEADER) + # Parse the DB version into variables to be used in the lib names + string(REGEX REPLACE ".*DB_VERSION_MAJOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MAJOR "${_BERKELEYDB_DB_HEADER}") + string(REGEX REPLACE ".*DB_VERSION_MINOR ([0-9]+).*" "\\1" BerkeleyDB_VERSION_MINOR "${_BERKELEYDB_DB_HEADER}") + # Patch version example on non-crypto installs: x.x.xNC + string(REGEX REPLACE ".*DB_VERSION_PATCH ([0-9]+(NC)?).*" "\\1" BerkeleyDB_VERSION_PATCH "${_BERKELEYDB_DB_HEADER}") +else() + if(BerkeleyDB_FIND_REQUIRED) + # If the find_package(BerkeleyDB REQUIRED) was used, fail since we couldn't find the header + message(FATAL_ERROR "Failed to find Berkeley DB's header file \"db.h\"! Try setting \"BerkeleyDB_ROOT_DIR\" when initiating Cmake.") + elseif(NOT BerkeleyDB_FIND_QUIETLY) + message(WARNING "Failed to find Berkeley DB's header file \"db.h\"! Try setting \"BerkeleyDB_ROOT_DIR\" when initiating Cmake.") + endif() + # Set some garbage values to the versions since we didn't find a file to read + set(BerkeleyDB_VERSION_MAJOR "0") + set(BerkeleyDB_VERSION_MINOR "0") + set(BerkeleyDB_VERSION_PATCH "0") +endif() + +# The actual returned/output version variable (the others can be used if needed) +set(BerkeleyDB_VERSION "${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}.${BerkeleyDB_VERSION_PATCH}") + +# Finds the target library for berkeley db, since they all follow the same naming conventions +macro(findpackage_berkeleydb_get_lib _BERKELEYDB_OUTPUT_VARNAME _TARGET_BERKELEYDB_LIB) + # Different systems sometimes have a version in the lib name... + # and some have a dash or underscore before the versions. + # CMake recommends to put unversioned names before versioned names + find_library(${_BERKELEYDB_OUTPUT_VARNAME} + NAMES + "${_TARGET_BERKELEYDB_LIB}" + "lib${_TARGET_BERKELEYDB_LIB}" + "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}.${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}${BerkeleyDB_VERSION_MINOR}" + "lib${_TARGET_BERKELEYDB_LIB}${BerkeleyDB_VERSION_MAJOR}" + "lib${_TARGET_BERKELEYDB_LIB}-${BerkeleyDB_VERSION_MAJOR}" + "lib${_TARGET_BERKELEYDB_LIB}_${BerkeleyDB_VERSION_MAJOR}" + HINTS ${_BERKELEYDB_HINTS} + PATH_SUFFIXES "lib" "lib64" "libs" "libs64" + PATHS ${_BERKELEYDB_PATHS} + ) + # If the library was found, add it to our list of libraries + if(${_BERKELEYDB_OUTPUT_VARNAME}) + # If found, append to our libraries variable + # The ${{}} is because the first expands to target the real variable, the second expands the variable's contents... + # and the real variable's contents is the path to the lib. Thus, it appends the path of the lib to BerkeleyDB_LIBRARIES. + list(APPEND BerkeleyDB_LIBRARIES "${${_BERKELEYDB_OUTPUT_VARNAME}}") + endif() +endmacro() + +# Find and set the paths of the specific library to the variable +findpackage_berkeleydb_get_lib(BerkeleyDB_LIBRARY "db") +# NOTE: Windows doesn't have a db_cxx lib, but instead compiles the cxx code into the "db" lib +findpackage_berkeleydb_get_lib(BerkeleyDB_Cxx_LIBRARY "db_cxx") +# NOTE: I don't think Linux/Unix gets an SQL lib +findpackage_berkeleydb_get_lib(BerkeleyDB_Sql_LIBRARY "db_sql") +findpackage_berkeleydb_get_lib(BerkeleyDB_Stl_LIBRARY "db_stl") + +# Needed for find_package_handle_standard_args() +include(FindPackageHandleStandardArgs) +# Fails if required vars aren't found, or if the version doesn't meet specifications. +find_package_handle_standard_args(BerkeleyDB + FOUND_VAR BerkeleyDB_FOUND + REQUIRED_VARS + BerkeleyDB_INCLUDE_DIRS + BerkeleyDB_LIBRARY + VERSION_VAR BerkeleyDB_VERSION + ) + +# Create an imported lib for easy linking by external projects +if(BerkeleyDB_FOUND AND BerkeleyDB_LIBRARIES AND NOT TARGET Oracle::BerkeleyDB) + add_library(Oracle::BerkeleyDB UNKNOWN IMPORTED) + set_target_properties(Oracle::BerkeleyDB PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${BerkeleyDB_INCLUDE_DIRS}" + IMPORTED_LOCATION "${BerkeleyDB_LIBRARY}" + INTERFACE_LINK_LIBRARIES "${BerkeleyDB_LIBRARIES}" + ) +endif() + +# Only show the includes path and libraries in the GUI if they click "advanced". +# Does nothing when using the CLI +mark_as_advanced(FORCE + BerkeleyDB_INCLUDE_DIRS + BerkeleyDB_LIBRARIES + BerkeleyDB_LIBRARY + BerkeleyDB_Cxx_LIBRARY + BerkeleyDB_Sql_LIBRARY + BerkeleyDB_Stl_LIBRARY + ) + +include(FindPackageMessage) +# A message that tells the user what includes/libs were found, and obeys the QUIET command. +find_package_message(BerkeleyDB + "Found BerkeleyDB libraries: ${BerkeleyDB_LIBRARIES}" + "[${BerkeleyDB_LIBRARIES}[${BerkeleyDB_INCLUDE_DIRS}]]" + ) diff --git a/contrib/cmake/FindGMP.cmake b/contrib/cmake/FindGMP.cmake new file mode 100644 index 0000000..ee39ba1 --- /dev/null +++ b/contrib/cmake/FindGMP.cmake @@ -0,0 +1,33 @@ +# - Find GMP +# This module defines +# GMP_INCLUDE_DIR, where to find GMP headers +# GMP_LIBRARY, LibEvent libraries +# GMP_FOUND, If false, do not try to use GMP + +set(GMP_PREFIX "" CACHE PATH "path ") + +find_path(GMP_INCLUDE_DIR gmp.h gmpxx.h + PATHS ${GMP_PREFIX}/include /usr/include /usr/local/include ) + +find_library(GMP_LIBRARY NAMES gmp libgmp + PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib) + +if(GMP_INCLUDE_DIR AND GMP_LIBRARY) + get_filename_component(GMP_LIBRARY_DIR ${GMP_LIBRARY} PATH) + set(GMP_FOUND TRUE) +endif() + +if(GMP_FOUND) + if(NOT GMP_FIND_QUIETLY) + MESSAGE(STATUS "Found GMP: ${GMP_LIBRARY}") + endif() +elseif(GMP_FOUND) + if(GMP_FIND_REQUIRED) + message(FATAL_ERROR "Could not find GMP") + endif() +endif() + +mark_as_advanced( + GMP_LIB + GMP_INCLUDE_DIR +) diff --git a/contrib/cmake/FindLibEvent.cmake b/contrib/cmake/FindLibEvent.cmake new file mode 100644 index 0000000..d0ffdf0 --- /dev/null +++ b/contrib/cmake/FindLibEvent.cmake @@ -0,0 +1,44 @@ +# - Find LibEvent (a cross event library) +# This module defines +# LIBEVENT_INCLUDE_DIR, where to find LibEvent headers +# LIBEVENT_LIB, LibEvent libraries +# LibEvent_FOUND, If false, do not try to use libevent + +if(($ENV{triple}) AND (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}")) + set(LIBEVENT_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}/include") + set(LIBEVENT_LIB "${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}/lib/libevent.a") + set(LIBEVENT_PTHREAD_LIB "${CMAKE_CURRENT_SOURCE_DIR}/depends/$ENV{triple}/lib/libevent.a") +else() + set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}") + foreach(prefix ${LibEvent_EXTRA_PREFIXES}) + list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include") + list(APPEND LibEvent_LIB_PATHS "${prefix}/lib") + endforeach() + + find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS}) + find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS}) + find_library(LIBEVENT_PTHREAD_LIB NAMES event_pthreads PATHS ${LibEvent_LIB_PATHS}) +endif() + +if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR AND LIBEVENT_PTHREAD_LIB) + set(LibEvent_FOUND TRUE) + set(LIBEVENT_LIB ${LIBEVENT_LIB} ${LIBEVENT_PTHREAD_LIB}) +else () + set(LibEvent_FOUND FALSE) +endif () + +if (LibEvent_FOUND) + if (NOT LibEvent_FIND_QUIETLY) + message(STATUS "Found libevent: ${LIBEVENT_LIB}") + endif () +else () + if (LibEvent_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find libevent and libevent_pthread.") + endif () + message(STATUS "libevent and libevent_pthread NOT found.") +endif () + +mark_as_advanced( + LIBEVENT_LIB + LIBEVENT_INCLUDE_DIR +) diff --git a/contrib/cmake/FindQrcode.cmake b/contrib/cmake/FindQrcode.cmake new file mode 100644 index 0000000..702d0d1 --- /dev/null +++ b/contrib/cmake/FindQrcode.cmake @@ -0,0 +1,37 @@ +# - Find Qrcode +# This module defines +# QRCODE_INCLUDE_DIR, where to find libqrencode headers +# QRCODE_LIB, libqrencode libraries +# QRCODE_FOUND, If false, do not try to use libqrencode + +set(QRCODE_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}") +foreach(prefix ${ZMQ_EXTRA_PREFIXES}) + list(APPEND QRCODE_INCLUDE_PATHS "${prefix}/include") + list(APPEND QRCODE_LIB_PATHS "${prefix}/lib") +endforeach() + +find_path(QRCODE_INCLUDE_DIR qrencode.h PATHS ${QRCODE_INCLUDE_PATHS}) +find_library(QRCODE_LIB NAMES qrencode PATHS ${QRCODE_LIB_PATHS}) + +if (QRCODE_LIB AND QRCODE_INCLUDE_DIR) + set(QRCODE_FOUND TRUE) +else () + set(QRCODE_FOUND FALSE) +endif () + +if (QRCODE_FOUND) + if (NOT QRCODE_FIND_QUIETLY) + message(STATUS "Found libqrencode: ${QRCODE_LIB}") + include_directories(${QRCODE_INCLUDE_DIR}) + endif () +else () + if (QRCODE_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find libqrencode.") + endif () + message(STATUS "libqrencode NOT found.") +endif () + +mark_as_advanced( + QRCODE_LIB + QRCODE_INCLUDE_DIR +) diff --git a/contrib/cmake/FindZMQ.cmake b/contrib/cmake/FindZMQ.cmake new file mode 100644 index 0000000..84b0273 --- /dev/null +++ b/contrib/cmake/FindZMQ.cmake @@ -0,0 +1,37 @@ +# - Find ZeroMQ +# This module defines +# ZMQ_INCLUDE_DIR, where to find ZMQ headers +# ZMQ_LIB, ZMQ libraries +# ZMQ_FOUND, If false, do not try to use ZeroMQ + +set(ZMQ_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}") +foreach(prefix ${ZMQ_EXTRA_PREFIXES}) + list(APPEND ZMQ_INCLUDE_PATHS "${prefix}/include") + list(APPEND ZMQ_LIB_PATHS "${prefix}/lib") +endforeach() + +find_path(ZMQ_INCLUDE_DIR zmq.h PATHS ${ZMQ_INCLUDE_PATHS}) +find_library(ZMQ_LIB NAMES zmq PATHS ${ZMQ_LIB_PATHS}) + +if (ZMQ_LIB AND ZMQ_INCLUDE_DIR) + set(ZMQ_FOUND TRUE) +else () + set(ZMQ_FOUND FALSE) +endif () + +if (ZMQ_FOUND) + if (NOT ZMQ_FIND_QUIETLY) + message(STATUS "Found ZeroMQ: ${ZMQ_LIB}") + include_directories(${ZMQ_INCLUDE_DIR}) + endif () +else () + if (ZMQ_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find ZeroMQ.") + endif () + message(STATUS "ZeroMQ NOT found.") +endif () + +mark_as_advanced( + ZMQ_LIB + ZMQ_INCLUDE_DIR +) diff --git a/contrib/debian/README.md b/contrib/debian/README.md new file mode 100644 index 0000000..617a8f3 --- /dev/null +++ b/contrib/debian/README.md @@ -0,0 +1,21 @@ + +Debian +==================== +This directory contains files used to package versessd/versess-qt +for Debian-based Linux systems. If you compile versessd/versess-qt yourself, there are some useful files here. + +## versess: URI support ## + + +versess-qt.desktop (Gnome / Open Desktop) +To install: + + sudo desktop-file-install versess-qt.desktop + sudo update-desktop-database + +If you build yourself, you will either need to modify the paths in +the .desktop file or copy or symlink your versess-qt binary to `/usr/bin` +and the `../../share/pixmaps/versess128.png` to `/usr/share/pixmaps` + +versess-qt.protocol (KDE) + diff --git a/contrib/debian/changelog b/contrib/debian/changelog new file mode 100644 index 0000000..0720b1b --- /dev/null +++ b/contrib/debian/changelog @@ -0,0 +1,5 @@ +versess (3.2.0-trusty1) trusty; urgency=medium + + * Versess Coin v3.2.0 (trusty). + + -- Fuzzbawls Fri, 12 Apr 2019 12:01:00 -0700 diff --git a/contrib/debian/compat b/contrib/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/contrib/debian/compat @@ -0,0 +1 @@ +7 diff --git a/contrib/debian/control b/contrib/debian/control new file mode 100644 index 0000000..e778a38 --- /dev/null +++ b/contrib/debian/control @@ -0,0 +1,64 @@ +Source: versess +Section: utils +Priority: optional +Maintainer: Fuzzbawls +Uploaders: Fuzzbawls +Build-Depends: debhelper, + devscripts, + automake, + libtool, + bash-completion, + libdb4.8++-dev, + libssl1.0-dev | libssl-dev, + pkg-config, + libevent-dev, + libgmp-dev, + libboost-system1.48-dev | libboost-system-dev (>> 1.47), + libboost-filesystem1.48-dev | libboost-filesystem-dev (>> 1.47), + libboost-program-options1.48-dev | libboost-program-options-dev (>> 1.47), + libboost-thread1.48-dev | libboost-thread-dev (>> 1.47), + libboost-test1.48-dev | libboost-test-dev (>> 1.47), + libboost-chrono1.48-dev | libboost-chrono-dev (>> 1.47), + libminiupnpc8-dev | libminiupnpc-dev, + xvfb, + qtbase5-dev, qttools5-dev-tools, qttools5-dev, + libqrencode-dev, + libprotobuf-dev, protobuf-compiler, + python, + libzmq3-dev, + dh-systemd +Standards-Version: 3.9.2 +Homepage: http://www.versess.org +Vcs-Git: git://github.com/Versess-Project/Versess.git +Vcs-Browser: http://github.com/Versess-Project/Versess + +Package: versessd +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: peer-to-peer network based digital currency - daemon + Versess 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 10+ GB of space, slowly growing. + . + This package provides the daemon, versessd, and the CLI tool + versess-cli to interact with the daemon. + +Package: versess-qt +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: peer-to-peer network based digital currency - Qt GUI + Versess 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 10+ GB of space, slowly growing. + . + This package provides Versess-Qt, a GUI for Versess based on Qt. diff --git a/contrib/debian/copyright b/contrib/debian/copyright new file mode 100644 index 0000000..b45222e --- /dev/null +++ b/contrib/debian/copyright @@ -0,0 +1,165 @@ +Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?rev=174 +Upstream-Name: Bitcoin +Upstream-Contact: Satoshi Nakamoto + irc://#bitcoin@freenode.net +Source: https://github.com/bitcoin/bitcoin + +Files: * +Copyright: 2009-2012, Bitcoin Core Developers +License: Expat +Comment: The Bitcoin Core Developers encompasses the current developers listed on bitcoin.org, + as well as the numerous contributors to the project. + +Files: src/json/* +Copyright: 2007-2009, John W. Wilkinson +License: Expat + +Files: src/strlcpy.h +Copyright: 1998, Todd C. Miller +License: ISC + +Files: debian/* +Copyright: 2010-2011, Jonas Smedegaard + 2011, Matt Corallo +License: GPL-2+ + +Files: debian/manpages/* +Copyright: Micah Anderson +License: GPL-3+ + +Files: src/qt/res/icons/clock*.png, src/qt/res/icons/tx*.png, + src/qt/res/src/*.svg +Copyright: Wladimir van der Laan +License: Expat + +Files: src/qt/res/icons/address-book.png, src/qt/res/icons/export.png, + src/qt/res/icons/history.png, src/qt/res/icons/key.png, + src/qt/res/icons/lock_*.png, src/qt/res/icons/overview.png, + src/qt/res/icons/receive.png, src/qt/res/icons/send.png, + src/qt/res/icons/synced.png, src/qt/res/icons/filesave.png +Copyright: David Vignoni (david@icon-king.com) + ICON KING - www.icon-king.com +License: LGPL +Comment: NUVOLA ICON THEME for KDE 3.x + Original icons: kaddressbook, klipper_dock, view-list-text, + key-password, encrypted/decrypted, go-home, go-down, + go-next, dialog-ok + Site: http://www.icon-king.com/projects/nuvola/ + +Files: src/qt/res/icons/connect*.png +Copyright: schollidesign +License: GPL-3+ +Comment: Icon Pack: Human-O2 + Site: http://findicons.com/icon/93743/blocks_gnome_netstatus_0 + +Files: src/qt/res/icons/transaction*.png +Copyright: md2k7 +License: Expat +Comment: Site: https://bitcointalk.org/index.php?topic=15276.0 + +Files: src/qt/res/icons/configure.png, src/qt/res/icons/quit.png, + src/qt/res/icons/editcopy.png, src/qt/res/icons/editpaste.png, + src/qt/res/icons/add.png, src/qt/res/icons/edit.png, + src/qt/res/icons/remove.png +Copyright: http://www.everaldo.com +License: LGPL +Comment: Icon Pack: Crystal SVG + +Files: src/qt/res/icons/bitcoin.png, src/qt/res/icons/toolbar.png +Copyright: Bitboy (optimized for 16x16 by Wladimir van der Laan) +License: PUB-DOM +Comment: Site: https://bitcointalk.org/?topic=1756.0 + +Files: scripts/img/reload.xcf, src/qt/res/movies/*.png +Copyright: Everaldo (Everaldo Coelho) +License: GPL-3+ +Comment: Icon Pack: Kids + Site: http://findicons.com/icon/17102/reload?id=17102 + +Files: src/qt/res/images/splash2.jpg +License: PUB-DOM +Copyright: Crobbo (forum) +Comment: Site: https://bitcointalk.org/index.php?topic=32273.0 + + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +License: ISC + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR + BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES + OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + . + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. +Comment: + On Debian systems the GNU General Public License (GPL) version 2 is + located in '/usr/share/common-licenses/GPL-2'. + . + You should have received a copy of the GNU General Public License along + with this program. If not, see . + +License: GPL-3+ + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU General Public License, Version 3 or any + later version published by the Free Software Foundation. +Comment: + On Debian systems the GNU General Public License (GPL) version 3 is + located in '/usr/share/common-licenses/GPL-3'. + . + You should have received a copy of the GNU General Public License along + with this program. If not, see . + +License: LGPL + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +Comment: + On Debian systems the GNU Lesser General Public License (LGPL) is + located in '/usr/share/common-licenses/LGPL'. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +License: PUB-DOM + This work is in the public domain. diff --git a/contrib/debian/examples/versess.conf b/contrib/debian/examples/versess.conf new file mode 100644 index 0000000..457100b --- /dev/null +++ b/contrib/debian/examples/versess.conf @@ -0,0 +1,105 @@ +## +## versess.conf configuration file. Lines beginning with # are comments. +## + +# Network-related settings: + +# Run on the test network instead of the real versess network. +#testnet=0 + +# 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:13811 + +# 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:13811 + +# 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 Versess/versessd process) +# + +# server=1 tells Versess-QT and versessd to accept JSON-RPC commands +#server=0 + +# You must set rpcuser and rpcpassword to secure the JSON-RPC api +#rpcuser=Ulysseys +#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593 + +# How many seconds versess will wait for a complete RPC HTTP request. +# after the HTTP connection is established. +#rpcclienttimeout=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 Versess-QT to accept JSON-RPC commands. +# it is also read by versessd 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=13810 + +# You can use Versess or versessd to send commands to Versess/versessd +# running on another host using this option: +#rpcconnect=127.0.0.1 + +# Miscellaneous options + +# 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 + +# Pay an optional transaction fee every time you send VERSs. Transactions with fees +# are more likely than free transactions to be included in generated blocks, so may +# be validated sooner. +#paytxfee=0.00 + +# User interface options + +# Start Versess minimized +#min=1 + +# Minimize to the system tray +#minimizetotray=1 diff --git a/contrib/debian/gbp.conf b/contrib/debian/gbp.conf new file mode 100644 index 0000000..a7281f9 --- /dev/null +++ b/contrib/debian/gbp.conf @@ -0,0 +1,5 @@ +# Configuration file for git-buildpackage and friends + +[DEFAULT] +pristine-tar = True +sign-tags = True diff --git a/contrib/debian/patches/README b/contrib/debian/patches/README new file mode 100644 index 0000000..80c1584 --- /dev/null +++ b/contrib/debian/patches/README @@ -0,0 +1,3 @@ +0xxx: Grabbed from upstream development. +1xxx: Possibly relevant for upstream adoption. +2xxx: Only relevant for official Debian release. diff --git a/contrib/debian/patches/series b/contrib/debian/patches/series new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/contrib/debian/patches/series @@ -0,0 +1 @@ + diff --git a/contrib/debian/rules b/contrib/debian/rules new file mode 100644 index 0000000..1397281 --- /dev/null +++ b/contrib/debian/rules @@ -0,0 +1,38 @@ +#!/usr/bin/make -f +# -*- mode: makefile; coding: utf-8 -*- + +#DEB_MAKE_CHECK_TARGET = test_versess +#build/bitcoind:: +# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_versess) + +DEB_INSTALL_EXAMPLES_bitcoind += debian/examples/* +DEB_INSTALL_MANPAGES_bitcoind += debian/manpages/* + +%: + dh --with bash-completion $@ + +override_dh_auto_clean: + if [ -f Makefile ]; then $(MAKE) distclean; fi + rm -rf Makefile.in aclocal.m4 configure src/Makefile.in src/versess-config.h.in src/build-aux src/qt/Makefile.in src/qt/test/Makefile.in src/test/Makefile.in + +# Yea, autogen should be run on the source archive, but I like doing git archive +override_dh_auto_configure: + ./autogen.sh + ./configure --with-gui=qt5 + +override_dh_auto_test: + make check + +# No SysV or Upstart init scripts included +override_dh_installinit: + dh_installinit \ + --noscripts + +# Don’t enable service by default +override_dh_systemd_enable: + dh_systemd_enable \ + --no-enable + +# Restart after upgrade +override_dh_systemd_start: + dh_systemd_start \ diff --git a/contrib/debian/source/format b/contrib/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/contrib/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/contrib/debian/versess-qt.desktop b/contrib/debian/versess-qt.desktop new file mode 100644 index 0000000..72c013d --- /dev/null +++ b/contrib/debian/versess-qt.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Name=Versess Coin +Comment=Versess P2P Cryptocurrency +Comment[fr]=Versess, monnaie virtuelle cryptographique pair à pair +Comment[tr]=Versess, eÅŸten eÅŸe kriptografik sanal para birimi +Exec=versess-qt %u +Terminal=false +Type=Application +Icon=versess128 +MimeType=x-scheme-handler/versess; +Categories=Office;Finance; +StartupWMClass=Versess-qt diff --git a/contrib/debian/versess-qt.install b/contrib/debian/versess-qt.install new file mode 100644 index 0000000..f5818a3 --- /dev/null +++ b/contrib/debian/versess-qt.install @@ -0,0 +1,6 @@ +usr/local/bin/versess-qt usr/bin +share/pixmaps/versess32.xpm usr/share/pixmaps +share/pixmaps/versess16.xpm usr/share/pixmaps +share/pixmaps/versess128.png usr/share/pixmaps +debian/versess-qt.desktop usr/share/applications +debian/versess-qt.protocol usr/share/kde4/services/ diff --git a/contrib/debian/versess-qt.lintian-overrides b/contrib/debian/versess-qt.lintian-overrides new file mode 100644 index 0000000..13fc454 --- /dev/null +++ b/contrib/debian/versess-qt.lintian-overrides @@ -0,0 +1,2 @@ +# Linked code is Expat - only Debian packaging is GPL-2+ +versess-qt: possible-gpl-code-linked-with-openssl diff --git a/contrib/debian/versess-qt.manpages b/contrib/debian/versess-qt.manpages new file mode 100644 index 0000000..7da430b --- /dev/null +++ b/contrib/debian/versess-qt.manpages @@ -0,0 +1 @@ +doc/man/versess-qt.1 diff --git a/contrib/debian/versess-qt.protocol b/contrib/debian/versess-qt.protocol new file mode 100644 index 0000000..990f8fb --- /dev/null +++ b/contrib/debian/versess-qt.protocol @@ -0,0 +1,11 @@ +[Protocol] +exec=versess-qt '%u' +protocol=versess +input=none +output=none +helper=true +listing= +reading=false +writing=false +makedir=false +deleting=false diff --git a/contrib/debian/versessd.bash-completion b/contrib/debian/versessd.bash-completion new file mode 100644 index 0000000..c9b5504 --- /dev/null +++ b/contrib/debian/versessd.bash-completion @@ -0,0 +1,2 @@ +contrib/versessd.bash-completion versessd +contrib/versess-cli.bash-completion versess-cli diff --git a/contrib/debian/versessd.examples b/contrib/debian/versessd.examples new file mode 100644 index 0000000..8f30d40 --- /dev/null +++ b/contrib/debian/versessd.examples @@ -0,0 +1 @@ +debian/examples/versess.conf diff --git a/contrib/debian/versessd.install b/contrib/debian/versessd.install new file mode 100644 index 0000000..758bf3b --- /dev/null +++ b/contrib/debian/versessd.install @@ -0,0 +1,3 @@ +usr/local/bin/versessd usr/bin +usr/local/bin/versess-cli usr/bin +debian/examples/versess.conf etc/versess diff --git a/contrib/debian/versessd.lintian-overrides b/contrib/debian/versessd.lintian-overrides new file mode 100644 index 0000000..6e03e26 --- /dev/null +++ b/contrib/debian/versessd.lintian-overrides @@ -0,0 +1,2 @@ +# Linked code is Expat - only Debian packaging is GPL-2+ +versessd: possible-gpl-code-linked-with-openssl diff --git a/contrib/debian/versessd.manpages b/contrib/debian/versessd.manpages new file mode 100644 index 0000000..0304d8f --- /dev/null +++ b/contrib/debian/versessd.manpages @@ -0,0 +1,2 @@ +doc/man/versessd.1 +doc/man/versess-cli.1 diff --git a/contrib/debian/versessd.postinst b/contrib/debian/versessd.postinst new file mode 100644 index 0000000..6af2435 --- /dev/null +++ b/contrib/debian/versessd.postinst @@ -0,0 +1,28 @@ + +#!/bin/sh + +# setup versess account, homedir etc + +set -e + +BCUSER="versess" +BCHOME="/var/lib/versess" + +if [ "$1" = "configure" ]; then + # Add versess user/group - this will gracefully abort if the user already exists. + # A homedir is never created. + set +e + adduser --system --home "${BCHOME}" --no-create-home --group "${BCUSER}" 2>/dev/null + set -e + + # If the homedir does not already exist, create it with proper + # ownership and permissions. + if [ ! -d "${BCHOME}" ]; then + mkdir -m 0750 -p "${BCHOME}" + chown "${BCUSER}:${BCUSER}" "${BCHOME}" + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/contrib/debian/versessd.postrm b/contrib/debian/versessd.postrm new file mode 100644 index 0000000..7a11f62 --- /dev/null +++ b/contrib/debian/versessd.postrm @@ -0,0 +1,35 @@ +#!/bin/sh + +# setup versess account, homedir etc + +set -e + +BCUSER="versess" +BCHOME="/var/lib/versess" + +if [ "$1" = "purge" ]; then + + # The versess user is left in place for now - This is to ensure that a new user + # will not inherit the users UID/GID and inadvertently gain access to wallets etc + + # The homedir is also left intact to ensure that we don't accidentally delete a + # wallet or something equally important + + echo + echo "#" + echo "# The versess user (${BCUSER}) and data dir (${BCHOME})" + echo "# were left intact." + echo "#" + echo "# Make sure to check \"${BCHOME}\" for wallets and other" + echo "# important bits." + echo "#" + echo "# After backing up all vital data, cleanup can be completed" + echo "# by running: sudo userdel -r ${BCUSER}" + echo "#" + echo + +fi + +#DEBHELPER# + +exit 0 diff --git a/contrib/debian/versessd.service b/contrib/debian/versessd.service new file mode 100644 index 0000000..93cc871 --- /dev/null +++ b/contrib/debian/versessd.service @@ -0,0 +1,45 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit versessd.service +# See "man systemd.service" for details. + +# Note that almost all daemon options could be specified in +# /etc/versess/versess.conf + +[Unit] +Description=Versess daemon +After=network.target + +[Service] +ExecStart=/usr/bin/versessd -daemon -datadir=/var/lib/versess -conf=/etc/versess/versess.conf -pid=/run/versessd/versessd.pid +# Creates /run/versessd owned by versess +RuntimeDirectory=versessd +User=versess +Type=forking +PIDFile=/run/versessd/versessd.pid +Restart=on-failure + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +# Commented out as it's not supported on Debian 8 or Ubuntu 16.04 LTS +#MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/contrib/debian/watch b/contrib/debian/watch new file mode 100644 index 0000000..8a5cf9c --- /dev/null +++ b/contrib/debian/watch @@ -0,0 +1,5 @@ +# Run the "uscan" command to check for upstream updates and more. +version=3 +# use qa.debian.org redirector; see man uscan +opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\d*// \ + http://githubredir.debian.net/github/versess-project/versess v(.*).tar.gz diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md new file mode 100644 index 0000000..9802ddd --- /dev/null +++ b/contrib/devtools/README.md @@ -0,0 +1,210 @@ +Contents +======== +This directory contains tools for developers working on this repository. + +check-doc.py +============ + +Check if all command line args are documented. The return value indicates the +number of undocumented args. + +clang-format-diff.py +=================== + +A script to format unified git diffs according to [.clang-format](../../src/.clang-format). + +Requires `clang-format`, installed e.g. via `brew install clang-format` on macOS. + +For instance, to format the last commit with 0 lines of context, +the script should be called from the git root folder as follows. + +``` +git diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v +``` + +copyright\_header.py +==================== + +Provides utilities for managing copyright headers of `The Versess +developers` in repository source files. It has three subcommands: + +``` +$ ./copyright_header.py report [verbose] +$ ./copyright_header.py update +$ ./copyright_header.py insert +``` +Running these subcommands without arguments displays a usage string. + +copyright\_header.py report \ [verbose] +--------------------------------------------------------- + +Produces a report of all copyright header notices found inside the source files +of a repository. Useful to quickly visualize the state of the headers. +Specifying `verbose` will list the full filenames of files of each category. + +copyright\_header.py update \ [verbose] +--------------------------------------------------------- +Updates all the copyright headers of `The Versess developers` which were +changed in a year more recent than is listed. For example: +``` +// Copyright (c) - The Versess developers +``` +will be updated to: +``` +// Copyright (c) - The Versess developers +``` +where `` is obtained from the `git log` history. + +This subcommand also handles copyright headers that have only a single year. In +those cases: +``` +// Copyright (c) The Versess developers +``` +will be updated to: +``` +// Copyright (c) - The Versess developers +``` +where the update is appropriate. + +copyright\_header.py insert \ +------------------------------------ +Inserts a copyright header for `The Versess developers` at the top of the +file in either Python or C++ style as determined by the file extension. If the +file is a Python file and it has `#!` starting the first line, the header is +inserted in the line below it. + +The copyright dates will be set to be `-` where +`` is according to the `git log` history. If +`` is equal to ``, it will be set as a single +year rather than two hyphenated years. + +If the file already has a copyright for `The Versess developers`, the +script will exit. + +gen-manpages.sh +=============== + +A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option. +This requires help2man which can be found at: https://www.gnu.org/software/help2man/ + +With in-tree builds this tool can be run from any directory within the +repostitory. To use this tool with out-of-tree builds set `BUILDDIR`. For +example: + +```bash +BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh +``` + +github-merge.py +=============== + +A small script to automate merging pull-requests securely and sign them with GPG. + +For example: + + ./github-merge.py 3077 + +(in any git repository) will help you merge pull request #3077 for the +Versess-Project/Versess repository. + +What it does: +* Fetch master and the pull request. +* Locally construct a merge commit. +* Show the diff that merge results in. +* Ask you to verify the resulting source tree (so you can do a make +check or whatever). +* Ask you whether to GPG sign the merge commit. +* Ask you whether to push the result upstream. + +This means that there are no potential race conditions (where a +pullreq gets updated while you're reviewing it, but before you click +merge), and when using GPG signatures, that even a compromised GitHub +couldn't mess with the sources. + +Setup +--------- +Configuring the github-merge tool for the Versess repository is done in the following way: + + git config githubmerge.repository Versess-Project/Versess + git config githubmerge.testcmd "make -j4 check" (adapt to whatever you want to use for testing) + git config --global user.signingkey mykeyid + +Authentication (optional) +-------------------------- + +The API request limit for unauthenticated requests is quite low, but the +limit for authenticated requests is much higher. If you start running +into rate limiting errors it can be useful to set an authentication token +so that the script can authenticate requests. + +- First, go to [Personal access tokens](https://github.com/settings/tokens). +- Click 'Generate new token'. +- Fill in an arbitrary token description. No further privileges are needed. +- Click the `Generate token` button at the bottom of the form. +- Copy the generated token (should be a hexadecimal string) + +Then do: + + git config --global user.ghtoken "pasted token" + +Create and verify timestamps of merge commits +--------------------------------------------- +To create or verify timestamps on the merge commits, install the OpenTimestamps +client via `pip3 install opentimestamps-client`. Then, dowload the gpg wrapper +`ots-git-gpg-wrapper.sh` and set it as git's `gpg.program`. See +[the ots git integration documentation](https://github.com/opentimestamps/opentimestamps-client/blob/master/doc/git-integration.md#usage) +for further details. + +optimize-pngs.py +================ + +A script to optimize png files in the Versess +repository (requires pngcrush). + +security-check.py and test-security-check.py +============================================ + +Perform basic ELF security checks on a series of executables. + +symbol-check.py +=============== + +A script to check that the (Linux) executables produced by gitian only contain +allowed gcc, glibc and libstdc++ version symbols. This makes sure they are +still compatible with the minimum supported Linux distribution versions. + +Example usage after a gitian build: + + find ../gitian-builder/build -type f -executable | xargs python3 contrib/devtools/symbol-check.py + +If only supported symbols are used the return value will be 0 and the output will be empty. + +If there are 'unsupported' symbols, the return value will be 1 a list like this will be printed: + + .../64/test_versess: symbol memcpy from unsupported version GLIBC_2.14 + .../64/test_versess: symbol __fdelt_chk from unsupported version GLIBC_2.15 + .../64/test_versess: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 + .../64/test_versess: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 + +update-translations.py +====================== + +Run this script from the root of the repository to update all translations from transifex. +It will do the following automatically: + +- fetch all translations +- post-process them into valid and committable format +- add missing translations to the build system (TODO) + +See doc/translation-process.md for more information. + +circular-dependencies.py +======================== + +Run this script from the root of the source tree (`src/`) to find circular dependencies in the source code. +This looks only at which files include other files, treating the `.cpp` and `.h` file as one unit. + +Example usage: + + cd .../src + ../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp} diff --git a/contrib/devtools/check-doc.py b/contrib/devtools/check-doc.py new file mode 100644 index 0000000..75cbbac --- /dev/null +++ b/contrib/devtools/check-doc.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# Copyright (c) 2015-2018 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +''' +This checks if all command line args are documented. +Return value is 0 to indicate no error. + +Author: @MarcoFalke +''' + +from subprocess import check_output +import re +import sys + +FOLDER_GREP = 'src' +FOLDER_TEST = 'src/test/' +CMD_ROOT_DIR = '`git rev-parse --show-toplevel`/{}'.format(FOLDER_GREP) +CMD_GREP_ARGS = r"egrep -r -I '(map(Multi)?Args(\.count\(|\[)|Get(Bool)?Arg\()\"\-[^\"]+?\"' {} | grep -v '{}'".format(CMD_ROOT_DIR, FOLDER_TEST) +CMD_GREP_DOCS = r"egrep -r -I 'HelpMessageOpt\(\"\-[^\"=]+?(=|\")' {}".format(CMD_ROOT_DIR) +REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"') +REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")') +# list unsupported, deprecated and duplicate args as they need no documentation +SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-sendfreetransactions', '-checklevel', '-liquidityprovider', '-anonymizeversessamount']) + +def main(): + used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True) + docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True) + + args_used = set(re.findall(re.compile(REGEX_ARG), used)) + args_docd = set(re.findall(re.compile(REGEX_DOC), docd)).union(SET_DOC_OPTIONAL) + args_need_doc = args_used.difference(args_docd) + args_unknown = args_docd.difference(args_used) + + print("Args used : {}".format(len(args_used))) + print("Args documented : {}".format(len(args_docd))) + print("Args undocumented: {}".format(len(args_need_doc))) + print(args_need_doc) + print("Args unknown : {}".format(len(args_unknown))) + print(args_unknown) + + sys.exit(len(args_need_doc)) + + +if __name__ == "__main__": + main() diff --git a/contrib/devtools/circular-dependencies.py b/contrib/devtools/circular-dependencies.py new file mode 100644 index 0000000..73d82eb --- /dev/null +++ b/contrib/devtools/circular-dependencies.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 + +import sys +import re + +MAPPING = { + 'core_read.cpp': 'core_io.cpp', + 'core_write.cpp': 'core_io.cpp', +} + +# Directories with header-based modules, where the assumption that .cpp files +# define functions and variables declared in corresponding .h files is +# incorrect. +HEADER_MODULE_PATHS = [ + 'interfaces/' +] + +def module_name(path): + if path in MAPPING: + path = MAPPING[path] + if any(path.startswith(dirpath) for dirpath in HEADER_MODULE_PATHS): + return path + if path.endswith(".h"): + return path[:-2] + if path.endswith(".c"): + return path[:-2] + if path.endswith(".cpp"): + return path[:-4] + return None + +files = dict() +deps = dict() + +RE = re.compile("^#include \"(.*)\"") + +# Iterate over files, and create list of modules +for arg in sys.argv[1:]: + module = module_name(arg) + if module is None: + print("Ignoring file %s (does not constitute module)\n" % arg) + else: + files[arg] = module + deps[module] = set() + +# Iterate again, and build list of direct dependencies for each module +# TODO: implement support for multiple include directories +for arg in sorted(files.keys()): + module = files[arg] + with open(arg, 'r', encoding="utf8") as f: + for line in f: + match = RE.match(line) + if match: + include = match.group(1) + included_module = module_name(include) + if included_module is not None and included_module in deps and included_module != module: + deps[module].add(included_module) + +# Loop to find the shortest (remaining) circular dependency +have_cycle = False +while True: + shortest_cycle = None + for module in sorted(deps.keys()): + # Build the transitive closure of dependencies of module + closure = dict() + for dep in deps[module]: + closure[dep] = [] + while True: + old_size = len(closure) + old_closure_keys = sorted(closure.keys()) + for src in old_closure_keys: + for dep in deps[src]: + if dep not in closure: + closure[dep] = closure[src] + [src] + if len(closure) == old_size: + break + # If module is in its own transitive closure, it's a circular dependency; check if it is the shortest + if module in closure and (shortest_cycle is None or len(closure[module]) + 1 < len(shortest_cycle)): + shortest_cycle = [module] + closure[module] + if shortest_cycle is None: + break + # We have the shortest circular dependency; report it + module = shortest_cycle[0] + print("Circular dependency: %s" % (" -> ".join(shortest_cycle + [module]))) + # And then break the dependency to avoid repeating in other cycles + deps[shortest_cycle[-1]] = deps[shortest_cycle[-1]] - set([module]) + have_cycle = True + +sys.exit(1 if have_cycle else 0) diff --git a/contrib/devtools/clang-format-diff.py b/contrib/devtools/clang-format-diff.py new file mode 100644 index 0000000..f322b3a --- /dev/null +++ b/contrib/devtools/clang-format-diff.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +# +#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. +# +# ============================================================ +# +# University of Illinois/NCSA +# Open Source License +# +# Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign. +# All rights reserved. +# +# Developed by: +# +# LLVM Team +# +# University of Illinois at Urbana-Champaign +# +# http://llvm.org +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal with +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is furnished to do +# so, subject to the following conditions: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimers. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimers in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of the LLVM Team, University of Illinois at +# Urbana-Champaign, nor the names of its contributors may be used to +# endorse or promote products derived from this Software without specific +# prior written permission. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +# SOFTWARE. +# +# ============================================================ +# +#===------------------------------------------------------------------------===# + +r""" +ClangFormat Diff Reformatter +============================ + +This script reads input from a unified diff and reformats all the changed +lines. This is useful to reformat all the lines touched by a specific patch. +Example usage for git/svn users: + + git diff -U0 HEAD^ | clang-format-diff.py -p1 -i + svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i + +""" + +import argparse +import difflib +import io +import re +import subprocess +import sys + + +# Change this to the full path if clang-format is not on the path. +binary = 'clang-format' + + +def main(): + parser = argparse.ArgumentParser(description= + 'Reformat changed lines in diff. Without -i ' + 'option just output the diff that would be ' + 'introduced.') + parser.add_argument('-i', action='store_true', default=False, + help='apply edits to files instead of displaying a diff') + parser.add_argument('-p', metavar='NUM', default=0, + help='strip the smallest prefix containing P slashes') + parser.add_argument('-regex', metavar='PATTERN', default=None, + help='custom pattern selecting file paths to reformat ' + '(case sensitive, overrides -iregex)') + parser.add_argument('-iregex', metavar='PATTERN', default= + r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc|js|ts|proto' + r'|protodevel|java)', + help='custom pattern selecting file paths to reformat ' + '(case insensitive, overridden by -regex)') + parser.add_argument('-sort-includes', action='store_true', default=False, + help='let clang-format sort include blocks') + parser.add_argument('-v', '--verbose', action='store_true', + help='be more verbose, ineffective without -i') + args = parser.parse_args() + + # Extract changed lines for each file. + filename = None + lines_by_file = {} + for line in sys.stdin: + match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) + if match: + filename = match.group(2) + if filename is None: + continue + + if args.regex is not None: + if not re.match('^%s$' % args.regex, filename): + continue + else: + if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): + continue + + match = re.search('^@@.*\+(\d+)(,(\d+))?', line) + if match: + start_line = int(match.group(1)) + line_count = 1 + if match.group(3): + line_count = int(match.group(3)) + if line_count == 0: + continue + end_line = start_line + line_count - 1 + lines_by_file.setdefault(filename, []).extend( + ['-lines', str(start_line) + ':' + str(end_line)]) + + # Reformat files containing changes in place. + for filename, lines in lines_by_file.items(): + if args.i and args.verbose: + print('Formatting {}'.format(filename)) + command = [binary, filename] + if args.i: + command.append('-i') + if args.sort_includes: + command.append('-sort-includes') + command.extend(lines) + command.extend(['-style=file', '-fallback-style=none']) + p = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=None, + stdin=subprocess.PIPE, + universal_newlines=True) + stdout, stderr = p.communicate() + if p.returncode != 0: + sys.exit(p.returncode) + + if not args.i: + with open(filename, encoding="utf8") as f: + code = f.readlines() + formatted_code = io.StringIO(stdout).readlines() + diff = difflib.unified_diff(code, formatted_code, + filename, filename, + '(before formatting)', '(after formatting)') + diff_string = ''.join(diff) + if len(diff_string) > 0: + sys.stdout.write(diff_string) + +if __name__ == '__main__': + main() diff --git a/contrib/devtools/commit-script-check.sh b/contrib/devtools/commit-script-check.sh new file mode 100644 index 0000000..1c9dbc7 --- /dev/null +++ b/contrib/devtools/commit-script-check.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# Copyright (c) 2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# This simple script checks for commits beginning with: scripted-diff: +# If found, looks for a script between the lines -BEGIN VERIFY SCRIPT- and +# -END VERIFY SCRIPT-. If no ending is found, it reads until the end of the +# commit message. + +# The resulting script should exactly transform the previous commit into the current +# one. Any remaining diff signals an error. + +if test "x$1" = "x"; then + echo "Usage: $0 ..." + exit 1 +fi + +RET=0 +PREV_BRANCH=`git name-rev --name-only HEAD` +PREV_HEAD=`git rev-parse HEAD` +for i in `git rev-list --reverse $1`; do + if git rev-list -n 1 --pretty="%s" $i | grep -q "^scripted-diff:"; then + git checkout --quiet $i^ || exit + SCRIPT="`git rev-list --format=%b -n1 $i | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d'`" + if test "x$SCRIPT" = "x"; then + echo "Error: missing script for: $i" + echo "Failed" + RET=1 + else + echo "Running script for: $i" + echo "$SCRIPT" + eval "$SCRIPT" + git --no-pager diff --exit-code $i && echo "OK" || (echo "Failed"; false) || RET=1 + fi + git reset --quiet --hard HEAD + else + if git rev-list "--format=%b" -n1 $i | grep -q '^-\(BEGIN\|END\)[ a-zA-Z]*-$'; then + echo "Error: script block marker but no scripted-diff in title" + echo "Failed" + RET=1 + fi + fi +done +git checkout --quiet $PREV_BRANCH 2>/dev/null || git checkout --quiet $PREV_HEAD +exit $RET diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py new file mode 100644 index 0000000..3dd596d --- /dev/null +++ b/contrib/devtools/copyright_header.py @@ -0,0 +1,621 @@ +#!/usr/bin/env python3 +# Copyright (c) 2016-2018 The Bitcoin Core developers +# Copyright (c) 2018-2019 The PIVX developers +# Copyright (c) 2019 The Versess developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import re +import fnmatch +import sys +import subprocess +import datetime +import os + +################################################################################ +# file filtering +################################################################################ + +EXCLUDE = [ + # auto generated: + 'src/qt/versessstrings.cpp', + 'src/chainparamsseeds.h', + # other external copyrights: + 'src/tinyformat.h', + 'src/crypto/scrypt.cpp', + 'test/functional/test_framework/bignum.py', + # python init: + '*__init__.py', +] +EXCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in EXCLUDE])) + +EXCLUDE_DIRS = [ + # git subtrees + "src/crypto/ctaes/", + "src/leveldb/", + "src/secp256k1/", + "src/univalue/", +] + +INCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.py'] +INCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE])) + +def applies_to_file(filename): + for excluded_dir in EXCLUDE_DIRS: + if filename.startswith(excluded_dir): + return False + return ((EXCLUDE_COMPILED.match(filename) is None) and + (INCLUDE_COMPILED.match(filename) is not None)) + +################################################################################ +# obtain list of files in repo according to INCLUDE and EXCLUDE +################################################################################ + +GIT_LS_CMD = 'git ls-files --full-name'.split(' ') +GIT_TOPLEVEL_CMD = 'git rev-parse --show-toplevel'.split(' ') + +def call_git_ls(base_directory): + out = subprocess.check_output([*GIT_LS_CMD, base_directory]) + return [f for f in out.decode("utf-8").split('\n') if f != ''] + +def call_git_toplevel(): + "Returns the absolute path to the project root" + return subprocess.check_output(GIT_TOPLEVEL_CMD).strip().decode("utf-8") + +def get_filenames_to_examine(base_directory): + "Returns an array of absolute paths to any project files in the base_directory that pass the include/exclude filters" + root = call_git_toplevel() + filenames = call_git_ls(base_directory) + return sorted([os.path.join(root, filename) for filename in filenames if + applies_to_file(filename)]) + +################################################################################ +# define and compile regexes for the patterns we are looking for +################################################################################ + + +COPYRIGHT_WITH_C = 'Copyright \(c\)' +COPYRIGHT_WITHOUT_C = 'Copyright' +ANY_COPYRIGHT_STYLE = '(%s|%s)' % (COPYRIGHT_WITH_C, COPYRIGHT_WITHOUT_C) + +YEAR = "20[0-9][0-9]" +YEAR_RANGE = '(%s)(-%s)?' % (YEAR, YEAR) +YEAR_LIST = '(%s)(, %s)+' % (YEAR, YEAR) +ANY_YEAR_STYLE = '(%s|%s)' % (YEAR_RANGE, YEAR_LIST) +ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE = ("%s %s" % (ANY_COPYRIGHT_STYLE, + ANY_YEAR_STYLE)) + +ANY_COPYRIGHT_COMPILED = re.compile(ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE) + +def compile_copyright_regex(copyright_style, year_style, name): + return re.compile('%s %s,? %s' % (copyright_style, year_style, name)) + +EXPECTED_HOLDER_NAMES = [ + "Satoshi Nakamoto\n", + "The Bitcoin Core developers\n", + "The Bitcoin Core developers \n", + "Bitcoin Core Developers\n", + "the Bitcoin Core developers\n", + "The Bitcoin developers\n", + "The LevelDB Authors\. All rights reserved\.\n", + "BitPay Inc\.\n", + "BitPay, Inc\.\n", + "University of Illinois at Urbana-Champaign\.\n", + "MarcoFalke\n", + "Pieter Wuille\n", + "Pieter Wuille +\*\n", + "Pieter Wuille, Gregory Maxwell +\*\n", + "Pieter Wuille, Andrew Poelstra +\*\n", + "Ian Miers, Christina Garman and Matthew Green\n", + "Andrew Poelstra +\*\n", + "Wladimir J. van der Laan\n", + "Jeff Garzik\n", + "Diederik Huys, Pieter Wuille +\*\n", + "Thomas Daede, Cory Fields +\*\n", + "Jan-Klaas Kollhof\n", + "Sam Rushing\n", + "ArtForz -- public domain half-a-node\n", + " Projet RNRT SAPHIR\n", + "The Zcash developers\n", + "The Dash developers\n", + "The Dash Developers\n", + "The Dash Core developers\n", + "The Versess developers\n", + "The PPCoin developers\n", +] + +DOMINANT_STYLE_COMPILED = {} +YEAR_LIST_STYLE_COMPILED = {} +WITHOUT_C_STYLE_COMPILED = {} + +for holder_name in EXPECTED_HOLDER_NAMES: + DOMINANT_STYLE_COMPILED[holder_name] = ( + compile_copyright_regex(COPYRIGHT_WITH_C, YEAR_RANGE, holder_name)) + YEAR_LIST_STYLE_COMPILED[holder_name] = ( + compile_copyright_regex(COPYRIGHT_WITH_C, YEAR_LIST, holder_name)) + WITHOUT_C_STYLE_COMPILED[holder_name] = ( + compile_copyright_regex(COPYRIGHT_WITHOUT_C, ANY_YEAR_STYLE, + holder_name)) + +################################################################################ +# search file contents for copyright message of particular category +################################################################################ + +def get_count_of_copyrights_of_any_style_any_holder(contents): + return len(ANY_COPYRIGHT_COMPILED.findall(contents)) + +def file_has_dominant_style_copyright_for_holder(contents, holder_name): + match = DOMINANT_STYLE_COMPILED[holder_name].search(contents) + return match is not None + +def file_has_year_list_style_copyright_for_holder(contents, holder_name): + match = YEAR_LIST_STYLE_COMPILED[holder_name].search(contents) + return match is not None + +def file_has_without_c_style_copyright_for_holder(contents, holder_name): + match = WITHOUT_C_STYLE_COMPILED[holder_name].search(contents) + return match is not None + +################################################################################ +# get file info +################################################################################ + +def read_file(filename): + return open(filename, 'r', encoding="utf8").read() + +def gather_file_info(filename): + info = {} + info['filename'] = filename + c = read_file(filename) + info['contents'] = c + + info['all_copyrights'] = get_count_of_copyrights_of_any_style_any_holder(c) + + info['classified_copyrights'] = 0 + info['dominant_style'] = {} + info['year_list_style'] = {} + info['without_c_style'] = {} + for holder_name in EXPECTED_HOLDER_NAMES: + has_dominant_style = ( + file_has_dominant_style_copyright_for_holder(c, holder_name)) + has_year_list_style = ( + file_has_year_list_style_copyright_for_holder(c, holder_name)) + has_without_c_style = ( + file_has_without_c_style_copyright_for_holder(c, holder_name)) + info['dominant_style'][holder_name] = has_dominant_style + info['year_list_style'][holder_name] = has_year_list_style + info['without_c_style'][holder_name] = has_without_c_style + if has_dominant_style or has_year_list_style or has_without_c_style: + info['classified_copyrights'] = info['classified_copyrights'] + 1 + return info + +################################################################################ +# report execution +################################################################################ + +SEPARATOR = '-'.join(['' for _ in range(80)]) + +def print_filenames(filenames, verbose): + if not verbose: + return + for filename in filenames: + print("\t%s" % filename) + +def print_report(file_infos, verbose): + print(SEPARATOR) + examined = [i['filename'] for i in file_infos] + print("%d files examined according to INCLUDE and EXCLUDE fnmatch rules" % + len(examined)) + print_filenames(examined, verbose) + + print(SEPARATOR) + print('') + zero_copyrights = [i['filename'] for i in file_infos if + i['all_copyrights'] == 0] + print("%4d with zero copyrights" % len(zero_copyrights)) + print_filenames(zero_copyrights, verbose) + one_copyright = [i['filename'] for i in file_infos if + i['all_copyrights'] == 1] + print("%4d with one copyright" % len(one_copyright)) + print_filenames(one_copyright, verbose) + two_copyrights = [i['filename'] for i in file_infos if + i['all_copyrights'] == 2] + print("%4d with two copyrights" % len(two_copyrights)) + print_filenames(two_copyrights, verbose) + three_copyrights = [i['filename'] for i in file_infos if + i['all_copyrights'] == 3] + print("%4d with three copyrights" % len(three_copyrights)) + print_filenames(three_copyrights, verbose) + four_or_more_copyrights = [i['filename'] for i in file_infos if + i['all_copyrights'] >= 4] + print("%4d with four or more copyrights" % len(four_or_more_copyrights)) + print_filenames(four_or_more_copyrights, verbose) + print('') + print(SEPARATOR) + print('Copyrights with dominant style:\ne.g. "Copyright (c)" and ' + '"" or "-":\n') + for holder_name in EXPECTED_HOLDER_NAMES: + dominant_style = [i['filename'] for i in file_infos if + i['dominant_style'][holder_name]] + if len(dominant_style) > 0: + print("%4d with '%s'" % (len(dominant_style), + holder_name.replace('\n', '\\n'))) + print_filenames(dominant_style, verbose) + print('') + print(SEPARATOR) + print('Copyrights with year list style:\ne.g. "Copyright (c)" and ' + '", , ...":\n') + for holder_name in EXPECTED_HOLDER_NAMES: + year_list_style = [i['filename'] for i in file_infos if + i['year_list_style'][holder_name]] + if len(year_list_style) > 0: + print("%4d with '%s'" % (len(year_list_style), + holder_name.replace('\n', '\\n'))) + print_filenames(year_list_style, verbose) + print('') + print(SEPARATOR) + print('Copyrights with no "(c)" style:\ne.g. "Copyright" and "" or ' + '"-":\n') + for holder_name in EXPECTED_HOLDER_NAMES: + without_c_style = [i['filename'] for i in file_infos if + i['without_c_style'][holder_name]] + if len(without_c_style) > 0: + print("%4d with '%s'" % (len(without_c_style), + holder_name.replace('\n', '\\n'))) + print_filenames(without_c_style, verbose) + + print('') + print(SEPARATOR) + + unclassified_copyrights = [i['filename'] for i in file_infos if + i['classified_copyrights'] < i['all_copyrights']] + print("%d with unexpected copyright holder names" % + len(unclassified_copyrights)) + print_filenames(unclassified_copyrights, verbose) + print(SEPARATOR) + +def exec_report(base_directory, verbose): + filenames = get_filenames_to_examine(base_directory) + file_infos = [gather_file_info(f) for f in filenames] + print_report(file_infos, verbose) + +################################################################################ +# report cmd +################################################################################ + +REPORT_USAGE = """ +Produces a report of all copyright header notices found inside the source files +of a repository. + +Usage: + $ ./copyright_header.py report [verbose] + +Arguments: + - The base directory of a bitcoin source code repository. + [verbose] - Includes a list of every file of each subcategory in the report. +""" + +def report_cmd(argv): + if len(argv) == 2: + sys.exit(REPORT_USAGE) + + base_directory = argv[2] + if not os.path.exists(base_directory): + sys.exit("*** bad : %s" % base_directory) + + if len(argv) == 3: + verbose = False + elif argv[3] == 'verbose': + verbose = True + else: + sys.exit("*** unknown argument: %s" % argv[2]) + + exec_report(base_directory, verbose) + +################################################################################ +# query git for year of last change +################################################################################ + +GIT_LOG_CMD = "git log --pretty=format:%%ai %s" + +def call_git_log(filename): + out = subprocess.check_output((GIT_LOG_CMD % filename).split(' ')) + return out.decode("utf-8").split('\n') + +def get_git_change_years(filename): + git_log_lines = call_git_log(filename) + if len(git_log_lines) == 0: + return [datetime.date.today().year] + # timestamp is in ISO 8601 format. e.g. "2016-09-05 14:25:32 -0600" + return [line.split(' ')[0].split('-')[0] for line in git_log_lines] + +def get_most_recent_git_change_year(filename): + return max(get_git_change_years(filename)) + +################################################################################ +# read and write to file +################################################################################ + +def read_file_lines(filename): + f = open(filename, 'r', encoding="utf8") + file_lines = f.readlines() + f.close() + return file_lines + +def write_file_lines(filename, file_lines): + f = open(filename, 'w', encoding="utf8") + f.write(''.join(file_lines)) + f.close() + +################################################################################ +# update header years execution +################################################################################ + +COPYRIGHT = 'Copyright \(c\)' +YEAR = "20[0-9][0-9]" +YEAR_RANGE = '(%s)(-%s)?' % (YEAR, YEAR) +HOLDER = 'The Versess developers' +UPDATEABLE_LINE_COMPILED = re.compile(' '.join([COPYRIGHT, YEAR_RANGE, HOLDER])) + +def get_updatable_copyright_line(file_lines): + index = 0 + for line in file_lines: + if UPDATEABLE_LINE_COMPILED.search(line) is not None: + return index, line + index = index + 1 + return None, None + +def parse_year_range(year_range): + year_split = year_range.split('-') + start_year = year_split[0] + if len(year_split) == 1: + return start_year, start_year + return start_year, year_split[1] + +def year_range_to_str(start_year, end_year): + if start_year == end_year: + return start_year + return "%s-%s" % (start_year, end_year) + +def create_updated_copyright_line(line, last_git_change_year): + copyright_splitter = 'Copyright (c) ' + copyright_split = line.split(copyright_splitter) + # Preserve characters on line that are ahead of the start of the copyright + # notice - they are part of the comment block and vary from file-to-file. + before_copyright = copyright_split[0] + after_copyright = copyright_split[1] + + space_split = after_copyright.split(' ') + year_range = space_split[0] + start_year, end_year = parse_year_range(year_range) + if end_year == last_git_change_year: + return line + return (before_copyright + copyright_splitter + + year_range_to_str(start_year, last_git_change_year) + ' ' + + ' '.join(space_split[1:])) + +def update_updatable_copyright(filename): + file_lines = read_file_lines(filename) + index, line = get_updatable_copyright_line(file_lines) + if not line: + print_file_action_message(filename, "No updatable copyright.") + return + last_git_change_year = get_most_recent_git_change_year(filename) + new_line = create_updated_copyright_line(line, last_git_change_year) + if line == new_line: + print_file_action_message(filename, "Copyright up-to-date.") + return + file_lines[index] = new_line + write_file_lines(filename, file_lines) + print_file_action_message(filename, + "Copyright updated! -> %s" % last_git_change_year) + +def exec_update_header_year(base_directory): + for filename in get_filenames_to_examine(base_directory): + update_updatable_copyright(filename) + +################################################################################ +# update cmd +################################################################################ + +UPDATE_USAGE = """ +Updates all the copyright headers of "The Versess developers" which were +changed in a year more recent than is listed. For example: + +// Copyright (c) - The Versess developers + +will be updated to: + +// Copyright (c) - The Versess developers + +where is obtained from the 'git log' history. + +This subcommand also handles copyright headers that have only a single year. In those cases: + +// Copyright (c) The Versess developers + +will be updated to: + +// Copyright (c) - The Versess developers + +where the update is appropriate. + +Usage: + $ ./copyright_header.py update + +Arguments: + - The base directory of a versess source code repository. +""" + +def print_file_action_message(filename, action): + print("%-52s %s" % (filename, action)) + +def update_cmd(argv): + if len(argv) != 3: + sys.exit(UPDATE_USAGE) + + base_directory = argv[2] + if not os.path.exists(base_directory): + sys.exit("*** bad base_directory: %s" % base_directory) + exec_update_header_year(base_directory) + +################################################################################ +# inserted copyright header format +################################################################################ + +def get_header_lines(header, start_year, end_year): + lines = header.split('\n')[1:-1] + lines[0] = lines[0] % year_range_to_str(start_year, end_year) + return [line + '\n' for line in lines] + +CPP_HEADER = ''' +// Copyright (c) %s The Versess developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' + +def get_cpp_header_lines_to_insert(start_year, end_year): + return reversed(get_header_lines(CPP_HEADER, start_year, end_year)) + +PYTHON_HEADER = ''' +# Copyright (c) %s The Versess developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' + +def get_python_header_lines_to_insert(start_year, end_year): + return reversed(get_header_lines(PYTHON_HEADER, start_year, end_year)) + +################################################################################ +# query git for year of last change +################################################################################ + +def get_git_change_year_range(filename): + years = get_git_change_years(filename) + return min(years), max(years) + +################################################################################ +# check for existing core copyright +################################################################################ + +def file_already_has_core_copyright(file_lines): + index, _ = get_updatable_copyright_line(file_lines) + return index is not None + +################################################################################ +# insert header execution +################################################################################ + +def file_has_hashbang(file_lines): + if len(file_lines) < 1: + return False + if len(file_lines[0]) <= 2: + return False + return file_lines[0][:2] == '#!' + +def insert_python_header(filename, file_lines, start_year, end_year): + if file_has_hashbang(file_lines): + insert_idx = 1 + else: + insert_idx = 0 + header_lines = get_python_header_lines_to_insert(start_year, end_year) + for line in header_lines: + file_lines.insert(insert_idx, line) + write_file_lines(filename, file_lines) + +def insert_cpp_header(filename, file_lines, start_year, end_year): + header_lines = get_cpp_header_lines_to_insert(start_year, end_year) + for line in header_lines: + file_lines.insert(0, line) + write_file_lines(filename, file_lines) + +def exec_insert_header(filename, style): + file_lines = read_file_lines(filename) + if file_already_has_core_copyright(file_lines): + sys.exit('*** %s already has a copyright by The Versess developers' + % (filename)) + start_year, end_year = get_git_change_year_range(filename) + if style == 'python': + insert_python_header(filename, file_lines, start_year, end_year) + else: + insert_cpp_header(filename, file_lines, start_year, end_year) + +################################################################################ +# insert cmd +################################################################################ + +INSERT_USAGE = """ +Inserts a copyright header for "The Versess developers" at the top of the +file in either Python or C++ style as determined by the file extension. If the +file is a Python file and it has a '#!' starting the first line, the header is +inserted in the line below it. + +The copyright dates will be set to be: + +"-" + +where is according to the 'git log' history. If + is equal to , the date will be set to be: + +"" + +If the file already has a copyright for "The Versess developers", the +script will exit. + +Usage: + $ ./copyright_header.py insert + +Arguments: + - A source file in the bitcoin repository. +""" + +def insert_cmd(argv): + if len(argv) != 3: + sys.exit(INSERT_USAGE) + + filename = argv[2] + if not os.path.isfile(filename): + sys.exit("*** bad filename: %s" % filename) + _, extension = os.path.splitext(filename) + if extension not in ['.h', '.cpp', '.cc', '.c', '.py']: + sys.exit("*** cannot insert for file extension %s" % extension) + + if extension == '.py': + style = 'python' + else: + style = 'cpp' + exec_insert_header(filename, style) + +################################################################################ +# UI +################################################################################ + +USAGE = """ +copyright_header.py - utilities for managing copyright headers of 'The Bitcoin +Core developers' in repository source files. + +Usage: + $ ./copyright_header + +Subcommands: + report + update + insert + +To see subcommand usage, run them without arguments. +""" + +SUBCOMMANDS = ['report', 'update', 'insert'] + +if __name__ == "__main__": + if len(sys.argv) == 1: + sys.exit(USAGE) + subcommand = sys.argv[1] + if subcommand not in SUBCOMMANDS: + sys.exit(USAGE) + if subcommand == 'report': + report_cmd(sys.argv) + elif subcommand == 'update': + update_cmd(sys.argv) + elif subcommand == 'insert': + insert_cmd(sys.argv) diff --git a/contrib/devtools/gen-manpages.sh b/contrib/devtools/gen-manpages.sh new file mode 100644 index 0000000..15d7fa2 --- /dev/null +++ b/contrib/devtools/gen-manpages.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +export LC_ALL=C +TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} +BUILDDIR=${BUILDDIR:-$TOPDIR} + +BINDIR=${BINDIR:-$BUILDDIR/src} +MANDIR=${MANDIR:-$TOPDIR/doc/man} + +BITCOIND=${BITCOIND:-$BINDIR/versessd} +BITCOINCLI=${BITCOINCLI:-$BINDIR/versess-cli} +BITCOINTX=${BITCOINTX:-$BINDIR/versess-tx} +BITCOINQT=${BITCOINQT:-$BINDIR/qt/versess-qt} + +[ ! -x $BITCOIND ] && echo "$BITCOIND not found or not executable." && exit 1 + +# The autodetected version git tag can screw up manpage output a little bit +BTCVER=($($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }')) + +# Create a footer file with copyright content. +# This gets autodetected fine for bitcoind if --version-string is not set, +# but has different outcomes for bitcoin-qt and bitcoin-cli. +echo "[COPYRIGHT]" > footer.h2m +$BITCOIND --version | sed -n '1!p' >> footer.h2m + +for cmd in $BITCOIND $BITCOINCLI $BITCOINTX $BITCOINQT; do + cmdname="${cmd##*/}" + help2man -N --version-string=${BTCVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} + sed -i "s/\\\-${BTCVER[1]}//g" ${MANDIR}/${cmdname}.1 +done + +rm -f footer.h2m diff --git a/contrib/devtools/git-subtree-check.sh b/contrib/devtools/git-subtree-check.sh new file mode 100644 index 0000000..85e8b84 --- /dev/null +++ b/contrib/devtools/git-subtree-check.sh @@ -0,0 +1,95 @@ +#!/bin/sh +# Copyright (c) 2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +DIR="$1" +COMMIT="$2" +if [ -z "$COMMIT" ]; then + COMMIT=HEAD +fi + +# Taken from git-subtree (Copyright (C) 2009 Avery Pennarun ) +find_latest_squash() +{ + dir="$1" + sq= + main= + sub= + git log --grep="^git-subtree-dir: $dir/*\$" \ + --pretty=format:'START %H%n%s%n%n%b%nEND%n' "$COMMIT" | + while read a b _; do + case "$a" in + START) sq="$b" ;; + git-subtree-mainline:) main="$b" ;; + git-subtree-split:) sub="$b" ;; + END) + if [ -n "$sub" ]; then + if [ -n "$main" ]; then + # a rejoin commit? + # Pretend its sub was a squash. + sq="$sub" + fi + echo "$sq" "$sub" + break + fi + sq= + main= + sub= + ;; + esac + done +} + +# find latest subtree update +latest_squash="$(find_latest_squash "$DIR")" +if [ -z "$latest_squash" ]; then + echo "ERROR: $DIR is not a subtree" >&2 + exit 2 +fi +set $latest_squash +old=$1 +rev=$2 + +# get the tree in the current commit +tree_actual=$(git ls-tree -d "$COMMIT" "$DIR" | head -n 1) +if [ -z "$tree_actual" ]; then + echo "FAIL: subtree directory $DIR not found in $COMMIT" >&2 + exit 1 +fi +set $tree_actual +tree_actual_type=$2 +tree_actual_tree=$3 +echo "$DIR in $COMMIT currently refers to $tree_actual_type $tree_actual_tree" +if [ "d$tree_actual_type" != "dtree" ]; then + echo "FAIL: subtree directory $DIR is not a tree in $COMMIT" >&2 + exit 1 +fi + +# get the tree at the time of the last subtree update +tree_commit=$(git show -s --format="%T" $old) +echo "$DIR in $COMMIT was last updated in commit $old (tree $tree_commit)" + +# ... and compare the actual tree with it +if [ "$tree_actual_tree" != "$tree_commit" ]; then + git diff $tree_commit $tree_actual_tree >&2 + echo "FAIL: subtree directory was touched without subtree merge" >&2 + exit 1 +fi + +# get the tree in the subtree commit referred to +if [ "d$(git cat-file -t $rev 2>/dev/null)" != dcommit ]; then + echo "subtree commit $rev unavailable: cannot compare" >&2 + exit +fi +tree_subtree=$(git show -s --format="%T" $rev) +echo "$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)" + +# ... and compare the actual tree with it +if [ "$tree_actual_tree" != "$tree_subtree" ]; then + echo "FAIL: subtree update commit differs from upstream tree!" >&2 + exit 1 +fi + +echo "GOOD" diff --git a/contrib/devtools/github-merge.py b/contrib/devtools/github-merge.py new file mode 100644 index 0000000..df1f3c8 --- /dev/null +++ b/contrib/devtools/github-merge.py @@ -0,0 +1,384 @@ +#!/usr/bin/env python3 +# Copyright (c) 2016-2017 Bitcoin Core Developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# This script will locally construct a merge commit for a pull request on a +# github repository, inspect it, sign it and optionally push it. + +# The following temporary branches are created/overwritten and deleted: +# * pull/$PULL/base (the current master we're merging onto) +# * pull/$PULL/head (the current state of the remote pull request) +# * pull/$PULL/merge (github's merge) +# * pull/$PULL/local-merge (our merge) + +# In case of a clean merge that is accepted by the user, the local branch with +# name $BRANCH is overwritten with the merged result, and optionally pushed. +import os +from sys import stdin,stdout,stderr +import argparse +import hashlib +import subprocess +import sys +import json +import codecs +from urllib.request import Request, urlopen +from urllib.error import HTTPError + +# External tools (can be overridden using environment) +GIT = os.getenv('GIT','git') +BASH = os.getenv('BASH','bash') + +# OS specific configuration for terminal attributes +ATTR_RESET = '' +ATTR_PR = '' +COMMIT_FORMAT = '%h %s (%an)%d' +if os.name == 'posix': # if posix, assume we can use basic terminal escapes + ATTR_RESET = '\033[0m' + ATTR_PR = '\033[1;36m' + COMMIT_FORMAT = '%C(bold blue)%h%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset' + +def git_config_get(option, default=None): + ''' + Get named configuration option from git repository. + ''' + try: + return subprocess.check_output([GIT,'config','--get',option]).rstrip().decode('utf-8') + except subprocess.CalledProcessError: + return default + +def get_response(req_url, ghtoken): + req = Request(req_url) + if ghtoken is not None: + req.add_header('Authorization', 'token ' + ghtoken) + return urlopen(req) + +def retrieve_json(req_url, ghtoken, use_pagination=False): + ''' + Retrieve json from github. + Return None if an error happens. + ''' + try: + reader = codecs.getreader('utf-8') + if not use_pagination: + return json.load(reader(get_response(req_url, ghtoken))) + + obj = [] + page_num = 1 + while True: + req_url_page = '{}?page={}'.format(req_url, page_num) + result = get_response(req_url_page, ghtoken) + obj.extend(json.load(reader(result))) + + link = result.headers.get('link', None) + if link is not None: + link_next = [l for l in link.split(',') if 'rel="next"' in l] + if len(link_next) > 0: + page_num = int(link_next[0][link_next[0].find("page=")+5:link_next[0].find(">")]) + continue + break + return obj + except HTTPError as e: + error_message = e.read() + print('Warning: unable to retrieve pull information from github: %s' % e) + print('Detailed error: %s' % error_message) + return None + except Exception as e: + print('Warning: unable to retrieve pull information from github: %s' % e) + return None + +def retrieve_pr_info(repo,pull,ghtoken): + req_url = "https://api.github.com/repos/"+repo+"/pulls/"+pull + return retrieve_json(req_url,ghtoken) + +def retrieve_pr_comments(repo,pull,ghtoken): + req_url = "https://api.github.com/repos/"+repo+"/issues/"+pull+"/comments" + return retrieve_json(req_url,ghtoken,use_pagination=True) + +def retrieve_pr_reviews(repo,pull,ghtoken): + req_url = "https://api.github.com/repos/"+repo+"/pulls/"+pull+"/reviews" + return retrieve_json(req_url,ghtoken,use_pagination=True) + +def ask_prompt(text): + print(text,end=" ",file=stderr) + stderr.flush() + reply = stdin.readline().rstrip() + print("",file=stderr) + return reply + +def get_symlink_files(): + files = sorted(subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', 'HEAD']).splitlines()) + ret = [] + for f in files: + if (int(f.decode('utf-8').split(" ")[0], 8) & 0o170000) == 0o120000: + ret.append(f.decode('utf-8').split("\t")[1]) + return ret + +def tree_sha512sum(commit='HEAD'): + # request metadata for entire tree, recursively + files = [] + blob_by_name = {} + for line in subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', commit]).splitlines(): + name_sep = line.index(b'\t') + metadata = line[:name_sep].split() # perms, 'blob', blobid + assert(metadata[1] == b'blob') + name = line[name_sep+1:] + files.append(name) + blob_by_name[name] = metadata[2] + + files.sort() + # open connection to git-cat-file in batch mode to request data for all blobs + # this is much faster than launching it per file + p = subprocess.Popen([GIT, 'cat-file', '--batch'], stdout=subprocess.PIPE, stdin=subprocess.PIPE) + overall = hashlib.sha512() + for f in files: + blob = blob_by_name[f] + # request blob + p.stdin.write(blob + b'\n') + p.stdin.flush() + # read header: blob, "blob", size + reply = p.stdout.readline().split() + assert(reply[0] == blob and reply[1] == b'blob') + size = int(reply[2]) + # hash the blob data + intern = hashlib.sha512() + ptr = 0 + while ptr < size: + bs = min(65536, size - ptr) + piece = p.stdout.read(bs) + if len(piece) == bs: + intern.update(piece) + else: + raise IOError('Premature EOF reading git cat-file output') + ptr += bs + dig = intern.hexdigest() + assert(p.stdout.read(1) == b'\n') # ignore LF that follows blob data + # update overall hash with file hash + overall.update(dig.encode("utf-8")) + overall.update(" ".encode("utf-8")) + overall.update(f) + overall.update("\n".encode("utf-8")) + p.stdin.close() + if p.wait(): + raise IOError('Non-zero return value executing git cat-file') + return overall.hexdigest() + +def get_acks_from_comments(head_commit, comments): + assert len(head_commit) == 6 + ack_str ='\n\nACKs for commit {}:\n'.format(head_commit) + for c in comments: + review = [l for l in c['body'].split('\r\n') if 'ACK' in l and head_commit in l] + if review: + ack_str += ' {}:\n'.format(c['user']['login']) + ack_str += ' {}\n'.format(review[0]) + return ack_str + +def print_merge_details(pull, title, branch, base_branch, head_branch): + print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET)) + subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch]) + +def parse_arguments(): + epilog = ''' + In addition, you can set the following git configuration variables: + githubmerge.repository (mandatory), + user.signingkey (mandatory), + user.ghtoken (default: none). + githubmerge.host (default: git@github.com), + githubmerge.branch (no default), + githubmerge.testcmd (default: none). + ''' + parser = argparse.ArgumentParser(description='Utility to merge, sign and push github pull requests', + epilog=epilog) + parser.add_argument('pull', metavar='PULL', type=int, nargs=1, + help='Pull request ID to merge') + parser.add_argument('branch', metavar='BRANCH', type=str, nargs='?', + default=None, help='Branch to merge against (default: githubmerge.branch setting, or base branch for pull, or \'master\')') + return parser.parse_args() + +def main(): + # Extract settings from git repo + repo = git_config_get('githubmerge.repository') + host = git_config_get('githubmerge.host','git@github.com') + opt_branch = git_config_get('githubmerge.branch',None) + testcmd = git_config_get('githubmerge.testcmd') + ghtoken = git_config_get('user.ghtoken') + signingkey = git_config_get('user.signingkey') + if repo is None: + print("ERROR: No repository configured. Use this command to set:", file=stderr) + print("git config githubmerge.repository /", file=stderr) + sys.exit(1) + if signingkey is None: + print("ERROR: No GPG signing key set. Set one using:",file=stderr) + print("git config --global user.signingkey ",file=stderr) + sys.exit(1) + + if host.startswith(('https:','http:')): + host_repo = host+"/"+repo+".git" + else: + host_repo = host+":"+repo + + # Extract settings from command line + args = parse_arguments() + pull = str(args.pull[0]) + + # Receive pull information from github + info = retrieve_pr_info(repo,pull,ghtoken) + if info is None: + sys.exit(1) + comments = retrieve_pr_comments(repo,pull,ghtoken) + retrieve_pr_reviews(repo,pull,ghtoken) + if comments is None: + sys.exit(1) + title = info['title'].strip() + body = info['body'].strip() + # precedence order for destination branch argument: + # - command line argument + # - githubmerge.branch setting + # - base branch for pull (as retrieved from github) + # - 'master' + branch = args.branch or opt_branch or info['base']['ref'] or 'master' + + # Initialize source branches + head_branch = 'pull/'+pull+'/head' + base_branch = 'pull/'+pull+'/base' + merge_branch = 'pull/'+pull+'/merge' + local_merge_branch = 'pull/'+pull+'/local-merge' + + devnull = open(os.devnull, 'w', encoding="utf8") + try: + subprocess.check_call([GIT,'checkout','-q',branch]) + except subprocess.CalledProcessError: + print("ERROR: Cannot check out branch %s." % (branch), file=stderr) + sys.exit(3) + try: + subprocess.check_call([GIT,'fetch','-q',host_repo,'+refs/pull/'+pull+'/*:refs/heads/pull/'+pull+'/*', + '+refs/heads/'+branch+':refs/heads/'+base_branch]) + except subprocess.CalledProcessError: + print("ERROR: Cannot find pull request #%s or branch %s on %s." % (pull,branch,host_repo), file=stderr) + sys.exit(3) + try: + subprocess.check_call([GIT,'log','-q','-1','refs/heads/'+head_branch], stdout=devnull, stderr=stdout) + except subprocess.CalledProcessError: + print("ERROR: Cannot find head of pull request #%s on %s." % (pull,host_repo), file=stderr) + sys.exit(3) + try: + subprocess.check_call([GIT,'log','-q','-1','refs/heads/'+merge_branch], stdout=devnull, stderr=stdout) + except subprocess.CalledProcessError: + print("ERROR: Cannot find merge of pull request #%s on %s." % (pull,host_repo), file=stderr) + sys.exit(3) + subprocess.check_call([GIT,'checkout','-q',base_branch]) + subprocess.call([GIT,'branch','-q','-D',local_merge_branch], stderr=devnull) + subprocess.check_call([GIT,'checkout','-q','-b',local_merge_branch]) + + try: + # Go up to the repository's root. + toplevel = subprocess.check_output([GIT,'rev-parse','--show-toplevel']).strip() + os.chdir(toplevel) + # Create unsigned merge commit. + if title: + firstline = 'Merge #%s: %s' % (pull,title) + else: + firstline = 'Merge #%s' % (pull,) + message = firstline + '\n\n' + message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8') + message += '\n\nPull request description:\n\n ' + body.replace('\n', '\n ') + '\n' + message += get_acks_from_comments(head_commit=subprocess.check_output([GIT,'log','-1','--pretty=format:%H',head_branch]).decode('utf-8')[:6], comments=comments) + try: + subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','--no-gpg-sign','-m',message.encode('utf-8'),head_branch]) + except subprocess.CalledProcessError: + print("ERROR: Cannot be merged cleanly.",file=stderr) + subprocess.check_call([GIT,'merge','--abort']) + sys.exit(4) + logmsg = subprocess.check_output([GIT,'log','--pretty=format:%s','-n','1']).decode('utf-8') + if logmsg.rstrip() != firstline.rstrip(): + print("ERROR: Creating merge failed (already merged?).",file=stderr) + sys.exit(4) + + symlink_files = get_symlink_files() + for f in symlink_files: + print("ERROR: File %s was a symlink" % f) + if len(symlink_files) > 0: + sys.exit(4) + + # Put tree SHA512 into the message + try: + first_sha512 = tree_sha512sum() + message += '\n\nTree-SHA512: ' + first_sha512 + except subprocess.CalledProcessError: + print("ERROR: Unable to compute tree hash") + sys.exit(4) + try: + subprocess.check_call([GIT,'commit','--amend','--no-gpg-sign','-m',message.encode('utf-8')]) + except subprocess.CalledProcessError: + print("ERROR: Cannot update message.", file=stderr) + sys.exit(4) + + print_merge_details(pull, title, branch, base_branch, head_branch) + print() + + # Run test command if configured. + if testcmd: + if subprocess.call(testcmd,shell=True): + print("ERROR: Running %s failed." % testcmd,file=stderr) + sys.exit(5) + + # Show the created merge. + diff = subprocess.check_output([GIT,'diff',merge_branch+'..'+local_merge_branch]) + subprocess.check_call([GIT,'diff',base_branch+'..'+local_merge_branch]) + if diff: + print("WARNING: merge differs from github!",file=stderr) + reply = ask_prompt("Type 'ignore' to continue.") + if reply.lower() == 'ignore': + print("Difference with github ignored.",file=stderr) + else: + sys.exit(6) + else: + # Verify the result manually. + print("Dropping you on a shell so you can try building/testing the merged source.",file=stderr) + print("Run 'git diff HEAD~' to show the changes being merged.",file=stderr) + print("Type 'exit' when done.",file=stderr) + if os.path.isfile('/etc/debian_version'): # Show pull number on Debian default prompt + os.putenv('debian_chroot',pull) + subprocess.call([BASH,'-i']) + + second_sha512 = tree_sha512sum() + if first_sha512 != second_sha512: + print("ERROR: Tree hash changed unexpectedly",file=stderr) + sys.exit(8) + + # Sign the merge commit. + print_merge_details(pull, title, branch, base_branch, head_branch) + while True: + reply = ask_prompt("Type 's' to sign off on the above merge, or 'x' to reject and exit.").lower() + if reply == 's': + try: + subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit']) + break + except subprocess.CalledProcessError: + print("Error while signing, asking again.",file=stderr) + elif reply == 'x': + print("Not signing off on merge, exiting.",file=stderr) + sys.exit(1) + + # Put the result in branch. + subprocess.check_call([GIT,'checkout','-q',branch]) + subprocess.check_call([GIT,'reset','-q','--hard',local_merge_branch]) + finally: + # Clean up temporary branches. + subprocess.call([GIT,'checkout','-q',branch]) + subprocess.call([GIT,'branch','-q','-D',head_branch],stderr=devnull) + subprocess.call([GIT,'branch','-q','-D',base_branch],stderr=devnull) + subprocess.call([GIT,'branch','-q','-D',merge_branch],stderr=devnull) + subprocess.call([GIT,'branch','-q','-D',local_merge_branch],stderr=devnull) + + # Push the result. + while True: + reply = ask_prompt("Type 'push' to push the result to %s, branch %s, or 'x' to exit without pushing." % (host_repo,branch)).lower() + if reply == 'push': + subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch]) + break + elif reply == 'x': + sys.exit(1) + +if __name__ == '__main__': + main() + diff --git a/contrib/devtools/lint-whitespace.sh b/contrib/devtools/lint-whitespace.sh new file mode 100644 index 0000000..beb7ec4 --- /dev/null +++ b/contrib/devtools/lint-whitespace.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# +# Check for new lines in diff that introduce trailing whitespace. + +# We can't run this check unless we know the commit range for the PR. + +export LC_ALL=C +while getopts "?" opt; do + case $opt in + ?) + echo "Usage: .lint-whitespace.sh [N]" + echo " TRAVIS_COMMIT_RANGE='' .lint-whitespace.sh" + echo " .lint-whitespace.sh -?" + echo "Checks unstaged changes, the previous N commits, or a commit range." + echo "TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' .lint-whitespace.sh" + exit 0 + ;; + esac +done + +if [ -z "${TRAVIS_COMMIT_RANGE}" ]; then + if [ "$1" ]; then + TRAVIS_COMMIT_RANGE="HEAD~$1...HEAD" + else + TRAVIS_COMMIT_RANGE="HEAD" + fi +fi + +showdiff() { + if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- "." ":(exclude)depends/patches/" ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/"; then + echo "Failed to get a diff" + exit 1 + fi +} + +showcodediff() { + if ! git diff -U0 "${TRAVIS_COMMIT_RANGE}" -- *.cpp *.h *.md *.py *.sh ":(exclude)src/leveldb/" ":(exclude)src/secp256k1/" ":(exclude)src/univalue/" ":(exclude)doc/release-notes/"; then + echo "Failed to get a diff" + exit 1 + fi +} + +RET=0 + +# Check if trailing whitespace was found in the diff. +if showdiff | grep -E -q '^\+.*\s+$'; then + echo "This diff appears to have added new lines with trailing whitespace." + echo "The following changes were suspected:" + FILENAME="" + SEEN=0 + SEENLN=0 + while read -r line; do + if [[ "$line" =~ ^diff ]]; then + FILENAME="$line" + SEEN=0 + elif [[ "$line" =~ ^@@ ]]; then + LINENUMBER="$line" + SEENLN=0 + else + if [ "$SEEN" -eq 0 ]; then + # The first time a file is seen with trailing whitespace, we print the + # filename (preceded by a newline). + echo + echo "$FILENAME" + SEEN=1 + fi + if [ "$SEENLN" -eq 0 ]; then + echo "$LINENUMBER" + SEENLN=1 + fi + echo "$line" + fi + done < <(showdiff | grep -E '^(diff --git |@@|\+.*\s+$)') + RET=1 +fi + +# Check if tab characters were found in the diff. +if showcodediff | perl -nle '$MATCH++ if m{^\+.*\t}; END{exit 1 unless $MATCH>0}' > /dev/null; then + echo "This diff appears to have added new lines with tab characters instead of spaces." + echo "The following changes were suspected:" + FILENAME="" + SEEN=0 + SEENLN=0 + while read -r line; do + if [[ "$line" =~ ^diff ]]; then + FILENAME="$line" + SEEN=0 + elif [[ "$line" =~ ^@@ ]]; then + LINENUMBER="$line" + SEENLN=0 + else + if [ "$SEEN" -eq 0 ]; then + # The first time a file is seen with a tab character, we print the + # filename (preceded by a newline). + echo + echo "$FILENAME" + SEEN=1 + fi + if [ "$SEENLN" -eq 0 ]; then + echo "$LINENUMBER" + SEENLN=1 + fi + echo "$line" + fi + done < <(showcodediff | perl -nle 'print if m{^(diff --git |@@|\+.*\t)}') + RET=1 +fi + +exit $RET diff --git a/contrib/devtools/logprint-scanner.py b/contrib/devtools/logprint-scanner.py new file mode 100644 index 0000000..3e5ec86 --- /dev/null +++ b/contrib/devtools/logprint-scanner.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-2018 The Versess developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import os, sys +from subprocess import check_output + +def countRelevantCommas(line): + openParensPosStack = [] + openParensPos = 0 + charCounter = 0 + numRelevantCommas = 0 + firstOpenParensIndex = line.find("(") + + for char in line: + if char == '(': + openParensPosStack.append(charCounter) + + if char == ')': + openParensPosStack.pop() + + if char == "," and openParensPosStack[-1] == firstOpenParensIndex: + numRelevantCommas += 1 + charCounter += 1 + + return numRelevantCommas + +if __name__ == "__main__": + out = check_output("git rev-parse --show-toplevel", shell=True, universal_newlines=True) + srcDir = out.rstrip() + "/src/" + + filelist = [os.path.join(dp, f) for dp, dn, filenames in os.walk(srcDir) for f in filenames if os.path.splitext(f)[1] == '.cpp' or os.path.splitext(f)[1] == '.h' ] + incorrectInstanceCounter = 0 + + for file in filelist: + f = open(file,"r", encoding="utf-8") + data = f.read() + rows = data.split("\n") + count = 0 + full_data = [] + lineCounter = 1 + + tempLine = "" + tempCount = 0 + + for row in rows: + # Collapse multiple lines into one + tempLine += row + + # Line contains LogPrint or LogPrintf + if tempLine.find("LogPrint") != -1: + if tempLine.count("(") == tempLine.count(")"): + havePercents = tempLine.count('%') > 0 + + if havePercents: + # This line of code has a format specifier that requires checking number of associated arguments + # Determine the number of arguments provided, see if that matches the number of format specifiers + # Count the number of commas after the format specifier string. Check to see if it matches the number of format specifiers. + # Assumes quotes are not escaped in the specifier string and there are no percent signs when specifying the debug level. + + # First, determine the position of the comma after the format specifier section, named commaAfterEndSpecifierStringIndex + firstSpecifierIndex = tempLine.find('%') + startSpecifierStringIndex = tempLine.rfind('"',firstSpecifierIndex) + endSpecifierStringIndex = tempLine.find('"',firstSpecifierIndex) + commaAfterEndSpecifierStringIndex = tempLine.find(',',endSpecifierStringIndex) + + # Count the number of commas after the specifier string + line = "(" + tempLine[commaAfterEndSpecifierStringIndex:-1] + numCommas = countRelevantCommas(line) + + # Determine number of extra percents after specifier string + numExtraPercents = tempLine.count('%', commaAfterEndSpecifierStringIndex) + + # Subtract extra from total count. This is the number of expected specifiers + # ignore %% + numPercents = tempLine.count('%') - numExtraPercents - 2*tempLine.count('%%') + + if numPercents != numCommas: + print("Incorrect number of arguments for LogPrint(f) statement found.") + print(str(file) + ":" + str(lineCounter - tempCount)) + print("Line = " + tempLine) + print("numRelevantCommas = " + str(numCommas) + ", numRelevantPercents = " + str(numPercents)) + print("") + + incorrectInstanceCounter += 1 + + # Done with this multiline, clear tempLine + tempLine = "" + tempCount = 0 + else: + tempCount += 1 + else: + # No LogPrint, clear tempLine + tempLine = "" + tempCount = 0 + + lineCounter += 1 + + print("# of incorrect instances: " + str(incorrectInstanceCounter)) + + sys.exit(incorrectInstanceCounter) diff --git a/contrib/devtools/optimize-pngs.py b/contrib/devtools/optimize-pngs.py new file mode 100644 index 0000000..e9481db --- /dev/null +++ b/contrib/devtools/optimize-pngs.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# Copyright (c) 2014-2018 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). +#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text +''' +import os +import sys +import subprocess +import hashlib +from PIL import Image # pip3 install Pillow + +def file_hash(filename): + '''Return hash of raw file contents''' + with open(filename, 'rb') as f: + return hashlib.sha256(f.read()).hexdigest() + +def content_hash(filename): + '''Return hash of RGBA contents of image''' + i = Image.open(filename) + i = i.convert('RGBA') + data = i.tobytes() + return hashlib.sha256(data).hexdigest() + +pngcrush = 'pngcrush' +git = 'git' +folders = ["src/qt/res/movies", "src/qt/res/icons", "share/pixmaps"] +basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel'], universal_newlines=True, encoding='utf8').rstrip('\n') +totalSaveBytes = 0 +noHashChange = True + +outputArray = [] +for folder in folders: + absFolder=os.path.join(basePath, folder) + for file in os.listdir(absFolder): + extension = os.path.splitext(file)[1] + if extension.lower() == '.png': + print("optimizing {}...".format(file), end =' ') + file_path = os.path.join(absFolder, file) + fileMetaMap = {'file' : file, 'osize': os.path.getsize(file_path), 'sha256Old' : file_hash(file_path)} + fileMetaMap['contentHashPre'] = content_hash(file_path) + + try: + subprocess.call([pngcrush, "-brute", "-ow", "-rem", "gAMA", "-rem", "cHRM", "-rem", "iCCP", "-rem", "sRGB", "-rem", "alla", "-rem", "text", file_path], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + except: + print("pngcrush is not installed, aborting...") + sys.exit(0) + + #verify + if "Not a PNG file" in subprocess.check_output([pngcrush, "-n", "-v", file_path], stderr=subprocess.STDOUT, universal_newlines=True, encoding='utf8'): + print("PNG file "+file+" is corrupted after crushing, check out pngcursh version") + sys.exit(1) + + fileMetaMap['sha256New'] = file_hash(file_path) + fileMetaMap['contentHashPost'] = content_hash(file_path) + + if fileMetaMap['contentHashPre'] != fileMetaMap['contentHashPost']: + print("Image contents of PNG file {} before and after crushing don't match".format(file)) + sys.exit(1) + + fileMetaMap['psize'] = os.path.getsize(file_path) + outputArray.append(fileMetaMap) + print("done") + +print("summary:\n+++++++++++++++++") +for fileDict in outputArray: + oldHash = fileDict['sha256Old'] + newHash = fileDict['sha256New'] + totalSaveBytes += fileDict['osize'] - fileDict['psize'] + noHashChange = noHashChange and (oldHash == newHash) + print(fileDict['file']+"\n size diff from: "+str(fileDict['osize'])+" to: "+str(fileDict['psize'])+"\n old sha256: "+oldHash+"\n new sha256: "+newHash+"\n") + +print("completed. Checksum stable: "+str(noHashChange)+". Total reduction: "+str(totalSaveBytes)+" bytes") diff --git a/contrib/devtools/security-check.py b/contrib/devtools/security-check.py new file mode 100644 index 0000000..44b7f6c --- /dev/null +++ b/contrib/devtools/security-check.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python3 +# Copyright (c) 2015-2018 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Perform basic ELF security checks on a series of executables. +Exit status will be 0 if successful, and the program will be silent. +Otherwise the exit status will be 1 and it will log which executables failed which checks. +Needs `readelf` (for ELF) and `objdump` (for PE). +''' +import subprocess +import sys +import os + +READELF_CMD = os.getenv('READELF', '/usr/bin/readelf') +OBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump') +NONFATAL = {} # checks which are non-fatal for now but only generate a warning + +def check_ELF_PIE(executable): + ''' + Check for position independent executable (PIE), allowing for address space randomization. + ''' + p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + + ok = False + for line in stdout.splitlines(): + line = line.split() + if len(line)>=2 and line[0] == 'Type:' and line[1] == 'DYN': + ok = True + return ok + +def get_ELF_program_headers(executable): + '''Return type and flags for ELF program headers''' + p = subprocess.Popen([READELF_CMD, '-l', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + in_headers = False + count = 0 + headers = [] + for line in stdout.splitlines(): + if line.startswith('Program Headers:'): + in_headers = True + if line == '': + in_headers = False + if in_headers: + if count == 1: # header line + ofs_typ = line.find('Type') + ofs_offset = line.find('Offset') + ofs_flags = line.find('Flg') + ofs_align = line.find('Align') + if ofs_typ == -1 or ofs_offset == -1 or ofs_flags == -1 or ofs_align == -1: + raise ValueError('Cannot parse elfread -lW output') + elif count > 1: + typ = line[ofs_typ:ofs_offset].rstrip() + flags = line[ofs_flags:ofs_align].rstrip() + headers.append((typ, flags)) + count += 1 + return headers + +def check_ELF_NX(executable): + ''' + Check that no sections are writable and executable (including the stack) + ''' + have_wx = False + have_gnu_stack = False + for (typ, flags) in get_ELF_program_headers(executable): + if typ == 'GNU_STACK': + have_gnu_stack = True + if 'W' in flags and 'E' in flags: # section is both writable and executable + have_wx = True + return have_gnu_stack and not have_wx + +def check_ELF_RELRO(executable): + ''' + Check for read-only relocations. + GNU_RELRO program header must exist + Dynamic section must have BIND_NOW flag + ''' + have_gnu_relro = False + for (typ, flags) in get_ELF_program_headers(executable): + # Note: not checking flags == 'R': here as linkers set the permission differently + # This does not affect security: the permission flags of the GNU_RELRO program header are ignored, the PT_LOAD header determines the effective permissions. + # However, the dynamic linker need to write to this area so these are RW. + # Glibc itself takes care of mprotecting this area R after relocations are finished. + # See also https://marc.info/?l=binutils&m=1498883354122353 + if typ == 'GNU_RELRO': + have_gnu_relro = True + + have_bindnow = False + p = subprocess.Popen([READELF_CMD, '-d', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + for line in stdout.splitlines(): + tokens = line.split() + if len(tokens)>1 and tokens[1] == '(BIND_NOW)' or (len(tokens)>2 and tokens[1] == '(FLAGS)' and 'BIND_NOW' in tokens[2:]): + have_bindnow = True + return have_gnu_relro and have_bindnow + +def check_ELF_Canary(executable): + ''' + Check for use of stack canary + ''' + p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + ok = False + for line in stdout.splitlines(): + if '__stack_chk_fail' in line: + ok = True + return ok + +def get_PE_dll_characteristics(executable): + ''' + Get PE DllCharacteristics bits. + Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386' + and bits is the DllCharacteristics value. + ''' + p = subprocess.Popen([OBJDUMP_CMD, '-x', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + arch = '' + bits = 0 + for line in stdout.splitlines(): + tokens = line.split() + if len(tokens)>=2 and tokens[0] == 'architecture:': + arch = tokens[1].rstrip(',') + if len(tokens)>=2 and tokens[0] == 'DllCharacteristics': + bits = int(tokens[1],16) + return (arch,bits) + +IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020 +IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE = 0x0040 +IMAGE_DLL_CHARACTERISTICS_NX_COMPAT = 0x0100 + +def check_PE_DYNAMIC_BASE(executable): + '''PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)''' + (arch,bits) = get_PE_dll_characteristics(executable) + reqbits = IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE + return (bits & reqbits) == reqbits + +# On 64 bit, must support high-entropy 64-bit address space layout randomization in addition to DYNAMIC_BASE +# to have secure ASLR. +def check_PE_HIGH_ENTROPY_VA(executable): + '''PIE: DllCharacteristics bit 0x20 signifies high-entropy ASLR''' + (arch,bits) = get_PE_dll_characteristics(executable) + if arch == 'i386:x86-64': + reqbits = IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA + else: # Unnecessary on 32-bit + assert(arch == 'i386') + reqbits = 0 + return (bits & reqbits) == reqbits + +def check_PE_NX(executable): + '''NX: DllCharacteristics bit 0x100 signifies nxcompat (DEP)''' + (arch,bits) = get_PE_dll_characteristics(executable) + return (bits & IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) == IMAGE_DLL_CHARACTERISTICS_NX_COMPAT + +CHECKS = { +'ELF': [ + ('PIE', check_ELF_PIE), + ('NX', check_ELF_NX), + ('RELRO', check_ELF_RELRO), + ('Canary', check_ELF_Canary) +], +'PE': [ + ('DYNAMIC_BASE', check_PE_DYNAMIC_BASE), + ('HIGH_ENTROPY_VA', check_PE_HIGH_ENTROPY_VA), + ('NX', check_PE_NX) +] +} + +def identify_executable(executable): + with open(filename, 'rb') as f: + magic = f.read(4) + if magic.startswith(b'MZ'): + return 'PE' + elif magic.startswith(b'\x7fELF'): + return 'ELF' + return None + +if __name__ == '__main__': + retval = 0 + for filename in sys.argv[1:]: + try: + etype = identify_executable(filename) + if etype is None: + print('%s: unknown format' % filename) + retval = 1 + continue + + failed = [] + warning = [] + for (name, func) in CHECKS[etype]: + if not func(filename): + if name in NONFATAL: + warning.append(name) + else: + failed.append(name) + if failed: + print('%s: failed %s' % (filename, ' '.join(failed))) + retval = 1 + if warning: + print('%s: warning %s' % (filename, ' '.join(warning))) + except IOError: + print('%s: cannot open' % filename) + retval = 1 + sys.exit(retval) + diff --git a/contrib/devtools/split-debug.sh.in b/contrib/devtools/split-debug.sh.in new file mode 100644 index 0000000..92b72b1 --- /dev/null +++ b/contrib/devtools/split-debug.sh.in @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +if [ $# -ne 3 ]; + then echo "usage: $0 " +fi + +@OBJCOPY@ --enable-deterministic-archives -p --only-keep-debug $1 $3 +@OBJCOPY@ --enable-deterministic-archives -p --strip-debug $1 $2 +@STRIP@ --enable-deterministic-archives -p -s $2 +@OBJCOPY@ --enable-deterministic-archives -p --add-gnu-debuglink=$3 $2 diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py new file mode 100644 index 0000000..7729dd7 --- /dev/null +++ b/contrib/devtools/symbol-check.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +# Copyright (c) 2014 Wladimir J. van der Laan +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +A script to check that the (Linux) executables produced by gitian only contain +allowed gcc, glibc and libstdc++ version symbols. This makes sure they are +still compatible with the minimum supported Linux distribution versions. + +Example usage: + + find ../gitian-builder/build -type f -executable | xargs python3 contrib/devtools/symbol-check.py +''' +import subprocess +import re +import sys +import os + +# Debian 6.0.9 (Squeeze) has: +# +# - g++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=g%2B%2B) +# - libc version 2.11.3 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libc6) +# - libstdc++ version 4.4.5 (https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libstdc%2B%2B6) +# +# Ubuntu 10.04.4 (Lucid Lynx) has: +# +# - g++ version 4.4.3 (http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=lucid§ion=all) +# - libc version 2.11.1 (http://packages.ubuntu.com/search?keywords=libc6&searchon=names&suite=lucid§ion=all) +# - libstdc++ version 4.4.3 (http://packages.ubuntu.com/search?suite=lucid§ion=all&arch=any&keywords=libstdc%2B%2B&searchon=names) +# +# Taking the minimum of these as our target. +# +# According to GNU ABI document (http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to: +# GCC 4.4.0: GCC_4.4.0 +# GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3 +# (glibc) GLIBC_2_11 +# +MAX_VERSIONS = { +'GCC': (4,4,0), +'CXXABI': (1,3,3), +'GLIBCXX': (3,4,13), +'GLIBC': (2,11), +'LIBATOMIC': (1,0) +} +# See here for a description of _IO_stdin_used: +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#109 + +# Ignore symbols that are exported as part of every executable +IGNORE_EXPORTS = { +'_edata', '_end', '__end__', '_init', '__bss_start', '__bss_start__', '_bss_end__', '__bss_end__', '_fini', '_IO_stdin_used', 'stdin', 'stdout', 'stderr' +} +READELF_CMD = os.getenv('READELF', '/usr/bin/readelf') +CPPFILT_CMD = os.getenv('CPPFILT', '/usr/bin/c++filt') +# Allowed NEEDED libraries +ALLOWED_LIBRARIES = { +# bitcoind and bitcoin-qt +'libgcc_s.so.1', # GCC base support +'libc.so.6', # C library +'libpthread.so.0', # threading +'libanl.so.1', # DNS resolve +'libm.so.6', # math library +'librt.so.1', # real-time (clock) +'libatomic.so.1', +'ld-linux-x86-64.so.2', # 64-bit dynamic linker +'ld-linux.so.2', # 32-bit dynamic linker +'ld-linux-aarch64.so.1', # 64-bit ARM dynamic linker +'ld-linux-armhf.so.3', # 32-bit ARM dynamic linker +'ld-linux-riscv64-lp64d.so.1', # 64-bit RISC-V dynamic linker +# bitcoin-qt only +'libX11-xcb.so.1', # part of X11 +'libX11.so.6', # part of X11 +'libxcb.so.1', # part of X11 +'libfontconfig.so.1', # font support +'libfreetype.so.6', # font parsing +'libdl.so.2' # programming interface to dynamic linker +} +ARCH_MIN_GLIBC_VER = { +'80386': (2,1), +'X86-64': (2,2,5), +'ARM': (2,4), +'AArch64':(2,17), +'RISC-V': (2,27) +} +class CPPFilt(object): + ''' + Demangle C++ symbol names. + + Use a pipe to the 'c++filt' command. + ''' + def __init__(self): + self.proc = subprocess.Popen(CPPFILT_CMD, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) + + def __call__(self, mangled): + self.proc.stdin.write(mangled + '\n') + self.proc.stdin.flush() + return self.proc.stdout.readline().rstrip() + + def close(self): + self.proc.stdin.close() + self.proc.stdout.close() + self.proc.wait() + +def read_symbols(executable, imports=True): + ''' + Parse an ELF executable and return a list of (symbol,version) tuples + for dynamic, imported symbols. + ''' + p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', '-h', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Could not read symbols for %s: %s' % (executable, stderr.strip())) + syms = [] + for line in stdout.splitlines(): + line = line.split() + if 'Machine:' in line: + arch = line[-1] + if len(line)>7 and re.match('[0-9]+:$', line[0]): + (sym, _, version) = line[7].partition('@') + is_import = line[6] == 'UND' + if version.startswith('@'): + version = version[1:] + if is_import == imports: + syms.append((sym, version, arch)) + return syms + +def check_version(max_versions, version, arch): + if '_' in version: + (lib, _, ver) = version.rpartition('_') + else: + lib = version + ver = '0' + ver = tuple([int(x) for x in ver.split('.')]) + if not lib in max_versions: + return False + return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch] + +def read_libraries(filename): + p = subprocess.Popen([READELF_CMD, '-d', '-W', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + if p.returncode: + raise IOError('Error opening file') + libraries = [] + for line in stdout.splitlines(): + tokens = line.split() + if len(tokens)>2 and tokens[1] == '(NEEDED)': + match = re.match('^Shared library: \[(.*)\]$', ' '.join(tokens[2:])) + if match: + libraries.append(match.group(1)) + else: + raise ValueError('Unparseable (NEEDED) specification') + return libraries + +if __name__ == '__main__': + cppfilt = CPPFilt() + retval = 0 + for filename in sys.argv[1:]: + # Check imported symbols + for sym,version,arch in read_symbols(filename, True): + if version and not check_version(MAX_VERSIONS, version, arch): + print('%s: symbol %s from unsupported version %s' % (filename, cppfilt(sym), version)) + retval = 1 + # Check exported symbols + if arch != 'RISC-V': + for sym,version,arch in read_symbols(filename, False): + if sym in IGNORE_EXPORTS: + continue + print('%s: export of symbol %s not allowed' % (filename, cppfilt(sym))) + retval = 1 + # Check dependency libraries + for library_name in read_libraries(filename): + if library_name not in ALLOWED_LIBRARIES: + print('%s: NEEDED library %s is not allowed' % (filename, library_name)) + retval = 1 + + sys.exit(retval) + + diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py new file mode 100644 index 0000000..9b6d6bf --- /dev/null +++ b/contrib/devtools/test-security-check.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +# Copyright (c) 2015-2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Test script for security-check.py +''' +import subprocess +import unittest + +def write_testcode(filename): + with open(filename, 'w', encoding="utf8") as f: + f.write(''' + #include + int main() + { + printf("the quick brown fox jumps over the lazy god\\n"); + return 0; + } + ''') + +def call_security_check(cc, source, executable, options): + subprocess.check_call([cc,source,'-o',executable] + options) + p = subprocess.Popen(['./security-check.py',executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) + (stdout, stderr) = p.communicate() + return (p.returncode, stdout.rstrip()) + +class TestSecurityChecks(unittest.TestCase): + def test_ELF(self): + source = 'test1.c' + executable = 'test1' + cc = 'gcc' + write_testcode(source) + + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro']), + (1, executable+': failed PIE NX RELRO Canary')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro']), + (1, executable+': failed PIE RELRO Canary')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro']), + (1, executable+': failed PIE RELRO')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE']), + (1, executable+': failed RELRO')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE']), + (0, '')) + + def test_32bit_PE(self): + source = 'test1.c' + executable = 'test1.exe' + cc = 'i686-w64-mingw32-gcc' + write_testcode(source) + + self.assertEqual(call_security_check(cc, source, executable, []), + (1, executable+': failed DYNAMIC_BASE NX')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat']), + (1, executable+': failed DYNAMIC_BASE')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase']), + (0, '')) + def test_64bit_PE(self): + source = 'test1.c' + executable = 'test1.exe' + cc = 'x86_64-w64-mingw32-gcc' + write_testcode(source) + + self.assertEqual(call_security_check(cc, source, executable, []), (1, executable+': failed DYNAMIC_BASE NX\n'+executable+': warning HIGH_ENTROPY_VA')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat']), (1, executable+': failed DYNAMIC_BASE\n'+executable+': warning HIGH_ENTROPY_VA')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase']), (0, executable+': warning HIGH_ENTROPY_VA')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase','-Wl,--high-entropy-va']), (0, '')) + +if __name__ == '__main__': + unittest.main() + diff --git a/contrib/devtools/update-translations.py b/contrib/devtools/update-translations.py new file mode 100644 index 0000000..78a5a8c --- /dev/null +++ b/contrib/devtools/update-translations.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python3 +# Copyright (c) 2014 Wladimir J. van der Laan +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Run this script from the root of the repository to update all translations from +transifex. +It will do the following automatically: + +- fetch all translations using the tx tool +- post-process them into valid and committable format + - remove invalid control characters + - remove location tags (makes diffs less noisy) + +TODO: +- auto-add new translations to the build system according to the translation process +''' +import subprocess +import re +import sys +import os +import io +import xml.etree.ElementTree as ET + +# Name of transifex tool +TX = 'tx' +# Name of source language file +SOURCE_LANG = 'versess_en.ts' +# Directory with locale files +LOCALE_DIR = 'src/qt/locale' +# Minimum number of messages for translation to be considered at all +MIN_NUM_MESSAGES = 10 + +def check_at_repository_root(): + if not os.path.exists('.git'): + print('No .git directory found') + print('Execute this script at the root of the repository', file=sys.stderr) + sys.exit(1) + +def fetch_all_translations(): + if subprocess.call([TX, 'pull', '-f', '-a']): + print('Error while fetching translations', file=sys.stderr) + sys.exit(1) + +def find_format_specifiers(s): + '''Find all format specifiers in a string.''' + pos = 0 + specifiers = [] + while True: + percent = s.find('%', pos) + if percent < 0: + break + try: + specifiers.append(s[percent+1]) + except: + print('Failed to get specifier') + pos = percent+2 + return specifiers + +def split_format_specifiers(specifiers): + '''Split format specifiers between numeric (Qt) and others (strprintf)''' + numeric = [] + other = [] + for s in specifiers: + if s in {'1','2','3','4','5','6','7','8','9'}: + numeric.append(s) + else: + other.append(s) + + # If both numeric format specifiers and "others" are used, assume we're dealing + # with a Qt-formatted message. In the case of Qt formatting (see https://doc.qt.io/qt-5/qstring.html#arg) + # only numeric formats are replaced at all. This means "(percentage: %1%)" is valid, without needing + # any kind of escaping that would be necessary for strprintf. Without this, this function + # would wrongly detect '%)' as a printf format specifier. + if numeric: + other = [] + + # numeric (Qt) can be present in any order, others (strprintf) must be in specified order + return set(numeric),other + +def sanitize_string(s): + '''Sanitize string for printing''' + return s.replace('\n',' ') + +def check_format_specifiers(source, translation, errors, numerus): + source_f = split_format_specifiers(find_format_specifiers(source)) + # assert that no source messages contain both Qt and strprintf format specifiers + # if this fails, go change the source as this is hacky and confusing! + assert(not(source_f[0] and source_f[1])) + try: + translation_f = split_format_specifiers(find_format_specifiers(translation)) + except IndexError: + errors.append("Parse error in translation for '%s': '%s'" % (sanitize_string(source), sanitize_string(translation))) + return False + else: + if source_f != translation_f: + if numerus and source_f == (set(), ['n']) and translation_f == (set(), []) and translation.find('%') == -1: + # Allow numerus translations to omit %n specifier (usually when it only has one possible value) + return True + errors.append("Mismatch between '%s' and '%s'" % (sanitize_string(source), sanitize_string(translation))) + return False + return True + +def all_ts_files(suffix=''): + for filename in os.listdir(LOCALE_DIR): + # process only language files, and do not process source language + if not filename.endswith('.ts'+suffix) or filename == SOURCE_LANG+suffix: + continue + if suffix: # remove provided suffix + filename = filename[0:-len(suffix)] + filepath = os.path.join(LOCALE_DIR, filename) + yield(filename, filepath) + +FIX_RE = re.compile(b'[\x00-\x09\x0b\x0c\x0e-\x1f]') +def remove_invalid_characters(s): + '''Remove invalid characters from translation string''' + return FIX_RE.sub(b'', s) + +# Override cdata escape function to make our output match Qt's (optional, just for cleaner diffs for +# comparison, disable by default) +_orig_escape_cdata = None +def escape_cdata(text): + text = _orig_escape_cdata(text) + text = text.replace("'", ''') + text = text.replace('"', '"') + return text + +def postprocess_translations(reduce_diff_hacks=False): + print('Checking and postprocessing...') + + if reduce_diff_hacks: + global _orig_escape_cdata + _orig_escape_cdata = ET._escape_cdata + ET._escape_cdata = escape_cdata + + for (filename,filepath) in all_ts_files(): + os.rename(filepath, filepath+'.orig') + + have_errors = False + for (filename,filepath) in all_ts_files('.orig'): + # pre-fixups to cope with transifex output + parser = ET.XMLParser(encoding='utf-8') # need to override encoding because 'utf8' is not understood only 'utf-8' + with open(filepath + '.orig', 'rb') as f: + data = f.read() + # remove control characters; this must be done over the entire file otherwise the XML parser will fail + data = remove_invalid_characters(data) + tree = ET.parse(io.BytesIO(data), parser=parser) + + # iterate over all messages in file + root = tree.getroot() + for context in root.findall('context'): + for message in context.findall('message'): + numerus = message.get('numerus') == 'yes' + source = message.find('source').text + translation_node = message.find('translation') + # pick all numerusforms + if numerus: + translations = [i.text for i in translation_node.findall('numerusform')] + else: + translations = [translation_node.text] + + for translation in translations: + if translation is None: + continue + errors = [] + valid = check_format_specifiers(source, translation, errors, numerus) + + for error in errors: + print('%s: %s' % (filename, error)) + + if not valid: # set type to unfinished and clear string if invalid + translation_node.clear() + translation_node.set('type', 'unfinished') + have_errors = True + + # Remove location tags + for location in message.findall('location'): + message.remove(location) + + # Remove entire message if it is an unfinished translation + if translation_node.get('type') == 'unfinished': + context.remove(message) + + # check if document is (virtually) empty, and remove it if so + num_messages = 0 + for context in root.findall('context'): + for message in context.findall('message'): + num_messages += 1 + if num_messages < MIN_NUM_MESSAGES: + print('Removing %s, as it contains only %i messages' % (filepath, num_messages)) + continue + + # write fixed-up tree + # if diff reduction requested, replace some XML to 'sanitize' to qt formatting + if reduce_diff_hacks: + out = io.BytesIO() + tree.write(out, encoding='utf-8') + out = out.getvalue() + out = out.replace(b' />', b'/>') + with open(filepath, 'wb') as f: + f.write(out) + else: + tree.write(filepath, encoding='utf-8') + return have_errors + +if __name__ == '__main__': + check_at_repository_root() + fetch_all_translations() + postprocess_translations() + diff --git a/contrib/filter-lcov.py b/contrib/filter-lcov.py new file mode 100644 index 0000000..df1db76 --- /dev/null +++ b/contrib/filter-lcov.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +import argparse + +parser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.') +parser.add_argument('--pattern', '-p', action='append', help='the pattern of files to remove', required=True) +parser.add_argument('tracefile', help='the tracefile to remove the coverage data from') +parser.add_argument('outfile', help='filename for the output to be written to') + +args = parser.parse_args() +tracefile = args.tracefile +pattern = args.pattern +outfile = args.outfile + +in_remove = False +with open(tracefile, 'r', encoding="utf8") as f: + with open(outfile, 'w', encoding="utf8") as wf: + for line in f: + for p in pattern: + if line.startswith("SF:") and p in line: + in_remove = True + if not in_remove: + wf.write(line) + if line == 'end_of_record\n': + in_remove = False diff --git a/contrib/gitian-build.py b/contrib/gitian-build.py new file mode 100644 index 0000000..ca35646 --- /dev/null +++ b/contrib/gitian-build.py @@ -0,0 +1,262 @@ +#!/usr/bin/env python3 + +import argparse +import os +import subprocess +import sys + +def setup(): + global args, workdir + programs = ['ruby', 'git', 'make', 'wget', 'curl'] + if args.kvm: + programs += ['apt-cacher-ng', 'python-vm-builder', 'qemu-kvm', 'qemu-utils'] + elif args.docker and not os.path.isfile('/lib/systemd/system/docker.service'): + dockers = ['docker.io', 'docker-ce'] + for i in dockers: + return_code = subprocess.call(['sudo', 'apt-get', 'install', '-qq', i]) + if return_code == 0: + break + if return_code != 0: + print('Cannot find any way to install Docker.', file=sys.stderr) + sys.exit(1) + else: + programs += ['apt-cacher-ng', 'lxc', 'debootstrap'] + subprocess.check_call(['sudo', 'apt-get', 'install', '-qq'] + programs) + if not os.path.isdir('gitian.sigs'): + subprocess.check_call(['git', 'clone', 'https://github.com/versess-Project/gitian.sigs.git']) + if not os.path.isdir('versess-detached-sigs'): + subprocess.check_call(['git', 'clone', 'https://github.com/versess-Project/versess-detached-sigs.git']) + if not os.path.isdir('gitian-builder'): + subprocess.check_call(['git', 'clone', 'https://github.com/devrandom/gitian-builder.git']) + if not os.path.isdir('versess'): + subprocess.check_call(['git', 'clone', 'https://github.com/versess-Project/versess.git']) + os.chdir('gitian-builder') + make_image_prog = ['bin/make-base-vm', '--suite', 'bionic', '--arch', 'amd64'] + if args.docker: + make_image_prog += ['--docker'] + elif not args.kvm: + make_image_prog += ['--lxc'] + subprocess.check_call(make_image_prog) + os.chdir(workdir) + if args.is_bionic and not args.kvm and not args.docker: + subprocess.check_call(['sudo', 'sed', '-i', 's/lxcbr0/br0/', '/etc/default/lxc-net']) + print('Reboot is required') + sys.exit(0) + +def build(): + global args, workdir + + os.makedirs('versess-binaries/' + args.version, exist_ok=True) + print('\nBuilding Dependencies\n') + os.chdir('gitian-builder') + os.makedirs('inputs', exist_ok=True) + + subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz']) + subprocess.check_call(['wget', '-N', '-P', 'inputs', 'https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch']) + subprocess.check_call(["echo 'a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 inputs/osslsigncode-Backports-to-1.7.1.patch' | sha256sum -c"], shell=True) + subprocess.check_call(["echo 'f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 inputs/osslsigncode-1.7.1.tar.gz' | sha256sum -c"], shell=True) + subprocess.check_call(['make', '-C', '../versess/depends', 'download', 'SOURCES_PATH=' + os.getcwd() + '/cache/common']) + + if args.linux: + print('\nCompiling ' + args.version + ' Linux') + subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'versess='+args.commit, '--url', 'versess='+args.url, '../versess/contrib/gitian-descriptors/gitian-linux.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-linux', '--destination', '../gitian.sigs/', '../versess/contrib/gitian-descriptors/gitian-linux.yml']) + subprocess.check_call('mv build/out/versess-*.tar.gz build/out/src/versess-*.tar.gz ../versess-binaries/'+args.version, shell=True) + + if args.windows: + print('\nCompiling ' + args.version + ' Windows') + subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'versess='+args.commit, '--url', 'versess='+args.url, '../versess/contrib/gitian-descriptors/gitian-win.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-win-unsigned', '--destination', '../gitian.sigs/', '../versess/contrib/gitian-descriptors/gitian-win.yml']) + subprocess.check_call('mv build/out/versess-*-win-unsigned.tar.gz inputs/', shell=True) + subprocess.check_call('mv build/out/versess-*.zip build/out/versess-*.exe build/out/src/versess-*.tar.gz ../versess-binaries/'+args.version, shell=True) + + if args.macos: + print('\nCompiling ' + args.version + ' MacOS') + subprocess.check_call(['bin/gbuild', '-j', args.jobs, '-m', args.memory, '--commit', 'versess='+args.commit, '--url', 'versess='+args.url, '../versess/contrib/gitian-descriptors/gitian-osx.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-osx-unsigned', '--destination', '../gitian.sigs/', '../versess/contrib/gitian-descriptors/gitian-osx.yml']) + subprocess.check_call('mv build/out/versess-*-osx-unsigned.tar.gz inputs/', shell=True) + subprocess.check_call('mv build/out/versess-*.tar.gz build/out/versess-*.dmg build/out/src/versess-*.tar.gz ../versess-binaries/'+args.version, shell=True) + + os.chdir(workdir) + + if args.commit_files: + print('\nCommitting '+args.version+' Unsigned Sigs\n') + os.chdir('gitian.sigs') + subprocess.check_call(['git', 'add', args.version+'-linux/'+args.signer]) + subprocess.check_call(['git', 'add', args.version+'-win-unsigned/'+args.signer]) + subprocess.check_call(['git', 'add', args.version+'-osx-unsigned/'+args.signer]) + subprocess.check_call(['git', 'commit', '-m', 'Add '+args.version+' unsigned sigs for '+args.signer]) + os.chdir(workdir) + +def sign(): + global args, workdir + os.chdir('gitian-builder') + + if args.windows: + print('\nSigning ' + args.version + ' Windows') + subprocess.check_call('cp inputs/versess-' + args.version + '-win-unsigned.tar.gz inputs/versess-win-unsigned.tar.gz', shell=True) + subprocess.check_call(['bin/gbuild', '--skip-image', '--upgrade', '--commit', 'signature='+args.commit, '../versess/contrib/gitian-descriptors/gitian-win-signer.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-win-signed', '--destination', '../gitian.sigs/', '../versess/contrib/gitian-descriptors/gitian-win-signer.yml']) + subprocess.check_call('mv build/out/versess-*win64-setup.exe ../versess-binaries/'+args.version, shell=True) + subprocess.check_call('mv build/out/versess-*win32-setup.exe ../versess-binaries/'+args.version, shell=True) + + if args.macos: + print('\nSigning ' + args.version + ' MacOS') + subprocess.check_call('cp inputs/versess-' + args.version + '-osx-unsigned.tar.gz inputs/versess-osx-unsigned.tar.gz', shell=True) + subprocess.check_call(['bin/gbuild', '--skip-image', '--upgrade', '--commit', 'signature='+args.commit, '../versess/contrib/gitian-descriptors/gitian-osx-signer.yml']) + subprocess.check_call(['bin/gsign', '-p', args.sign_prog, '--signer', args.signer, '--release', args.version+'-osx-signed', '--destination', '../gitian.sigs/', '../versess/contrib/gitian-descriptors/gitian-osx-signer.yml']) + subprocess.check_call('mv build/out/versess-osx-signed.dmg ../versess-binaries/'+args.version+'/versess-'+args.version+'-osx.dmg', shell=True) + + os.chdir(workdir) + + if args.commit_files: + print('\nCommitting '+args.version+' Signed Sigs\n') + os.chdir('gitian.sigs') + subprocess.check_call(['git', 'add', args.version+'-win-signed/'+args.signer]) + subprocess.check_call(['git', 'add', args.version+'-osx-signed/'+args.signer]) + subprocess.check_call(['git', 'commit', '-a', '-m', 'Add '+args.version+' signed binary sigs for '+args.signer]) + os.chdir(workdir) + +def verify(): + global args, workdir + rc = 0 + os.chdir('gitian-builder') + + print('\nVerifying v'+args.version+' Linux\n') + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-linux', '../versess/contrib/gitian-descriptors/gitian-linux.yml']): + print('Verifying v'+args.version+' Linux FAILED\n') + rc = 1 + + print('\nVerifying v'+args.version+' Windows\n') + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-win-unsigned', '../versess/contrib/gitian-descriptors/gitian-win.yml']): + print('Verifying v'+args.version+' Windows FAILED\n') + rc = 1 + + print('\nVerifying v'+args.version+' MacOS\n') + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-win-signed', '../versess/contrib/gitian-descriptors/gitian-osx.yml']): + print('Verifying v'+args.version+' MacOS FAILED\n') + rc = 1 + + print('\nVerifying v'+args.version+' Signed Windows\n') + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-win-signed', '../versess/contrib/gitian-descriptors/gitian-win-signer.yml']): + print('Verifying v'+args.version+' Signed Windows FAILED\n') + rc = 1 + + print('\nVerifying v'+args.version+' Signed MacOS\n') + if subprocess.call(['bin/gverify', '-v', '-d', '../gitian.sigs/', '-r', args.version+'-osx-signed', '../versess/contrib/gitian-descriptors/gitian-osx-signer.yml']): + print('Verifying v'+args.version+' Signed MacOS FAILED\n') + rc = 1 + + os.chdir(workdir) + return rc + +def main(): + global args, workdir + + parser = argparse.ArgumentParser(description='Script for running full Gitian builds.') + parser.add_argument('-c', '--commit', action='store_true', dest='commit', help='Indicate that the version argument is for a commit or branch') + parser.add_argument('-p', '--pull', action='store_true', dest='pull', help='Indicate that the version argument is the number of a github repository pull request') + parser.add_argument('-u', '--url', dest='url', default='https://github.com/versess-Project/versess', help='Specify the URL of the repository. Default is %(default)s') + parser.add_argument('-v', '--verify', action='store_true', dest='verify', help='Verify the Gitian build') + parser.add_argument('-b', '--build', action='store_true', dest='build', help='Do a Gitian build') + parser.add_argument('-s', '--sign', action='store_true', dest='sign', help='Make signed binaries for Windows and MacOS') + parser.add_argument('-B', '--buildsign', action='store_true', dest='buildsign', help='Build both signed and unsigned binaries') + parser.add_argument('-o', '--os', dest='os', default='lwm', help='Specify which Operating Systems the build is for. Default is %(default)s. l for Linux, w for Windows, m for MacOS') + parser.add_argument('-j', '--jobs', dest='jobs', default='2', help='Number of processes to use. Default %(default)s') + parser.add_argument('-m', '--memory', dest='memory', default='2000', help='Memory to allocate in MiB. Default %(default)s') + parser.add_argument('-k', '--kvm', action='store_true', dest='kvm', help='Use KVM instead of LXC') + parser.add_argument('-d', '--docker', action='store_true', dest='docker', help='Use Docker instead of LXC') + parser.add_argument('-S', '--setup', action='store_true', dest='setup', help='Set up the Gitian building environment. Only works on Debian-based systems (Ubuntu, Debian)') + parser.add_argument('-D', '--detach-sign', action='store_true', dest='detach_sign', help='Create the assert file for detached signing. Will not commit anything.') + parser.add_argument('-n', '--no-commit', action='store_false', dest='commit_files', help='Do not commit anything to git') + parser.add_argument('signer', nargs='?', help='GPG signer to sign each build assert file') + parser.add_argument('version', nargs='?', help='Version number, commit, or branch to build. If building a commit or branch, the -c option must be specified') + + args = parser.parse_args() + workdir = os.getcwd() + + args.is_bionic = b'bionic' in subprocess.check_output(['lsb_release', '-cs']) + + if args.kvm and args.docker: + raise Exception('Error: cannot have both kvm and docker') + + # Ensure no more than one environment variable for gitian-builder (USE_LXC, USE_VBOX, USE_DOCKER) is set as they + # can interfere (e.g., USE_LXC being set shadows USE_DOCKER; for details see gitian-builder/libexec/make-clean-vm). + os.environ['USE_LXC'] = '' + os.environ['USE_VBOX'] = '' + os.environ['USE_DOCKER'] = '' + if args.docker: + os.environ['USE_DOCKER'] = '1' + elif not args.kvm: + os.environ['USE_LXC'] = '1' + if 'GITIAN_HOST_IP' not in os.environ.keys(): + os.environ['GITIAN_HOST_IP'] = '10.0.3.1' + if 'LXC_GUEST_IP' not in os.environ.keys(): + os.environ['LXC_GUEST_IP'] = '10.0.3.5' + + if args.setup: + setup() + + if args.buildsign: + args.build = True + args.sign = True + + if not args.build and not args.sign and not args.verify: + sys.exit(0) + + args.linux = 'l' in args.os + args.windows = 'w' in args.os + args.macos = 'm' in args.os + + # Disable for MacOS if no SDK found + if args.macos and not os.path.isfile('gitian-builder/inputs/MacOSX10.11.sdk.tar.gz'): + print('Cannot build for MacOS, SDK does not exist. Will build for other OSes') + args.macos = False + + args.sign_prog = 'true' if args.detach_sign else 'gpg --detach-sign' + + script_name = os.path.basename(sys.argv[0]) + if not args.signer: + print(script_name+': Missing signer') + print('Try '+script_name+' --help for more information') + sys.exit(1) + if not args.version: + print(script_name+': Missing version') + print('Try '+script_name+' --help for more information') + sys.exit(1) + + # Add leading 'v' for tags + if args.commit and args.pull: + raise Exception('Cannot have both commit and pull') + args.commit = ('' if args.commit else 'v') + args.version + + os.chdir('versess') + if args.pull: + subprocess.check_call(['git', 'fetch', args.url, 'refs/pull/'+args.version+'/merge']) + os.chdir('../gitian-builder/inputs/versess') + subprocess.check_call(['git', 'fetch', args.url, 'refs/pull/'+args.version+'/merge']) + args.commit = subprocess.check_output(['git', 'show', '-s', '--format=%H', 'FETCH_HEAD'], universal_newlines=True, encoding='utf8').strip() + args.version = 'pull-' + args.version + print(args.commit) + subprocess.check_call(['git', 'fetch']) + subprocess.check_call(['git', 'checkout', args.commit]) + os.chdir(workdir) + + os.chdir('gitian-builder') + subprocess.check_call(['git', 'pull']) + os.chdir(workdir) + + if args.build: + build() + + if args.sign: + sign() + + if args.verify: + os.chdir('gitian.sigs') + subprocess.check_call(['git', 'pull']) + os.chdir(workdir) + sys.exit(verify()) + +if __name__ == '__main__': + main() diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml new file mode 100644 index 0000000..ad94be7 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -0,0 +1,193 @@ +--- +name: "versess-linux-3.4" +enable_cache: true +distro: "ubuntu" +suites: +- "bionic" +architectures: +- "amd64" +packages: +- "curl" +- "g++-aarch64-linux-gnu" +- "g++-8-aarch64-linux-gnu" +- "gcc-8-aarch64-linux-gnu" +- "binutils-aarch64-linux-gnu" +- "g++-arm-linux-gnueabihf" +- "g++-8-arm-linux-gnueabihf" +- "gcc-8-arm-linux-gnueabihf" +- "binutils-arm-linux-gnueabihf" +- "g++-riscv64-linux-gnu" +- "g++-8-riscv64-linux-gnu" +- "gcc-8-riscv64-linux-gnu" +- "binutils-riscv64-linux-gnu" +- "g++-8-multilib" +- "gcc-8-multilib" +- "binutils-gold" +- "git" +- "pkg-config" +- "autoconf" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +- "ca-certificates" +- "python3" +remotes: +- "url": "https://github.com/versess-project/versess.git" + "dir": "versess" +files: [] +script: | + set -e -o pipefail + + WRAP_DIR=$HOME/wrapped + HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu" + CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests" + FAKETIME_HOST_PROGS="gcc g++" + FAKETIME_PROGS="date ar ranlib nm" + HOST_CFLAGS="-O2 -g" + HOST_CXXFLAGS="-O2 -g" + HOST_LDFLAGS=-static-libstdc++ + + export QT_RCC_TEST=1 + export QT_RCC_SOURCE_DATE_OVERRIDE=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 + + function create_global_faketime_wrappers { + for prog in ${FAKETIME_PROGS}; do + echo '#!/usr/bin/env 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/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + } + + function create_per-host_faketime_wrappers { + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + if which ${i}-${prog}-8 + then + echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + fi + done + done + } + + # Faketime for depends so intermediate results are comparable + export PATH_orig=${PATH} + create_global_faketime_wrappers "2000-01-01 12:00:00" + create_per-host_faketime_wrappers "2000-01-01 12:00:00" + export PATH=${WRAP_DIR}:${PATH} + + EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes + mkdir -p $EXTRA_INCLUDES_BASE + + # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm, + # but we can't write there. Instead, create a link here and force it to be included in the + # search paths by wrapping gcc/g++. + + mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu + rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm + ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm + + for prog in gcc g++; do + rm -f ${WRAP_DIR}/${prog} + cat << EOF > ${WRAP_DIR}/${prog} + #!/usr/bin/env bash + REAL="`which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1`" + for var in "\$@" + do + if [ "\$var" = "-m32" ]; then + export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" + export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu" + break + fi + done + \$REAL \$@ + EOF + chmod +x ${WRAP_DIR}/${prog} + done + + cd versess + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i" + if [ -d "$EXTRA_INCLUDES" ]; then + export HOST_ID_SALT="$EXTRA_INCLUDES" + fi + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + unset HOST_ID_SALT + done + + # Faketime for binaries + export PATH=${PATH_orig} + create_global_faketime_wrappers "${REFERENCE_DATETIME}" + create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" + export PATH=${WRAP_DIR}:${PATH} + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ + make dist + SOURCEDIST=`echo versess-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find versess-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd + + # Workaround for tarball not building with the bare tag version (prep) + make -C src obj/build.h + + 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 + + # Workaround for tarball not building with the bare tag version + echo '#!/bin/true' >share/genbuild.sh + mkdir src/obj + cp ../src/obj/build.h src/obj/ + + CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" + make ${MAKEOPTS} + make ${MAKEOPTS} -C src check-security + make ${MAKEOPTS} -C src check-symbols + make install DESTDIR=${INSTALLPATH} + cd installed + find . -name "lib*.la" -delete + find . -name "lib*.a" -delete + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg + #find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg + cp ../doc/README.md ${DISTNAME}/ + find ${DISTNAME} -not -name "*.dbg" | 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 + find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz + cd ../../ + rm -rf distsrc-${i} + done + mkdir -p $OUTDIR/src + mv $SOURCEDIST $OUTDIR/src diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml new file mode 100644 index 0000000..4f3ce26 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -0,0 +1,40 @@ +--- +name: "versess-dmg-signer" +distro: "ubuntu" +suites: +- "bionic" +architectures: +- "amd64" +packages: +- "faketime" +remotes: +- "url": "https://github.com/versess-project/versess-detached-sigs.git" + "dir": "signature" +files: +- "versess-osx-unsigned.tar.gz" +script: | + set -e -o pipefail + + 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 '#!/usr/bin/env 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/x86_64-linux-gnu/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=versess-osx-unsigned.tar.gz + SIGNED=versess-osx-signed.dmg + + tar -xf ${UNSIGNED} + OSX_VOLNAME="$(cat osx_volname)" + ./detached-sig-apply.sh ${UNSIGNED} signature/osx + ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -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 0000000..00bb414 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -0,0 +1,170 @@ +--- +name: "versess-osx-3.4" +enable_cache: true +distro: "ubuntu" +suites: +- "bionic" +architectures: +- "amd64" +packages: +- "ca-certificates" +- "curl" +- "g++" +- "git" +- "pkg-config" +- "autoconf" +- "librsvg2-bin" +- "libtiff-tools" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +- "cmake" +- "imagemagick" +- "libcap-dev" +- "libz-dev" +- "libbz2-dev" +- "python3" +- "python3-dev" +- "python3-setuptools" +- "fonts-tuffy" +remotes: +- "url": "https://github.com/versess-project/versess.git" + "dir": "versess" +files: +- "MacOSX10.11.sdk.tar.gz" +script: | + set -e -o pipefail + + WRAP_DIR=$HOME/wrapped + HOSTS="x86_64-apple-darwin14" + CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage" + FAKETIME_HOST_PROGS="" + FAKETIME_PROGS="ar ranlib date dmg genisoimage" + + export QT_RCC_TEST=1 + export QT_RCC_SOURCE_DATE_OVERRIDE=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 + + function create_global_faketime_wrappers { + for prog in ${FAKETIME_PROGS}; do + echo '#!/usr/bin/env 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/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + } + + function create_per-host_faketime_wrappers { + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/usr/bin/env 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/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + } + + # Faketime for depends so intermediate results are comparable + export PATH_orig=${PATH} + create_global_faketime_wrappers "2000-01-01 12:00:00" + create_per-host_faketime_wrappers "2000-01-01 12:00:00" + export PATH=${WRAP_DIR}:${PATH} + + cd versess + BASEPREFIX=`pwd`/depends + + mkdir -p ${BASEPREFIX}/SDKs + tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz + + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Faketime for binaries + export PATH=${PATH_orig} + create_global_faketime_wrappers "${REFERENCE_DATETIME}" + create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" + export PATH=${WRAP_DIR}:${PATH} + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ + make dist + SOURCEDIST=`echo versess-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find versess-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + popd + + # Workaround for tarball not building with the bare tag version (prep) + make -C src obj/build.h + + 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 + + # Workaround for tarball not building with the bare tag version + echo '#!/bin/true' >share/genbuild.sh + mkdir src/obj + cp ../src/obj/build.h src/obj/ + + CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} + make ${MAKEOPTS} + make install-strip DESTDIR=${INSTALLPATH} + + make osx_volname + make deploydir + OSX_VOLNAME="$(cat osx_volname)" + mkdir -p unsigned-app-${i} + cp osx_volname 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 "${OSX_VOLNAME}.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-signer.yml b/contrib/gitian-descriptors/gitian-win-signer.yml new file mode 100644 index 0000000..cd8fc0f --- /dev/null +++ b/contrib/gitian-descriptors/gitian-win-signer.yml @@ -0,0 +1,42 @@ +--- +name: "versess-win-signer" +distro: "ubuntu" +suites: +- "bionic" +architectures: +- "amd64" +packages: +# Once osslsigncode supports openssl 1.1, we can change this back to libssl-dev +- "libssl1.0-dev" +- "autoconf" +remotes: +- "url": "https://github.com/versess-project/versess-detached-sigs.git" + "dir": "signature" +files: +- "osslsigncode-1.7.1.tar.gz" +- "osslsigncode-Backports-to-1.7.1.patch" +- "versess-win-unsigned.tar.gz" +script: | + set -e -o pipefail + + BUILD_DIR=`pwd` + SIGDIR=${BUILD_DIR}/signature/win + UNSIGNED_DIR=${BUILD_DIR}/unsigned + + echo "f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 osslsigncode-1.7.1.tar.gz" | sha256sum -c + echo "a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 osslsigncode-Backports-to-1.7.1.patch" | sha256sum -c + + mkdir -p ${UNSIGNED_DIR} + tar -C ${UNSIGNED_DIR} -xf versess-win-unsigned.tar.gz + + tar xf osslsigncode-1.7.1.tar.gz + cd osslsigncode-1.7.1 + patch -p1 < ${BUILD_DIR}/osslsigncode-Backports-to-1.7.1.patch + + ./configure --without-gsf --without-curl --disable-dependency-tracking + make + find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do + INFILE="`basename "${i}"`" + OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`" + ./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem" + done diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml new file mode 100644 index 0000000..5646d45 --- /dev/null +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -0,0 +1,184 @@ +--- +name: "versess-win-3.4" +enable_cache: true +distro: "ubuntu" +suites: +- "bionic" +architectures: +- "amd64" +packages: +- "curl" +- "g++" +- "git" +- "pkg-config" +- "autoconf" +- "libtool" +- "automake" +- "faketime" +- "bsdmainutils" +- "mingw-w64" +- "g++-mingw-w64" +- "nsis" +- "zip" +- "ca-certificates" +- "python3" +- "rename" +remotes: +- "url": "https://github.com/versess-project/versess.git" + "dir": "versess" +files: [] +script: | + set -e -o pipefail + + WRAP_DIR=$HOME/wrapped + HOSTS="i686-w64-mingw32 x86_64-w64-mingw32" + CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests" + FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy" + FAKETIME_PROGS="date makensis zip" + HOST_CFLAGS="-O2 -g" + HOST_CXXFLAGS="-O2 -g" + + export QT_RCC_TEST=1 + export QT_RCC_SOURCE_DATE_OVERRIDE=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 + + function create_global_faketime_wrappers { + for prog in ${FAKETIME_PROGS}; do + echo '#!/usr/bin/env 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/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${prog} + chmod +x ${WRAP_DIR}/${prog} + done + } + + function create_per-host_faketime_wrappers { + for i in $HOSTS; do + for prog in ${FAKETIME_HOST_PROGS}; do + echo '#!/usr/bin/env 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/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + } + + function create_per-host_linker_wrapper { + # This is only needed for trusty, as the mingw linker leaks a few bytes of + # heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900 + for i in $HOSTS; do + mkdir -p ${WRAP_DIR}/${i} + for prog in collect2; do + echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog} + REAL=$(${i}-gcc -print-prog-name=${prog}) + echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog} + echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog} + chmod +x ${WRAP_DIR}/${i}/${prog} + done + for prog in gcc g++; do + echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} + echo "REAL=\`which -a ${i}-${prog}-posix | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog} + echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} + echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} + echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog} + echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} + chmod +x ${WRAP_DIR}/${i}-${prog} + done + done + } + + # Faketime for depends so intermediate results are comparable + export PATH_orig=${PATH} + create_global_faketime_wrappers "2000-01-01 12:00:00" + create_per-host_faketime_wrappers "2000-01-01 12:00:00" + create_per-host_linker_wrapper "2000-01-01 12:00:00" + export PATH=${WRAP_DIR}:${PATH} + + cd versess + BASEPREFIX=`pwd`/depends + # Build dependencies for each host + for i in $HOSTS; do + make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" + done + + # Faketime for binaries + export PATH=${PATH_orig} + create_global_faketime_wrappers "${REFERENCE_DATETIME}" + create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" + create_per-host_linker_wrapper "${REFERENCE_DATETIME}" + export PATH=${WRAP_DIR}:${PATH} + + # Create the release tarball using (arbitrarily) the first host + ./autogen.sh + CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ + make dist + SOURCEDIST=`echo versess-*.tar.gz` + DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` + + # Correct tar file order + mkdir -p temp + pushd temp + tar xf ../$SOURCEDIST + find versess-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST + mkdir -p $OUTDIR/src + cp ../$SOURCEDIST $OUTDIR/src + popd + + # Workaround for tarball not building with the bare tag version (prep) + make -C src obj/build.h + + 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 + + # Workaround for tarball not building with the bare tag version + echo '#!/bin/true' >share/genbuild.sh + mkdir src/obj + cp ../src/obj/build.h src/obj/ + + CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" + make ${MAKEOPTS} + make ${MAKEOPTS} -C src check-security + make deploy + make install DESTDIR=${INSTALLPATH} + rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe + cp -f versess-*setup*.exe $OUTDIR/ + cd installed + # mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/ # temporarily disabled for Zerocoin + # find . -name "lib*.la" -delete # temporarily disabled for Zerocoin + # find . -name "lib*.a" -delete # temporarily disabled for Zerocoin + rm -rf ${DISTNAME}/lib/pkgconfig + find ${DISTNAME}/bin -type f -executable -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \; + # find ${DISTNAME}/lib -type f -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \; + find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip + find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip + cd ../../ + rm -rf distsrc-${i} + done + cp -rf contrib/windeploy $BUILD_DIR + cd $BUILD_DIR/windeploy + mkdir unsigned + cp $OUTDIR/versess-*setup-unsigned.exe unsigned/ + find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz + mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip + mv ${OUTDIR}/${DISTNAME}-i686-*-debug.zip ${OUTDIR}/${DISTNAME}-win32-debug.zip + mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip + mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip diff --git a/contrib/gitian-keys/blondfrogs-key.gpg b/contrib/gitian-keys/blondfrogs-key.gpg new file mode 100644 index 0000000..f1a4e85 --- /dev/null +++ b/contrib/gitian-keys/blondfrogs-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +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 +GvJbpbEarkB5rJwDBkMB +=M/6E +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/furszy-key.gpg b/contrib/gitian-keys/furszy-key.gpg new file mode 100644 index 0000000..4a9f71b --- /dev/null +++ b/contrib/gitian-keys/furszy-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +Xv+1YbtNXqh49IoqCQ== +=et/t +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/contrib/gitian-keys/fuzzbawls-key.gpg b/contrib/gitian-keys/fuzzbawls-key.gpg new file mode 100644 index 0000000..80dccc6 --- /dev/null +++ b/contrib/gitian-keys/fuzzbawls-key.gpg @@ -0,0 +1,388 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +KDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIy +MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIASgBKAMB +IgACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMC +BAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJ +ChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3 +eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS +09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAEC +AwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgU +QpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVW +V1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqy +s7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAM +AwEAAhEDEQA/APKrhd0SSIc7PX0quwWSLY/3W647Uukfvo3DgkKQBzU9xaGIF4FO +zup7VrUpt+8i4y6MzlsSJPncbOoIPJqxlEURrwPTFPRWmPy8Lnlj1qy0KLAVVR6k +mpUJT+IG0tEQRyxxDCglj1J70v2gCXPIyORVQgmTALAdeDT/AC1bkgn6mtE30JLf +2lcZI/WkFyTyoGBycc57VCkSHnYPxrb8PaXHfairOieRB+9kB746D8f8a1jFzlYR +0Om2v9jaCGZl+0TfvH/2fQfgP51zOoXJmnLHjtW94gvRuIzyfSuRlLORjpW1aVly +LZFpF2ADGe3Ws6crctJu+6x/L0q1GTHExOcYxVAkpKRncnY+lcNS9k0VdbFGSCSO +XY4JY9D61cgt/IXe5/eEd+ij/Gpg3yg5yPWmAebgZITuSOvtUc0paCslqMlyyE8h +QeM1r6fZosaTTwM6nnGOvp+FPsdLEmx5046rH3PvW46YiZcBiR1HauiEFBXYJObF +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 +=iS2u +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/gpdionisio-key.gpg b/contrib/gitian-keys/gpdionisio-key.gpg new file mode 100644 index 0000000..959a5f6 --- /dev/null +++ b/contrib/gitian-keys/gpdionisio-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +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 +8C9XZfWXj3OSfD45FeqISCGE0RSKSzff1yf5 +=tKJr +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/jonspock-key.gpg b/contrib/gitian-keys/jonspock-key.gpg new file mode 100644 index 0000000..5ba0fd9 --- /dev/null +++ b/contrib/gitian-keys/jonspock-key.gpg @@ -0,0 +1,51 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +V3x+w2zU0DkwqDFpLQ== +=hsIs +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/mrs-x-key.gpg b/contrib/gitian-keys/mrs-x-key.gpg new file mode 100644 index 0000000..98a699e --- /dev/null +++ b/contrib/gitian-keys/mrs-x-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +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 +vNuZAr0oNiINOswkwGDopEInAlADa0pB +=t7OC +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/presstab-key.gpg b/contrib/gitian-keys/presstab-key.gpg new file mode 100644 index 0000000..163b70d --- /dev/null +++ b/contrib/gitian-keys/presstab-key.gpg @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQENBFjnyFoBCADUkI7ML5LHxGTVF7QWnOG6JkrEMch18fo8jTQPyBg4L5zvXqn/ +jJpqK4+UhXS0j7yCYNS/vN392vg3+kB2q/FAbjsotN0qxJgG+/7uAJJBpvLCF2kq +GyN/AqjCfAvqm9sjgLq9JUKpQTRKjDbT8BAeMjE9SfwtsP0JwVz82vulcDjdSh6D +igqHm/Vrtg7Wm3bMr2ZoOIyT8xOJ50uECZJNgOJS6o2MAX2qmQK2Md2u/8DHOpF9 +xkMHMWPvaiR1Jkp7KJm0TuIMs5NiXrRzpThq+IwCTnHtclMcf5kiBSIe0PmFNyXL +uChL0CVSBlm85qGvOA92TUxH5jVfc4salWf7ABEBAAG0IXByZXNzdGFiIDxwcmVz +c3RhYjEzMzdAZ21haWwuY29tPokBOAQTAQIAIgUCWOfIWgIbAwYLCQgHAwIGFQgC +CQoLBBYCAwECHgECF4AACgkQoBjGWyAqWfDoGQf/aIxZE1b1eeipvDbj0B3tpChy +2LFLZjiTrv5+r2/5cYmTNwPZJx5iHDzvQwQwVN9U3Rh/N2EKRr9etN3H434SiYY0 ++RqvLeesTRz+2rXrYM+YKxk4xPuny68j91DpwYbw3le3tjnUyatFS8Wp3u/X7YWy +WGMZGmkx14AidyJ0erpqT4vxQUxjQbg1E1Uml+K5K+moWoKVElk0Tu/r54X2KGdN +5cCrXVV48oxYldmdxAc9gYATfakjltPXdsKo9csYUZ9Uo8SGbAMRxegEov+PQvY7 +Cn4pyjWKWTqoY0DBpv4k8rtGa0a5Dsa+i11ybUKgnc40GalUGygX+BKXnxbkqLkB +DQRY58haAQgA72X6LdfMh3UjY37wJZfCNQGG8Tci4DpOftUGGWMBTSIMQC5IHnnU +jOg9NQC11ee4uLhtx2pzXBGKazamPfrapFGtadC3yqguuzuipOxcEKKPy7EO4lXV +j+IGVuBuoj4yVAYTTJHnopMdvhaZLBgpXBfG6PHhIu0QsohiCGsIJdHWDBsRhxTq +JqcBYTsIcRtLMOVF6/tvM/L6WNHC/uzH//XjMtH+muqi45K9CK0yKKgLkK6rgUKh +gmnzz7C9qtJYoWhygsICFTdBw85kl19GBcbzbyANMwghHKYvLcWf7074b/R55hzG +ICWbMZ96SVlaATYD/NUWOhzgKdUYfpPOUwARAQABiQEfBBgBAgAJBQJY58haAhsM +AAoJEKAYxlsgKlnwgOoH/0QMnpp9yaZLgFXMmKDDUSBI32zdx0Ngj3WXQcheAb0H +BhyGnZ8CJA10BOLoN/ZdaCJ9V3VygliNs2w94GFX3FpHljkv+dN1cgknzjYOVWhp +l1weilBlsUrkiJAi731syYNTxHWO2VocYXrEIE0zCpqo6sadcSHd3/1mFynyhZ/2 +IjsOIZHwHyhtBri5B3DtjGLZhmC628anbaD3N7dbfFpvYTd1k54y9PYUAWT1rJ3/ +PwcLeLmTMe4d60o2Vru6nOWcsXlB9GLbX7RrSSAmAQmBm26P6MhIjnkXTTFmsqxC +D6VEEIBEXg8WzvW8MVRzOy19bi+7mxokKXrbxu3ezKY= +=nuEB +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/rejectedpromise-key.gpg b/contrib/gitian-keys/rejectedpromise-key.gpg new file mode 100644 index 0000000..c99da55 --- /dev/null +++ b/contrib/gitian-keys/rejectedpromise-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +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 +6DfrZCHjeQMTceEyd9fShQ== +=Sbji +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/gitian-keys/s3v3nh4cks-key.gpg b/contrib/gitian-keys/s3v3nh4cks-key.gpg new file mode 100644 index 0000000..149a2b2 --- /dev/null +++ b/contrib/gitian-keys/s3v3nh4cks-key.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Comment: GPGTools - https://gpgtools.org + +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 +kY+BVpiLBOJa+eykxS15bw== +=xbPI +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/contrib/gitian-keys/warrows-key.gpg b/contrib/gitian-keys/warrows-key.gpg new file mode 100644 index 0000000..5a9ce55 --- /dev/null +++ b/contrib/gitian-keys/warrows-key.gpg @@ -0,0 +1,51 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=kst3 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/init/README.md b/contrib/init/README.md new file mode 100644 index 0000000..c14cb52 --- /dev/null +++ b/contrib/init/README.md @@ -0,0 +1,12 @@ +Sample configuration files for: +``` +SystemD: versessd.service +Upstart: versessd.conf +OpenRC: versessd.openrc + versessd.openrcconf +CentOS: versessd.init +macOS: org.versess.versessd.plist +``` +have been made available to assist packagers in creating node packages here. + +See doc/init.md for more information. diff --git a/contrib/init/org.versess.versessd.plist b/contrib/init/org.versess.versessd.plist new file mode 100644 index 0000000..525a743 --- /dev/null +++ b/contrib/init/org.versess.versessd.plist @@ -0,0 +1,14 @@ + + + + + Label + org.versess.versessd + ProgramArguments + + /usr/local/bin/versessd + + RunAtLoad + + + diff --git a/contrib/init/versessd.conf b/contrib/init/versessd.conf new file mode 100644 index 0000000..95a7bf6 --- /dev/null +++ b/contrib/init/versessd.conf @@ -0,0 +1,63 @@ +description "Versess Coin Daemon" + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +env BITCOIND_BIN="/usr/bin/versessd" +env BITCOIND_USER="versess" +env BITCOIND_GROUP="versess" +env BITCOIND_PIDDIR="/var/run/versessd" +# upstart can't handle variables constructed with other variables +env BITCOIND_PIDFILE="/var/run/versessd/versessd.pid" +env BITCOIND_CONFIGFILE="/etc/versess/versess.conf" +env BITCOIND_DATADIR="/var/lib/versessd" + +expect fork + +respawn +respawn limit 5 120 +kill timeout 60 + +pre-start script + # this will catch non-existent config files + # versessd 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 versessd." + 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 recommended that you also set alertnotify so you are " + echo "notified of problems:" + echo + echo "ie: alertnotify=echo %%s | mail -s \"Versess 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" \ + -daemon diff --git a/contrib/init/versessd.init b/contrib/init/versessd.init new file mode 100644 index 0000000..cadb693 --- /dev/null +++ b/contrib/init/versessd.init @@ -0,0 +1,67 @@ +#!/bin/bash +# +# versessd The Versess core server. +# +# +# chkconfig: 345 80 20 +# description: versessd +# processname: versessd +# + +# Source function library. +. /etc/init.d/functions + +# you can override defaults in /etc/sysconfig/versessd, see below +if [ -f /etc/sysconfig/versessd ]; then + . /etc/sysconfig/versessd +fi + +RETVAL=0 + +prog=versessd +# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/versessd +lockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/versessd} + +# versessd defaults to /usr/bin/versessd, override with BITCOIND_BIN +bitcoind=${BITCOIND_BIN-/usr/bin/versessd} + +# versessd opts default to -disablewallet, override with BITCOIND_OPTS +bitcoind_opts=${BITCOIND_OPTS} + +start() { + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $bitcoind $bitcoind_opts + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status $prog + ;; + restart) + stop + start + ;; + *) + echo "Usage: service $prog {start|stop|status|restart}" + exit 1 + ;; +esac diff --git a/contrib/init/versessd.openrc b/contrib/init/versessd.openrc new file mode 100644 index 0000000..d904bdc --- /dev/null +++ b/contrib/init/versessd.openrc @@ -0,0 +1,92 @@ +#!/sbin/openrc-run + +# backward compatibility for existing gentoo layout +# +if [ -d "/var/lib/versess/.versess" ]; then + BITCOIND_DEFAULT_DATADIR="/var/lib/versess/.versess" +else + BITCOIND_DEFAULT_DATADIR="/var/lib/versessd" +fi + +BITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/versess/versess.conf} +BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/versessd} +BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/versessd.pid} +BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}} +BITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-versess} +BITCOIND_GROUP=${BITCOIND_GROUP:-versess} +BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/versessd} +BITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}} +BITCOIND_OPTS="${BITCOIND_OPTS:-${BITCOIN_OPTS}}" + +name="Versess Coin Daemon" +description="Versess crypto-currency p2p network daemon" + +command="/usr/bin/versessd" +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} -w 2000" +pidfile="${BITCOIND_PIDFILE}" + +# The retry schedule to use when stopping the daemon. Could be either +# a timeout in seconds or multiple signal/timeout pairs (like +# "SIGKILL/180 SIGTERM/300") +retry="${BITCOIND_SIGTERM_TIMEOUT}" + +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 versessd." + 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 recommended that you also set alertnotify so you are " + eerror "notified of problems:" + eerror "" + eerror "ie: alertnotify=echo %%s | mail -s \"Versess Alert\"" \ + "admin@foo.com" + eerror "" + return 1 + fi +} diff --git a/contrib/init/versessd.openrcconf b/contrib/init/versessd.openrcconf new file mode 100644 index 0000000..f58ecd0 --- /dev/null +++ b/contrib/init/versessd.openrcconf @@ -0,0 +1,33 @@ +# /etc/conf.d/versessd: config file for /etc/init.d/versessd + +# Config file location +#BITCOIND_CONFIGFILE="/etc/versess/versess.conf" + +# What directory to write pidfile to? (created and owned by $BITCOIND_USER) +#BITCOIND_PIDDIR="/var/run/versessd" + +# What filename to give the pidfile +#BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/versessd.pid" + +# Where to write versessd data (be mindful that the blockchain is large) +#BITCOIND_DATADIR="/var/lib/versessd" + +# User and group to own versessd process +#BITCOIND_USER="versess" +#BITCOIND_GROUP="versess" + +# Path to versessd executable +#BITCOIND_BIN="/usr/bin/versessd" + +# Nice value to run versessd under +#BITCOIND_NICE=0 + +# Additional options (avoid -conf and -datadir, use flags above) +#BITCOIND_OPTS="" + +# The timeout in seconds OpenRC will wait for bitcoind to terminate +# after a SIGTERM has been raised. +# Note that this will be mapped as argument to start-stop-daemon's +# '--retry' option, which means you can specify a retry schedule +# here. For more information see man 8 start-stop-daemon. +BITCOIND_SIGTERM_TIMEOUT=60 diff --git a/contrib/init/versessd.service b/contrib/init/versessd.service new file mode 100644 index 0000000..475d7c6 --- /dev/null +++ b/contrib/init/versessd.service @@ -0,0 +1,44 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit bitcoind.service +# See "man systemd.service" for details. + +# Note that almost all daemon options could be specified in +# /etc/versess/versess.conf + +[Unit] +Description=Versess daemon +After=network.target + +[Service] +ExecStart=/usr/bin/versessd -daemon -conf=/etc/versess/versess.conf -pid=/run/versessd/versessd.pid +# Creates /run/versessd owned by versess +RuntimeDirectory=versessd +User=versess +Type=forking +PIDFile=/run/versessd/versessd.pid +Restart=on-failure + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh new file mode 100644 index 0000000..811678b --- /dev/null +++ b/contrib/install_db4.sh @@ -0,0 +1,101 @@ +#!/bin/sh + +# Install libdb4.8 (Berkeley DB). + +export LC_ALL=C +set -e + +if [ -z "${1}" ]; then + echo "Usage: $0 [ ...]" + echo + echo "Must specify a single argument: the directory in which db4 will be built." + echo "This is probably \`pwd\` if you're at the root of the versess repository." + exit 1 +fi + +expand_path() { + echo "$(cd "${1}" && pwd -P)" +} + +BDB_PREFIX="$(expand_path ${1})/db4"; shift; +BDB_VERSION='db-4.8.30.NC' +BDB_HASH='12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef' +BDB_URL="https://download.oracle.com/berkeley-db/${BDB_VERSION}.tar.gz" + +check_exists() { + which "$1" >/dev/null 2>&1 +} + +sha256_check() { + # Args: + # + if check_exists sha256sum; then + echo "${1} ${2}" | sha256sum -c + elif check_exists sha256; then + if [ "$(uname)" = "FreeBSD" ]; then + sha256 -c "${1}" "${2}" + else + echo "${1} ${2}" | sha256 -c + fi + else + echo "${1} ${2}" | shasum -a 256 -c + fi +} + +http_get() { + # Args: + # + # It's acceptable that we don't require SSL here because we manually verify + # content hashes below. + # + if [ -f "${2}" ]; then + echo "File ${2} already exists; not downloading again" + elif check_exists curl; then + curl --insecure --retry 5 "${1}" -o "${2}" + else + wget --no-check-certificate "${1}" -O "${2}" + fi + + sha256_check "${3}" "${2}" +} + +mkdir -p "${BDB_PREFIX}" +http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}" +tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX" +cd "${BDB_PREFIX}/${BDB_VERSION}/" + +# Apply a patch necessary when building with clang and c++11 (see https://community.oracle.com/thread/3952592) +CLANG_CXX11_PATCH_URL='https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch' +CLANG_CXX11_PATCH_HASH='7a9a47b03fd5fb93a16ef42235fa9512db9b0829cfc3bdf90edd3ec1f44d637c' +http_get "${CLANG_CXX11_PATCH_URL}" clang.patch "${CLANG_CXX11_PATCH_HASH}" +patch -p2 < clang.patch + +# The packaged config.guess and config.sub are ancient (2009) and can cause build issues. +# Replace them with modern versions. +# See https://github.com/bitcoin/bitcoin/issues/16064 +CONFIG_GUESS_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b' +CONFIG_GUESS_HASH='2d1ff7bca773d2ec3c6217118129220fa72d8adda67c7d2bf79994b3129232c1' +CONFIG_SUB_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b' +CONFIG_SUB_HASH='3a4befde9bcdf0fdb2763fc1bfa74e8696df94e1ad7aac8042d133c8ff1d2e32' + +rm -f "dist/config.guess" +rm -f "dist/config.sub" + +http_get "${CONFIG_GUESS_URL}" dist/config.guess "${CONFIG_GUESS_HASH}" +http_get "${CONFIG_SUB_URL}" dist/config.sub "${CONFIG_SUB_HASH}" + +cd build_unix/ + +"${BDB_PREFIX}/${BDB_VERSION}/dist/configure" \ + --enable-cxx --disable-shared --disable-replication --with-pic --prefix="${BDB_PREFIX}" \ + "${@}" + +make install + +echo +echo "db4 build complete." +echo +echo 'When compiling versessd, run `./configure` in the following way:' +echo +echo " export BDB_PREFIX='${BDB_PREFIX}'" +echo ' ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...' diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md new file mode 100644 index 0000000..157586e --- /dev/null +++ b/contrib/linearize/README.md @@ -0,0 +1,33 @@ +# 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 new file mode 100644 index 0000000..13f61e5 --- /dev/null +++ b/contrib/linearize/example-linearize.cfg @@ -0,0 +1,19 @@ + +# bitcoind RPC settings (linearize-hashes) +rpcuser=someuser +rpcpassword=somepassword +host=127.0.0.1 +port=51470 + +# bootstrap.dat hashlist settings (linearize-hashes) +max_height=313000 + +# bootstrap.dat input/output settings (linearize-data) +netmagic=90c4fde9 +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 100644 index 0000000..058568e --- /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(" + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md new file mode 100644 index 0000000..8b25cbb --- /dev/null +++ b/contrib/macdeploy/README.md @@ -0,0 +1,15 @@ +### MacDeploy ### + +For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package: + + sudo easy_install argparse + +This script should not be run manually, instead, after building as usual: + + make deploy + +During the process, the disk image window will pop up briefly where the fancy +settings are applied. This is normal, please do not interfere. + +When finished, it will produce `Versess-Qt.dmg`. + diff --git a/contrib/macdeploy/background.svg b/contrib/macdeploy/background.svg new file mode 100644 index 0000000..9c330af --- /dev/null +++ b/contrib/macdeploy/background.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + PACKAGE_NAME + + + + + diff --git a/contrib/macdeploy/custom_dsstore.py b/contrib/macdeploy/custom_dsstore.py new file mode 100644 index 0000000..51d60c1 --- /dev/null +++ b/contrib/macdeploy/custom_dsstore.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# Copyright (c) 2013-2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +import biplist +from ds_store import DSStore +from mac_alias import Alias +import sys + +output_file = sys.argv[1] +package_name_ns = sys.argv[2] + +ds = DSStore.open(output_file, 'w+') +ds['.']['bwsp'] = { + 'ShowStatusBar': False, + 'WindowBounds': '{{300, 280}, {500, 343}}', + 'ContainerShowSidebar': False, + 'SidebarWidth': 0, + 'ShowTabView': False, + 'PreviewPaneVisibility': False, + 'ShowToolbar': False, + 'ShowSidebar': False, + 'ShowPathbar': True +} + +icvp = { + 'gridOffsetX': 0.0, + 'textSize': 12.0, + 'viewOptionsVersion': 1, + 'backgroundImageAlias': b'\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00', + 'backgroundColorBlue': 1.0, + 'iconSize': 96.0, + 'backgroundColorGreen': 1.0, + 'arrangeBy': 'none', + 'showIconPreview': True, + 'gridSpacing': 100.0, + 'gridOffsetY': 0.0, + 'showItemInfo': False, + 'labelOnBottom': True, + 'backgroundType': 2, + 'backgroundColorRed': 1.0 +} +alias = Alias.from_bytes(icvp['backgroundImageAlias']) +alias.volume.name = package_name_ns +alias.volume.posix_path = '/Volumes/' + package_name_ns +alias.volume.disk_image_alias.target.filename = package_name_ns + '.temp.dmg' +alias.volume.disk_image_alias.target.carbon_path = 'Macintosh HD:Users:\x00bitcoinuser:\x00Documents:\x00bitcoin:\x00bitcoin:\x00' + package_name_ns + '.temp.dmg' +alias.volume.disk_image_alias.target.posix_path = 'Users/bitcoinuser/Documents/bitcoin/bitcoin/' + package_name_ns + '.temp.dmg' +alias.target.carbon_path = package_name_ns + ':.background:\x00background.tiff' +icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes()) +ds['.']['icvp'] = icvp + +ds['.']['vSrn'] = ('long', 1) + +ds['Applications']['Iloc'] = (370, 156) +ds['Versess-Qt.app']['Iloc'] = (128, 156) + +ds.flush() +ds.close() diff --git a/contrib/macdeploy/detached-sig-apply.sh b/contrib/macdeploy/detached-sig-apply.sh new file mode 100644 index 0000000..f8503e4 --- /dev/null +++ b/contrib/macdeploy/detached-sig-apply.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# Copyright (c) 2014-2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +set -e + +UNSIGNED="$1" +SIGNATURE="$2" +ARCH=x86_64 +ROOTDIR=dist +TEMPDIR=signed.temp +OUTDIR=signed-app + +if [ -z "$UNSIGNED" ]; then + echo "usage: $0 " + exit 1 +fi + +if [ -z "$SIGNATURE" ]; then + echo "usage: $0 " + exit 1 +fi + +rm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR} +tar -C ${TEMPDIR} -xf ${UNSIGNED} +cp -rf "${SIGNATURE}"/* ${TEMPDIR} + +if [ -z "${PAGESTUFF}" ]; then + PAGESTUFF=${TEMPDIR}/pagestuff +fi + +if [ -z "${CODESIGN_ALLOCATE}" ]; then + CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate +fi + +find ${TEMPDIR} -name "*.sign" | while read i; 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 100644 index 0000000..0632214 --- /dev/null +++ b/contrib/macdeploy/detached-sig-create.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# Copyright (c) 2014-2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +set -e + +ROOTDIR=dist +BUNDLE=${ROOTDIR}/Versess-Qt.app +CODESIGN=codesign +TEMPDIR=sign.temp +TEMPLIST=${TEMPDIR}/signatures.txt +OUT=signature-osx.tar.gz +OUTROOT=osx + +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}" + +grep -v CodeResources < "${TEMPLIST}" | while read i; 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}/${OUTROOT}/${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 + +grep CodeResources < "${TEMPLIST}" | while read i; do + TARGETFILE="${BUNDLE}/`echo "${i}" | sed "s|.*${BUNDLE}/||"`" + RESOURCE="${TEMPDIR}/${OUTROOT}/${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/extract-osx-sdk.sh b/contrib/macdeploy/extract-osx-sdk.sh new file mode 100644 index 0000000..4c17515 --- /dev/null +++ b/contrib/macdeploy/extract-osx-sdk.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Copyright (c) 2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +set -e + +INPUTFILE="Xcode_7.3.1.dmg" +HFSFILENAME="5.hfs" +SDKDIR="Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" + +7z x "${INPUTFILE}" "${HFSFILENAME}" +SDKNAME="$(basename "${SDKDIR}")" +SDKDIRINODE=$(ifind -n "${SDKDIR}" "${HFSFILENAME}") +fls "${HFSFILENAME}" -rpF ${SDKDIRINODE} | + while read type inode filename; do + inode="${inode::-1}" + if [ "${filename:0:14}" = "usr/share/man/" ]; then + continue + fi + filename="${SDKNAME}/$filename" + echo "Extracting $filename ..." + mkdir -p "$(dirname "$filename")" + if [ "$type" = "l/l" ]; then + ln -s "$(icat "${HFSFILENAME}" $inode)" "$filename" + else + icat "${HFSFILENAME}" $inode >"$filename" + fi +done +echo "Building ${SDKNAME}.tar.gz ..." +MTIME="$(istat "${HFSFILENAME}" "${SDKDIRINODE}" | perl -nle 'm/Content Modified:\s+(.*?)\s\(/ && print $1')" +find "${SDKNAME}" | sort | tar --no-recursion --mtime="${MTIME}" --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > "${SDKNAME}.tar.gz" +echo 'All done!' diff --git a/contrib/macdeploy/fancy.plist b/contrib/macdeploy/fancy.plist new file mode 100644 index 0000000..f601071 --- /dev/null +++ b/contrib/macdeploy/fancy.plist @@ -0,0 +1,32 @@ + + + + + window_bounds + + 300 + 300 + 800 + 620 + + background_picture + background.tiff + icon_size + 96 + applications_symlink + + items_position + + Applications + + 370 + 156 + + Versess-Qt.app + + 128 + 156 + + + + diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus new file mode 100644 index 0000000..1c435a8 --- /dev/null +++ b/contrib/macdeploy/macdeployqtplus @@ -0,0 +1,872 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2011 Patrick "p2k" Schneider +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import subprocess, sys, re, os, shutil, stat, os.path, time +from string import Template +from argparse import ArgumentParser + +# This is ported from the original macdeployqt with modifications + +class FrameworkInfo(object): + def __init__(self): + self.frameworkDirectory = "" + self.frameworkName = "" + self.frameworkPath = "" + self.binaryDirectory = "" + self.binaryName = "" + self.binaryPath = "" + self.version = "" + self.installName = "" + self.deployedInstallName = "" + self.sourceFilePath = "" + self.destinationDirectory = "" + self.sourceResourcesDirectory = "" + self.sourceVersionContentsDirectory = "" + self.sourceContentsDirectory = "" + self.destinationResourcesDirectory = "" + self.destinationVersionContentsDirectory = "" + + def __eq__(self, other): + if self.__class__ == other.__class__: + return self.__dict__ == other.__dict__ + else: + return False + + def __str__(self): + return """ Framework name: %s + Framework directory: %s + Framework path: %s + Binary name: %s + Binary directory: %s + Binary path: %s + Version: %s + Install name: %s + Deployed install name: %s + Source file Path: %s + Deployed Directory (relative to bundle): %s +""" % (self.frameworkName, + self.frameworkDirectory, + self.frameworkPath, + self.binaryName, + self.binaryDirectory, + self.binaryPath, + self.version, + self.installName, + self.deployedInstallName, + self.sourceFilePath, + self.destinationDirectory) + + def isDylib(self): + return self.frameworkName.endswith(".dylib") + + def isQtFramework(self): + if self.isDylib(): + return self.frameworkName.startswith("libQt") + else: + return self.frameworkName.startswith("Qt") + + reOLine = re.compile(r'^(.+) \(compatibility version [0-9.]+, current version [0-9.]+\)$') + bundleFrameworkDirectory = "Contents/Frameworks" + bundleBinaryDirectory = "Contents/MacOS" + + @classmethod + def fromOtoolLibraryLine(cls, line): + # Note: line must be trimmed + if line == "": + return None + + # Don't deploy system libraries (exception for libQtuitools and libQtlucene). + if line.startswith("/System/Library/") or line.startswith("@executable_path") or (line.startswith("/usr/lib/") and "libQt" not in line): + return None + + m = cls.reOLine.match(line) + if m is None: + raise RuntimeError("otool line could not be parsed: " + line) + + path = m.group(1) + + info = cls() + info.sourceFilePath = path + info.installName = path + + if path.endswith(".dylib"): + dirname, filename = os.path.split(path) + info.frameworkName = filename + info.frameworkDirectory = dirname + info.frameworkPath = path + + info.binaryDirectory = dirname + info.binaryName = filename + info.binaryPath = path + info.version = "-" + + info.installName = path + info.deployedInstallName = "@executable_path/../Frameworks/" + info.binaryName + info.sourceFilePath = path + info.destinationDirectory = cls.bundleFrameworkDirectory + else: + parts = path.split("/") + i = 0 + # Search for the .framework directory + for part in parts: + if part.endswith(".framework"): + break + i += 1 + if i == len(parts): + raise RuntimeError("Could not find .framework or .dylib in otool line: " + line) + + info.frameworkName = parts[i] + info.frameworkDirectory = "/".join(parts[:i]) + info.frameworkPath = os.path.join(info.frameworkDirectory, info.frameworkName) + + info.binaryName = parts[i+3] + info.binaryDirectory = "/".join(parts[i+1:i+3]) + info.binaryPath = os.path.join(info.binaryDirectory, info.binaryName) + info.version = parts[i+2] + + info.deployedInstallName = "@executable_path/../Frameworks/" + os.path.join(info.frameworkName, info.binaryPath) + info.destinationDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, info.binaryDirectory) + + info.sourceResourcesDirectory = os.path.join(info.frameworkPath, "Resources") + info.sourceContentsDirectory = os.path.join(info.frameworkPath, "Contents") + info.sourceVersionContentsDirectory = os.path.join(info.frameworkPath, "Versions", info.version, "Contents") + info.destinationResourcesDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Resources") + info.destinationContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Contents") + info.destinationVersionContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, "Versions", info.version, "Contents") + + return info + +class ApplicationBundleInfo(object): + def __init__(self, path): + self.path = path + appName = "Versess-Qt" + self.binaryPath = os.path.join(path, "Contents", "MacOS", appName) + if not os.path.exists(self.binaryPath): + raise RuntimeError("Could not find bundle binary for " + path) + self.resourcesPath = os.path.join(path, "Contents", "Resources") + self.pluginPath = os.path.join(path, "Contents", "PlugIns") + +class DeploymentInfo(object): + def __init__(self): + self.qtPath = None + self.pluginPath = None + self.deployedFrameworks = [] + + def detectQtPath(self, frameworkDirectory): + parentDir = os.path.dirname(frameworkDirectory) + if os.path.exists(os.path.join(parentDir, "translations")): + # Classic layout, e.g. "/usr/local/Trolltech/Qt-4.x.x" + self.qtPath = parentDir + elif os.path.exists(os.path.join(parentDir, "share", "qt4", "translations")): + # MacPorts layout, e.g. "/opt/local/share/qt4" + self.qtPath = os.path.join(parentDir, "share", "qt4") + elif os.path.exists(os.path.join(os.path.dirname(parentDir), "share", "qt4", "translations")): + # Newer Macports layout + self.qtPath = os.path.join(os.path.dirname(parentDir), "share", "qt4") + else: + self.qtPath = os.getenv("QTDIR", None) + + if self.qtPath is not None: + pluginPath = os.path.join(self.qtPath, "plugins") + if os.path.exists(pluginPath): + self.pluginPath = pluginPath + + def usesFramework(self, name): + nameDot = "%s." % name + libNameDot = "lib%s." % name + for framework in self.deployedFrameworks: + if framework.endswith(".framework"): + if framework.startswith(nameDot): + return True + elif framework.endswith(".dylib"): + if framework.startswith(libNameDot): + return True + return False + +def getFrameworks(binaryPath, verbose): + if verbose >= 3: + print("Inspecting with otool: " + binaryPath) + otoolbin=os.getenv("OTOOL", "otool") + otool = subprocess.Popen([otoolbin, "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + o_stdout, o_stderr = otool.communicate() + if otool.returncode != 0: + if verbose >= 1: + sys.stderr.write(o_stderr) + sys.stderr.flush() + raise RuntimeError("otool failed with return code %d" % otool.returncode) + + otoolLines = o_stdout.split("\n") + otoolLines.pop(0) # First line is the inspected binary + if ".framework" in binaryPath or binaryPath.endswith(".dylib"): + otoolLines.pop(0) # Frameworks and dylibs list themselves as a dependency. + + libraries = [] + for line in otoolLines: + line = line.replace("@loader_path", os.path.dirname(binaryPath)) + info = FrameworkInfo.fromOtoolLibraryLine(line.strip()) + if info is not None: + if verbose >= 3: + print("Found framework:") + print(info) + libraries.append(info) + + return libraries + +def runInstallNameTool(action, *args): + installnametoolbin=os.getenv("INSTALLNAMETOOL", "install_name_tool") + subprocess.check_call([installnametoolbin, "-"+action] + list(args)) + +def changeInstallName(oldName, newName, binaryPath, verbose): + if verbose >= 3: + print("Using install_name_tool:") + print(" in", binaryPath) + print(" change reference", oldName) + print(" to", newName) + runInstallNameTool("change", oldName, newName, binaryPath) + +def changeIdentification(id, binaryPath, verbose): + if verbose >= 3: + print("Using install_name_tool:") + print(" change identification in", binaryPath) + print(" to", id) + runInstallNameTool("id", id, binaryPath) + +def runStrip(binaryPath, verbose): + stripbin=os.getenv("STRIP", "strip") + if verbose >= 3: + print("Using strip:") + print(" stripped", binaryPath) + subprocess.check_call([stripbin, "-x", binaryPath]) + +def copyFramework(framework, path, verbose): + if framework.sourceFilePath.startswith("Qt"): + #standard place for Nokia Qt installer's frameworks + fromPath = "/Library/Frameworks/" + framework.sourceFilePath + else: + fromPath = framework.sourceFilePath + toDir = os.path.join(path, framework.destinationDirectory) + toPath = os.path.join(toDir, framework.binaryName) + + if not os.path.exists(fromPath): + raise RuntimeError("No file at " + fromPath) + + if os.path.exists(toPath): + return None # Already there + + if not os.path.exists(toDir): + os.makedirs(toDir) + + shutil.copy2(fromPath, toPath) + if verbose >= 3: + print("Copied:", fromPath) + print(" to:", toPath) + + permissions = os.stat(toPath) + if not permissions.st_mode & stat.S_IWRITE: + os.chmod(toPath, permissions.st_mode | stat.S_IWRITE) + + if not framework.isDylib(): # Copy resources for real frameworks + + linkfrom = os.path.join(path, "Contents","Frameworks", framework.frameworkName, "Versions", "Current") + linkto = framework.version + if not os.path.exists(linkfrom): + os.symlink(linkto, linkfrom) + if verbose >= 2: + print("Linked:", linkfrom, "->", linkto) + fromResourcesDir = framework.sourceResourcesDirectory + if os.path.exists(fromResourcesDir): + toResourcesDir = os.path.join(path, framework.destinationResourcesDirectory) + shutil.copytree(fromResourcesDir, toResourcesDir, symlinks=True) + if verbose >= 3: + print("Copied resources:", fromResourcesDir) + print(" to:", toResourcesDir) + fromContentsDir = framework.sourceVersionContentsDirectory + if not os.path.exists(fromContentsDir): + fromContentsDir = framework.sourceContentsDirectory + if os.path.exists(fromContentsDir): + toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory) + shutil.copytree(fromContentsDir, toContentsDir, symlinks=True) + if verbose >= 3: + print("Copied Contents:", fromContentsDir) + print(" to:", toContentsDir) + elif framework.frameworkName.startswith("libQtGui"): # Copy qt_menu.nib (applies to non-framework layout) + qtMenuNibSourcePath = os.path.join(framework.frameworkDirectory, "Resources", "qt_menu.nib") + qtMenuNibDestinationPath = os.path.join(path, "Contents", "Resources", "qt_menu.nib") + if os.path.exists(qtMenuNibSourcePath) and not os.path.exists(qtMenuNibDestinationPath): + shutil.copytree(qtMenuNibSourcePath, qtMenuNibDestinationPath, symlinks=True) + if verbose >= 3: + print("Copied for libQtGui:", qtMenuNibSourcePath) + print(" to:", qtMenuNibDestinationPath) + + return toPath + +def deployFrameworks(frameworks, bundlePath, binaryPath, strip, verbose, deploymentInfo=None): + if deploymentInfo is None: + deploymentInfo = DeploymentInfo() + + while len(frameworks) > 0: + framework = frameworks.pop(0) + deploymentInfo.deployedFrameworks.append(framework.frameworkName) + + if verbose >= 2: + print("Processing", framework.frameworkName, "...") + + # 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.") + continue + + # install_name_tool the new id into the binary + changeInstallName(framework.installName, framework.deployedInstallName, binaryPath, verbose) + + # Copy framework to app bundle. + deployedBinaryPath = copyFramework(framework, bundlePath, verbose) + # Skip the rest if already was deployed. + if deployedBinaryPath is None: + continue + + if strip: + runStrip(deployedBinaryPath, verbose) + + # install_name_tool it a new id. + changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose) + # Check for framework dependencies + dependencies = getFrameworks(deployedBinaryPath, verbose) + + for dependency in dependencies: + changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose) + + # Deploy framework if necessary. + if dependency.frameworkName not in deploymentInfo.deployedFrameworks and dependency not in frameworks: + frameworks.append(dependency) + + return deploymentInfo + +def deployFrameworksForAppBundle(applicationBundle, strip, verbose): + frameworks = getFrameworks(applicationBundle.binaryPath, verbose) + if len(frameworks) == 0 and verbose >= 1: + print("Warning: Could not find any external frameworks to deploy in %s." % (applicationBundle.path)) + return DeploymentInfo() + else: + return deployFrameworks(frameworks, applicationBundle.path, applicationBundle.binaryPath, strip, verbose) + +def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): + # Lookup available plugins, exclude unneeded + plugins = [] + if deploymentInfo.pluginPath is None: + return + for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath): + pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath) + if pluginDirectory == "designer": + # Skip designer plugins + continue + elif pluginDirectory == "phonon" or pluginDirectory == "phonon_backend": + # Deploy the phonon plugins only if phonon is in use + if not deploymentInfo.usesFramework("phonon"): + continue + elif pluginDirectory == "sqldrivers": + # Deploy the sql plugins only if QtSql is in use + if not deploymentInfo.usesFramework("QtSql"): + continue + elif pluginDirectory == "script": + # Deploy the script plugins only if QtScript is in use + if not deploymentInfo.usesFramework("QtScript"): + continue + elif pluginDirectory == "qmltooling" or pluginDirectory == "qml1tooling": + # Deploy the qml plugins only if QtDeclarative is in use + if not deploymentInfo.usesFramework("QtDeclarative"): + continue + elif pluginDirectory == "bearer": + # 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) + if pluginName.endswith("_debug.dylib"): + # Skip debug plugins + continue + elif pluginPath == "imageformats/libqsvg.dylib" or pluginPath == "iconengines/libqsvgicon.dylib": + # Deploy the svg plugins only if QtSvg is in use + if not deploymentInfo.usesFramework("QtSvg"): + continue + elif pluginPath == "accessible/libqtaccessiblecompatwidgets.dylib": + # Deploy accessibility for Qt3Support only if the Qt3Support is in use + if not deploymentInfo.usesFramework("Qt3Support"): + continue + elif pluginPath == "graphicssystems/libqglgraphicssystem.dylib": + # 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)) + + for pluginDirectory, pluginName in plugins: + if verbose >= 2: + print("Processing plugin", os.path.join(pluginDirectory, pluginName), "...") + + sourcePath = os.path.join(deploymentInfo.pluginPath, pluginDirectory, pluginName) + destinationDirectory = os.path.join(appBundleInfo.pluginPath, pluginDirectory) + if not os.path.exists(destinationDirectory): + os.makedirs(destinationDirectory) + + destinationPath = os.path.join(destinationDirectory, pluginName) + shutil.copy2(sourcePath, destinationPath) + if verbose >= 3: + print("Copied:", sourcePath) + print(" to:", destinationPath) + + if strip: + runStrip(destinationPath, verbose) + + dependencies = getFrameworks(destinationPath, verbose) + + for dependency in dependencies: + changeInstallName(dependency.installName, dependency.deployedInstallName, destinationPath, verbose) + + # Deploy framework if necessary. + if dependency.frameworkName not in deploymentInfo.deployedFrameworks: + deployFrameworks([dependency], appBundleInfo.path, destinationPath, strip, verbose, deploymentInfo) + +qt_conf="""[Paths] +Translations=Resources +Plugins=PlugIns +""" + +ap = ArgumentParser(description="""Improved version of macdeployqt. + +Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .dmg file. +Note, that the "dist" folder will be deleted before deploying on each run. + +Optionally, Qt translation files (.qm) and additional resources can be added to the bundle. + +Also optionally signs the .app bundle; set the CODESIGNARGS environment variable to pass arguments +to the codesign tool. +E.g. CODESIGNARGS='--sign "Developer ID Application: ..." --keychain /encrypted/foo.keychain'""") + +ap.add_argument("app_bundle", nargs=1, metavar="app-bundle", help="application bundle to be deployed") +ap.add_argument("-verbose", type=int, nargs=1, default=[1], metavar="<0-3>", help="0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug") +ap.add_argument("-no-plugins", dest="plugins", action="store_false", default=True, help="skip plugin deployment") +ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, help="don't run 'strip' on the binaries") +ap.add_argument("-sign", dest="sign", action="store_true", default=False, help="sign .app bundle with codesign tool") +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 resources; 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") +ap.add_argument("-volname", nargs=1, metavar="volname", default=[], help="custom volume name for dmg") + +config = ap.parse_args() + +verbose = config.verbose[0] + +# ------------------------------------------------ + +app_bundle = config.app_bundle[0] + +if not os.path.exists(app_bundle): + if verbose >= 1: + sys.stderr.write("Error: Could not find app bundle \"%s\"\n" % (app_bundle)) + sys.exit(1) + +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: + print("Checking for \"%s\"..." % p) + if not os.path.exists(p): + if verbose >= 1: + sys.stderr.write("Error: Could not find additional resource file \"%s\"\n" % (p)) + sys.exit(1) + +# ------------------------------------------------ + +if len(config.fancy) == 1: + if verbose >= 3: + print("Fancy: Importing plistlib...") + try: + import plistlib + except ImportError: + if verbose >= 1: + sys.stderr.write("Error: Could not import plistlib which is required for fancy disk images.\n") + sys.exit(1) + + p = config.fancy[0] + if verbose >= 3: + print("Fancy: Loading \"%s\"..." % p) + if not os.path.exists(p): + if verbose >= 1: + sys.stderr.write("Error: Could not find fancy disk image plist at \"%s\"\n" % (p)) + sys.exit(1) + + try: + fancy = plistlib.readPlist(p) + except: + if verbose >= 1: + sys.stderr.write("Error: Could not parse fancy disk image plist at \"%s\"\n" % (p)) + sys.exit(1) + + try: + assert "window_bounds" not in fancy or (isinstance(fancy["window_bounds"], list) and len(fancy["window_bounds"]) == 4) + assert "background_picture" not in fancy or isinstance(fancy["background_picture"], str) + assert "icon_size" not in fancy or isinstance(fancy["icon_size"], int) + assert "applications_symlink" not in fancy or isinstance(fancy["applications_symlink"], bool) + if "items_position" in fancy: + assert isinstance(fancy["items_position"], dict) + for key, value in fancy["items_position"].items(): + assert isinstance(value, list) and len(value) == 2 and isinstance(value[0], int) and isinstance(value[1], int) + except: + if verbose >= 1: + sys.stderr.write("Error: Bad format of fancy disk image plist at \"%s\"\n" % (p)) + sys.exit(1) + + if "background_picture" in fancy: + bp = fancy["background_picture"] + if verbose >= 3: + print("Fancy: Resolving background picture \"%s\"..." % bp) + if not os.path.exists(bp): + bp = os.path.join(os.path.dirname(p), bp) + if not os.path.exists(bp): + if verbose >= 1: + sys.stderr.write("Error: Could not find background picture at \"%s\" or \"%s\"\n" % (fancy["background_picture"], bp)) + sys.exit(1) + else: + fancy["background_picture"] = bp +else: + fancy = None + +# ------------------------------------------------ + +if os.path.exists("dist"): + if verbose >= 2: + print("+ Removing old dist folder +") + + shutil.rmtree("dist") + +# ------------------------------------------------ + +if len(config.volname) == 1: + volname = config.volname[0] +else: + volname = app_bundle_name + +# ------------------------------------------------ + +target = os.path.join("dist", "Versess-Qt.app") + +if verbose >= 2: + print("+ Copying source bundle +") +if verbose >= 3: + print(app_bundle, "->", target) + +os.mkdir("dist") +shutil.copytree(app_bundle, target, symlinks=True) + +applicationBundle = ApplicationBundleInfo(target) + +# ------------------------------------------------ + +if verbose >= 2: + print("+ Deploying frameworks +") + +try: + deploymentInfo = deployFrameworksForAppBundle(applicationBundle, config.strip, verbose) + if deploymentInfo.qtPath is None: + deploymentInfo.qtPath = os.getenv("QTDIR", None) + if deploymentInfo.qtPath is None: + if verbose >= 1: + sys.stderr.write("Warning: Could not detect Qt's path, skipping plugin deployment!\n") + config.plugins = False +except RuntimeError as e: + if verbose >= 1: + sys.stderr.write("Error: %s\n" % str(e)) + sys.exit(1) + +# ------------------------------------------------ + +if config.plugins: + if verbose >= 2: + print("+ Deploying plugins +") + + try: + deployPlugins(applicationBundle, deploymentInfo, config.strip, verbose) + except RuntimeError as e: + if verbose >= 1: + sys.stderr.write("Error: %s\n" % str(e)) + sys.exit(1) + +# ------------------------------------------------ + +if len(config.add_qt_tr) == 0: + add_qt_tr = [] +else: + 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) + if verbose >= 3: + print("Checking for \"%s\"..." % p) + if not os.path.exists(p): + if verbose >= 1: + sys.stderr.write("Error: Could not find Qt translation file \"%s\"\n" % (lng_file)) + sys.exit(1) + +# ------------------------------------------------ + +if verbose >= 2: + print("+ Installing qt.conf +") + +with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f: + f.write(qt_conf.encode()) + +# ------------------------------------------------ + +if len(add_qt_tr) > 0 and verbose >= 2: + print("+ Adding Qt translations +") + +for lng_file in add_qt_tr: + if verbose >= 3: + print(os.path.join(qt_tr_dir, lng_file), "->", os.path.join(applicationBundle.resourcesPath, lng_file)) + shutil.copy2(os.path.join(qt_tr_dir, lng_file), os.path.join(applicationBundle.resourcesPath, lng_file)) + +# ------------------------------------------------ + +if len(config.add_resources) > 0 and verbose >= 2: + print("+ Adding additional resources +") + +for p in config.add_resources: + t = os.path.join(applicationBundle.resourcesPath, os.path.basename(p)) + if verbose >= 3: + print(p, "->", t) + if os.path.isdir(p): + shutil.copytree(p, t, symlinks=True) + else: + shutil.copy2(p, t) + +# ------------------------------------------------ + +if config.sign and 'CODESIGNARGS' not in os.environ: + print("You must set the CODESIGNARGS environment variable. Skipping signing.") +elif config.sign: + if verbose >= 1: + print("Code-signing app bundle %s"%(target,)) + subprocess.check_call("codesign --force %s %s"%(os.environ['CODESIGNARGS'], target), shell=True) + +# ------------------------------------------------ + +if config.dmg is not None: + + def runHDIUtil(verb, image_basename, **kwargs): + hdiutil_args = ["hdiutil", verb, image_basename + ".dmg"] + if "capture_stdout" in kwargs: + del kwargs["capture_stdout"] + run = subprocess.check_output + else: + if verbose < 2: + hdiutil_args.append("-quiet") + elif verbose >= 3: + hdiutil_args.append("-verbose") + run = subprocess.check_call + + for key, value in kwargs.items(): + hdiutil_args.append("-" + key) + if not value is True: + hdiutil_args.append(str(value)) + + return run(hdiutil_args, universal_newlines=True) + + if verbose >= 2: + if fancy is None: + print("+ Creating .dmg disk image +") + else: + print("+ Preparing .dmg disk image +") + + if config.dmg != "": + dmg_name = config.dmg + else: + spl = app_bundle_name.split(" ") + dmg_name = spl[0] + "".join(p.capitalize() for p in spl[1:]) + + if fancy is None: + try: + runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname=volname, ov=True) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) + else: + if verbose >= 3: + print("Determining size of \"dist\"...") + size = 0 + for path, dirs, files in os.walk("dist"): + for file in files: + size += os.path.getsize(os.path.join(path, file)) + size += int(size * 0.15) + + if verbose >= 3: + print("Creating temp image for modification...") + try: + runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname=volname, ov=True) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) + + if verbose >= 3: + print("Attaching temp image...") + try: + output = runHDIUtil("attach", dmg_name + ".temp", readwrite=True, noverify=True, noautoopen=True, capture_stdout=True) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) + + m = re.search("/Volumes/(.+$)", output) + disk_root = m.group(0) + disk_name = m.group(1) + + if verbose >= 2: + print("+ Applying fancy settings +") + + if "background_picture" in fancy: + bg_path = os.path.join(disk_root, ".background", os.path.basename(fancy["background_picture"])) + os.mkdir(os.path.dirname(bg_path)) + if verbose >= 3: + print(fancy["background_picture"], "->", bg_path) + shutil.copy2(fancy["background_picture"], bg_path) + else: + bg_path = None + + if fancy.get("applications_symlink", False): + os.symlink("/Applications", os.path.join(disk_root, "Applications")) + + # The Python appscript package broke with OSX 10.8 and isn't being fixed. + # So we now build up an AppleScript string and use the osascript command + # to make the .dmg file pretty: + appscript = Template( """ + on run argv + tell application "Finder" + tell disk "$disk" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {$window_bounds} + set theViewOptions to the icon view options of container window + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to $icon_size + $background_commands + $items_positions + close -- close/reopen works around a bug... + open + update without registering applications + delay 5 + eject + end tell + end tell + end run + """) + + itemscript = Template('set position of item "${item}" of container window to {${position}}') + items_positions = [] + if "items_position" in fancy: + for name, position in fancy["items_position"].items(): + params = { "item" : name, "position" : ",".join([str(p) for p in position]) } + items_positions.append(itemscript.substitute(params)) + + params = { + "disk" : volname, + "window_bounds" : "300,300,800,620", + "icon_size" : "96", + "background_commands" : "", + "items_positions" : "\n ".join(items_positions) + } + if "window_bounds" in fancy: + params["window_bounds"] = ",".join([str(p) for p in fancy["window_bounds"]]) + if "icon_size" in fancy: + params["icon_size"] = str(fancy["icon_size"]) + if bg_path is not None: + # Set background file, then call SetFile to make it invisible. + # (note: making it invisible first makes set background picture fail) + bgscript = Template("""set background picture of theViewOptions to file ".background:$bgpic" + do shell script "SetFile -a V /Volumes/$disk/.background/$bgpic" """) + params["background_commands"] = bgscript.substitute({"bgpic" : os.path.basename(bg_path), "disk" : params["disk"]}) + + s = appscript.substitute(params) + if verbose >= 2: + print("Running AppleScript:") + print(s) + + p = subprocess.Popen(['osascript', '-'], stdin=subprocess.PIPE) + p.communicate(input=s.encode('utf-8')) + if p.returncode: + print("Error running osascript.") + + 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: + sys.exit(e.returncode) + + os.unlink(dmg_name + ".temp.dmg") + +# ------------------------------------------------ + +if verbose >= 2: + print("+ Done +") + +sys.exit(0) diff --git a/contrib/qos/README.md b/contrib/qos/README.md new file mode 100644 index 0000000..2cedb9f --- /dev/null +++ b/contrib/qos/README.md @@ -0,0 +1,5 @@ +### Qos ### + +This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 13811, but not if the destination IP is within a LAN (defined as 192.168.x.x). + +This means one can have an always-on versessd instance running, and another local versessd/versess-qt instance which connects to this node and receives blocks from it. diff --git a/contrib/qos/tc.sh b/contrib/qos/tc.sh new file mode 100644 index 0000000..721946a --- /dev/null +++ b/contrib/qos/tc.sh @@ -0,0 +1,41 @@ +#network interface on which to limit traffic +IF="eth0" +#limit of the network interface in question +LINKCEIL="1gbit" +#limit outbound Bitcoin protocol traffic to this rate +LIMIT="160kbit" +#defines the address space for which you wish to disable rate limiting +LOCALNET="192.168.0.0/16" + +#delete existing rules +tc qdisc del dev ${IF} root + +#add root class +tc qdisc add dev ${IF} root handle 1: htb default 10 + +#add parent class +tc class add dev ${IF} parent 1: classid 1:1 htb rate ${LINKCEIL} ceil ${LINKCEIL} + +#add our two classes. one unlimited, another limited +tc class add dev ${IF} parent 1:1 classid 1:10 htb rate ${LINKCEIL} ceil ${LINKCEIL} prio 0 +tc class add dev ${IF} parent 1:1 classid 1:11 htb rate ${LIMIT} ceil ${LIMIT} prio 1 + +#add handles to our classes so packets marked with go into the class with "... handle fw ..." +tc filter add dev ${IF} parent 1: protocol ip prio 1 handle 1 fw classid 1:10 +tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11 + +#delete any existing rules +#disable for now +#ret=0 +#while [ $ret -eq 0 ]; do +# iptables -t mangle -D OUTPUT 1 +# ret=$? +#done + +#limit outgoing traffic to and from port 13811. but not when dealing with a host on the local network +# (defined by $LOCALNET) +# --set-mark marks packages matching these criteria with the number "2" +# these packages are filtered by the tc filter with "handle 2" +# this filter sends the packages into the 1:11 class, and this class is limited to ${LIMIT} +iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 13811 ! -d ${LOCALNET} -j MARK --set-mark 0x2 +iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 13811 ! -d ${LOCALNET} -j MARK --set-mark 0x2 diff --git a/contrib/qt_translations.py b/contrib/qt_translations.py new file mode 100644 index 0000000..fd8a8b7 --- /dev/null +++ b/contrib/qt_translations.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Helpful little script that spits out a comma-separated list of +# language codes for Qt icons that should be included +# in binary bitcoin distributions + +import glob +import os +import re +import sys + +if len(sys.argv) != 3: + sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.argv[0]) + +d1 = sys.argv[1] +d2 = sys.argv[2] + +l1 = set([ re.search(r'qt_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d1, 'qt_*.qm')) ]) +l2 = set([ re.search(r'bitcoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'bitcoin_*.qm')) ]) + +print ",".join(sorted(l1.intersection(l2))) + diff --git a/contrib/rpm/README.md b/contrib/rpm/README.md new file mode 100644 index 0000000..e1e0745 --- /dev/null +++ b/contrib/rpm/README.md @@ -0,0 +1,185 @@ +RPM Spec File Notes +------------------- + +The RPM spec file provided here is for Bitcoin-Core 0.12.0 and builds on CentOS +7 with either the CentOS provided OpenSSL library or with LibreSSL as packaged +at [LibreLAMP.com](https://librelamp.com/). It should hopefully not be too +difficult to port the RPM spec file to most RPM based Linux distributions. + +When porting the spec file to build for a particular distribution, there are +some important notes. + +## Sources + +It is considered good form for all sources to reference a URL where the source +can be downloaded. + +Sources 0-9 should be reserved for source code tarballs. `Source0` should +reference the release tarball available from https://bitcoin.org/bin/ and +`Source1` should reference the BerkeleyDB source. + +Sources 10-99 are for source files that are maintained in the +[Bitcoin git repository](https://github.com/bitcoin/bitcoin) but are not part of +the release tarball. Most of these will reside in the `contrib` sub-directory. + +Sources 10-19 should be reserved for miscellaneous configuration files. +Currently only `Source10` is used, for the example `bitcoin.conf` file. + +Sources 20-29 should be reserved for man pages. Currently only `Source20` +through `Source23` are used. + +Sources 30-39 should be reserved for SELinux related files. Currently only +`Source30` through `Source32` are used. Until those files are in a tagged +release, the full URL specified in the RPM spec file will not work. You can get +them from the git repository where you retrieved this file. + +Sources 100+ are for files that are not source tarballs and are not maintained +in the bitcoin git repository. At present only an SVG version of the Bitcoin +icon is used. + +## Patches + +In general, patches should be avoided. When a packager feels a patch is +necessary, the packager should bring the problem to the attention of the bitcoin +developers so that an official fix to the issue can make it into the next +release. + +### Patch0 bitcoin-0.12.0-libressl.patch + +This patch is only needed if building against LibreSSL. LibreSSL is not the +standard TLS library on most Linux distributions. The patch will likely not be +needed when 0.12.1 is released, a proper fix is already in the Bitcoin git +master branch. + +## BuildRequires + +The packages specified in the `BuildRequires` are specified according to the +package naming convention currently used in CentOS 7 and EPEL for CentOS 7. You +may need to change some of the package names for other distributions. This is +most likely to be the case with the Qt packages. + +## BerkeleyDB + +The `build-unix.md` file recommends building against BerkeleyDB 4.8.30. Even if +that is the version your Linux distribution ships with, it probably is a good +idea to build Bitcoin Core against a static version of that library compiled +according to the instructions in the `build-unix.md` file so that any changes +the distribution may make in the future will not result in a problem for users. + +The problem that can exist, clients built against different versions of +BerkeleyDB may not be able read each other's `wallet.dat` file which can make it +difficult for a user to recover from backup in the event of a system failure. + +## Graphical User Interface and Qt Version + +The RPM spec file will by default build the GUI client linked against the Qt5 +libraries. If you wish instead to link against the Qt4 libraries you need to +pass the switch `-D '_use_qt4 1'` at build time to the `rpmbuild` or `mock` +command used to build the packages. + +If you would prefer not to build the GUI at all, you can pass the switch +`-D '_no_gui 1'` to the `rpmbuild` or `mock` build command. + +## Desktop and KDE Files + +The desktop and KDE meta files are created in the spec file itself with the +`cat` command. This is done to allow easy distribution specific changes without +needing to use any patches. A specific timestamp is given to the files so that +it does not they do not appear to have been updated every time the package is +built. If you do make changes to them, you probably should update timestamp +assigned to them in the `touch` command that specifies the timestamp. + +## SVG, PNG, and XPM Icons + +The `bitcoin.svg` file is from the source listed as `Source100`. It is used as +the source for the PNG and XPM files. The generated PNG and XPM files are given +the same timestamp as the source SVG file as a means of indicating they are +derived from it. + +## Systemd + +This spec file assumes the target distribution uses systemd. That really only +matters for the `bitcoin-server` package. At this point, most RPM based +distributions that still receive vendor updates do in fact use systemd. + +The files to control the service are created in the RPM spec file itself using +the `cat` command. This is done to make it easy to modify for other +distributions that may implement things differently without needing to patch +source. A specific timestamp is given to the files so that they do not appear +to have been updated every time the package is built. If you do make changes to +them, you probably should update the timestamp assigned to them in the `touch` +command that specifies the timestamp. + +## SELinux + +The `bitcoin-server` package should have SELinux support. How to properly do +that *may* vary by distribution and version of distribution. + +The SELinux stuff in this RPM spec file *should* be correct for CentOS, RHEL, +and Fedora but it would be a good idea to review it before building the package +on other distributions. + +## Tests + +The `%check` section takes a very long time to run. If your build system has a +time limit for package build, you may need to make an exception for this +package. On CentOS 7 the `%check` section completes successfully with both +OpenSSL and LibreSSL, a failure really does mean something is wrong. + +## LibreSSL Build Notes + +To build against LibreSSL you will need to pass the switch +`-D '_use_libressl 1'` to the `rpmbuild` or `mock` command or the spec file will +want the OpenSSL development files. + +### LibreSSL and Boost + +LibreSSL (and some newer builds of OpenSSL) do not have support for SSLv3. This +can cause issues with the Boost package if the Boost package has not been +patched accordingly. On those distributions, you will either need to build +Bitcoin-Core against OpenSSL or use a patched version of Boost in the build +system. + +As SSLv3 is no longer safe, distributions that have not patched Boost to work +with TLS libraries that do not support SSLv3 should have bug reports filed +against the Boost package. This bug report has already been filed for RHEL 7 but +it may need to be filed for other distributions. + +A patch for Boost: https://github.com/boostorg/asio/pull/23/files + +## ZeroMQ + +At this time, this RPM spec file does not support the ZeroMQ build options. A +suitable version of ZeroMQ is not available for the platform this spec file was +developed on (CentOS 7). + +## Legacy Credit + +This RPM spec file is largely based upon the work of Michael Hampton at +[Ringing Liberty](https://www.ringingliberty.com/bitcoin/). He has been +packaging Bitcoin for Fedora at least since 2012. + +Most of the differences between his packaging and this package are stylistic in +nature. The major differences: + +1. He builds from a github tagged release rather than a release tarball. This +should not result in different source code. + +2. He does not build BerkeleyDB but instead uses the BerkeleyDB provided by the +Linux distribution. For the distributions he packages for, they currently all +use the same version of BerkeleyDB so that difference is *probably* just +academic. + +3. As of his 10.11.2 package he did not allow for building against LibreSSL, +specifying a build without the Qt GUI, or specifying which version of the Qt +libraries to use. + +4. I renamed the `bitcoin` package that contains the Qt GUI to `bitcoin-core` as +that appears to be how the general population refers to it, in contrast to +`bitcoin-xt` or `bitcoin-classic`. I wanted to make sure the general population +knows what they are getting when installing the GUI package. + +As far as minor differences, I generally prefer to assign the file permissions +in the `%files` portion of an RPM spec file rather than specifying the +permissions of a file during `%install` and other minor things like that +are largely just cosmetic. diff --git a/contrib/rpm/versess.fc b/contrib/rpm/versess.fc new file mode 100644 index 0000000..18539f1 --- /dev/null +++ b/contrib/rpm/versess.fc @@ -0,0 +1,8 @@ +/usr/bin/versess-cli -- gen_context(system_u:object_r:versess_exec_t,s0) +/usr/sbin/versessd -- gen_context(system_u:object_r:versess_exec_t,s0) +/usr/lib(64)?/versess/versessd -- gen_context(system_u:object_r:versess_exec_t,s0) + +/etc/versess(/.*)? gen_context(system_u:object_r:versess_conf_t,s0) +/var/lib/versess(/.*)? gen_context(system_u:object_r:versess_var_lib_t,s0) + +(/var)?/run/versessd(/.*)? gen_context(system_u:object_r:versess_var_run_t,s0) diff --git a/contrib/rpm/versess.if b/contrib/rpm/versess.if new file mode 100644 index 0000000..f64ea75 --- /dev/null +++ b/contrib/rpm/versess.if @@ -0,0 +1,157 @@ + +## policy for versess + + +######################################## +## +## Transition to versess. +## +## +## +## Domain allowed to transition. +## +## +# +interface(`versess_domtrans',` + gen_require(` + type versess_t, versess_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, versess_exec_t, versess_t) +') + + +######################################## +## +## Execute versess server in the versess domain. +## +## +## +## Domain allowed access. +## +## +# +interface(`versess_initrc_domtrans',` + gen_require(` + type versess_initrc_exec_t; + ') + + init_labeled_script_domtrans($1, versess_initrc_exec_t) +') + + +######################################## +## +## Search versess lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`versess_search_lib',` + gen_require(` + type versess_var_lib_t; + ') + + allow $1 versess_var_lib_t:dir search_dir_perms; + files_search_var_lib($1) +') + +######################################## +## +## Read versess lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`versess_read_lib_files',` + gen_require(` + type versess_var_lib_t; + ') + + files_search_var_lib($1) + read_files_pattern($1, versess_var_lib_t, versess_var_lib_t) +') + +######################################## +## +## Manage versess lib files. +## +## +## +## Domain allowed access. +## +## +# +interface(`versess_manage_lib_files',` + gen_require(` + type versess_var_lib_t; + ') + + files_search_var_lib($1) + manage_files_pattern($1, versess_var_lib_t, versess_var_lib_t) +') + +######################################## +## +## Manage versess lib directories. +## +## +## +## Domain allowed access. +## +## +# +interface(`versess_manage_lib_dirs',` + gen_require(` + type versess_var_lib_t; + ') + + files_search_var_lib($1) + manage_dirs_pattern($1, versess_var_lib_t, versess_var_lib_t) +') + + +######################################## +## +## All of the rules required to administrate +## a versess environment +## +## +## +## Domain allowed access. +## +## +## +## +## Role allowed access. +## +## +## +# +interface(`versess_admin',` + gen_require(` + type versess_t; + type versess_initrc_exec_t; + type versess_var_lib_t; + ') + + allow $1 versess_t:process { ptrace signal_perms }; + ps_process_pattern($1, versess_t) + + versess_initrc_domtrans($1) + domain_system_change_exemption($1) + role_transition $2 versess_initrc_exec_t system_r; + allow $2 system_r; + + files_search_var_lib($1) + admin_pattern($1, versess_var_lib_t) + +') + diff --git a/contrib/rpm/versess.spec b/contrib/rpm/versess.spec new file mode 100644 index 0000000..4709076 --- /dev/null +++ b/contrib/rpm/versess.spec @@ -0,0 +1,442 @@ +%define bdbv 4.8.30 +%global selinux_variants mls strict targeted + +%if 0%{?_no_gui:1} +%define _buildqt 0 +%define buildargs --with-gui=no +%else +%define _buildqt 1 +%if 0%{?_use_qt4} +%define buildargs --with-qrencode --with-gui=qt4 +%else +%define buildargs --with-qrencode --with-gui=qt5 +%endif +%endif + +Name: versess +Version: 0.12.0 +Release: 2%{?dist} +Summary: Peer to Peer Cryptographic Currency + +Group: Applications/System +License: MIT +URL: https://versess.org/ +Source0: https://versess.org/bin/versess-core-%{version}/versess-%{version}.tar.gz +Source1: http://download.oracle.com/berkeley-db/db-%{bdbv}.NC.tar.gz + +Source10: https://raw.githubusercontent.com/versess-project/versess/v%{version}/contrib/debian/examples/versess.conf + +#man pages +Source20: https://raw.githubusercontent.com/versess-project/versess/v%{version}/doc/man/versessd.1 +Source21: https://raw.githubusercontent.com/versess-project/versess/v%{version}/doc/man/versess-cli.1 +Source22: https://raw.githubusercontent.com/versess-project/versess/v%{version}/doc/man/versess-qt.1 + +#selinux +Source30: https://raw.githubusercontent.com/versess-project/versess/v%{version}/contrib/rpm/versess.te +# Source31 - what about versess-tx and bench_versess ??? +Source31: https://raw.githubusercontent.com/versess-project/versess/v%{version}/contrib/rpm/versess.fc +Source32: https://raw.githubusercontent.com/versess-project/versess/v%{version}/contrib/rpm/versess.if + +Source100: https://upload.wikimedia.org/wikipedia/commons/4/46/Bitcoin.svg + +%if 0%{?_use_libressl:1} +BuildRequires: libressl-devel +%else +BuildRequires: openssl-devel +%endif +BuildRequires: boost-devel +BuildRequires: miniupnpc-devel +BuildRequires: autoconf automake libtool +BuildRequires: libevent-devel + + +Patch0: versess-0.12.0-libressl.patch + + +%description +Bitcoin is a digital cryptographic currency that uses peer-to-peer technology to +operate with no central authority or banks; managing transactions and the +issuing of versesss is carried out collectively by the network. + +%if %{_buildqt} +%package core +Summary: Peer to Peer Cryptographic Currency +Group: Applications/System +Obsoletes: %{name} < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +%if 0%{?_use_qt4} +BuildRequires: qt-devel +%else +BuildRequires: qt5-qtbase-devel +# for /usr/bin/lrelease-qt5 +BuildRequires: qt5-linguist +%endif +BuildRequires: protobuf-devel +BuildRequires: qrencode-devel +BuildRequires: %{_bindir}/desktop-file-validate +# for icon generation from SVG +BuildRequires: %{_bindir}/inkscape +BuildRequires: %{_bindir}/convert + +%description core +Bitcoin is a digital cryptographic currency that uses peer-to-peer technology to +operate with no central authority or banks; managing transactions and the +issuing of versesss is carried out collectively by the network. + +This package contains the Qt based graphical client and node. If you are looking +to run a Bitcoin wallet, this is probably the package you want. +%endif + + +%package libs +Summary: Bitcoin shared libraries +Group: System Environment/Libraries + +%description libs +This package provides the versessconsensus shared libraries. These libraries +may be used by third party software to provide consensus verification +functionality. + +Unless you know need this package, you probably do not. + +%package devel +Summary: Development files for versess +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} + +%description devel +This package contains the header files and static library for the +versessconsensus shared library. If you are developing or compiling software +that wants to link against that library, then you need this package installed. + +Most people do not need this package installed. + +%package server +Summary: The versess daemon +Group: System Environment/Daemons +Requires: versess-utils = %{version}-%{release} +Requires: selinux-policy policycoreutils-python +Requires(pre): shadow-utils +Requires(post): %{_sbindir}/semodule %{_sbindir}/restorecon %{_sbindir}/fixfiles %{_sbindir}/sestatus +Requires(postun): %{_sbindir}/semodule %{_sbindir}/restorecon %{_sbindir}/fixfiles %{_sbindir}/sestatus +BuildRequires: systemd +BuildRequires: checkpolicy +BuildRequires: %{_datadir}/selinux/devel/Makefile + +%description server +This package provides a stand-alone versess-core daemon. For most users, this +package is only needed if they need a full-node without the graphical client. + +Some third party wallet software will want this package to provide the actual +versess-core node they use to connect to the network. + +If you use the graphical versess-core client then you almost certainly do not +need this package. + +%package utils +Summary: Bitcoin utilities +Group: Applications/System + +%description utils +This package provides several command line utilities for interacting with a +versess-core daemon. + +The versess-cli utility allows you to communicate and control a versess daemon +over RPC, the versess-tx utility allows you to create a custom transaction, and +the bench_versess utility can be used to perform some benchmarks. + +This package contains utilities needed by the versess-server package. + + +%prep +%setup -q +%patch0 -p1 -b .libressl +cp -p %{SOURCE10} ./versess.conf.example +tar -zxf %{SOURCE1} +cp -p db-%{bdbv}.NC/LICENSE ./db-%{bdbv}.NC-LICENSE +mkdir db4 SELinux +cp -p %{SOURCE30} %{SOURCE31} %{SOURCE32} SELinux/ + + +%build +CWD=`pwd` +cd db-%{bdbv}.NC/build_unix/ +../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${CWD}/db4 +make install +cd ../.. + +./autogen.sh +%configure LDFLAGS="-L${CWD}/db4/lib/" CPPFLAGS="-I${CWD}/db4/include/" --with-miniupnpc --enable-glibc-back-compat %{buildargs} +make %{?_smp_mflags} + +pushd SELinux +for selinuxvariant in %{selinux_variants}; do + make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile + mv versess.pp versess.pp.${selinuxvariant} + make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean +done +popd + + +%install +make install DESTDIR=%{buildroot} + +mkdir -p -m755 %{buildroot}%{_sbindir} +mv %{buildroot}%{_bindir}/versessd %{buildroot}%{_sbindir}/versessd + +# systemd stuff +mkdir -p %{buildroot}%{_tmpfilesdir} +cat < %{buildroot}%{_tmpfilesdir}/versess.conf +d /run/versessd 0750 versess versess - +EOF +touch -a -m -t 201504280000 %{buildroot}%{_tmpfilesdir}/versess.conf + +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +cat < %{buildroot}%{_sysconfdir}/sysconfig/versess +# Provide options to the versess daemon here, for example +# OPTIONS="-testnet -disable-wallet" + +OPTIONS="" + +# System service defaults. +# Don't change these unless you know what you're doing. +CONFIG_FILE="%{_sysconfdir}/versess/versess.conf" +DATA_DIR="%{_localstatedir}/lib/versess" +PID_FILE="/run/versessd/versessd.pid" +EOF +touch -a -m -t 201504280000 %{buildroot}%{_sysconfdir}/sysconfig/versess + +mkdir -p %{buildroot}%{_unitdir} +cat < %{buildroot}%{_unitdir}/versess.service +[Unit] +Description=Bitcoin daemon +After=syslog.target network.target + +[Service] +Type=forking +ExecStart=%{_sbindir}/versessd -daemon -conf=\${CONFIG_FILE} -datadir=\${DATA_DIR} -pid=\${PID_FILE} \$OPTIONS +EnvironmentFile=%{_sysconfdir}/sysconfig/versess +User=versess +Group=versess + +Restart=on-failure +PrivateTmp=true +TimeoutStopSec=120 +TimeoutStartSec=60 +StartLimitInterval=240 +StartLimitBurst=5 + +[Install] +WantedBy=multi-user.target +EOF +touch -a -m -t 201504280000 %{buildroot}%{_unitdir}/versess.service +#end systemd stuff + +mkdir %{buildroot}%{_sysconfdir}/versess +mkdir -p %{buildroot}%{_localstatedir}/lib/versess + +#SELinux +for selinuxvariant in %{selinux_variants}; do + install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} + install -p -m 644 SELinux/versess.pp.${selinuxvariant} %{buildroot}%{_datadir}/selinux/${selinuxvariant}/versess.pp +done + +%if %{_buildqt} +# qt icons +install -D -p share/pixmaps/versess.ico %{buildroot}%{_datadir}/pixmaps/versess.ico +install -p share/pixmaps/nsis-header.bmp %{buildroot}%{_datadir}/pixmaps/ +install -p share/pixmaps/nsis-wizard.bmp %{buildroot}%{_datadir}/pixmaps/ +install -p %{SOURCE100} %{buildroot}%{_datadir}/pixmaps/versess.svg +%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/versess16.png -w16 -h16 +%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/versess32.png -w32 -h32 +%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/versess64.png -w64 -h64 +%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/versess128.png -w128 -h128 +%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/versess256.png -w256 -h256 +%{_bindir}/convert -resize 16x16 %{buildroot}%{_datadir}/pixmaps/versess256.png %{buildroot}%{_datadir}/pixmaps/versess16.xpm +%{_bindir}/convert -resize 32x32 %{buildroot}%{_datadir}/pixmaps/versess256.png %{buildroot}%{_datadir}/pixmaps/versess32.xpm +%{_bindir}/convert -resize 64x64 %{buildroot}%{_datadir}/pixmaps/versess256.png %{buildroot}%{_datadir}/pixmaps/versess64.xpm +%{_bindir}/convert -resize 128x128 %{buildroot}%{_datadir}/pixmaps/versess256.png %{buildroot}%{_datadir}/pixmaps/versess128.xpm +%{_bindir}/convert %{buildroot}%{_datadir}/pixmaps/versess256.png %{buildroot}%{_datadir}/pixmaps/versess256.xpm +touch %{buildroot}%{_datadir}/pixmaps/*.png -r %{SOURCE100} +touch %{buildroot}%{_datadir}/pixmaps/*.xpm -r %{SOURCE100} + +# Desktop File - change the touch timestamp if modifying +mkdir -p %{buildroot}%{_datadir}/applications +cat < %{buildroot}%{_datadir}/applications/versess-core.desktop +[Desktop Entry] +Encoding=UTF-8 +Name=Bitcoin +Comment=Bitcoin P2P Cryptocurrency +Comment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair +Comment[tr]=Bitcoin, eÅŸten eÅŸe kriptografik sanal para birimi +Exec=versess-qt %u +Terminal=false +Type=Application +Icon=versess128 +MimeType=x-scheme-handler/versess; +Categories=Office;Finance; +EOF +# change touch date when modifying desktop +touch -a -m -t 201511100546 %{buildroot}%{_datadir}/applications/versess-core.desktop +%{_bindir}/desktop-file-validate %{buildroot}%{_datadir}/applications/versess-core.desktop + +# KDE protocol - change the touch timestamp if modifying +mkdir -p %{buildroot}%{_datadir}/kde4/services +cat < %{buildroot}%{_datadir}/kde4/services/versess-core.protocol +[Protocol] +exec=versess-qt '%u' +protocol=versess +input=none +output=none +helper=true +listing= +reading=false +writing=false +makedir=false +deleting=false +EOF +# change touch date when modifying protocol +touch -a -m -t 201511100546 %{buildroot}%{_datadir}/kde4/services/versess-core.protocol +%endif + +# man pages +install -D -p %{SOURCE20} %{buildroot}%{_mandir}/man1/versessd.1 +install -p %{SOURCE21} %{buildroot}%{_mandir}/man1/versess-cli.1 +%if %{_buildqt} +install -p %{SOURCE22} %{buildroot}%{_mandir}/man1/versess-qt.1 +%endif + +# nuke these, we do extensive testing of binaries in %%check before packaging +rm -f %{buildroot}%{_bindir}/test_* + +%check +make check +srcdir=src test/versess-util-test.py +test/functional/test_runner.py --extended + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%pre server +getent group versess >/dev/null || groupadd -r versess +getent passwd versess >/dev/null || + useradd -r -g versess -d /var/lib/versess -s /sbin/nologin \ + -c "Bitcoin wallet server" versess +exit 0 + +%post server +%systemd_post versess.service +# SELinux +if [ `%{_sbindir}/sestatus |grep -c "disabled"` -eq 0 ]; then +for selinuxvariant in %{selinux_variants}; do + %{_sbindir}/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/versess.pp &> /dev/null || : +done +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 8332 +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 8333 +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 18332 +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 18333 +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 18443 +%{_sbindir}/semanage port -a -t versess_port_t -p tcp 18444 +%{_sbindir}/fixfiles -R versess-server restore &> /dev/null || : +%{_sbindir}/restorecon -R %{_localstatedir}/lib/versess || : +fi + +%posttrans server +%{_bindir}/systemd-tmpfiles --create + +%preun server +%systemd_preun versess.service + +%postun server +%systemd_postun versess.service +# SELinux +if [ $1 -eq 0 ]; then + if [ `%{_sbindir}/sestatus |grep -c "disabled"` -eq 0 ]; then + %{_sbindir}/semanage port -d -p tcp 8332 + %{_sbindir}/semanage port -d -p tcp 8333 + %{_sbindir}/semanage port -d -p tcp 18332 + %{_sbindir}/semanage port -d -p tcp 18333 + %{_sbindir}/semanage port -d -p tcp 18443 + %{_sbindir}/semanage port -d -p tcp 18444 + for selinuxvariant in %{selinux_variants}; do + %{_sbindir}/semodule -s ${selinuxvariant} -r versess &> /dev/null || : + done + %{_sbindir}/fixfiles -R versess-server restore &> /dev/null || : + [ -d %{_localstatedir}/lib/versess ] && \ + %{_sbindir}/restorecon -R %{_localstatedir}/lib/versess &> /dev/null || : + fi +fi + +%clean +rm -rf %{buildroot} + +%if %{_buildqt} +%files core +%defattr(-,root,root,-) +%license COPYING db-%{bdbv}.NC-LICENSE +%doc COPYING versess.conf.example doc/README.md doc/bips.md doc/files.md doc/multiwallet-qt.md doc/reduce-traffic.md doc/release-notes.md doc/tor.md +%attr(0755,root,root) %{_bindir}/versess-qt +%attr(0644,root,root) %{_datadir}/applications/versess-core.desktop +%attr(0644,root,root) %{_datadir}/kde4/services/versess-core.protocol +%attr(0644,root,root) %{_datadir}/pixmaps/*.ico +%attr(0644,root,root) %{_datadir}/pixmaps/*.bmp +%attr(0644,root,root) %{_datadir}/pixmaps/*.svg +%attr(0644,root,root) %{_datadir}/pixmaps/*.png +%attr(0644,root,root) %{_datadir}/pixmaps/*.xpm +%attr(0644,root,root) %{_mandir}/man1/versess-qt.1* +%endif + +%files libs +%defattr(-,root,root,-) +%license COPYING +%doc COPYING doc/README.md doc/shared-libraries.md +%{_libdir}/lib*.so.* + +%files devel +%defattr(-,root,root,-) +%license COPYING +%doc COPYING doc/README.md doc/developer-notes.md doc/shared-libraries.md +%attr(0644,root,root) %{_includedir}/*.h +%{_libdir}/*.so +%{_libdir}/*.a +%{_libdir}/*.la +%attr(0644,root,root) %{_libdir}/pkgconfig/*.pc + +%files server +%defattr(-,root,root,-) +%license COPYING db-%{bdbv}.NC-LICENSE +%doc COPYING versess.conf.example doc/README.md doc/REST-interface.md doc/bips.md doc/dnsseed-policy.md doc/files.md doc/reduce-traffic.md doc/release-notes.md doc/tor.md +%attr(0755,root,root) %{_sbindir}/versessd +%attr(0644,root,root) %{_tmpfilesdir}/versess.conf +%attr(0644,root,root) %{_unitdir}/versess.service +%dir %attr(0750,versess,versess) %{_sysconfdir}/versess +%dir %attr(0750,versess,versess) %{_localstatedir}/lib/versess +%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/versess +%attr(0644,root,root) %{_datadir}/selinux/*/*.pp +%attr(0644,root,root) %{_mandir}/man1/versessd.1* + +%files utils +%defattr(-,root,root,-) +%license COPYING +%doc COPYING versess.conf.example doc/README.md +%attr(0755,root,root) %{_bindir}/versess-cli +%attr(0755,root,root) %{_bindir}/versess-tx +%attr(0755,root,root) %{_bindir}/bench_versess +%attr(0644,root,root) %{_mandir}/man1/versess-cli.1* + + + +%changelog +* Fri Feb 26 2016 Alice Wonder - 0.12.0-2 +- Rename Qt package from versess to versess-core +- Make building of the Qt package optional +- When building the Qt package, default to Qt5 but allow building +- against Qt4 +- Only run SELinux stuff in post scripts if it is not set to disabled + +* Wed Feb 24 2016 Alice Wonder - 0.12.0-1 +- Initial spec file for 0.12.0 release + +# This spec file is written from scratch but a lot of the packaging decisions are directly +# based upon the 0.11.2 package spec file from https://www.ringingliberty.com/versess/ diff --git a/contrib/rpm/versess.te b/contrib/rpm/versess.te new file mode 100644 index 0000000..4f79cdc --- /dev/null +++ b/contrib/rpm/versess.te @@ -0,0 +1,81 @@ +policy_module(versess, 1.100.1) + +######################################## +# +# Declarations +# + +type versess_t; +type versess_exec_t; +init_daemon_domain(versess_t, versess_exec_t) + +permissive versess_t; + +type versess_initrc_exec_t; +init_script_file(versess_initrc_exec_t) + +type versess_conf_t; +files_type(versess_conf_t) + +type versess_var_lib_t; +files_type(versess_var_lib_t) + +type versess_var_run_t; +files_type(versess_var_run_t) + +type versess_port_t; +corenet_port(versess_port_t) + +######################################## +# +# versess local policy +# +allow versess_t self:process { fork }; + +allow versess_t self:fifo_file rw_fifo_file_perms; +allow versess_t self:unix_stream_socket create_stream_socket_perms; + +manage_dirs_pattern(versess_t, versess_conf_t, versess_conf_t) +manage_files_pattern(versess_t, versess_conf_t, versess_conf_t) + +manage_dirs_pattern(versess_t, versess_var_lib_t, versess_var_lib_t) +manage_files_pattern(versess_t, versess_var_lib_t, versess_var_lib_t) +files_var_lib_filetrans(versess_t, versess_var_lib_t, { dir file }) + +manage_dirs_pattern(versess_t, versess_var_run_t, versess_var_run_t) +manage_files_pattern(versess_t, versess_var_run_t, versess_var_run_t) + +sysnet_dns_name_resolve(versess_t) +corenet_all_recvfrom_unlabeled(versess_t) + +allow versess_t self:tcp_socket create_stream_socket_perms; +corenet_tcp_sendrecv_generic_if(versess_t) +corenet_tcp_sendrecv_generic_node(versess_t) +corenet_tcp_sendrecv_all_ports(versess_t) +corenet_tcp_bind_generic_node(versess_t) + +gen_require(` + type versess_port_t; +') +allow versess_t versess_port_t:tcp_socket name_bind; + +gen_require(` + type versess_port_t; +') +allow versess_t versess_port_t:tcp_socket name_connect; + +domain_use_interactive_fds(versess_t) + +files_read_etc_files(versess_t) + +miscfiles_read_localization(versess_t) + +sysnet_dns_name_resolve(versess_t) + +allow versess_t versess_exec_t:file execute_no_trans; +allow versess_t self:process setsched; +corecmd_exec_ls(versess_t) +corenet_tcp_connect_http_port(versess_t) +dev_read_urand(versess_t) +fs_getattr_xattr_fs(versess_t) +kernel_read_system_state(versess_t) diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md new file mode 100644 index 0000000..bf58fc3 --- /dev/null +++ b/contrib/seeds/README.md @@ -0,0 +1,19 @@ +# Seeds + +Utility to generate the seeds.txt list that is compiled into the client +(see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)). + +Be sure to update `PATTERN_AGENT` in `makeseeds.py` to include the current version, +and remove old versions as necessary. + +The seeds compiled into the release are created from fuzzbawls' DNS seed data, like this: + + curl -s http://seeder.fuzzbawls.pw/versess-mainnet.txt > seeds_main.txt + python3 makeseeds.py < seeds_main.txt > nodes_main.txt + python3 generate-seeds.py . > ../../src/chainparamsseeds.h + +## Dependencies + +Ubuntu: + + sudo apt-get install python3-dnspython diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py new file mode 100644 index 0000000..3174271 --- /dev/null +++ b/contrib/seeds/generate-seeds.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 +# Copyright (c) 2014-2017 Wladimir J. van der Laan +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +''' +Script to generate list of seed nodes for chainparams.cpp. + +This script expects two text files in the directory that is passed as an +argument: + + nodes_main.txt + nodes_test.txt + +These files must consist of lines in the format + + + : + [] + []: + .onion + 0xDDBBCCAA (IPv4 little-endian old pnSeeds format) + +The output will be two data structures with the peers in binary format: + + static SeedSpec6 pnSeed6_main[]={ + ... + } + static SeedSpec6 pnSeed6_test[]={ + ... + } + +These should be pasted into `src/chainparamsseeds.h`. +''' + +from base64 import b32decode +from binascii import a2b_hex +import sys, os +import re + +# ipv4 in ipv6 prefix +pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff]) +# tor-specific ipv6 prefix +pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43]) + +def name_to_ipv6(addr): + if len(addr)>6 and addr.endswith('.onion'): + vchAddr = b32decode(addr[0:-6], True) + if len(vchAddr) != 16-len(pchOnionCat): + raise ValueError('Invalid onion %s' % s) + return pchOnionCat + vchAddr + elif '.' in addr: # IPv4 + return pchIPv4 + bytearray((int(x) for x in addr.split('.'))) + elif ':' in addr: # IPv6 + sub = [[], []] # prefix, suffix + x = 0 + addr = addr.split(':') + for i,comp in enumerate(addr): + if comp == '': + if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end + continue + x += 1 # :: skips to suffix + assert(x < 2) + else: # two bytes per component + val = int(comp, 16) + sub[x].append(val >> 8) + sub[x].append(val & 0xff) + nullbytes = 16 - len(sub[0]) - len(sub[1]) + assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0)) + return bytearray(sub[0] + ([0] * nullbytes) + sub[1]) + elif addr.startswith('0x'): # IPv4-in-little-endian + return pchIPv4 + bytearray(reversed(a2b_hex(addr[2:]))) + else: + raise ValueError('Could not parse address %s' % addr) + +def parse_spec(s, defaultport): + match = re.match('\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s) + if match: # ipv6 + host = match.group(1) + port = match.group(2) + elif s.count(':') > 1: # ipv6, no port + host = s + port = '' + else: + (host,_,port) = s.partition(':') + + if not port: + port = defaultport + else: + port = int(port) + + host = name_to_ipv6(host) + + return (host,port) + +def process_nodes(g, f, structname, defaultport): + g.write('static SeedSpec6 %s[] = {\n' % structname) + first = True + for line in f: + comment = line.find('#') + if comment != -1: + line = line[0:comment] + line = line.strip() + if not line: + continue + if not first: + g.write(',\n') + first = False + + (host,port) = parse_spec(line, defaultport) + hoststr = ','.join(('0x%02x' % b) for b in host) + g.write(' {{%s}, %i}' % (hoststr, port)) + g.write('\n};\n') + +def main(): + if len(sys.argv)<2: + print(('Usage: %s ' % sys.argv[0]), file=sys.stderr) + exit(1) + g = sys.stdout + indir = sys.argv[1] + g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n') + g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n') + g.write('/**\n') + g.write(' * List of fixed seed nodes for the bitcoin network\n') + g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n') + g.write(' *\n') + g.write(' * Each line contains a 16-byte IPv6 address and a port.\n') + g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n') + g.write(' */\n') + with open(os.path.join(indir,'nodes_main.txt'),'r') as f: + process_nodes(g, f, 'pnSeed6_main', 13811) + g.write('\n') + with open(os.path.join(indir,'nodes_test.txt'),'r') as f: + process_nodes(g, f, 'pnSeed6_test', 51474) + g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') + +if __name__ == '__main__': + main() diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py new file mode 100644 index 0000000..53cc1a0 --- /dev/null +++ b/contrib/seeds/makeseeds.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +# Copyright (c) 2013-2017 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# +# Generate seeds.txt from Pieter's DNS seeder +# + +NSEEDS=512 + +MAX_SEEDS_PER_ASN=2 + +MIN_BLOCKS = 615801 + +# These are hosts that have been observed to be behaving strangely (e.g. +# aggressively connecting to every node). +SUSPICIOUS_HOSTS = { + "" +} + +import re +import sys +import dns.resolver +import collections + +PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") +PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$") +PATTERN_ONION = re.compile(r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$") +PATTERN_AGENT = re.compile(r"^(/Versess:2.2.(0|1|99)/)$") + +def parseline(line): + sline = line.split() + if len(sline) < 11: + return None + m = PATTERN_IPV4.match(sline[0]) + sortkey = None + ip = None + if m is None: + m = PATTERN_IPV6.match(sline[0]) + if m is None: + m = PATTERN_ONION.match(sline[0]) + if m is None: + return None + else: + net = 'onion' + ipstr = sortkey = m.group(1) + port = int(m.group(2)) + else: + net = 'ipv6' + if m.group(1) in ['::']: # Not interested in localhost + return None + ipstr = m.group(1) + sortkey = ipstr # XXX parse IPv6 into number, could use name_to_ipv6 from generate-seeds + port = int(m.group(2)) + else: + # 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 + net = 'ipv4' + sortkey = ip + ipstr = m.group(1) + port = int(m.group(6)) + # 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. + if len(sline) > 11: + agent = sline[11][1:] + sline[12][:-1] + else: + agent = sline[11][1:-1] + # Extract service flags. + service = int(sline[9], 16) + # Extract blocks. + blocks = int(sline[8]) + # Construct result. + return { + 'net': net, + 'ip': ipstr, + 'port': port, + 'ipnum': ip, + 'uptime': uptime30, + 'lastsuccess': lastsuccess, + 'version': version, + 'agent': agent, + 'service': service, + 'blocks': blocks, + 'sortkey': sortkey, + } + +def filtermultiport(ips): + '''Filter out hosts with more nodes per IP''' + hist = collections.defaultdict(list) + for ip in ips: + hist[ip['sortkey']].append(ip) + return [value[0] for (key,value) in list(hist.items()) if len(value)==1] + +# Based on Greg Maxwell's seed_filter.py +def filterbyasn(ips, max_per_asn, max_total): + # Sift out ips by type + ips_ipv4 = [ip for ip in ips if ip['net'] == 'ipv4'] + ips_ipv6 = [ip for ip in ips if ip['net'] == 'ipv6'] + ips_onion = [ip for ip in ips if ip['net'] == 'onion'] + + # Filter IPv4 by ASN + result = [] + asn_count = {} + for ip in ips_ipv4: + 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') + + # TODO: filter IPv6 by ASN + + # Add back non-IPv4 + result.extend(ips_ipv6) + result.extend(ips_onion) + return result + +def main(): + lines = sys.stdin.readlines() + ips = [parseline(line) for line in lines] + + # Skip entries with valid 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(re.sub(' ', '-', 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) + # Filter out hosts with multiple bitcoin ports, these are likely abusive + ips = filtermultiport(ips) + # 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['net'], x['sortkey'])) + + for ip in ips: + if ip['net'] == 'ipv6': + print('[%s]:%i' % (ip['ip'], ip['port'])) + else: + print('%s:%i' % (ip['ip'], ip['port'])) + +if __name__ == '__main__': + main() diff --git a/contrib/spendfrom/README.md b/contrib/spendfrom/README.md new file mode 100644 index 0000000..1ce9333 --- /dev/null +++ b/contrib/spendfrom/README.md @@ -0,0 +1,35 @@ +### SpendFrom ### + +Use the raw transactions API to send coins received on a particular +address (or addresses). + +### Usage: ### +Depends on [jsonrpc](http://json-rpc.org/). + + spendfrom.py --from=FROMADDRESS1[,FROMADDRESS2] --to=TOADDRESS --amount=amount \ + --fee=fee --datadir=/path/to/.versess --testnet --dry_run + +With no arguments, outputs a list of amounts associated with addresses. + +With arguments, sends coins received by the `FROMADDRESS` addresses to the `TOADDRESS`. + +### Notes ### + +- You may explicitly specify how much fee to pay (a fee more than 1% of the amount +will fail, though, to prevent versess-losing accidents). Spendfrom may fail if +it thinks the transaction would never be confirmed (if the amount being sent is +too small, or if the transaction is too many bytes for the fee). + +- If a change output needs to be created, the change will be sent to the last +`FROMADDRESS` (if you specify just one `FROMADDRESS`, change will go back to it). + +- If `--datadir` is not specified, the default datadir is used. + +- The `--dry_run` option will just create and sign the transaction and print +the transaction data (as hexadecimal), instead of broadcasting it. + +- If the transaction is created and broadcast successfully, a transaction id +is printed. + +- If this was a tool for end-users and not programmers, it would have much friendlier +error-handling. diff --git a/contrib/spendfrom/setup.py b/contrib/spendfrom/setup.py new file mode 100644 index 0000000..01b9768 --- /dev/null +++ b/contrib/spendfrom/setup.py @@ -0,0 +1,9 @@ +from distutils.core import setup +setup(name='btcspendfrom', + version='1.0', + description='Command-line utility for bitcoin "coin control"', + author='Gavin Andresen', + author_email='gavin@bitcoinfoundation.org', + requires=['jsonrpc'], + scripts=['spendfrom.py'], + ) diff --git a/contrib/spendfrom/spendfrom.py b/contrib/spendfrom/spendfrom.py new file mode 100644 index 0000000..6df7f1c --- /dev/null +++ b/contrib/spendfrom/spendfrom.py @@ -0,0 +1,267 @@ +#!/usr/bin/env python +# +# Use the raw transactions API to spend VERSs received on particular addresses, +# and send any change back to that same address. +# +# Example usage: +# spendfrom.py # Lists available funds +# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 +# +# Assumes it will talk to a versessd or versess-Qt running +# on localhost. +# +# Depends on jsonrpc +# + +from decimal import * +import getpass +import math +import os +import os.path +import platform +import sys +import time +from jsonrpc import ServiceProxy, json + +BASE_FEE=Decimal("0.001") + +def check_json_precision(): + """Make sure json library being used does not lose precision converting BTC values""" + n = Decimal("20000000.00000003") + satoshis = int(json.loads(json.dumps(float(n)))*1.0e8) + if satoshis != 2000000000000003: + raise RuntimeError("JSON encode/decode loses precision") + +def determine_db_dir(): + """Return the default location of the versess data directory""" + if platform.system() == "Darwin": + return os.path.expanduser("~/Library/Application Support/Versess/") + elif platform.system() == "Windows": + return os.path.join(os.environ['APPDATA'], "Versess") + return os.path.expanduser("~/.versess") + +def read_bitcoin_config(dbdir): + """Read the versess.conf file from dbdir, returns dictionary of settings""" + from ConfigParser import SafeConfigParser + + class FakeSecHead(object): + def __init__(self, fp): + self.fp = fp + self.sechead = '[all]\n' + def readline(self): + if self.sechead: + try: return self.sechead + finally: self.sechead = None + else: + s = self.fp.readline() + if s.find('#') != -1: + s = s[0:s.find('#')].strip() +"\n" + return s + + config_parser = SafeConfigParser() + config_parser.readfp(FakeSecHead(open(os.path.join(dbdir, "versess.conf")))) + return dict(config_parser.items("all")) + +def connect_JSON(config): + """Connect to a versess JSON-RPC server""" + testnet = config.get('testnet', '0') + testnet = (int(testnet) > 0) # 0/1 in config file, convert to True/False + if not 'rpcport' in config: + config['rpcport'] = 51475 if testnet else 13810 + connect = "http://%s:%s@127.0.0.1:%s"%(config['rpcuser'], config['rpcpassword'], config['rpcport']) + try: + result = ServiceProxy(connect) + # ServiceProxy is lazy-connect, so send an RPC command mostly to catch connection errors, + # but also make sure the versessd we're talking to is/isn't testnet: + if result.getmininginfo()['testnet'] != testnet: + sys.stderr.write("RPC server at "+connect+" testnet setting mismatch\n") + sys.exit(1) + return result + except: + sys.stderr.write("Error connecting to RPC server at "+connect+"\n") + sys.exit(1) + +def unlock_wallet(versessd): + info = versessd.getinfo() + if 'unlocked_until' not in info: + return True # wallet is not encrypted + t = int(info['unlocked_until']) + if t <= time.time(): + try: + passphrase = getpass.getpass("Wallet is locked; enter passphrase: ") + versessd.walletpassphrase(passphrase, 5) + except: + sys.stderr.write("Wrong passphrase\n") + + info = versessd.getinfo() + return int(info['unlocked_until']) > time.time() + +def list_available(versessd): + address_summary = dict() + + address_to_account = dict() + for info in versessd.listreceivedbyaddress(0): + address_to_account[info["address"]] = info["account"] + + unspent = versessd.listunspent(0) + for output in unspent: + # listunspent doesn't give addresses, so: + rawtx = versessd.getrawtransaction(output['txid'], 1) + vout = rawtx["vout"][output['vout']] + pk = vout["scriptPubKey"] + + # This code only deals with ordinary pay-to-versess-address + # or pay-to-script-hash outputs right now; anything exotic is ignored. + if pk["type"] != "pubkeyhash" and pk["type"] != "scripthash": + continue + + address = pk["addresses"][0] + if address in address_summary: + address_summary[address]["total"] += vout["value"] + address_summary[address]["outputs"].append(output) + else: + address_summary[address] = { + "total" : vout["value"], + "outputs" : [output], + "account" : address_to_account.get(address, "") + } + + return address_summary + +def select_coins(needed, inputs): + # Feel free to improve this, this is good enough for my simple needs: + outputs = [] + have = Decimal("0.0") + n = 0 + while have < needed and n < len(inputs): + outputs.append({ "txid":inputs[n]["txid"], "vout":inputs[n]["vout"]}) + have += inputs[n]["amount"] + n += 1 + return (outputs, have-needed) + +def create_tx(versessd, fromaddresses, toaddress, amount, fee): + all_coins = list_available(versessd) + + total_available = Decimal("0.0") + needed = amount+fee + potential_inputs = [] + for addr in fromaddresses: + if addr not in all_coins: + continue + potential_inputs.extend(all_coins[addr]["outputs"]) + total_available += all_coins[addr]["total"] + + if total_available < needed: + sys.stderr.write("Error, only %f BTC available, need %f\n"%(total_available, needed)); + sys.exit(1) + + # + # Note: + # Python's json/jsonrpc modules have inconsistent support for Decimal numbers. + # Instead of wrestling with getting json.dumps() (used by jsonrpc) to encode + # Decimals, I'm casting amounts to float before sending them to versessd. + # + outputs = { toaddress : float(amount) } + (inputs, change_amount) = select_coins(needed, potential_inputs) + if change_amount > BASE_FEE: # don't bother with zero or tiny change + change_address = fromaddresses[-1] + if change_address in outputs: + outputs[change_address] += float(change_amount) + else: + outputs[change_address] = float(change_amount) + + rawtx = versessd.createrawtransaction(inputs, outputs) + signed_rawtx = versessd.signrawtransaction(rawtx) + if not signed_rawtx["complete"]: + sys.stderr.write("signrawtransaction failed\n") + sys.exit(1) + txdata = signed_rawtx["hex"] + + return txdata + +def compute_amount_in(versessd, txinfo): + result = Decimal("0.0") + for vin in txinfo['vin']: + in_info = versessd.getrawtransaction(vin['txid'], 1) + vout = in_info['vout'][vin['vout']] + result = result + vout['value'] + return result + +def compute_amount_out(txinfo): + result = Decimal("0.0") + for vout in txinfo['vout']: + result = result + vout['value'] + return result + +def sanity_test_fee(versessd, txdata_hex, max_fee): + class FeeError(RuntimeError): + pass + try: + txinfo = versessd.decoderawtransaction(txdata_hex) + total_in = compute_amount_in(versessd, txinfo) + total_out = compute_amount_out(txinfo) + if total_in-total_out > max_fee: + raise FeeError("Rejecting transaction, unreasonable fee of "+str(total_in-total_out)) + + tx_size = len(txdata_hex)/2 + kb = tx_size/1000 # integer division rounds down + if kb > 1 and fee < BASE_FEE: + raise FeeError("Rejecting no-fee transaction, larger than 1000 bytes") + if total_in < 0.01 and fee < BASE_FEE: + raise FeeError("Rejecting no-fee, tiny-amount transaction") + # Exercise for the reader: compute transaction priority, and + # warn if this is a very-low-priority transaction + + except FeeError as err: + sys.stderr.write((str(err)+"\n")) + sys.exit(1) + +def main(): + import optparse + + parser = optparse.OptionParser(usage="%prog [options]") + parser.add_option("--from", dest="fromaddresses", default=None, + help="addresses to get VERSs from") + parser.add_option("--to", dest="to", default=None, + help="address to get send VERSs to") + parser.add_option("--amount", dest="amount", default=None, + help="amount to send") + parser.add_option("--fee", dest="fee", default="0.0", + help="fee to include") + parser.add_option("--datadir", dest="datadir", default=determine_db_dir(), + help="location of versess.conf file with RPC username/password (default: %default)") + parser.add_option("--testnet", dest="testnet", default=False, action="store_true", + help="Use the test network") + parser.add_option("--dry_run", dest="dry_run", default=False, action="store_true", + help="Don't broadcast the transaction, just create and print the transaction data") + + (options, args) = parser.parse_args() + + check_json_precision() + config = read_bitcoin_config(options.datadir) + if options.testnet: config['testnet'] = True + versessd = connect_JSON(config) + + if options.amount is None: + address_summary = list_available(versessd) + for address,info in address_summary.iteritems(): + n_transactions = len(info['outputs']) + if n_transactions > 1: + print("%s %.8f %s (%d transactions)"%(address, info['total'], info['account'], n_transactions)) + else: + print("%s %.8f %s"%(address, info['total'], info['account'])) + else: + fee = Decimal(options.fee) + amount = Decimal(options.amount) + while unlock_wallet(versessd) == False: + pass # Keep asking for passphrase until they get it right + txdata = create_tx(versessd, options.fromaddresses.split(","), options.to, amount, fee) + sanity_test_fee(versessd, txdata, amount*Decimal("0.01")) + if options.dry_run: + print(txdata) + else: + txid = versessd.sendrawtransaction(txdata) + print(txid) + +if __name__ == '__main__': + main() diff --git a/contrib/test-patches/README.md b/contrib/test-patches/README.md new file mode 100644 index 0000000..def40b0 --- /dev/null +++ b/contrib/test-patches/README.md @@ -0,0 +1,7 @@ +### Test Patches ### + +These patches are applied when the automated pull-tester +tests each pull and when master is tested using jenkins. +You can find more information about the tests run at +[http://jenkins.bluematt.me/pull-tester/files/ +](http://jenkins.bluematt.me/pull-tester/files/) \ No newline at end of file diff --git a/contrib/testgen/README.md b/contrib/testgen/README.md new file mode 100644 index 0000000..83624f4 --- /dev/null +++ b/contrib/testgen/README.md @@ -0,0 +1,8 @@ +### TestGen ### + +Utilities to generate test vectors for the data-driven Bitcoin tests. + +Usage: + + gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json + gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json \ No newline at end of file diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py new file mode 100644 index 0000000..b716495 --- /dev/null +++ b/contrib/testgen/base58.py @@ -0,0 +1,104 @@ +''' +Bitcoin base58 encoding and decoding. + +Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) +''' +import hashlib + +# for compatibility with following code... +class SHA256: + new = hashlib.sha256 + +if str != bytes: + # Python 3.x + def ord(c): + return c + def chr(n): + return bytes( (n,) ) + +__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' +__b58base = len(__b58chars) +b58chars = __b58chars + +def b58encode(v): + """ encode v, which is a string of bytes, to base58. + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += (256**i) * ord(c) + + result = '' + while long_value >= __b58base: + div, mod = divmod(long_value, __b58base) + result = __b58chars[mod] + result + long_value = div + result = __b58chars[long_value] + result + + # Bitcoin does a little leading-zero-compression: + # leading 0-bytes in the input become leading-1s + nPad = 0 + for c in v: + if c == '\0': nPad += 1 + else: break + + return (__b58chars[0]*nPad) + result + +def b58decode(v, length = None): + """ decode v into a string of len bytes + """ + long_value = 0 + for (i, c) in enumerate(v[::-1]): + long_value += __b58chars.find(c) * (__b58base**i) + + result = bytes() + while long_value >= 256: + div, mod = divmod(long_value, 256) + result = chr(mod) + result + long_value = div + result = chr(long_value) + result + + nPad = 0 + for c in v: + if c == __b58chars[0]: nPad += 1 + else: break + + result = chr(0)*nPad + result + if length is not None and len(result) != length: + return None + + return result + +def checksum(v): + """Return 32-bit checksum based on SHA256""" + return SHA256.new(SHA256.new(v).digest()).digest()[0:4] + +def b58encode_chk(v): + """b58encode a string, with 32-bit checksum""" + return b58encode(v + checksum(v)) + +def b58decode_chk(v): + """decode a base58 string, check and remove checksum""" + result = b58decode(v) + if result is None: + return None + h3 = checksum(result[:-4]) + if result[-4:] == checksum(result[:-4]): + return result[:-4] + else: + return None + +def get_bcaddress_version(strAddress): + """ Returns None if strAddress is invalid. Otherwise returns integer version of address. """ + addr = b58decode_chk(strAddress) + if addr is None or len(addr)!=21: return None + version = addr[0] + return ord(version) + +if __name__ == '__main__': + # Test case (from http://gitorious.org/bitcoin/python-base58.git) + assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0 + _ohai = 'o hai'.encode('ascii') + _tmp = b58encode(_ohai) + assert _tmp == 'DYB3oMS' + assert b58decode(_tmp, 5) == _ohai + print("Tests passed") diff --git a/contrib/testgen/gen_base58_test_vectors.py b/contrib/testgen/gen_base58_test_vectors.py new file mode 100644 index 0000000..5bbd30f --- /dev/null +++ b/contrib/testgen/gen_base58_test_vectors.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +''' +Generate valid and invalid base58 address and private key test vectors. + +Usage: + gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json + gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json +''' +# 2012 Wladimir J. van der Laan +# Released under MIT License +import os +from itertools import islice +from base58 import b58encode, b58decode, b58encode_chk, b58decode_chk, b58chars +import random +from binascii import b2a_hex + +# key types +PUBKEY_ADDRESS = 30 +SCRIPT_ADDRESS = 13 +PUBKEY_ADDRESS_TEST = 139 +SCRIPT_ADDRESS_TEST = 19 +PRIVKEY = 212 +PRIVKEY_TEST = 239 + +metadata_keys = ['isPrivkey', 'isTestnet', 'addrType', 'isCompressed'] +# templates for valid sequences +templates = [ + # prefix, payload_size, suffix, metadata + # None = N/A + ((PUBKEY_ADDRESS,), 20, (), (False, False, 'pubkey', None)), + ((SCRIPT_ADDRESS,), 20, (), (False, False, 'script', None)), + ((PUBKEY_ADDRESS_TEST,), 20, (), (False, True, 'pubkey', None)), + ((SCRIPT_ADDRESS_TEST,), 20, (), (False, True, 'script', None)), + ((PRIVKEY,), 32, (), (True, False, None, False)), + ((PRIVKEY,), 32, (1,), (True, False, None, True)), + ((PRIVKEY_TEST,), 32, (), (True, True, None, False)), + ((PRIVKEY_TEST,), 32, (1,), (True, True, None, True)) +] + +def is_valid(v): + '''Check vector v for validity''' + result = b58decode_chk(v) + if result is None: + return False + valid = False + for template in templates: + prefix = str(bytearray(template[0])) + suffix = str(bytearray(template[2])) + if result.startswith(prefix) and result.endswith(suffix): + if (len(result) - len(prefix) - len(suffix)) == template[1]: + return True + return False + +def gen_valid_vectors(): + '''Generate valid test vectors''' + while True: + for template in templates: + prefix = str(bytearray(template[0])) + payload = os.urandom(template[1]) + suffix = str(bytearray(template[2])) + rv = b58encode_chk(prefix + payload + suffix) + assert is_valid(rv) + metadata = dict([(x,y) for (x,y) in zip(metadata_keys,template[3]) if y is not None]) + yield (rv, b2a_hex(payload), metadata) + +def gen_invalid_vector(template, corrupt_prefix, randomize_payload_size, corrupt_suffix): + '''Generate possibly invalid vector''' + if corrupt_prefix: + prefix = os.urandom(1) + else: + prefix = str(bytearray(template[0])) + + if randomize_payload_size: + payload = os.urandom(max(int(random.expovariate(0.5)), 50)) + else: + payload = os.urandom(template[1]) + + if corrupt_suffix: + suffix = os.urandom(len(template[2])) + else: + suffix = str(bytearray(template[2])) + + return b58encode_chk(prefix + payload + suffix) + +def randbool(p = 0.5): + '''Return True with P(p)''' + return random.random() < p + +def gen_invalid_vectors(): + '''Generate invalid test vectors''' + # start with some manual edge-cases + yield "", + yield "x", + while True: + # kinds of invalid vectors: + # invalid prefix + # invalid payload length + # invalid (randomized) suffix (add random data) + # corrupt checksum + for template in templates: + val = gen_invalid_vector(template, randbool(0.2), randbool(0.2), randbool(0.2)) + if random.randint(0,10)<1: # line corruption + if randbool(): # add random character to end + val += random.choice(b58chars) + else: # replace random character in the middle + n = random.randint(0, len(val)) + val = val[0:n] + random.choice(b58chars) + val[n+1:] + if not is_valid(val): + yield val, + +if __name__ == '__main__': + import sys, json + iters = {'valid':gen_valid_vectors, 'invalid':gen_invalid_vectors} + try: + uiter = iters[sys.argv[1]] + except IndexError: + uiter = gen_valid_vectors + try: + count = int(sys.argv[2]) + except IndexError: + count = 0 + + data = list(islice(uiter(), count)) + json.dump(data, sys.stdout, sort_keys=True, indent=4) + sys.stdout.write('\n') + diff --git a/contrib/tidy_datadir.sh b/contrib/tidy_datadir.sh new file mode 100644 index 0000000..5d6d826 --- /dev/null +++ b/contrib/tidy_datadir.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +if [ -d "$1" ]; then + cd "$1" +else + echo "Usage: $0 " >&2 + echo "Removes obsolete Bitcoin database files" >&2 + exit 1 +fi + +LEVEL=0 +if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi +if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi +if [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi +if [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi + +case $LEVEL in + 0) + echo "Error: no Bitcoin datadir detected." + exit 1 + ;; + 1) + echo "Detected old Bitcoin datadir (before 0.7)." + echo "Nothing to do." + exit 0 + ;; + 2) + echo "Detected Bitcoin 0.7 datadir." + ;; + 3) + echo "Detected Bitcoin pre-0.8 datadir." + ;; + 4) + echo "Detected Bitcoin 0.8 datadir." + ;; +esac + +FILES="" +DIRS="" + +if [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi +if [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi +if [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi + +for FILE in $FILES; do + if [ -f $FILE ]; then + echo "Deleting: $FILE" + rm -f $FILE + fi +done + +for DIR in $DIRS; do + if [ -d $DIR ]; then + echo "Deleting: $DIR/" + rm -rf $DIR + fi +done + +echo "Done." diff --git a/contrib/valgrind.supp b/contrib/valgrind.supp new file mode 100644 index 0000000..4dc1d38 --- /dev/null +++ b/contrib/valgrind.supp @@ -0,0 +1,43 @@ +# Valgrind suppressions file for Versess. +# +# Includes known Valgrind warnings in our dependencies that cannot be fixed +# in-tree. +# +# Example use: +# $ valgrind --suppressions=contrib/valgrind.supp src/test/test_versess +# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ +# --show-leak-kinds=all src/test/test_versess --log_level=test_suite +{ + Suppress libstdc++ warning - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65434 + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + obj:*/libstdc++.* + fun:call_init.part.0 + fun:call_init + fun:_dl_init + obj:*/ld-*.so +} +{ + Suppress libdb warning - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662917 + Memcheck:Cond + obj:*/libdb_cxx-*.so + fun:__log_put + obj:*/libdb_cxx-*.so + fun:__log_put_record +} +{ + Suppress leveldb warning (leveldb::InitModule()) - https://github.com/google/leveldb/issues/113 + Memcheck:Leak + match-leak-kinds: reachable + fun:_Znwm + fun:_ZN7leveldbL10InitModuleEv +} +{ + Suppress leveldb warning (leveldb::Env::Default()) - https://github.com/google/leveldb/issues/113 + Memcheck:Leak + match-leak-kinds: reachable + fun:_Znwm + ... + fun:_ZN7leveldbL14InitDefaultEnvEv +} diff --git a/contrib/verifysfbinaries/README.md b/contrib/verifysfbinaries/README.md new file mode 100644 index 0000000..8c03886 --- /dev/null +++ b/contrib/verifysfbinaries/README.md @@ -0,0 +1,6 @@ +### Verify SF Binaries ### +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. + +The script returns 0 if everything passes the checks. It returns 1 if either the signature check or the hash check doesn't pass. If an error occurs the return value is 2. \ No newline at end of file diff --git a/contrib/verifysfbinaries/verify.sh b/contrib/verifysfbinaries/verify.sh new file mode 100644 index 0000000..3eb4693 --- /dev/null +++ b/contrib/verifysfbinaries/verify.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +### 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. +### The script returns 0 if everything passes the checks. It returns 1 if either the +### signature check or the hash check doesn't pass. If an error occurs the return value is 2 + +function clean_up { + for file in $* + do + rm "$file" 2> /dev/null + done +} + +WORKINGDIR="/tmp/bitcoin" +TMPFILE="hashes.tmp" + +#this URL is used if a version number is not specified as an argument to the script +SIGNATUREFILE="https://bitcoin.org/bin/0.9.2.1/SHA256SUMS.asc" + +SIGNATUREFILENAME="SHA256SUMS.asc" +RCSUBDIR="test/" +BASEDIR="https://bitcoin.org/bin/" +VERSIONPREFIX="bitcoin-" +RCVERSIONSTRING="rc" + +if [ ! -d "$WORKINGDIR" ]; then + mkdir "$WORKINGDIR" +fi + +cd "$WORKINGDIR" + +#test if a version number has been passed as an argument +if [ -n "$1" ]; then + #let's also check if the version number includes the prefix 'bitcoin-', + # and add this prefix if it doesn't + if [[ $1 == "$VERSIONPREFIX"* ]]; then + VERSION="$1" + else + VERSION="$VERSIONPREFIX$1" + fi + + #now let's see if the version string contains "rc", and strip it off if it does + # and simultaneously add RCSUBDIR to BASEDIR, where we will look for SIGNATUREFILENAME + if [[ $VERSION == *"$RCVERSIONSTRING"* ]]; then + BASEDIR="$BASEDIR${VERSION/%-$RCVERSIONSTRING*}/" + BASEDIR="$BASEDIR$RCSUBDIR" + else + BASEDIR="$BASEDIR$VERSION/" + fi + + SIGNATUREFILE="$BASEDIR$SIGNATUREFILENAME" +else + BASEDIR="${SIGNATUREFILE%/*}/" +fi + +#first we fetch the file containing the signature +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.9.2-rc1)" + echo "wget output:" + echo "$WGETOUT"|sed 's/^/\t/g' + exit 2 +fi + +#then we check it +GPGOUT=$(gpg --yes --decrypt --output "$TMPFILE" "$SIGNATUREFILENAME" 2>&1) + +#return value 0: good signature +#return value 1: bad signature +#return value 2: gpg error + +RET="$?" +if [ $RET -ne 0 ]; then + if [ $RET -eq 1 ]; then + #and notify the user if it's bad + echo "Bad signature." + elif [ $RET -eq 2 ]; then + #or if a gpg error has occurred + echo "gpg error. Do you have Gavin's code signing key installed?" + fi + + echo "gpg output:" + echo "$GPGOUT"|sed 's/^/\t/g' + clean_up $SIGNATUREFILENAME $TMPFILE + exit "$RET" +fi + +#here we extract the filenames from the signature file +FILES=$(awk '{print $2}' "$TMPFILE") + +#and download these one by one +for file in in $FILES +do + wget --quiet -N "$BASEDIR$file" +done + +#check hashes +DIFF=$(diff <(sha256sum $FILES) "$TMPFILE") + +if [ $? -eq 1 ]; then + echo "Hashes don't match." + echo "Offending files:" + echo "$DIFF"|grep "^<"|awk '{print "\t"$3}' + exit 1 +elif [ $? -gt 1 ]; then + echo "Error executing 'diff'" + exit 2 +fi + +#everything matches! clean up the mess +clean_up $FILES $SIGNATUREFILENAME $TMPFILE + +exit 0 diff --git a/contrib/versess-cli.bash-completion b/contrib/versess-cli.bash-completion new file mode 100644 index 0000000..c837689 --- /dev/null +++ b/contrib/versess-cli.bash-completion @@ -0,0 +1,154 @@ +# bash programmable completion for versess-cli(1) +# Copyright (c) 2012-2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# call $versess-cli for RPC +_versess_rpc() { + # determine already specified args necessary for RPC + local rpcargs=() + for i in ${COMP_LINE}; do + case "$i" in + -conf=*|-datadir=*|-regtest|-rpc*|-testnet) + rpcargs=( "${rpcargs[@]}" "$i" ) + ;; + esac + done + $versess_cli "${rpcargs[@]}" "$@" +} + +# Add wallet accounts to COMPREPLY +_versess_accounts() { + local accounts + accounts=$(_versess_rpc listaccounts | awk -F '"' '{ print $2 }') + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) ) +} + +_versess_cli() { + local cur prev words=() cword + local versess_cli + + # save and use original argument to invoke versess-cli for -help, help and RPC + # as versess-cli might not be in $PATH + versess_cli="$1" + + COMPREPLY=() + _get_comp_words_by_ref -n = cur prev words cword + + if ((cword > 5)); then + case ${words[cword-5]} in + sendtoaddress) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + esac + fi + + if ((cword > 4)); then + case ${words[cword-4]} in + importaddress|listtransactions|setban) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + signrawtransaction) + COMPREPLY=( $( compgen -W "ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY" -- "$cur" ) ) + return 0 + ;; + esac + fi + + if ((cword > 3)); then + case ${words[cword-3]} in + addmultisigaddress) + _versess_accounts + return 0 + ;; + getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + esac + fi + + if ((cword > 2)); then + case ${words[cword-2]} in + addnode) + COMPREPLY=( $( compgen -W "add remove onetry" -- "$cur" ) ) + return 0 + ;; + setban) + COMPREPLY=( $( compgen -W "add remove" -- "$cur" ) ) + return 0 + ;; + fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + move|setaccount) + _versess_accounts + return 0 + ;; + esac + fi + + case "$prev" in + backupwallet|dumpwallet|importwallet) + _filedir + return 0 + ;; + getaddednodeinfo|getrawmempool|lockunspent|setgenerate) + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + return 0 + ;; + getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany) + _versess_accounts + return 0 + ;; + esac + + case "$cur" in + -conf=*) + cur="${cur#*=}" + _filedir + return 0 + ;; + -datadir=*) + cur="${cur#*=}" + _filedir -d + return 0 + ;; + -*=*) # prevent nonsense completions + return 0 + ;; + *) + local helpopts commands + + # only parse -help if senseful + if [[ -z "$cur" || "$cur" =~ ^- ]]; then + helpopts=$($versess_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) + fi + + # only parse help if senseful + if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then + commands=$(_versess_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') + fi + + COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) + + # Prevent space if an argument is desired + if [[ $COMPREPLY == *= ]]; then + compopt -o nospace + fi + return 0 + ;; + esac +} && +complete -F _versess_cli versess-cli + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/versess-qt.pro b/contrib/versess-qt.pro new file mode 100644 index 0000000..28c34ef --- /dev/null +++ b/contrib/versess-qt.pro @@ -0,0 +1,660 @@ +###################################################################### +# Automatically generated by qmake (2.01a) ?? ??? 23 17:50:54 2015 +###################################################################### + +DEFINES += ENABLE_WALLET + +TEMPLATE = app +TARGET = +DEPENDPATH += . \ + src \ + src/compat \ + src/config \ + src/crypto \ + src/json \ + src/obj \ + src/primitives \ + src/qt \ + src/script \ + src/test \ + src/univalue \ + src/leveldb/db \ + src/leveldb/issues \ + src/leveldb/port \ + src/leveldb/table \ + src/leveldb/util \ + src/qt/forms \ + src/qt/locale \ + src/qt/test \ + src/secp256k1/include \ + src/secp256k1/src \ + src/test/data \ + src/leveldb/doc/bench \ + src/leveldb/helpers/memenv \ + src/leveldb/include/leveldb \ + src/leveldb/port/win \ + src/secp256k1/src/java +INCLUDEPATH += . \ + src \ + src/config \ + src/leveldb/port/win \ + src/crypto \ + src/primitives \ + src/script \ + src/obj \ + src/univalue \ + src/json \ + src/qt \ + src/qt/forms \ + src/compat \ + src/secp256k1/include \ + src/leveldb/helpers/memenv \ + src/test/data \ + src/test \ + src/qt/test \ + src/secp256k1/src \ + src/secp256k1/src/java + +# Input +HEADERS += src/activemasternode.h \ + src/addrman.h \ + src/alert.h \ + src/allocators.h \ + src/amount.h \ + src/base58.h \ + src/bloom.h \ + src/chain.h \ + src/chainparams.h \ + src/chainparamsbase.h \ + src/chainparamsseeds.h \ + src/checkpoints.h \ + src/checkqueue.h \ + src/clientversion.h \ + src/coincontrol.h \ + src/coins.h \ + src/compat.h \ + src/compressor.h \ + src/core_io.h \ + src/crypter.h \ + src/obfuscation-relay.h \ + src/obfuscation.h \ + src/versess-config.h \ + src/db.h \ + src/eccryptoverify.h \ + src/ecwrapper.h \ + src/hash.h \ + src/init.h \ + src/swifttx.h \ + src/keepass.h \ + src/key.h \ + src/keystore.h \ + src/leveldbwrapper.h \ + src/limitedmap.h \ + src/main.h \ + src/masternode-budget.h \ + src/masternode-payments.h \ + src/masternode-sync.h \ + src/masternode.h \ + src/masternodeconfig.h \ + src/masternodeman.h \ + src/merkleblock.h \ + src/miner.h \ + src/mruset.h \ + src/net.h \ + src/netbase.h \ + src/noui.h \ + src/pow.h \ + src/protocol.h \ + src/pubkey.h \ + src/random.h \ + src/rpcclient.h \ + src/rpcprotocol.h \ + src/rpcserver.h \ + src/serialize.h \ + src/spork.h \ + src/streams.h \ + src/sync.h \ + src/threadsafety.h \ + src/timedata.h \ + src/tinyformat.h \ + src/txdb.h \ + src/txmempool.h \ + src/ui_interface.h \ + src/uint256.h \ + src/undo.h \ + src/util.h \ + src/utilmoneystr.h \ + src/utilstrencodings.h \ + src/utiltime.h \ + src/version.h \ + src/wallet.h \ + src/wallet_ismine.h \ + src/walletdb.h \ + src/compat/sanity.h \ + src/config/versess-config.h \ + src/crypto/common.h \ + src/crypto/hmac_sha256.h \ + src/crypto/hmac_sha512.h \ + src/crypto/rfc6979_hmac_sha256.h \ + src/crypto/ripemd160.h \ + src/crypto/sha1.h \ + src/crypto/sha256.h \ + src/crypto/sha512.h \ + src/crypto/sph_blake.h \ + src/crypto/sph_bmw.h \ + src/crypto/sph_cubehash.h \ + src/crypto/sph_echo.h \ + src/crypto/sph_groestl.h \ + src/crypto/sph_jh.h \ + src/crypto/sph_keccak.h \ + src/crypto/sph_luffa.h \ + src/crypto/sph_shavite.h \ + src/crypto/sph_simd.h \ + src/crypto/sph_skein.h \ + src/crypto/sph_types.h \ + src/json/json_spirit.h \ + src/json/json_spirit_error_position.h \ + src/json/json_spirit_reader.h \ + src/json/json_spirit_reader_template.h \ + src/json/json_spirit_stream_reader.h \ + src/json/json_spirit_utils.h \ + src/json/json_spirit_value.h \ + src/json/json_spirit_writer.h \ + src/json/json_spirit_writer_template.h \ + src/obj/build.h \ + src/primitives/block.h \ + src/primitives/transaction.h \ + src/qt/addressbookpage.h \ + src/qt/addresstablemodel.h \ + src/qt/askpassphrasedialog.h \ + src/qt/bitcoinaddressvalidator.h \ + src/qt/bitcoinamountfield.h \ + src/qt/bitcoingui.h \ + src/qt/bitcoinunits.h \ + src/qt/clientmodel.h \ + src/qt/coincontroldialog.h \ + src/qt/coincontroltreewidget.h \ + src/qt/csvmodelwriter.h \ + src/qt/obfuscationconfig.h \ + src/qt/editaddressdialog.h \ + src/qt/guiconstants.h \ + src/qt/guiutil.h \ + src/qt/intro.h \ + src/qt/macdockiconhandler.h \ + src/qt/macnotificationhandler.h \ + src/qt/networkstyle.h \ + src/qt/notificator.h \ + src/qt/openuridialog.h \ + src/qt/optionsdialog.h \ + src/qt/optionsmodel.h \ + src/qt/overviewpage.h \ + src/qt/paymentrequest.pb.h \ + src/qt/paymentrequestplus.h \ + src/qt/paymentserver.h \ + src/qt/peertablemodel.h \ + src/qt/qvalidatedlineedit.h \ + src/qt/qvaluecombobox.h \ + src/qt/receivecoinsdialog.h \ + src/qt/receiverequestdialog.h \ + src/qt/recentrequeststablemodel.h \ + src/qt/rpcconsole.h \ + src/qt/sendcoinsdialog.h \ + src/qt/sendcoinsentry.h \ + src/qt/signverifymessagedialog.h \ + src/qt/splashscreen.h \ + src/qt/trafficgraphwidget.h \ + src/qt/transactiondesc.h \ + src/qt/transactiondescdialog.h \ + src/qt/transactionfilterproxy.h \ + src/qt/transactionrecord.h \ + src/qt/transactiontablemodel.h \ + src/qt/transactionview.h \ + src/qt/utilitydialog.h \ + src/qt/walletframe.h \ + src/qt/walletmodel.h \ + src/qt/walletmodeltransaction.h \ + src/qt/walletview.h \ + src/qt/winshutdownmonitor.h \ + src/script/bitcoinconsensus.h \ + src/script/interpreter.h \ + src/script/script.h \ + src/script/script_error.h \ + src/script/sigcache.h \ + src/script/sign.h \ + src/script/standard.h \ + src/univalue/univalue.h \ + src/univalue/univalue_escapes.h \ + src/leveldb/db/builder.h \ + src/leveldb/db/db_impl.h \ + src/leveldb/db/db_iter.h \ + src/leveldb/db/dbformat.h \ + src/leveldb/db/filename.h \ + src/leveldb/db/log_format.h \ + src/leveldb/db/log_reader.h \ + src/leveldb/db/log_writer.h \ + src/leveldb/db/memtable.h \ + src/leveldb/db/skiplist.h \ + src/leveldb/db/snapshot.h \ + src/leveldb/db/table_cache.h \ + src/leveldb/db/version_edit.h \ + src/leveldb/db/version_set.h \ + src/leveldb/db/write_batch_internal.h \ + src/leveldb/port/atomic_pointer.h \ + src/leveldb/port/port.h \ + src/leveldb/port/port_example.h \ + src/leveldb/port/port_posix.h \ + src/leveldb/port/port_win.h \ + src/leveldb/port/thread_annotations.h \ + src/leveldb/table/block.h \ + src/leveldb/table/block_builder.h \ + src/leveldb/table/filter_block.h \ + src/leveldb/table/format.h \ + src/leveldb/table/iterator_wrapper.h \ + src/leveldb/table/merger.h \ + src/leveldb/table/two_level_iterator.h \ + src/leveldb/util/arena.h \ + src/leveldb/util/coding.h \ + src/leveldb/util/crc32c.h \ + src/leveldb/util/hash.h \ + src/leveldb/util/histogram.h \ + src/leveldb/util/logging.h \ + src/leveldb/util/mutexlock.h \ + src/leveldb/util/posix_logger.h \ + src/leveldb/util/random.h \ + src/leveldb/util/testharness.h \ + src/leveldb/util/testutil.h \ + src/qt/forms/ui_aboutdialog.h \ + src/qt/test/paymentrequestdata.h \ + src/qt/test/paymentservertests.h \ + src/qt/test/uritests.h \ + src/secp256k1/include/secp256k1.h \ + src/secp256k1/src/ecdsa.h \ + src/secp256k1/src/ecdsa_impl.h \ + src/secp256k1/src/eckey.h \ + src/secp256k1/src/eckey_impl.h \ + src/secp256k1/src/ecmult.h \ + src/secp256k1/src/ecmult_gen.h \ + src/secp256k1/src/ecmult_gen_impl.h \ + src/secp256k1/src/ecmult_impl.h \ + src/secp256k1/src/field.h \ + src/secp256k1/src/field_10x26.h \ + src/secp256k1/src/field_10x26_impl.h \ + src/secp256k1/src/field_5x52.h \ + src/secp256k1/src/field_5x52_asm_impl.h \ + src/secp256k1/src/field_5x52_impl.h \ + src/secp256k1/src/field_5x52_int128_impl.h \ + src/secp256k1/src/field_gmp.h \ + src/secp256k1/src/field_gmp_impl.h \ + src/secp256k1/src/field_impl.h \ + src/secp256k1/src/group.h \ + src/secp256k1/src/group_impl.h \ + src/secp256k1/src/libsecp256k1-config.h \ + src/secp256k1/src/num.h \ + src/secp256k1/src/num_gmp.h \ + src/secp256k1/src/num_gmp_impl.h \ + src/secp256k1/src/num_impl.h \ + src/secp256k1/src/scalar.h \ + src/secp256k1/src/scalar_4x64.h \ + src/secp256k1/src/scalar_4x64_impl.h \ + src/secp256k1/src/scalar_8x32.h \ + src/secp256k1/src/scalar_8x32_impl.h \ + src/secp256k1/src/scalar_impl.h \ + src/secp256k1/src/testrand.h \ + src/secp256k1/src/testrand_impl.h \ + src/secp256k1/src/util.h \ + src/test/data/alertTests.raw.h \ + src/test/data/base58_encode_decode.json.h \ + src/test/data/base58_keys_invalid.json.h \ + src/test/data/base58_keys_valid.json.h \ + src/test/data/script_invalid.json.h \ + src/test/data/script_valid.json.h \ + src/test/data/sig_canonical.json.h \ + src/test/data/sig_noncanonical.json.h \ + src/test/data/sighash.json.h \ + src/test/data/tx_invalid.json.h \ + src/test/data/tx_valid.json.h \ + src/leveldb/helpers/memenv/memenv.h \ + src/leveldb/include/leveldb/c.h \ + src/leveldb/include/leveldb/cache.h \ + src/leveldb/include/leveldb/comparator.h \ + src/leveldb/include/leveldb/db.h \ + src/leveldb/include/leveldb/dumpfile.h \ + src/leveldb/include/leveldb/env.h \ + src/leveldb/include/leveldb/filter_policy.h \ + src/leveldb/include/leveldb/iterator.h \ + src/leveldb/include/leveldb/options.h \ + src/leveldb/include/leveldb/slice.h \ + src/leveldb/include/leveldb/status.h \ + src/leveldb/include/leveldb/table.h \ + src/leveldb/include/leveldb/table_builder.h \ + src/leveldb/include/leveldb/write_batch.h \ + src/leveldb/port/win/stdint.h \ + src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h \ + src/crypto/aes_helper.c \ + src/qt/bitcoinamountfield.moc \ + src/qt/versess.moc \ + src/qt/intro.moc \ + src/qt/overviewpage.moc \ + src/qt/rpcconsole.moc \ + src/secp256k1/src/secp256k1.c +FORMS += src/qt/forms/addressbookpage.ui \ + src/qt/forms/askpassphrasedialog.ui \ + src/qt/forms/coincontroldialog.ui \ + src/qt/forms/obfuscationconfig.ui \ + src/qt/forms/editaddressdialog.ui \ + src/qt/forms/helpmessagedialog.ui \ + src/qt/forms/intro.ui \ + src/qt/forms/openuridialog.ui \ + src/qt/forms/optionsdialog.ui \ + src/qt/forms/overviewpage.ui \ + src/qt/forms/receivecoinsdialog.ui \ + src/qt/forms/receiverequestdialog.ui \ + src/qt/forms/rpcconsole.ui \ + src/qt/forms/sendcoinsdialog.ui \ + src/qt/forms/sendcoinsentry.ui \ + src/qt/forms/signverifymessagedialog.ui \ + src/qt/forms/transactiondescdialog.ui +SOURCES += src/activemasternode.cpp \ + src/addrman.cpp \ + src/alert.cpp \ + src/allocators.cpp \ + src/amount.cpp \ + src/base58.cpp \ + src/bloom.cpp \ + src/chain.cpp \ + src/chainparams.cpp \ + src/chainparamsbase.cpp \ + src/checkpoints.cpp \ + src/clientversion.cpp \ + src/coins.cpp \ + src/compressor.cpp \ + src/core_read.cpp \ + src/core_write.cpp \ + src/crypter.cpp \ + src/obfuscation-relay.cpp \ + src/obfuscation.cpp \ + src/versess-cli.cpp \ + src/versess-tx.cpp \ + src/versess.cpp \ + src/db.cpp \ + src/eccryptoverify.cpp \ + src/ecwrapper.cpp \ + src/editaddressdialog.cpp \ + src/hash.cpp \ + src/init.cpp \ + src/swifttx.cpp \ + src/keepass.cpp \ + src/key.cpp \ + src/keystore.cpp \ + src/leveldbwrapper.cpp \ + src/main.cpp \ + src/masternode-budget.cpp \ + src/masternode-payments.cpp \ + src/masternode-sync.cpp \ + src/masternode.cpp \ + src/masternodeconfig.cpp \ + src/masternodeman.cpp \ + src/merkleblock.cpp \ + src/miner.cpp \ + src/net.cpp \ + src/netbase.cpp \ + src/noui.cpp \ + src/pow.cpp \ + src/protocol.cpp \ + src/pubkey.cpp \ + src/random.cpp \ + src/rest.cpp \ + src/rpcblockchain.cpp \ + src/rpcclient.cpp \ + src/rpcdump.cpp \ + src/rpcmasternode-budget.cpp \ + src/rpcmasternode.cpp \ + src/rpcmining.cpp \ + src/rpcmisc.cpp \ + src/rpcnet.cpp \ + src/rpcprotocol.cpp \ + src/rpcrawtransaction.cpp \ + src/rpcserver.cpp \ + src/rpcwallet.cpp \ + src/spork.cpp \ + src/sync.cpp \ + src/timedata.cpp \ + src/txdb.cpp \ + src/txmempool.cpp \ + src/uint256.cpp \ + src/util.cpp \ + src/utilmoneystr.cpp \ + src/utilstrencodings.cpp \ + src/utiltime.cpp \ + src/wallet.cpp \ + src/wallet_ismine.cpp \ + src/walletdb.cpp \ + src/compat/glibc_compat.cpp \ + src/compat/glibc_sanity.cpp \ + src/compat/glibcxx_compat.cpp \ + src/compat/glibcxx_sanity.cpp \ + src/compat/strnlen.cpp \ + src/crypto/aes_helper.c \ + src/crypto/blake.c \ + src/crypto/bmw.c \ + src/crypto/cubehash.c \ + src/crypto/echo.c \ + src/crypto/groestl.c \ + src/crypto/hmac_sha256.cpp \ + src/crypto/hmac_sha512.cpp \ + src/crypto/jh.c \ + src/crypto/keccak.c \ + src/crypto/luffa.c \ + src/crypto/rfc6979_hmac_sha256.cpp \ + src/crypto/ripemd160.cpp \ + src/crypto/sha1.cpp \ + src/crypto/sha256.cpp \ + src/crypto/sha512.cpp \ + src/crypto/shavite.c \ + src/crypto/simd.c \ + src/crypto/skein.c \ + src/json/json_spirit_reader.cpp \ + src/json/json_spirit_value.cpp \ + src/json/json_spirit_writer.cpp \ + src/primitives/block.cpp \ + src/primitives/transaction.cpp \ + src/qt/addressbookpage.cpp \ + src/qt/addresstablemodel.cpp \ + src/qt/askpassphrasedialog.cpp \ + src/qt/bitcoinaddressvalidator.cpp \ + src/qt/bitcoinamountfield.cpp \ + src/qt/bitcoingui.cpp \ + src/qt/bitcoinunits.cpp \ + src/qt/clientmodel.cpp \ + src/qt/coincontroldialog.cpp \ + src/qt/coincontroltreewidget.cpp \ + src/qt/csvmodelwriter.cpp \ + src/qt/obfuscationconfig.cpp \ + src/qt/versess.cpp \ + src/qt/versessstrings.cpp \ + src/qt/editaddressdialog.cpp \ + src/qt/guiutil.cpp \ + src/qt/intro.cpp \ + src/qt/networkstyle.cpp \ + src/qt/notificator.cpp \ + src/qt/openuridialog.cpp \ + src/qt/optionsdialog.cpp \ + src/qt/optionsmodel.cpp \ + src/qt/overviewpage.cpp \ + src/qt/paymentrequest.pb.cc \ + src/qt/paymentrequestplus.cpp \ + src/qt/paymentserver.cpp \ + src/qt/peertablemodel.cpp \ + src/qt/qvalidatedlineedit.cpp \ + src/qt/qvaluecombobox.cpp \ + src/qt/receivecoinsdialog.cpp \ + src/qt/receiverequestdialog.cpp \ + src/qt/recentrequeststablemodel.cpp \ + src/qt/rpcconsole.cpp \ + src/qt/sendcoinsdialog.cpp \ + src/qt/sendcoinsentry.cpp \ + src/qt/signverifymessagedialog.cpp \ + src/qt/splashscreen.cpp \ + src/qt/trafficgraphwidget.cpp \ + src/qt/transactiondesc.cpp \ + src/qt/transactiondescdialog.cpp \ + src/qt/transactionfilterproxy.cpp \ + src/qt/transactionrecord.cpp \ + src/qt/transactiontablemodel.cpp \ + src/qt/transactionview.cpp \ + src/qt/utilitydialog.cpp \ + src/qt/walletframe.cpp \ + src/qt/walletmodel.cpp \ + src/qt/walletmodeltransaction.cpp \ + src/qt/walletview.cpp \ + src/qt/winshutdownmonitor.cpp \ + src/script/bitcoinconsensus.cpp \ + src/script/interpreter.cpp \ + src/script/script.cpp \ + src/script/script_error.cpp \ + src/script/sigcache.cpp \ + src/script/sign.cpp \ + src/script/standard.cpp \ + src/test/accounting_tests.cpp \ + src/test/alert_tests.cpp \ + src/test/allocator_tests.cpp \ + src/test/base32_tests.cpp \ + src/test/base58_tests.cpp \ + src/test/base64_tests.cpp \ + src/test/bip32_tests.cpp \ + src/test/bloom_tests.cpp \ + src/test/checkblock_tests.cpp \ + src/test/Checkpoints_tests.cpp \ + src/test/coins_tests.cpp \ + src/test/compress_tests.cpp \ + src/test/crypto_tests.cpp \ + src/test/DoS_tests.cpp \ + src/test/getarg_tests.cpp \ + src/test/hash_tests.cpp \ + src/test/key_tests.cpp \ + src/test/main_tests.cpp \ + src/test/mempool_tests.cpp \ + src/test/miner_tests.cpp \ + src/test/mruset_tests.cpp \ + src/test/multisig_tests.cpp \ + src/test/netbase_tests.cpp \ + src/test/pmt_tests.cpp \ + src/test/rpc_tests.cpp \ + src/test/rpc_wallet_tests.cpp \ + src/test/sanity_tests.cpp \ + src/test/script_P2SH_tests.cpp \ + src/test/script_tests.cpp \ + src/test/scriptnum_tests.cpp \ + src/test/serialize_tests.cpp \ + src/test/sighash_tests.cpp \ + src/test/sigopcount_tests.cpp \ + src/test/skiplist_tests.cpp \ + src/test/test_versess.cpp \ + src/test/timedata_tests.cpp \ + src/test/transaction_tests.cpp \ + src/test/uint256_tests.cpp \ + src/test/univalue_tests.cpp \ + src/test/util_tests.cpp \ + src/test/wallet_tests.cpp \ + src/univalue/gen.cpp \ + src/univalue/univalue.cpp \ + src/univalue/univalue_read.cpp \ + src/univalue/univalue_write.cpp \ + src/leveldb/db/autocompact_test.cc \ + src/leveldb/db/builder.cc \ + src/leveldb/db/c.cc \ + src/leveldb/db/c_test.c \ + src/leveldb/db/corruption_test.cc \ + src/leveldb/db/db_bench.cc \ + src/leveldb/db/db_impl.cc \ + src/leveldb/db/db_iter.cc \ + src/leveldb/db/db_test.cc \ + src/leveldb/db/dbformat.cc \ + src/leveldb/db/dbformat_test.cc \ + src/leveldb/db/dumpfile.cc \ + src/leveldb/db/filename.cc \ + src/leveldb/db/filename_test.cc \ + src/leveldb/db/leveldb_main.cc \ + src/leveldb/db/log_reader.cc \ + src/leveldb/db/log_test.cc \ + src/leveldb/db/log_writer.cc \ + src/leveldb/db/memtable.cc \ + src/leveldb/db/repair.cc \ + src/leveldb/db/skiplist_test.cc \ + src/leveldb/db/table_cache.cc \ + src/leveldb/db/version_edit.cc \ + src/leveldb/db/version_edit_test.cc \ + src/leveldb/db/version_set.cc \ + src/leveldb/db/version_set_test.cc \ + src/leveldb/db/write_batch.cc \ + src/leveldb/db/write_batch_test.cc \ + src/leveldb/issues/issue178_test.cc \ + src/leveldb/issues/issue200_test.cc \ + src/leveldb/port/port_posix.cc \ + src/leveldb/port/port_win.cc \ + src/leveldb/table/block.cc \ + src/leveldb/table/block_builder.cc \ + src/leveldb/table/filter_block.cc \ + src/leveldb/table/filter_block_test.cc \ + src/leveldb/table/format.cc \ + src/leveldb/table/iterator.cc \ + src/leveldb/table/merger.cc \ + src/leveldb/table/table.cc \ + src/leveldb/table/table_builder.cc \ + src/leveldb/table/table_test.cc \ + src/leveldb/table/two_level_iterator.cc \ + src/leveldb/util/arena.cc \ + src/leveldb/util/arena_test.cc \ + src/leveldb/util/bloom.cc \ + src/leveldb/util/bloom_test.cc \ + src/leveldb/util/cache.cc \ + src/leveldb/util/cache_test.cc \ + src/leveldb/util/coding.cc \ + src/leveldb/util/coding_test.cc \ + src/leveldb/util/comparator.cc \ + src/leveldb/util/crc32c.cc \ + src/leveldb/util/crc32c_test.cc \ + src/leveldb/util/env.cc \ + src/leveldb/util/env_posix.cc \ + src/leveldb/util/env_test.cc \ + src/leveldb/util/env_win.cc \ + src/leveldb/util/filter_policy.cc \ + src/leveldb/util/hash.cc \ + src/leveldb/util/hash_test.cc \ + src/leveldb/util/histogram.cc \ + src/leveldb/util/logging.cc \ + src/leveldb/util/options.cc \ + src/leveldb/util/status.cc \ + src/leveldb/util/testharness.cc \ + src/leveldb/util/testutil.cc \ + src/qt/test/paymentservertests.cpp \ + src/qt/test/test_main.cpp \ + src/qt/test/uritests.cpp \ + src/secp256k1/src/bench_inv.c \ + src/secp256k1/src/bench_sign.c \ + src/secp256k1/src/bench_verify.c \ + src/secp256k1/src/secp256k1.c \ + src/secp256k1/src/tests.c \ + src/leveldb/doc/bench/db_bench_sqlite3.cc \ + src/leveldb/doc/bench/db_bench_tree_db.cc \ + src/leveldb/helpers/memenv/memenv.cc \ + src/leveldb/helpers/memenv/memenv_test.cc \ + src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c +RESOURCES += src/qt/versess.qrc src/qt/versess_locale.qrc + +TRANSLATIONS += src/qt/locale/versess_bg.ts \ + src/qt/locale/versess_de.ts \ + src/qt/locale/versess_en.ts \ + src/qt/locale/versess_es.ts \ + src/qt/locale/versess_fi.ts \ + src/qt/locale/versess_fr.ts \ + src/qt/locale/versess_it.ts \ + src/qt/locale/versess_ja.ts \ + src/qt/locale/versess_pl.ts \ + src/qt/locale/versess_pt.ts \ + src/qt/locale/versess_ru.ts \ + src/qt/locale/versess_sk.ts \ + src/qt/locale/versess_sv.ts \ + src/qt/locale/versess_vi.ts \ + src/qt/locale/versess_zh_CN.ts \ + src/qt/locale/versess_zh_TW.ts diff --git a/contrib/versess-tx.bash-completion b/contrib/versess-tx.bash-completion new file mode 100644 index 0000000..23d99e0 --- /dev/null +++ b/contrib/versess-tx.bash-completion @@ -0,0 +1,57 @@ +# bash programmable completion for versess-tx(1) +# Copyright (c) 2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +_versess_tx() { + local cur prev words=() cword + local versess_tx + + # save and use original argument to invoke versess-tx for -help + # it might not be in $PATH + versess_tx="$1" + + COMPREPLY=() + _get_comp_words_by_ref -n =: cur prev words cword + + case "$cur" in + load=*:*) + cur="${cur#load=*:}" + _filedir + return 0 + ;; + *=*) # prevent attempts to complete other arguments + return 0 + ;; + esac + + if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then + # only options (or an uncompletable hex-string) allowed + # parse versess-tx -help for options + local helpopts + helpopts=$($versess_tx -help | sed -e '/^ -/ p' -e d ) + COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) + else + # only commands are allowed + # parse -help for commands + local helpcmds + helpcmds=$($versess_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d ) + COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) ) + fi + + # Prevent space if an argument is desired + if [[ $COMPREPLY == *= ]]; then + compopt -o nospace + fi + + return 0 +} && +complete -F _versess_tx versess-tx + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/versessd.bash-completion b/contrib/versessd.bash-completion new file mode 100644 index 0000000..a381164 --- /dev/null +++ b/contrib/versessd.bash-completion @@ -0,0 +1,56 @@ +# bash programmable completion for versessd(1) and versess-qt(1) +# Copyright (c) 2012-2016 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +_versessd() { + local cur prev words=() cword + local versessd + + # save and use original argument to invoke versessd for -help + # it might not be in $PATH + versessd="$1" + + COMPREPLY=() + _get_comp_words_by_ref -n = cur prev words cword + + case "$cur" in + -conf=*|-pid=*|-loadblock=*|-rootcertificates=*|-rpccookiefile=*|-wallet=*) + cur="${cur#*=}" + _filedir + return 0 + ;; + -datadir=*) + cur="${cur#*=}" + _filedir -d + return 0 + ;; + -*=*) # prevent nonsense completions + return 0 + ;; + *) + + # only parse -help if sensible + if [[ -z "$cur" || "$cur" =~ ^- ]]; then + local helpopts + helpopts=$($versessd -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) + COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) + fi + + # Prevent space if an argument is desired + if [[ $COMPREPLY == *= ]]; then + compopt -o nospace + fi + return 0 + ;; + esac +} && +complete -F _versessd versessd versess-qt + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/windeploy/detached-sig-create.sh b/contrib/windeploy/detached-sig-create.sh new file mode 100644 index 0000000..15f8108 --- /dev/null +++ b/contrib/windeploy/detached-sig-create.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (c) 2014-2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C +if [ -z "$OSSLSIGNCODE" ]; then + OSSLSIGNCODE=osslsigncode +fi + +if [ ! -n "$1" ]; then + echo "usage: $0 " + echo "example: $0 -key codesign.key" + exit 1 +fi + +OUT=signature-win.tar.gz +SRCDIR=unsigned +WORKDIR=./.tmp +OUTDIR="${WORKDIR}/out" +OUTSUBDIR="${OUTDIR}/win" +TIMESERVER=http://timestamp.comodoca.com +CERTFILE="win-codesign.cert" + +mkdir -p "${OUTSUBDIR}" +basename -a `ls -1 "${SRCDIR}"/*-unsigned.exe` | while read UNSIGNED; do + echo Signing "${UNSIGNED}" + "${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@" + "${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}" +done + +rm -f "${OUT}" +tar -C "${OUTDIR}" -czf "${OUT}" . +rm -rf "${WORKDIR}" +echo "Created ${OUT}" diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py new file mode 100644 index 0000000..62c3d34 --- /dev/null +++ b/contrib/zmq/zmq_sub.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python + +import array +import binascii +import zmq +import struct + +port = 28332 + +zmqContext = zmq.Context() +zmqSubSocket = zmqContext.socket(zmq.SUB) +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashblock") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtx") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtxlock") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawblock") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawtx") +zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"rawtxlock") +zmqSubSocket.connect("tcp://127.0.0.1:%i" % port) + +try: + while True: + msg = zmqSubSocket.recv_multipart() + topic = str(msg[0].decode("utf-8")) + body = msg[1] + sequence = "Unknown"; + + if len(msg[-1]) == 4: + msgSequence = struct.unpack('/dev/null) +build_id_string+=$(shell $(build_AR) --version 2>/dev/null) +build_id_string+=$(shell $(build_CXX) --version 2>/dev/null) +build_id_string+=$(shell $(build_RANLIB) --version 2>/dev/null) +build_id_string+=$(shell $(build_STRIP) --version 2>/dev/null) + +$(host_arch)_$(host_os)_id_string:=$(HOST_ID_SALT) +$(host_arch)_$(host_os)_id_string+=$(shell $(host_CC) --version 2>/dev/null) +$(host_arch)_$(host_os)_id_string+=$(shell $(host_AR) --version 2>/dev/null) +$(host_arch)_$(host_os)_id_string+=$(shell $(host_CXX) --version 2>/dev/null) +$(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null) +$(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null) + +qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) +wallet_packages_$(NO_WALLET) = $(wallet_packages) +upnp_packages_$(NO_UPNP) = $(upnp_packages) +zmq_packages_$(NO_ZMQ) = $(zmq_packages) + +packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) +native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) + +ifneq ($(qt_packages_),) +native_packages += $(qt_native_packages) +endif + +ifneq ($(zmq_packages_),) +packages += $(zmq_packages) +endif + +all_packages = $(packages) $(native_packages) + +meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk + +$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) + +include funcs.mk + +toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin) +final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) +final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) +$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) + $(AT)rm -rf $(@D) + $(AT)mkdir -p $(@D) + $(AT)echo copying packages: $^ + $(AT)echo to: $(@D) + $(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); ) + $(AT)touch $@ + +$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id) + $(AT)@mkdir -p $(@D) + $(AT)sed -e 's|@HOST@|$(host)|' \ + -e 's|@CC@|$(toolchain_path)$(host_CC)|' \ + -e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \ + -e 's|@AR@|$(toolchain_path)$(host_AR)|' \ + -e 's|@RANLIB@|$(toolchain_path)$(host_RANLIB)|' \ + -e 's|@NM@|$(toolchain_path)$(host_NM)|' \ + -e 's|@STRIP@|$(toolchain_path)$(host_STRIP)|' \ + -e 's|@build_os@|$(build_os)|' \ + -e 's|@host_os@|$(host_os)|' \ + -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \ + -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \ + -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ + -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ + -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \ + -e 's|@no_qt@|$(NO_QT)|' \ + -e 's|@no_zmq@|$(NO_ZMQ)|' \ + -e 's|@no_wallet@|$(NO_WALLET)|' \ + -e 's|@no_upnp@|$(NO_UPNP)|' \ + -e 's|@debug@|$(DEBUG)|' \ + $< > $@ + $(AT)touch $@ + + +define check_or_remove_cached + mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \ + $(build_SHA256SUM) -c $($(package)_cached_checksum) >/dev/null 2>/dev/null || \ + ( rm -f $($(package)_cached_checksum); \ + if test -f "$($(package)_cached)"; then echo "Checksum mismatch for $(package). Forcing rebuild.."; rm -f $($(package)_cached_checksum) $($(package)_cached); fi ) +endef + +define check_or_remove_sources + mkdir -p $($(package)_source_dir); cd $($(package)_source_dir); \ + test -f $($(package)_fetched) && ( $(build_SHA256SUM) -c $($(package)_fetched) >/dev/null 2>/dev/null || \ + ( echo "Checksum missing or mismatched for $(package) source. Forcing re-download."; \ + rm -f $($(package)_all_sources) $($(1)_fetched))) || true +endef + +check-packages: + @$(foreach package,$(all_packages),$(call check_or_remove_cached,$(package));) +check-sources: + @$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));) + +$(host_prefix)/share/config.site: check-packages + +check-packages: check-sources + +clean-all: clean + @rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64* riscv32* riscv64* + +clean: + @rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD) + +install: check-packages $(host_prefix)/share/config.site + + +download-one: check-sources $(all_sources) + +download-osx: + @$(MAKE) -s HOST=x86_64-apple-darwin14 download-one +download-linux: + @$(MAKE) -s HOST=x86_64-unknown-linux-gnu download-one +download-win: + @$(MAKE) -s HOST=x86_64-w64-mingw32 download-one +download: download-osx download-linux download-win + +$(foreach package,$(all_packages),$(eval $(call ext_add_stages,$(package)))) + +.PHONY: install cached clean clean-all download-one download-osx download-linux download-win download check-packages check-sources diff --git a/depends/README.md b/depends/README.md new file mode 100644 index 0000000..35d0978 --- /dev/null +++ b/depends/README.md @@ -0,0 +1,93 @@ +### Usage + +To build dependencies for the current arch+OS: + + make + +To build for another arch/OS: + + make HOST=host-platform-triplet + +For example: + + make HOST=x86_64-w64-mingw32 -j4 + +A prefix will be generated that's suitable for plugging into Bitcoin's +configure. In the above example, a dir named x86_64-w64-mingw32 will be +created. To use it for Bitcoin: + + ./configure --prefix=`pwd`/depends/x86_64-w64-mingw32 + +Common `host-platform-triplets` for cross compilation are: + +- `i686-w64-mingw32` for Win32 +- `x86_64-w64-mingw32` for Win64 +- `x86_64-apple-darwin14` for macOS +- `arm-linux-gnueabihf` for Linux ARM 32 bit +- `aarch64-linux-gnu` for Linux ARM 64 bit +- `riscv32-linux-gnu` for Linux RISC-V 32 bit +- `riscv64-linux-gnu` for Linux RISC-V 64 bit + +No other options are needed, the paths are automatically configured. + +### Install the required dependencies: Ubuntu & Debian + +#### For macOS cross compilation + + sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python3-setuptools + +#### For Win32/Win64 cross compilation + +- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux) + +#### For linux (including i386, ARM) cross compilation + +Common linux dependencies: + + sudo apt-get install make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 patch + +For linux ARM cross compilation: + + sudo apt-get install g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf + +For linux AARCH64 cross compilation: + + sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + +For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit): + + sudo apt-get install g++-riscv64-linux-gnu binutils-riscv64-linux-gnu + +RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_versess` executable (see https://github.com/bitcoin/bitcoin/pull/13543), +this is apparently fixed in gcc-8.1.0. + +### Dependency Options +The following can be set when running make: make FOO=bar + + SOURCES_PATH: downloaded sources will be placed here + BASE_CACHE: built packages will be placed here + SDK_PATH: Path where sdk's can be found (used by macOS) + FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up + NO_QT: Don't download/build/cache qt and its dependencies + NO_ZMQ: Don't download/build/cache packages needed for enabling zeromq + NO_WALLET: Don't download/build/cache libs needed to enable the wallet + NO_UPNP: Don't download/build/cache packages needed for enabling upnp + DEBUG: disable some optimizations and enable more runtime checking + HOST_ID_SALT: Optional salt to use when generating host package ids + BUILD_ID_SALT: Optional salt to use when generating build package ids + +If some packages are not built, for example `make NO_WALLET=1`, the appropriate +options will be passed to bitcoin's configure. In this case, `--disable-wallet`. + +### Additional targets + + download: run 'make download' to fetch all sources without building them + download-osx: run 'make download-osx' to fetch all sources needed for macOS builds + download-win: run 'make download-win' to fetch all sources needed for win builds + download-linux: run 'make download-linux' to fetch all sources needed for linux builds + +### Other documentation + +- [description.md](description.md): General description of the depends system +- [packages.md](packages.md): Steps for adding packages + diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk new file mode 100644 index 0000000..c7671c1 --- /dev/null +++ b/depends/builders/darwin.mk @@ -0,0 +1,22 @@ +build_darwin_CC:=$(shell xcrun -f clang) +build_darwin_CXX:=$(shell xcrun -f clang++) +build_darwin_AR:=$(shell xcrun -f ar) +build_darwin_RANLIB:=$(shell xcrun -f ranlib) +build_darwin_STRIP:=$(shell xcrun -f strip) +build_darwin_OTOOL:=$(shell xcrun -f otool) +build_darwin_NM:=$(shell xcrun -f nm) +build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) +build_darwin_SHA256SUM=shasum -a 256 +build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o + +#darwin host on darwin builder. overrides darwin host preferences. +darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) +darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ +darwin_AR:=$(shell xcrun -f ar) +darwin_RANLIB:=$(shell xcrun -f ranlib) +darwin_STRIP:=$(shell xcrun -f strip) +darwin_LIBTOOL:=$(shell xcrun -f libtool) +darwin_OTOOL:=$(shell xcrun -f otool) +darwin_NM:=$(shell xcrun -f nm) +darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) +darwin_native_toolchain= diff --git a/depends/builders/default.mk b/depends/builders/default.mk new file mode 100644 index 0000000..f097db6 --- /dev/null +++ b/depends/builders/default.mk @@ -0,0 +1,20 @@ +default_build_CC = gcc +default_build_CXX = g++ +default_build_AR = ar +default_build_RANLIB = ranlib +default_build_STRIP = strip +default_build_NM = nm +default_build_OTOOL = otool +default_build_INSTALL_NAME_TOOL = install_name_tool + +define add_build_tool_func +build_$(build_os)_$1 ?= $$(default_build_$1) +build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) +build_$1=$$(build_$(build_arch)_$(build_os)_$1) +endef +$(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) +define add_build_flags_func +build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) +build_$1=$$(build_$(build_arch)_$(build_os)_$1) +endef +$(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) diff --git a/depends/builders/linux.mk b/depends/builders/linux.mk new file mode 100644 index 0000000..b03f424 --- /dev/null +++ b/depends/builders/linux.mk @@ -0,0 +1,2 @@ +build_linux_SHA256SUM = sha256sum +build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o diff --git a/depends/config.guess b/depends/config.guess new file mode 100644 index 0000000..2b79f6d --- /dev/null +++ b/depends/config.guess @@ -0,0 +1,1476 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-07-06' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" ; + for c in cc gcc c89 c99 ; do + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval "$set_cc_for_build" + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + eval "$set_cc_for_build" + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + eval "$set_cc_for_build" + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval "$set_cc_for_build" + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/depends/config.site.in b/depends/config.site.in new file mode 100644 index 0000000..e633752 --- /dev/null +++ b/depends/config.site.in @@ -0,0 +1,106 @@ +depends_prefix="`dirname ${ac_site_file}`/.." + +cross_compiling=maybe +host_alias=@HOST@ +ac_tool_prefix=${host_alias}- + +if test -z $with_boost; then + with_boost=$depends_prefix +fi +if test -z $with_qt_plugindir; then + with_qt_plugindir=$depends_prefix/plugins +fi +if test -z $with_qt_translationdir; then + with_qt_translationdir=$depends_prefix/translations +fi +if test -z $with_qt_bindir && test -z "@no_qt@"; then + with_qt_bindir=$depends_prefix/native/bin +fi +if test -z $with_protoc_bindir && test -z "@no_qt@"; then + with_protoc_bindir=$depends_prefix/native/bin +fi + + +if test -z $enable_wallet && test -n "@no_wallet@"; then + enable_wallet=no +fi + +if test -z $with_miniupnpc && test -n "@no_upnp@"; then + with_miniupnpc=no +fi + +if test -z $with_gui && test -n "@no_qt@"; then + with_gui=no +fi + +if test -z $enable_zmq && test -n "@no_zmq@"; then + enable_zmq=no +fi + +if test x@host_os@ = xdarwin; then + BREW=no + PORT=no +fi + +if test x@host_os@ = xmingw32; then + if test -z $with_qt_incdir; then + with_qt_incdir=$depends_prefix/include + fi + if test -z $with_qt_libdir; then + with_qt_libdir=$depends_prefix/lib + fi +fi + +PATH=$depends_prefix/native/bin:$PATH +PKG_CONFIG="`which pkg-config` --static" + +# These two need to remain exported because pkg-config does not see them +# otherwise. That means they must be unexported at the end of configure.ac to +# avoid ruining the cache. Sigh. +export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig +if test -z "@allow_host_packages@"; then + export PKGCONFIG_LIBDIR= +fi + +CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS" +LDFLAGS="-L$depends_prefix/lib $LDFLAGS" + +if test -n "@CC@" -a -z "${CC}"; then + CC="@CC@" +fi +if test -n "@CXX@" -a -z "${CXX}"; then + CXX="@CXX@" +fi +PYTHONPATH=$depends_prefix/native/lib/python3/dist-packages:$PYTHONPATH + +if test -n "@AR@"; then + AR=@AR@ + ac_cv_path_ac_pt_AR=${AR} +fi + +if test -n "@RANLIB@"; then + RANLIB=@RANLIB@ + ac_cv_path_ac_pt_RANLIB=${RANLIB} +fi + +if test -n "@NM@"; then + NM=@NM@ + ac_cv_path_ac_pt_NM=${NM} +fi + +if test -n "@debug@"; then + enable_reduce_exports=no +fi + +if test -n "@CFLAGS@"; then + CFLAGS="@CFLAGS@ $CFLAGS" +fi +if test -n "@CXXFLAGS@"; then + CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" +fi +if test -n "@CPPFLAGS@"; then + CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" +fi +if test -n "@LDFLAGS@"; then + LDFLAGS="@LDFLAGS@ $LDFLAGS" +fi diff --git a/depends/config.sub b/depends/config.sub new file mode 100644 index 0000000..c95acc6 --- /dev/null +++ b/depends/config.sub @@ -0,0 +1,1808 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-07-03' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \ + | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \ + | harris | dolphin | highlevel | gould | cbm | ns | masscomp \ + | apple | axis | knuth | cray | microblaze* \ + | sim | cisco | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + craynv) + basic_machine=craynv-cray + os=unicosmp + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-unknown + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \ + | avr | avr32 \ + | ba \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper | csky \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ + | wasm32 \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=${os:-none} + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + ;; + m9s12z | m68hcs12z | hcs12z | s12z) + basic_machine=s12z-unknown + os=${os:-none} + ;; + ms1) + basic_machine=mt-unknown + ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=${os:-none} + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | ba-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | e2k-* | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nfp-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ + | pyramid-* \ + | riscv-* | riscv32-* | riscv64-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | visium-* \ + | wasm32-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + abacus) + basic_machine=abacus-unknown + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + asmjs) + basic_machine=asmjs-unknown + ;; + blackfin-*) + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=cnk + ;; + c54x-*) + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=${os:-unicos} + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=${os:-elf} + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=${os:-elf} + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=${os:-bosx} + ;; + dpx2*) + basic_machine=m68k-bull + os=sysv3 + ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=$os"spe" + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + elxsi) + basic_machine=elxsi-elxsi + os=${os:-bsd} + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=hiuxwe2 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv32 + ;; + i*86v4*) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv4 + ;; + i*86v) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=sysv + ;; + i*86sol2) + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` + os=solaris2 + ;; + j90 | j90-cray) + basic_machine=j90-cray + os=${os:-unicos} + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + irix*) + ;; + *) + os=irix4 + ;; + esac + ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` + ;; + m68knommu-*) + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=mint + ;; + mips3*-*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown + ;; + ms1-*) + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=newsos + ;; + next | m*-next) + basic_machine=m68k-next + case $os in + nextstep* ) + ;; + ns2*) + os=nextstep2 + ;; + *) + os=nextstep3 + ;; + esac + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=hiuxwe2 + ;; + parisc-*) + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` + os=linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=${os:-elf} + ;; + sequent) + basic_machine=i386-sequent + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + simso-wrs) + basic_machine=sparclite-wrs + os=vxworks + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + tile*) + basic_machine=$basic_machine-unknown + os=linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + w65*) + basic_machine=w65-wdc + os=none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=proelf + ;; + x64) + basic_machine=x86_64-pc + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` + ;; + none) + basic_machine=none-none + os=${os:-none} + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x$os != x ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux + ;; + bluegene*) + os=cnk + ;; + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + solaris) + os=solaris2 + ;; + unixware*) + os=sysv4.2uw + ;; + gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=nto-$os + ;; + esac + ;; + hiux*) + os=hiuxwe2 + ;; + nto-qnx*) + ;; + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + ;; + linux-dietlibc) + os=linux-dietlibc + ;; + linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 + ;; + lynx*) + os=lynxos + ;; + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + opened*) + os=openedition + ;; + os400*) + os=os400 + ;; + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + wince*) + os=wince + ;; + utek*) + os=bsd + ;; + dynix*) + os=bsd + ;; + acis*) + os=aos + ;; + atheos*) + os=atheos + ;; + syllable*) + os=syllable + ;; + 386bsd) + os=bsd + ;; + ctix* | uts*) + os=sysv + ;; + nova*) + os=rtmk-nova + ;; + ns2) + os=nextstep2 + ;; + nsk*) + os=nsk + ;; + # Preserve the version number of sinix5. + sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + sinix*) + os=sysv4 + ;; + tpf*) + os=tpf + ;; + triton*) + os=sysv3 + ;; + oss*) + os=sysv3 + ;; + svr4*) + os=sysv4 + ;; + svr3) + os=sysv3 + ;; + sysvr4) + os=sysv4 + ;; + # This must come after sysvr4. + sysv*) + ;; + ose*) + os=ose + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint + ;; + zvmoe) + os=zvmoe + ;; + dicos*) + os=dicos + ;; + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac + ;; + nacl*) + ;; + ios) + ;; + none) + ;; + *-eabi) + ;; + *) + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=elf + ;; + spu-*) + os=elf + ;; + *-acorn) + os=riscix1.2 + ;; + arm*-rebel) + os=linux + ;; + arm*-semi) + os=aout + ;; + c4x-* | tic4x-*) + os=coff + ;; + c8051-*) + os=elf + ;; + clipper-intergraph) + os=clix + ;; + hexagon-*) + os=elf + ;; + tic54x-*) + os=coff + ;; + tic55x-*) + os=coff + ;; + tic6x-*) + os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=tops20 + ;; + pdp11-*) + os=none + ;; + *-dec | vax-*) + os=ultrix4.2 + ;; + m68*-apollo) + os=domain + ;; + i386-sun) + os=sunos4.0.2 + ;; + m68000-sun) + os=sunos3 + ;; + m68*-cisco) + os=aout + ;; + mep-*) + os=elf + ;; + mips*-cisco) + os=elf + ;; + mips*-*) + os=elf + ;; + or32-*) + os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=sysv3 + ;; + sparc-* | *-sun) + os=sunos4.1.1 + ;; + pru-*) + os=elf + ;; + *-be) + os=beos + ;; + *-ibm) + os=aix + ;; + *-knuth) + os=mmixware + ;; + *-wec) + os=proelf + ;; + *-winbond) + os=proelf + ;; + *-oki) + os=proelf + ;; + *-hp) + os=hpux + ;; + *-hitachi) + os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=sysv + ;; + *-cbm) + os=amigaos + ;; + *-dg) + os=dgux + ;; + *-dolphin) + os=sysv3 + ;; + m68k-ccur) + os=rtu + ;; + m88k-omron*) + os=luna + ;; + *-next) + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs + ;; + *-gould) + os=sysv + ;; + *-highlevel) + os=bsd + ;; + *-encore) + os=bsd + ;; + *-sgi) + os=irix + ;; + *-siemens) + os=sysv4 + ;; + *-masscomp) + os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=uxpv + ;; + *-rom68k) + os=coff + ;; + *-*bug) + os=coff + ;; + *-apple) + os=macos + ;; + *-atari*) + os=mint + ;; + *-wrs) + os=vxworks + ;; + *) + os=none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + riscix*) + vendor=acorn + ;; + sunos*) + vendor=sun + ;; + cnk*|-aix*) + vendor=ibm + ;; + beos*) + vendor=be + ;; + hpux*) + vendor=hp + ;; + mpeix*) + vendor=hp + ;; + hiux*) + vendor=hitachi + ;; + unos*) + vendor=crds + ;; + dgux*) + vendor=dg + ;; + luna*) + vendor=omron + ;; + genix*) + vendor=ns + ;; + clix*) + vendor=intergraph + ;; + mvs* | opened*) + vendor=ibm + ;; + os400*) + vendor=ibm + ;; + ptx*) + vendor=sequent + ;; + tpf*) + vendor=ibm + ;; + vxsim* | vxworks* | windiss*) + vendor=wrs + ;; + aux*) + vendor=apple + ;; + hms*) + vendor=hitachi + ;; + mpw* | macos*) + vendor=apple + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + vendor=atari + ;; + vos*) + vendor=stratus + ;; + esac + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` + ;; +esac + +echo "$basic_machine-$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/depends/description.md b/depends/description.md new file mode 100644 index 0000000..9fc7093 --- /dev/null +++ b/depends/description.md @@ -0,0 +1,53 @@ +This is a system of building and caching dependencies necessary for building Bitcoin. +There are several features that make it different from most similar systems: + +### It is designed to be builder and host agnostic + +In theory, binaries for any target OS/architecture can be created, from a +builder running any OS/architecture. In practice, build-side tools must be +specified when the defaults don't fit, and packages must be amended to work +on new hosts. For now, a build architecture of x86_64 is assumed, either on +Linux or macOS. + +### No reliance on timestamps + +File presence is used to determine what needs to be built. This makes the +results distributable and easily digestable by automated builders. + +### Each build only has its specified dependencies available at build-time. + +For each build, the sysroot is wiped and the (recursive) dependencies are +installed. This makes each build deterministic, since there will never be any +unknown files available to cause side-effects. + +### Each package is cached and only rebuilt as needed. + +Before building, a unique build-id is generated for each package. This id +consists of a hash of all files used to build the package (Makefiles, packages, +etc), and as well as a hash of the same data for each recursive dependency. If +any portion of a package's build recipe changes, it will be rebuilt as well as +any other package that depends on it. If any of the main makefiles (Makefile, +funcs.mk, etc) are changed, all packages will be rebuilt. After building, the +results are cached into a tarball that can be re-used and distributed. + +### Package build results are (relatively) deterministic. + +Each package is configured and patched so that it will yield the same +build-results with each consequent build, within a reasonable set of +constraints. Some things like timestamp insertion are unavoidable, and are +beyond the scope of this system. Additionally, the toolchain itself must be +capable of deterministic results. When revisions are properly bumped, a cached +build should represent an exact single payload. + +### Sources are fetched and verified automatically + +Each package must define its source location and checksum. The build will fail +if the fetched source does not match. Sources may be pre-seeded and/or cached +as desired. + +### Self-cleaning + +Build and staging dirs are wiped after use, and any previous version of a +cached result is removed following a successful build. Automated builders +should be able to build each revision and store the results with no further +intervention. diff --git a/depends/funcs.mk b/depends/funcs.mk new file mode 100644 index 0000000..8f03c5f --- /dev/null +++ b/depends/funcs.mk @@ -0,0 +1,254 @@ +define int_vars +#Set defaults for vars which may be overridden per-package +$(1)_cc=$($($(1)_type)_CC) +$(1)_cxx=$($($(1)_type)_CXX) +$(1)_objc=$($($(1)_type)_OBJC) +$(1)_objcxx=$($($(1)_type)_OBJCXX) +$(1)_ar=$($($(1)_type)_AR) +$(1)_ranlib=$($($(1)_type)_RANLIB) +$(1)_libtool=$($($(1)_type)_LIBTOOL) +$(1)_nm=$($($(1)_type)_NM) +$(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS) +$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS) +$(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib +$(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include +$(1)_recipe_hash:= +endef + +define int_get_all_dependencies +$(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies)))) +endef + +define fetch_file_inner + ( mkdir -p $$($(1)_download_dir) && echo Fetching $(3) from $(2) && \ + $(build_DOWNLOAD) "$$($(1)_download_dir)/$(4).temp" "$(2)/$(3)" && \ + echo "$(5) $$($(1)_download_dir)/$(4).temp" > $$($(1)_download_dir)/.$(4).hash && \ + $(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \ + mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \ + rm -rf $$($(1)_download_dir) ) +endef + +define fetch_file + ( test -f $$($(1)_source_dir)/$(4) || \ + ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \ + $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5)))) +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)) | 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 +$(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies))) +$(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) +$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id_string)) +$(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) +final_build_id_long+=$($(package)_build_id_long) + +#compute package-specific paths +$(1)_build_subdir?=. +$(1)_download_file?=$($(1)_file_name) +$(1)_source_dir:=$(SOURCES_PATH) +$(1)_source:=$$($(1)_source_dir)/$($(1)_file_name) +$(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) +$(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix) +$(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) +$(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version) +$(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir) +$(1)_cached_checksum:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz.hash +$(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id) +$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/ +$(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz +$(1)_all_sources=$($(1)_file_name) $($(1)_extra_sources) + +#stamps +$(1)_fetched=$(SOURCES_PATH)/download-stamps/.stamp_fetched-$(1)-$($(1)_file_name).hash +$(1)_extracted=$$($(1)_extract_dir)/.stamp_extracted +$(1)_preprocessed=$$($(1)_extract_dir)/.stamp_preprocessed +$(1)_cleaned=$$($(1)_extract_dir)/.stamp_cleaned +$(1)_built=$$($(1)_build_dir)/.stamp_built +$(1)_configured=$$($(1)_build_dir)/.stamp_configured +$(1)_staged=$$($(1)_staging_dir)/.stamp_staged +$(1)_postprocessed=$$($(1)_staging_prefix_dir)/.stamp_postprocessed +$(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path)) + + +#default commands +# The default behavior for tar will try to set ownership when running as uid 0 and may not succeed, --no-same-owner disables this behavior +$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) +$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --no-same-owner --strip-components=1 -xf $$($(1)_source) +$(1)_preprocess_cmds ?= +$(1)_build_cmds ?= +$(1)_config_cmds ?= +$(1)_stage_cmds ?= +$(1)_set_vars ?= + + +all_sources+=$$($(1)_fetched) +endef +#$(foreach dep_target,$($(1)_all_dependencies),$(eval $(1)_dependency_targets=$($(dep_target)_cached))) + + +define int_config_attach_build_config +$(eval $(call $(1)_set_vars,$(1))) +$(1)_cflags+=$($(1)_cflags_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_arch)) $($(1)_cflags_$(host_arch)_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_os)) $($(1)_cflags_$(host_os)_$(release_type)) +$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) $($(1)_cflags_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_cxxflags+=$($(1)_cxxflags_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) $($(1)_cxxflags_$(host_arch)_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) $($(1)_cxxflags_$(host_os)_$(release_type)) +$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) $($(1)_cxxflags_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_cppflags+=$($(1)_cppflags_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) $($(1)_cppflags_$(host_arch)_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_os)) $($(1)_cppflags_$(host_os)_$(release_type)) +$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) $($(1)_cppflags_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_ldflags+=$($(1)_ldflags_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) $($(1)_ldflags_$(host_arch)_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_os)) $($(1)_ldflags_$(host_os)_$(release_type)) +$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) $($(1)_ldflags_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_build_opts+=$$($(1)_build_opts_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) $$($(1)_build_opts_$(host_arch)_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) $$($(1)_build_opts_$(host_os)_$(release_type)) +$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) $$($(1)_build_opts_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_config_opts+=$$($(1)_config_opts_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) $$($(1)_config_opts_$(host_arch)_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) $$($(1)_config_opts_$(host_os)_$(release_type)) +$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) $$($(1)_config_opts_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_config_env+=$$($(1)_config_env_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type)) +$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type)) + +$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig +$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig +$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" + +ifneq ($($(1)_nm),) +$(1)_autoconf += NM="$$($(1)_nm)" +endif +ifneq ($($(1)_ranlib),) +$(1)_autoconf += RANLIB="$$($(1)_ranlib)" +endif +ifneq ($($(1)_ar),) +$(1)_autoconf += AR="$$($(1)_ar)" +endif +ifneq ($($(1)_cflags),) +$(1)_autoconf += CFLAGS="$$($(1)_cflags)" +endif +ifneq ($($(1)_cxxflags),) +$(1)_autoconf += CXXFLAGS="$$($(1)_cxxflags)" +endif +ifneq ($($(1)_cppflags),) +$(1)_autoconf += CPPFLAGS="$$($(1)_cppflags)" +endif +ifneq ($($(1)_ldflags),) +$(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" +endif +endef + +define int_add_cmds +$($(1)_fetched): + $(AT)mkdir -p $$(@D) $(SOURCES_PATH) + $(AT)rm -f $$@ + $(AT)touch $$@ + $(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1)) + $(AT)cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);) + $(AT)touch $$@ +$($(1)_extracted): | $($(1)_fetched) + $(AT)echo Extracting $(1)... + $(AT)mkdir -p $$(@D) + $(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1)) + $(AT)touch $$@ +$($(1)_preprocessed): | $($(1)_extracted) + $(AT)echo Preprocessing $(1)... + $(AT)mkdir -p $$(@D) $($(1)_patch_dir) + $(AT)$(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) + $(AT)cd $$(@D); $(call $(1)_preprocess_cmds, $(1)) + $(AT)touch $$@ +$($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed) + $(AT)echo Configuring $(1)... + $(AT)rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar --no-same-owner -xf $($(package)_cached); ) + $(AT)mkdir -p $$(@D) + $(AT)+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1)) + $(AT)touch $$@ +$($(1)_built): | $($(1)_configured) + $(AT)echo Building $(1)... + $(AT)mkdir -p $$(@D) + $(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1)) + $(AT)touch $$@ +$($(1)_staged): | $($(1)_built) + $(AT)echo Staging $(1)... + $(AT)mkdir -p $($(1)_staging_dir)/$(host_prefix) + $(AT)cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1)) + $(AT)rm -rf $($(1)_extract_dir) + $(AT)touch $$@ +$($(1)_postprocessed): | $($(1)_staged) + $(AT)echo Postprocessing $(1)... + $(AT)cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds) + $(AT)touch $$@ +$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) + $(AT)echo Caching $(1)... + $(AT)cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - + $(AT)mkdir -p $$(@D) + $(AT)rm -rf $$(@D) && mkdir -p $$(@D) + $(AT)mv $$($(1)_staging_dir)/$$(@F) $$(@) + $(AT)rm -rf $($(1)_staging_dir) +$($(1)_cached_checksum): $($(1)_cached) + $(AT)cd $$(@D); $(build_SHA256SUM) $$( $$(@) + +.PHONY: $(1) +$(1): | $($(1)_cached_checksum) +.SECONDARY: $($(1)_cached) $($(1)_postprocessed) $($(1)_staged) $($(1)_built) $($(1)_configured) $($(1)_preprocessed) $($(1)_extracted) $($(1)_fetched) + +endef + +stages = fetched extracted preprocessed configured built staged postprocessed cached cached_checksum + +define ext_add_stages +$(foreach stage,$(stages), + $(1)_$(stage): $($(1)_$(stage)) + .PHONY: $(1)_$(stage)) +endef + +# These functions create the build targets for each package. They must be +# broken down into small steps so that each part is done for all packages +# before moving on to the next step. Otherwise, a package's info +# (build-id for example) would only be available to another package if it +# happened to be computed already. + +#set the type for host/build packages. +$(foreach native_package,$(native_packages),$(eval $(native_package)_type=build)) +$(foreach package,$(packages),$(eval $(package)_type=$(host_arch)_$(host_os))) + +#set overridable defaults +$(foreach package,$(all_packages),$(eval $(call int_vars,$(package)))) + +#include package files +$(foreach package,$(all_packages),$(eval include packages/$(package).mk)) + +#compute a hash of all files that comprise this package's build recipe +$(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package)))) + +#generate a unique id for this package, incorporating its dependencies as well +$(foreach package,$(all_packages),$(eval $(call int_get_build_id,$(package)))) + +#compute final vars after reading package vars +$(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$(package)))) + +#create build targets +$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) + +#special exception: if a toolchain package exists, all non-native packages depend on it +$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) )) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk new file mode 100644 index 0000000..a1c943d --- /dev/null +++ b/depends/hosts/darwin.mk @@ -0,0 +1,17 @@ +OSX_MIN_VERSION=10.10 +OSX_SDK_VERSION=10.11 +OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk +LD64_VERSION=253.9 +darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ + +darwin_CFLAGS=-pipe +darwin_CXXFLAGS=$(darwin_CFLAGS) + +darwin_release_CFLAGS=-O2 +darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) + +darwin_debug_CFLAGS=-O1 +darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) + +darwin_native_toolchain=native_cctools diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk new file mode 100644 index 0000000..144e5f8 --- /dev/null +++ b/depends/hosts/default.mk @@ -0,0 +1,30 @@ +ifneq ($(host),$(build)) +host_toolchain:=$(host)- +endif + +default_host_CC = $(host_toolchain)gcc +default_host_CXX = $(host_toolchain)g++ +default_host_AR = $(host_toolchain)ar +default_host_RANLIB = $(host_toolchain)ranlib +default_host_STRIP = $(host_toolchain)strip +default_host_LIBTOOL = $(host_toolchain)libtool +default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool +default_host_OTOOL = $(host_toolchain)otool +default_host_NM = $(host_toolchain)nm + +define add_host_tool_func +$(host_os)_$1?=$$(default_host_$1) +$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) +$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) +host_$1=$$($(host_arch)_$(host_os)_$1) +endef + +define add_host_flags_func +$(host_arch)_$(host_os)_$1 += $($(host_os)_$1) +$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) +host_$1 = $$($(host_arch)_$(host_os)_$1) +host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) +endef + +$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) +$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk new file mode 100644 index 0000000..b13a0f1 --- /dev/null +++ b/depends/hosts/linux.mk @@ -0,0 +1,31 @@ +linux_CFLAGS=-pipe +linux_CXXFLAGS=$(linux_CFLAGS) + +linux_release_CFLAGS=-O2 +linux_release_CXXFLAGS=$(linux_release_CFLAGS) + +linux_debug_CFLAGS=-O1 +linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) + +linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC + +ifeq (86,$(findstring 86,$(build_arch))) +i686_linux_CC=gcc -m32 +i686_linux_CXX=g++ -m32 +i686_linux_AR=ar +i686_linux_RANLIB=ranlib +i686_linux_NM=nm +i686_linux_STRIP=strip + +x86_64_linux_CC=gcc -m64 +x86_64_linux_CXX=g++ -m64 +x86_64_linux_AR=ar +x86_64_linux_RANLIB=ranlib +x86_64_linux_NM=nm +x86_64_linux_STRIP=strip +else +i686_linux_CC=$(default_host_CC) -m32 +i686_linux_CXX=$(default_host_CXX) -m32 +x86_64_linux_CC=$(default_host_CC) -m64 +x86_64_linux_CXX=$(default_host_CXX) -m64 +endif diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk new file mode 100644 index 0000000..dbfb62f --- /dev/null +++ b/depends/hosts/mingw32.mk @@ -0,0 +1,10 @@ +mingw32_CFLAGS=-pipe +mingw32_CXXFLAGS=$(mingw32_CFLAGS) + +mingw32_release_CFLAGS=-O2 +mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) + +mingw32_debug_CFLAGS=-O1 +mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) + +mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC diff --git a/depends/packages.md b/depends/packages.md new file mode 100644 index 0000000..7d2bd46 --- /dev/null +++ b/depends/packages.md @@ -0,0 +1,148 @@ +Each recipe consists of 3 main parts: defining identifiers, setting build +variables, and defining build commands. + +The package "mylib" will be used here as an example + +General tips: +- mylib_foo is written as $(package)_foo in order to make recipes more similar. + +## Identifiers +Each package is required to define at least these variables: + + $(package)_version: + Version of the upstream library or program. If there is no version, a + placeholder such as 1.0 can be used. + + $(package)_download_path: + Location of the upstream source, without the file-name. Usually http, https + or ftp. Secure transmission options like https should be preferred if + available. + + $(package)_file_name: + The upstream source filename available at the download path. + + $(package)_sha256_hash: + The sha256 hash of the upstream file + +These variables are optional: + + $(package)_build_subdir: + cd to this dir before running configure/build/stage commands. + + $(package)_download_file: + The file-name of the upstream source if it differs from how it should be + stored locally. This can be used to avoid storing file-names with strange + characters. + + $(package)_dependencies: + Names of any other packages that this one depends on. + + $(package)_patches: + Filenames of any patches needed to build the package + + $(package)_extra_sources: + Any extra files that will be fetched via $(package)_fetch_cmds. These are + specified so that they can be fetched and verified via 'make download'. + + +## Build Variables: +After defining the main identifiers, build variables may be added or customized +before running the build commands. They should be added to a function called +$(package)_set_vars. For example: + + define $(package)_set_vars + ... + endef + +Most variables can be prefixed with the host, architecture, or both, to make +the modifications specific to that case. For example: + + Universal: $(package)_cc=gcc + Linux only: $(package)_linux_cc=gcc + x86_64 only: $(package)_x86_64_cc = gcc + x86_64 linux only: $(package)_x86_64_linux_cc = gcc + +These variables may be set to override or append their default values. + + $(package)_cc + $(package)_cxx + $(package)_objc + $(package)_objcxx + $(package)_ar + $(package)_ranlib + $(package)_libtool + $(package)_nm + $(package)_cflags + $(package)_cxxflags + $(package)_ldflags + $(package)_cppflags + $(package)_config_env + $(package)_build_env + $(package)_stage_env + $(package)_build_opts + $(package)_config_opts + +The *_env variables are used to add environment variables to the respective +commands. + +Many variables respect a debug/release suffix as well, in order to use them for +only the appropriate build config. For example: + + $(package)_cflags_release = -O3 + $(package)_cflags_i686_debug = -g + $(package)_config_opts_release = --disable-debug + +These will be used in addition to the options that do not specify +debug/release. All builds are considered to be release unless DEBUG=1 is set by +the user. Other variables may be defined as needed. + +## Build commands: + + For each build, a unique build dir and staging dir are created. For example, + `work/build/mylib/1.0-1adac830f6e` and `work/staging/mylib/1.0-1adac830f6e`. + + The following build commands are available for each recipe: + + $(package)_fetch_cmds: + Runs from: build dir + Fetch the source file. If undefined, it will be fetched and verified + against its hash. + + $(package)_extract_cmds: + Runs from: build dir + Verify the source file against its hash and extract it. If undefined, the + source is assumed to be a tarball. + + $(package)_preprocess_cmds: + Runs from: build dir/$(package)_build_subdir + Preprocess the source as necessary. If undefined, does nothing. + + $(package)_config_cmds: + Runs from: build dir/$(package)_build_subdir + Configure the source. If undefined, does nothing. + + $(package)_build_cmds: + Runs from: build dir/$(package)_build_subdir + Build the source. If undefined, does nothing. + + $(package)_stage_cmds: + Runs from: build dir/$(package)_build_subdir + Stage the build results. If undefined, does nothing. + + The following variables are available for each recipe: + + $(1)_staging_dir: package's destination sysroot path + $(1)_staging_prefix_dir: prefix path inside of the package's staging dir + $(1)_extract_dir: path to the package's extracted sources + $(1)_build_dir: path where configure/build/stage commands will be run + $(1)_patch_dir: path where the package's patches (if any) are found + +Notes on build commands: + +For packages built with autotools, $($(package)_autoconf) can be used in the +configure step to (usually) correctly configure automatically. Any +$($(package)_config_opts) will be appended. + +Most autotools projects can be properly staged using: + + $(MAKE) DESTDIR=$($(package)_staging_dir) install diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk new file mode 100644 index 0000000..6cdb795 --- /dev/null +++ b/depends/packages/bdb.mk @@ -0,0 +1,32 @@ +package=bdb +$(package)_version=4.8.30 +$(package)_download_path=https://download.oracle.com/berkeley-db +$(package)_file_name=db-$($(package)_version).NC.tar.gz +$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef +$(package)_build_subdir=build_unix + +define $(package)_set_vars +$(package)_config_opts=--disable-shared --enable-cxx --disable-replication +$(package)_config_opts_mingw32=--enable-mingw +$(package)_config_opts_linux=--with-pic +$(package)_cxxflags=-std=c++11 +$(package)_cppflags_mingw32=-DUNICODE -D_UNICODE +endef + +define $(package)_preprocess_cmds + sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \ + sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c && \ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist +endef + +define $(package)_config_cmds + ../dist/$($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) libdb_cxx-4.8.a libdb-4.8.a +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include +endef diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk new file mode 100644 index 0000000..a7226ad --- /dev/null +++ b/depends/packages/boost.mk @@ -0,0 +1,45 @@ +package=boost +$(package)_version=1_64_0 +$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/ +$(package)_file_name=$(package)_$($(package)_version).tar.bz2 +$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332 + +define $(package)_set_vars +$(package)_config_opts_release=variant=release +$(package)_config_opts_debug=variant=debug +$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam +$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 +$(package)_config_opts_linux=threadapi=pthread runtime-link=shared +$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared +$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static +$(package)_config_opts_x86_64_mingw32=address-model=64 +$(package)_config_opts_i686_mingw32=address-model=32 +$(package)_config_opts_i686_linux=address-model=32 architecture=x86 +$(package)_config_opts_s390x_linux=address-model=64 +$(package)_config_opts_sparc64_linux=address-model=64 +$(package)_config_opts_alpha_linux=address-model=64 +$(package)_config_opts_m68k_linux=address-model=32 +$(package)_toolset_$(host_os)=gcc +$(package)_archiver_$(host_os)=$($(package)_ar) +$(package)_toolset_darwin=darwin +$(package)_archiver_darwin=$($(package)_libtool) +$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test +$(package)_cxxflags=-std=c++11 -fvisibility=hidden +$(package)_cxxflags_linux=-fPIC +endef + +define $(package)_preprocess_cmds + echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam +endef + +define $(package)_config_cmds + ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries) +endef + +define $(package)_build_cmds + ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage +endef + +define $(package)_stage_cmds + ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install +endef diff --git a/depends/packages/dbus.mk b/depends/packages/dbus.mk new file mode 100644 index 0000000..bbe0375 --- /dev/null +++ b/depends/packages/dbus.mk @@ -0,0 +1,23 @@ +package=dbus +$(package)_version=1.10.18 +$(package)_download_path=https://dbus.freedesktop.org/releases/dbus +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=6049ddd5f3f3e2618f615f1faeda0a115104423a7996b7aa73e2f36e38cc514a +$(package)_dependencies=expat + +define $(package)_set_vars + $(package)_config_opts=--disable-tests --disable-doxygen-docs --disable-xml-docs --disable-static --without-x +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C dbus libdbus-1.la +endef + +define $(package)_stage_cmds + $(MAKE) -C dbus DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-dbusincludeHEADERS install-nodist_dbusarchincludeHEADERS && \ + $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA +endef diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk new file mode 100644 index 0000000..8d06882 --- /dev/null +++ b/depends/packages/expat.mk @@ -0,0 +1,21 @@ +package=expat +$(package)_version=2.2.6 +$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_6/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2 + +define $(package)_set_vars +$(package)_config_opts=--disable-static --without-docbook +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk new file mode 100644 index 0000000..d0996b4 --- /dev/null +++ b/depends/packages/fontconfig.mk @@ -0,0 +1,28 @@ +package=fontconfig +$(package)_version=2.12.1 +$(package)_download_path=https://www.freedesktop.org/software/fontconfig/release/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3 +$(package)_dependencies=freetype expat + +define $(package)_set_vars + $(package)_config_opts=--disable-docs --disable-static +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig +# have broken makefiles which needlessly attempt to re-generate headers with gperf. +# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation. +# This can be removed once the upstream build is fixed. +define $(package)_build_cmds + sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \ + sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \ + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk new file mode 100644 index 0000000..a98e82e --- /dev/null +++ b/depends/packages/freetype.mk @@ -0,0 +1,22 @@ +package=freetype +$(package)_version=2.7.1 +$(package)_download_path=https://download.savannah.gnu.org/releases/$(package) +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88 + +define $(package)_set_vars + $(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/gmp.mk b/depends/packages/gmp.mk new file mode 100644 index 0000000..afc3f39 --- /dev/null +++ b/depends/packages/gmp.mk @@ -0,0 +1,24 @@ +package=gmp +$(package)_version=6.1.2 +$(package)_download_path=https://gmplib.org/download/gmp +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +$(package)_config_opts_mingw32=--enable-mingw +$(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + diff --git a/depends/packages/libX11.mk b/depends/packages/libX11.mk new file mode 100644 index 0000000..a013da5 --- /dev/null +++ b/depends/packages/libX11.mk @@ -0,0 +1,27 @@ +package=libX11 +$(package)_version=1.6.2 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16 +$(package)_dependencies=libxcb xtrans xextproto xproto + +define $(package)_set_vars +$(package)_config_opts=--disable-xkb --disable-static +$(package)_config_opts_linux=--with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libXau.mk b/depends/packages/libXau.mk new file mode 100644 index 0000000..ce42140 --- /dev/null +++ b/depends/packages/libXau.mk @@ -0,0 +1,27 @@ +package=libXau +$(package)_version=1.0.8 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2 +$(package)_dependencies=xproto + +define $(package)_set_vars + $(package)_config_opts=--disable-shared + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libXext.mk b/depends/packages/libXext.mk new file mode 100644 index 0000000..458b967 --- /dev/null +++ b/depends/packages/libXext.mk @@ -0,0 +1,26 @@ +package=libXext +$(package)_version=1.3.2 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=f829075bc646cdc085fa25d98d5885d83b1759ceb355933127c257e8e50432e0 +$(package)_dependencies=xproto xextproto libX11 libXau + +define $(package)_set_vars + $(package)_config_opts=--disable-static +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk new file mode 100644 index 0000000..5f622f8 --- /dev/null +++ b/depends/packages/libevent.mk @@ -0,0 +1,30 @@ +package=libevent +$(package)_version=2.1.8-stable +$(package)_download_path=https://github.com/libevent/libevent/archive/ +$(package)_file_name=release-$($(package)_version).tar.gz +$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d + +define $(package)_preprocess_cmds + ./autogen.sh +endef + +define $(package)_set_vars + $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples + $(package)_config_opts_release=--disable-debug-mode + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds +endef diff --git a/depends/packages/libxcb.mk b/depends/packages/libxcb.mk new file mode 100644 index 0000000..3ddd5a7 --- /dev/null +++ b/depends/packages/libxcb.mk @@ -0,0 +1,36 @@ +package=libxcb +$(package)_version=1.10 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5 +$(package)_dependencies=xcb_proto libXau xproto + +define $(package)_set_vars +$(package)_config_opts=--disable-static +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux &&\ + sed "s/pthread-stubs//" -i configure +endef + +# Don't install xcb headers to the default path in order to work around a qt +# build issue: https://bugreports.qt.io/browse/QTBUG-34748 +# When using qt's internal libxcb, it may end up finding the real headers in +# depends staging. Use a non-default path to avoid that. + +define $(package)_config_cmds + $($(package)_autoconf) --includedir=$(host_prefix)/include/xcb-shared +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm -rf share/man share/doc +endef diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk new file mode 100644 index 0000000..fdbe22c --- /dev/null +++ b/depends/packages/miniupnpc.mk @@ -0,0 +1,28 @@ +package=miniupnpc +$(package)_version=2.0.20180203 +$(package)_download_path=https://miniupnp.tuxfamily.org/files/ +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7 + +define $(package)_set_vars +$(package)_build_opts=CC="$($(package)_cc)" +$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)" +$(package)_build_opts_mingw32=-f Makefile.mingw +$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" +endef + +define $(package)_preprocess_cmds + mkdir dll && \ + sed -e 's|MINIUPNPC_VERSION_STRING \"version\"|MINIUPNPC_VERSION_STRING \"$($(package)_version)\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \ + sed -i.old "s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|" Makefile.mingw +endef + +define $(package)_build_cmds + $(MAKE) libminiupnpc.a $($(package)_build_opts) +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ + install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ + install libminiupnpc.a $($(package)_staging_prefix_dir)/lib +endef diff --git a/depends/packages/native_biplist.mk b/depends/packages/native_biplist.mk new file mode 100644 index 0000000..c3054cb --- /dev/null +++ b/depends/packages/native_biplist.mk @@ -0,0 +1,15 @@ +package=native_biplist +$(package)_version=1.0.3 +$(package)_download_path=https://bitbucket.org/wooster/biplist/downloads +$(package)_file_name=biplist-$($(package)_version).tar.gz +$(package)_sha256_hash=4c0549764c5fe50b28042ec21aa2e14fe1a2224e239a1dae77d9e7f3932aa4c6 +$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages + +define $(package)_build_cmds + python3 setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk new file mode 100644 index 0000000..a065256 --- /dev/null +++ b/depends/packages/native_cctools.mk @@ -0,0 +1,65 @@ +package=native_cctools +$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6 +$(package)_download_path=https://github.com/theuni/cctools-port/archive +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a +$(package)_build_subdir=cctools +$(package)_clang_version=3.7.1 +$(package)_clang_download_path=https://llvm.org/releases/$($(package)_clang_version) +$(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz +$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz +$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9 +$(package)_extra_sources=$($(package)_clang_file_name) + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash)) +endef + +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \ + tar --no-same-owner --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \ + rm -f toolchain/lib/libc++abi.so* && \ + echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \ + echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \ + chmod +x toolchain/bin/$(host)-dsymutil && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source) +endef + +define $(package)_set_vars +$(package)_config_opts=--target=$(host) --disable-lto-support +$(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib +$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang +$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++ +endef + +define $(package)_preprocess_cmds + cd $($(package)_build_subdir); ./autogen.sh && \ + sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install && \ + cd $($(package)_extract_dir)/toolchain && \ + mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \ + mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \ + cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\ + cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\ + cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ + cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \ + cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ + if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \ + if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi +endef diff --git a/depends/packages/native_cdrkit.mk b/depends/packages/native_cdrkit.mk new file mode 100644 index 0000000..8243458 --- /dev/null +++ b/depends/packages/native_cdrkit.mk @@ -0,0 +1,26 @@ +package=native_cdrkit +$(package)_version=1.1.11 +$(package)_download_path=https://distro.ibiblio.org/fatdog/source/600/c +$(package)_file_name=cdrkit-$($(package)_version).tar.bz2 +$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564 +$(package)_patches=cdrkit-deterministic.patch + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch +endef + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) +endef + +define $(package)_build_cmds + $(MAKE) genisoimage +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C genisoimage install +endef + +define $(package)_postprocess_cmds + rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump +endef diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk new file mode 100644 index 0000000..f99b689 --- /dev/null +++ b/depends/packages/native_ds_store.mk @@ -0,0 +1,16 @@ +package=native_ds_store +$(package)_version=1.1.2 +$(package)_download_path=https://github.com/al45tair/ds_store/archive/ +$(package)_file_name=v$($(package)_version).tar.gz +$(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c +$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages +$(package)_dependencies=native_biplist + +define $(package)_build_cmds + python3 setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/native_libdmg-hfsplus.mk b/depends/packages/native_libdmg-hfsplus.mk new file mode 100644 index 0000000..a4ffb60 --- /dev/null +++ b/depends/packages/native_libdmg-hfsplus.mk @@ -0,0 +1,22 @@ +package=native_libdmg-hfsplus +$(package)_version=0.1 +$(package)_download_path=https://github.com/theuni/libdmg-hfsplus/archive +$(package)_file_name=libdmg-hfsplus-v$($(package)_version).tar.gz +$(package)_sha256_hash=6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3 +$(package)_build_subdir=build + +define $(package)_preprocess_cmds + mkdir build +endef + +define $(package)_config_cmds + cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix)/bin .. +endef + +define $(package)_build_cmds + $(MAKE) -C dmg +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C dmg install +endef diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk new file mode 100644 index 0000000..e60b99d --- /dev/null +++ b/depends/packages/native_mac_alias.mk @@ -0,0 +1,15 @@ +package=native_mac_alias +$(package)_version=2.0.7 +$(package)_download_path=https://github.com/al45tair/mac_alias/archive/ +$(package)_file_name=v$($(package)_version).tar.gz +$(package)_sha256_hash=6f606d3b6bccd2112aeabf1a063f5b5ece87005a5d7e97c8faca23b916e88838 +$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages + +define $(package)_build_cmds + python3 setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/native_protobuf.mk b/depends/packages/native_protobuf.mk new file mode 100644 index 0000000..1de8c37 --- /dev/null +++ b/depends/packages/native_protobuf.mk @@ -0,0 +1,25 @@ +package=native_protobuf +$(package)_version=2.6.1 +$(package)_download_path=https://github.com/google/protobuf/releases/download/v$($(package)_version) +$(package)_file_name=protobuf-$($(package)_version).tar.bz2 +$(package)_sha256_hash=ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared --without-zlib +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C src protoc +endef + +define $(package)_stage_cmds + $(MAKE) -C src DESTDIR=$($(package)_staging_dir) install-strip +endef + +define $(package)_postprocess_cmds + rm -rf lib include +endef diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk new file mode 100644 index 0000000..fdfd372 --- /dev/null +++ b/depends/packages/openssl.mk @@ -0,0 +1,86 @@ +package=openssl +$(package)_version=1.0.1k +$(package)_download_path=https://www.openssl.org/source +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c + +define $(package)_set_vars +$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" +$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl +$(package)_config_opts+=no-camellia +$(package)_config_opts+=no-capieng +$(package)_config_opts+=no-cast +$(package)_config_opts+=no-comp +$(package)_config_opts+=no-dso +$(package)_config_opts+=no-dtls1 +$(package)_config_opts+=no-ec_nistp_64_gcc_128 +$(package)_config_opts+=no-gost +$(package)_config_opts+=no-gmp +$(package)_config_opts+=no-heartbeats +$(package)_config_opts+=no-idea +$(package)_config_opts+=no-jpake +$(package)_config_opts+=no-krb5 +$(package)_config_opts+=no-libunbound +$(package)_config_opts+=no-md2 +$(package)_config_opts+=no-mdc2 +$(package)_config_opts+=no-rc4 +$(package)_config_opts+=no-rc5 +$(package)_config_opts+=no-rdrand +$(package)_config_opts+=no-rfc3779 +$(package)_config_opts+=no-rsax +$(package)_config_opts+=no-sctp +$(package)_config_opts+=no-seed +$(package)_config_opts+=no-sha0 +$(package)_config_opts+=no-shared +$(package)_config_opts+=no-ssl-trace +$(package)_config_opts+=no-ssl2 +$(package)_config_opts+=no-ssl3 +$(package)_config_opts+=no-static_engine +$(package)_config_opts+=no-store +$(package)_config_opts+=no-unit-test +$(package)_config_opts+=no-weak-ssl-ciphers +$(package)_config_opts+=no-whirlpool +$(package)_config_opts+=no-zlib +$(package)_config_opts+=no-zlib-dynamic +$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags) +$(package)_config_opts_linux=-fPIC -Wa,--noexecstack +$(package)_config_opts_x86_64_linux=linux-x86_64 +$(package)_config_opts_i686_linux=linux-generic32 +$(package)_config_opts_arm_linux=linux-generic32 +$(package)_config_opts_armv7l_linux=linux-generic32 +$(package)_config_opts_aarch64_linux=linux-generic64 +$(package)_config_opts_mipsel_linux=linux-generic32 +$(package)_config_opts_mips_linux=linux-generic32 +$(package)_config_opts_powerpc_linux=linux-generic32 +$(package)_config_opts_riscv32_linux=linux-generic32 +$(package)_config_opts_riscv64_linux=linux-generic64 +$(package)_config_opts_powerpc64le_linux=linux-generic64 +$(package)_config_opts_sparc64_linux=linux-generic64 +$(package)_config_opts_s390x_linux=linux-generic64 +$(package)_config_opts_alpha_linux=linux-generic64 +$(package)_config_opts_m68k_linux=linux-generic32 +$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc +$(package)_config_opts_x86_64_mingw32=mingw64 +$(package)_config_opts_i686_mingw32=mingw +endef + +define $(package)_preprocess_cmds + sed -i.old "/define DATE/d" util/mkbuildinf.pl && \ + sed -i.old "s|engines apps test|engines|" Makefile.org +endef + +define $(package)_config_cmds + ./Configure $($(package)_config_opts) +endef + +define $(package)_build_cmds + $(MAKE) -j1 build_libs libcrypto.pc libssl.pc openssl.pc +endef + +define $(package)_stage_cmds + $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw +endef + +define $(package)_postprocess_cmds + rm -rf share bin etc +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk new file mode 100644 index 0000000..c8b2ce8 --- /dev/null +++ b/depends/packages/packages.mk @@ -0,0 +1,21 @@ +packages:=boost openssl libevent gmp + +qt_native_packages = native_protobuf +qt_packages = qrencode protobuf zlib + +qt_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans + +qt_darwin_packages=qt +qt_mingw32_packages=qt + +wallet_packages=bdb + +zmq_packages=zeromq + +upnp_packages=miniupnpc + +darwin_native_packages = native_biplist native_ds_store native_mac_alias + +ifneq ($(build_os),darwin) +darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus +endif diff --git a/depends/packages/protobuf.mk b/depends/packages/protobuf.mk new file mode 100644 index 0000000..d201d11 --- /dev/null +++ b/depends/packages/protobuf.mk @@ -0,0 +1,34 @@ +package=protobuf +$(package)_version=$(native_$(package)_version) +$(package)_download_path=$(native_$(package)_download_path) +$(package)_file_name=$(native_$(package)_file_name) +$(package)_sha256_hash=$(native_$(package)_sha256_hash) +$(package)_dependencies=native_$(package) +$(package)_cxxflags=-std=c++11 + +define $(package)_set_vars + $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . &&\ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub gtest/build-aux +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) -C src libprotobuf.la +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-libLTLIBRARIES install-nobase_includeHEADERS &&\ + $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA +endef + +define $(package)_postprocess_cmds + rm lib/libprotoc.a +endef diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk new file mode 100644 index 0000000..313e4ad --- /dev/null +++ b/depends/packages/qrencode.mk @@ -0,0 +1,26 @@ +package=qrencode +$(package)_version=3.4.4 +$(package)_download_path=https://fukuchi.org/works/qrencode/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5 + +define $(package)_set_vars +$(package)_config_opts=--disable-shared -without-tools --disable-sdltest +$(package)_config_opts_linux=--with-pic +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub use +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk new file mode 100644 index 0000000..4ec8deb --- /dev/null +++ b/depends/packages/qt.mk @@ -0,0 +1,207 @@ +PACKAGE=qt +$(package)_version=5.9.7 +$(package)_download_path=https://download.qt.io/official_releases/qt/5.9/$($(package)_version)/submodules +$(package)_suffix=opensource-src-$($(package)_version).tar.xz +$(package)_file_name=qtbase-$($(package)_suffix) +$(package)_sha256_hash=36dd9574f006eaa1e5af780e4b33d11fe39d09fd7c12f3b9d83294174bd28f00 +$(package)_dependencies=openssl zlib +$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext +$(package)_build_subdir=qtbase +$(package)_qt_libs=corelib network widgets gui plugins testlib +$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch fix_rcc_determinism.patch fix_riscv64_arch.patch fix_s390x_powerpc_mips_mipsel_architectures.patch xkb-default.patch + +$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) +$(package)_qttranslations_sha256_hash=b36da7d93c3ab6fca56b32053bb73bc619c8b192bb89b74e3bcde2705f1c2a14 + +$(package)_qttools_file_name=qttools-$($(package)_suffix) +$(package)_qttools_sha256_hash=d62e0f70d99645d6704dbb8976fb2222443061743689943d40970c52c49367a1 + +$(package)_extra_sources = $($(package)_qttranslations_file_name) +$(package)_extra_sources += $($(package)_qttools_file_name) + +define $(package)_set_vars +$(package)_config_opts_release = -release +$(package)_config_opts_debug = -debug +$(package)_config_opts += -bindir $(build_prefix)/bin +$(package)_config_opts += -c++std c++11 +$(package)_config_opts += -confirm-license +$(package)_config_opts += -dbus-runtime +$(package)_config_opts += -hostprefix $(build_prefix) +$(package)_config_opts += -no-compile-examples +$(package)_config_opts += -no-cups +$(package)_config_opts += -no-egl +$(package)_config_opts += -no-eglfs +$(package)_config_opts += -no-freetype +$(package)_config_opts += -no-gif +$(package)_config_opts += -no-glib +$(package)_config_opts += -no-icu +$(package)_config_opts += -no-iconv +$(package)_config_opts += -no-kms +$(package)_config_opts += -no-linuxfb +$(package)_config_opts += -no-libudev +$(package)_config_opts += -no-mtdev +$(package)_config_opts += -no-openvg +$(package)_config_opts += -no-reduce-relocations +$(package)_config_opts += -no-qml-debug +$(package)_config_opts += -no-sql-db2 +$(package)_config_opts += -no-sql-ibase +$(package)_config_opts += -no-sql-oci +$(package)_config_opts += -no-sql-tds +$(package)_config_opts += -no-sql-mysql +$(package)_config_opts += -no-sql-odbc +$(package)_config_opts += -no-sql-psql +$(package)_config_opts += -no-sql-sqlite +$(package)_config_opts += -no-sql-sqlite2 +$(package)_config_opts += -no-use-gold-linker +$(package)_config_opts += -no-xinput2 +$(package)_config_opts += -nomake examples +$(package)_config_opts += -nomake tests +$(package)_config_opts += -opensource +$(package)_config_opts += -openssl-linked +$(package)_config_opts += -optimized-qmake +$(package)_config_opts += -pch +$(package)_config_opts += -pkg-config +$(package)_config_opts += -prefix $(host_prefix) +$(package)_config_opts += -qt-libpng +$(package)_config_opts += -qt-libjpeg +$(package)_config_opts += -qt-pcre +$(package)_config_opts += -qt-harfbuzz +$(package)_config_opts += -system-zlib +$(package)_config_opts += -static +$(package)_config_opts += -silent +$(package)_config_opts += -v +$(package)_config_opts += -no-feature-dial +$(package)_config_opts += -no-feature-ftp +$(package)_config_opts += -no-feature-lcdnumber +$(package)_config_opts += -no-feature-pdf +$(package)_config_opts += -no-feature-printer +$(package)_config_opts += -no-feature-printdialog +$(package)_config_opts += -no-feature-concurrent +$(package)_config_opts += -no-feature-sql +$(package)_config_opts += -no-feature-statemachine +$(package)_config_opts += -no-feature-syntaxhighlighter +$(package)_config_opts += -no-feature-textbrowser +$(package)_config_opts += -no-feature-textodfwriter +$(package)_config_opts += -no-feature-udpsocket +$(package)_config_opts += -no-feature-wizard +$(package)_config_opts += -no-feature-xml + +ifneq ($(build_os),darwin) +$(package)_config_opts_darwin = -xplatform macx-clang-linux +$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) +$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) +$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" +$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION) +$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) +$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION) +endif + +$(package)_config_opts_linux = -qt-xkbcommon-x11 +$(package)_config_opts_linux += -qt-xcb +$(package)_config_opts_linux += -system-freetype +$(package)_config_opts_linux += -no-feature-sessionmanager +$(package)_config_opts_linux += -fontconfig +$(package)_config_opts_linux += -no-opengl +$(package)_config_opts_arm_linux += -platform linux-g++ -xplatform versess-linux-g++ +$(package)_config_opts_i686_linux = -xplatform linux-g++-32 +$(package)_config_opts_x86_64_linux = -xplatform linux-g++-64 +$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++ +$(package)_config_opts_riscv64_linux = -platform linux-g++ -xplatform versess-linux-g++ +$(package)_config_opts_s390x_linux += -platform linux-g++ -xplatform linux-g++-64 +$(package)_config_opts_powerpc_linux += -platform linux-g++ -xplatform linux-g++-32 +$(package)_config_opts_powerpc64le_linux += -platform linux-g++ -xplatform linux-g++-64 +$(package)_config_opts_sparc64_linux += -platform linux-g++ -xplatform linux-g++-64 +$(package)_config_opts_alpha_linux += -platform linux-g++ -xplatform linux-g++-64 +$(package)_config_opts_m68k_linux += -platform linux-g++ -xplatform linux-g++-32 +$(package)_config_opts_mingw32 = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE="$(host)-" +$(package)_build_env = QT_RCC_TEST=1 +$(package)_build_env += QT_RCC_SOURCE_DATE_OVERRIDE=1 +endef + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) +endef + +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir qtbase && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ + mkdir qttranslations && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ + mkdir qttools && \ + tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools +endef + +define $(package)_preprocess_cmds + sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ + sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ + sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ + sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \ + sed -i.old "s|X11/extensions/XIproto.h|X11/X.h|" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \ + sed -i.old -e 's/if \[ "$$$$XPLATFORM_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/if \[ "$$$$BUILD_ON_MAC" = "yes" \]; then xspecvals=$$$$(macSDKify/' -e 's|/bin/pwd|pwd|' qtbase/configure && \ + sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \ + mkdir -p qtbase/mkspecs/macx-clang-linux &&\ + cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ + cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ + cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/versess-linux-g++ && \ + sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/versess-linux-g++/qmake.conf && \ + patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch &&\ + patch -p1 -i $($(package)_patch_dir)/fix_configure_mac.patch &&\ + patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch &&\ + patch -p1 -i $($(package)_patch_dir)/fix_rcc_determinism.patch &&\ + patch -p1 -i $($(package)_patch_dir)/xkb-default.patch &&\ + echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ + patch -p1 -i $($(package)_patch_dir)/fix_riscv64_arch.patch &&\ + patch -p1 -i $($(package)_patch_dir)/fix_s390x_powerpc_mips_mipsel_architectures.patch &&\ + echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ + echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf &&\ + sed -i.old "s|QMAKE_CFLAGS = |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_LFLAGS = |!host_build: QMAKE_LFLAGS = $($(package)_ldflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \ + sed -i.old "s|QMAKE_CXXFLAGS = |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf +endef + +define $(package)_config_cmds + export PKG_CONFIG_SYSROOT_DIR=/ && \ + export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \ + export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \ + ./configure $($(package)_config_opts) && \ + echo "host_build: QT_CONFIG ~= s/system-zlib/zlib" >> mkspecs/qconfig.pri && \ + echo "CONFIG += force_bootstrap" >> mkspecs/qconfig.pri && \ + $(MAKE) sub-src-clean && \ + cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \ + cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. && \ + cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile && \ + cd ../lupdate/ && ../../../../qtbase/bin/qmake lupdate.pro -o Makefile && cd ../../../.. +endef + +define $(package)_build_cmds + $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \ + $(MAKE) -C ../qttools/src/linguist/lrelease && \ + $(MAKE) -C ../qttools/src/linguist/lupdate && \ + $(MAKE) -C ../qttranslations +endef + +define $(package)_stage_cmds + $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. && \ + $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \ + $(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \ + $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \ + if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \ + cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \ + fi +endef + +define $(package)_postprocess_cmds + rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \ + rm -f lib/lib*.la lib/*.prl plugins/*/*.prl +endef diff --git a/depends/packages/xcb_proto.mk b/depends/packages/xcb_proto.mk new file mode 100644 index 0000000..4411039 --- /dev/null +++ b/depends/packages/xcb_proto.mk @@ -0,0 +1,27 @@ +package=xcb_proto +$(package)_version=1.10 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-proto-$($(package)_version).tar.bz2 +$(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c922800baaf05 + +define $(package)_set_vars + $(package)_config_opts=--disable-shared + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + find -name "*.pyc" -delete && \ + find -name "*.pyo" -delete +endef diff --git a/depends/packages/xextproto.mk b/depends/packages/xextproto.mk new file mode 100644 index 0000000..157b76e --- /dev/null +++ b/depends/packages/xextproto.mk @@ -0,0 +1,25 @@ +package=xextproto +$(package)_version=7.3.0 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0 + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/xproto.mk b/depends/packages/xproto.mk new file mode 100644 index 0000000..23ad5ff --- /dev/null +++ b/depends/packages/xproto.mk @@ -0,0 +1,25 @@ +package=xproto +$(package)_version=7.0.26 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f + +define $(package)_set_vars +$(package)_config_opts=--disable-shared +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/xtrans.mk b/depends/packages/xtrans.mk new file mode 100644 index 0000000..67d2d97 --- /dev/null +++ b/depends/packages/xtrans.mk @@ -0,0 +1,26 @@ +package=xtrans +$(package)_version=1.3.4 +$(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a +$(package)_dependencies= + +define $(package)_set_vars +$(package)_config_opts_linux=--with-pic --disable-static +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk new file mode 100644 index 0000000..dfbc505 --- /dev/null +++ b/depends/packages/zeromq.mk @@ -0,0 +1,35 @@ +package=zeromq +$(package)_version=4.3.1 +$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb +$(package)_patches=0001-fix-build-with-older-mingw64.patch 0002-disable-pthread_set_name_np.patch + +define $(package)_set_vars + $(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf --disable-Werror + $(package)_config_opts_linux=--with-pic + $(package)_cxxflags=-std=c++11 +endef + +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/0001-fix-build-with-older-mingw64.patch && \ + patch -p1 < $($(package)_patch_dir)/0002-disable-pthread_set_name_np.patch && \ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) src/libzmq.la +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA +endef + +define $(package)_postprocess_cmds + sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \ + rm -rf bin share +endef diff --git a/depends/packages/zlib.mk b/depends/packages/zlib.mk new file mode 100644 index 0000000..1600b11 --- /dev/null +++ b/depends/packages/zlib.mk @@ -0,0 +1,27 @@ +package=zlib +$(package)_version=1.2.11 +$(package)_download_path=https://www.zlib.net +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 + +define $(package)_set_vars +$(package)_build_opts= CC="$($(package)_cc)" +$(package)_build_opts+=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC" +$(package)_build_opts+=RANLIB="$($(package)_ranlib)" +$(package)_build_opts+=AR="$($(package)_ar)" +$(package)_build_opts_darwin+=AR="$($(package)_libtool)" +$(package)_build_opts_darwin+=ARFLAGS="-o" +endef + +define $(package)_config_cmds + ./configure --static --prefix=$(host_prefix) +endef + +define $(package)_build_cmds + $(MAKE) $($(package)_build_opts) libz.a +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install $($(package)_build_opts) +endef + diff --git a/depends/patches/native_cdrkit/cdrkit-deterministic.patch b/depends/patches/native_cdrkit/cdrkit-deterministic.patch new file mode 100644 index 0000000..8ab0993 --- /dev/null +++ b/depends/patches/native_cdrkit/cdrkit-deterministic.patch @@ -0,0 +1,86 @@ +--- cdrkit-1.1.11.old/genisoimage/tree.c 2008-10-21 19:57:47.000000000 -0400 ++++ cdrkit-1.1.11/genisoimage/tree.c 2013-12-06 00:23:18.489622668 -0500 +@@ -1139,8 +1139,9 @@ + scan_directory_tree(struct directory *this_dir, char *path, + struct directory_entry *de) + { +- DIR *current_dir; ++ int current_file; + char whole_path[PATH_MAX]; ++ struct dirent **d_list; + struct dirent *d_entry; + struct directory *parent; + int dflag; +@@ -1164,7 +1165,8 @@ + this_dir->dir_flags |= DIR_WAS_SCANNED; + + errno = 0; /* Paranoia */ +- current_dir = opendir(path); ++ //current_dir = opendir(path); ++ current_file = scandir(path, &d_list, NULL, alphasort); + d_entry = NULL; + + /* +@@ -1173,12 +1175,12 @@ + */ + old_path = path; + +- if (current_dir) { ++ if (current_file >= 0) { + errno = 0; +- d_entry = readdir(current_dir); ++ d_entry = d_list[0]; + } + +- if (!current_dir || !d_entry) { ++ if (current_file < 0 || !d_entry) { + int ret = 1; + + #ifdef USE_LIBSCHILY +@@ -1191,8 +1193,8 @@ + de->isorec.flags[0] &= ~ISO_DIRECTORY; + ret = 0; + } +- if (current_dir) +- closedir(current_dir); ++ if(d_list) ++ free(d_list); + return (ret); + } + #ifdef ABORT_DEEP_ISO_ONLY +@@ -1208,7 +1210,7 @@ + errmsgno(EX_BAD, "use Rock Ridge extensions via -R or -r,\n"); + errmsgno(EX_BAD, "or allow deep ISO9660 directory nesting via -D.\n"); + } +- closedir(current_dir); ++ free(d_list); + return (1); + } + #endif +@@ -1250,13 +1252,13 @@ + * The first time through, skip this, since we already asked + * for the first entry when we opened the directory. + */ +- if (dflag) +- d_entry = readdir(current_dir); ++ if (dflag && current_file >= 0) ++ d_entry = d_list[current_file]; + dflag++; + +- if (!d_entry) ++ if (current_file < 0) + break; +- ++ current_file--; + /* OK, got a valid entry */ + + /* If we do not want all files, then pitch the backups. */ +@@ -1348,7 +1350,7 @@ + insert_file_entry(this_dir, whole_path, d_entry->d_name); + #endif /* APPLE_HYB */ + } +- closedir(current_dir); ++ free(d_list); + + #ifdef APPLE_HYB + /* diff --git a/depends/patches/qt/fix_configure_mac.patch b/depends/patches/qt/fix_configure_mac.patch new file mode 100644 index 0000000..0d7dd64 --- /dev/null +++ b/depends/patches/qt/fix_configure_mac.patch @@ -0,0 +1,50 @@ +--- old/qtbase/mkspecs/features/mac/sdk.prf 2018-02-08 10:24:48.000000000 -0800 ++++ new/qtbase/mkspecs/features/mac/sdk.prf 2018-03-23 10:38:56.000000000 -0700 +@@ -8,21 +8,21 @@ + defineReplace(xcodeSDKInfo) { + info = $$1 + equals(info, "Path"): \ +- info = --show-sdk-path ++ infoarg = --show-sdk-path + equals(info, "PlatformPath"): \ +- info = --show-sdk-platform-path ++ infoarg = --show-sdk-platform-path + equals(info, "SDKVersion"): \ +- info = --show-sdk-version ++ infoarg = --show-sdk-version + sdk = $$2 + isEmpty(sdk): \ + sdk = $$QMAKE_MAC_SDK + + isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) { +- QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null") ++ QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$infoarg 2>/dev/null") + # --show-sdk-platform-path won't work for Command Line Tools; this is fine + # only used by the XCTest backend to testlib +- isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \ +- error("Could not resolve SDK $$info for \'$$sdk\'") ++ isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(infoarg, "--show-sdk-platform-path")): \ ++ error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg") + cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info}) + } + +--- old/qtbase/configure 2018-02-08 10:24:48.000000000 -0800 ++++ new/qtbase/configure 2018-03-23 05:42:29.000000000 -0700 +@@ -232,8 +232,13 @@ + + sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1") + if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi +- sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null) +- if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi ++ sysroot=$(getSingleQMakeVariable "QMAKE_MAC_SDK_PATH" "$1") ++ ++ echo "sysroot pre-configured as $sysroot"; ++ if [ -z "$sysroot" ]; then ++ sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null) ++ if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi ++ fi + + case "$sdk" in + macosx*) + + diff --git a/depends/patches/qt/fix_no_printer.patch b/depends/patches/qt/fix_no_printer.patch new file mode 100644 index 0000000..f868ca2 --- /dev/null +++ b/depends/patches/qt/fix_no_printer.patch @@ -0,0 +1,19 @@ +--- x/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h ++++ y/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h +@@ -52,6 +52,7 @@ + // + + #include ++#include + + #ifndef QT_NO_PRINTER + +--- x/qtbase/src/plugins/plugins.pro ++++ y/qtbase/src/plugins/plugins.pro +@@ -8,6 +8,3 @@ qtHaveModule(gui) { + qtConfig(imageformatplugin): SUBDIRS *= imageformats + !android:qtConfig(library): SUBDIRS *= generic + } +- +-!winrt:qtHaveModule(printsupport): \ +- SUBDIRS += printsupport diff --git a/depends/patches/qt/fix_qt_pkgconfig.patch b/depends/patches/qt/fix_qt_pkgconfig.patch new file mode 100644 index 0000000..34302a9 --- /dev/null +++ b/depends/patches/qt/fix_qt_pkgconfig.patch @@ -0,0 +1,11 @@ +--- old/qtbase/mkspecs/features/qt_module.prf ++++ new/qtbase/mkspecs/features/qt_module.prf +@@ -245,7 +245,7 @@ + load(qt_targets) + + # this builds on top of qt_common +-!internal_module:!lib_bundle:if(unix|mingw) { ++unix|mingw { + CONFIG += create_pc + QMAKE_PKGCONFIG_DESTDIR = pkgconfig + host_build: \ diff --git a/depends/patches/qt/fix_rcc_determinism.patch b/depends/patches/qt/fix_rcc_determinism.patch new file mode 100644 index 0000000..c1b07fe --- /dev/null +++ b/depends/patches/qt/fix_rcc_determinism.patch @@ -0,0 +1,15 @@ +--- old/qtbase/src/tools/rcc/rcc.cpp ++++ new/qtbase/src/tools/rcc/rcc.cpp +@@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) + if (lib.formatVersion() >= 2) { + // last modified time stamp + const QDateTime lastModified = m_fileInfo.lastModified(); +- lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0)); ++ quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0); ++ static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(); ++ if (sourceDate != 0) ++ lastmod = sourceDate; ++ lib.writeNumber8(lastmod); + if (text || pass1) + lib.writeChar('\n'); + } diff --git a/depends/patches/qt/fix_riscv64_arch.patch b/depends/patches/qt/fix_riscv64_arch.patch new file mode 100644 index 0000000..e7f29f0 --- /dev/null +++ b/depends/patches/qt/fix_riscv64_arch.patch @@ -0,0 +1,14 @@ +diff --git a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h +index 20bfd36..93729fa 100644 +--- a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h ++++ b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h +@@ -65,7 +65,8 @@ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ +- defined(__AARCH64EL__) ++ defined(__AARCH64EL__) || defined(__aarch64__) || \ ++ defined(__riscv) + #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 + #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) + #if defined(_WIN32) diff --git a/depends/patches/qt/fix_s390x_powerpc_mips_mipsel_architectures.patch b/depends/patches/qt/fix_s390x_powerpc_mips_mipsel_architectures.patch new file mode 100644 index 0000000..57328cf --- /dev/null +++ b/depends/patches/qt/fix_s390x_powerpc_mips_mipsel_architectures.patch @@ -0,0 +1,17 @@ +diff --git a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h +index 93729fae..398988c8 100644 +--- a/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h ++++ b/qtbase/src/3rdparty/double-conversion/include/double-conversion/utils.h +@@ -60,9 +60,9 @@ + #if defined(_M_X64) || defined(__x86_64__) || \ + defined(__ARMEL__) || defined(__avr32__) || _M_ARM_FP || \ + defined(__hppa__) || defined(__ia64__) || \ +- defined(__mips__) || \ +- defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ +- defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ ++ defined(__mips__) || defined(__mipsel__) || defined(__i386__) || \ ++ defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) || defined(__powerpc64el__) || defined(__ppc64el__) || \ ++ defined(__sparc__) || defined(__sparc) || defined(__s390__) || defined(__s390x__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) || defined(__aarch64__) || \ diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf new file mode 100644 index 0000000..337d0eb --- /dev/null +++ b/depends/patches/qt/mac-qmake.conf @@ -0,0 +1,26 @@ +MAKEFILE_GENERATOR = UNIX +CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname +QMAKE_INCREMENTAL_STYLE = sublib +include(../common/macx.conf) +include(../common/gcc-base-mac.conf) +include(../common/clang.conf) +include(../common/clang-mac.conf) +QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} +QMAKE_XCODE_VERSION=4.3 +QMAKE_XCODE_DEVELOPER_PATH=/Developer +QMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION} +QMAKE_MAC_SDK=macosx +QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH} +QMAKE_MAC_SDK.macosx.platform_name = macosx +QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION} +QMAKE_MAC_SDK.macosx.PlatformPath = /phony +QMAKE_APPLE_DEVICE_ARCHS=x86_64 +!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} +!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS +!host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION} +QMAKE_AR = $${CROSS_COMPILE}ar cq +QMAKE_RANLIB=$${CROSS_COMPILE}ranlib +QMAKE_LIBTOOL=$${CROSS_COMPILE}libtool +QMAKE_INSTALL_NAME_TOOL=$${CROSS_COMPILE}install_name_tool +load(qt_config) diff --git a/depends/patches/qt/xkb-default.patch b/depends/patches/qt/xkb-default.patch new file mode 100644 index 0000000..165abf3 --- /dev/null +++ b/depends/patches/qt/xkb-default.patch @@ -0,0 +1,26 @@ +--- old/qtbase/src/gui/configure.pri 2018-06-06 17:28:10.000000000 -0400 ++++ new/qtbase/src/gui/configure.pri 2018-08-17 18:43:01.589384567 -0400 +@@ -43,18 +43,11 @@ + } + + defineTest(qtConfTest_xkbConfigRoot) { +- qtConfTest_getPkgConfigVariable($${1}): return(true) +- +- for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) { +- exists($$dir) { +- $${1}.value = $$dir +- export($${1}.value) +- $${1}.cache += value +- export($${1}.cache) +- return(true) +- } +- } +- return(false) ++ $${1}.value = "/usr/share/X11/xkb" ++ export($${1}.value) ++ $${1}.cache += value ++ export($${1}.cache) ++ return(true) + } + + defineTest(qtConfTest_qpaDefaultPlatform) { diff --git a/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch b/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch new file mode 100644 index 0000000..b911ac5 --- /dev/null +++ b/depends/patches/zeromq/0001-fix-build-with-older-mingw64.patch @@ -0,0 +1,30 @@ +From f6866b0f166ad168618aae64c7fbee8775d3eb23 Mon Sep 17 00:00:00 2001 +From: mruddy <6440430+mruddy@users.noreply.github.com> +Date: Sat, 30 Jun 2018 09:44:58 -0400 +Subject: [PATCH] fix build with older mingw64 + +--- + src/windows.hpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/windows.hpp b/src/windows.hpp +index 6c3839fd..2c32ec79 100644 +--- a/src/windows.hpp ++++ b/src/windows.hpp +@@ -58,6 +58,13 @@ + #include + #include + #include ++ ++#if defined __MINGW64_VERSION_MAJOR && __MINGW64_VERSION_MAJOR < 4 ++// Workaround for mingw-w64 < v4.0 which did not include ws2ipdef.h in iphlpapi.h. ++// Fixed in mingw-w64 by 9bd8fe9148924840d315b4c915dd099955ea89d1. ++#include ++#include ++#endif + #include + + #if !defined __MINGW32__ +-- +2.17.1 + diff --git a/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch b/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch new file mode 100644 index 0000000..022e311 --- /dev/null +++ b/depends/patches/zeromq/0002-disable-pthread_set_name_np.patch @@ -0,0 +1,35 @@ +From c9bbdd6581d07acfe8971e4bcebe278a3676cf03 Mon Sep 17 00:00:00 2001 +From: mruddy <6440430+mruddy@users.noreply.github.com> +Date: Sat, 30 Jun 2018 09:57:18 -0400 +Subject: [PATCH] disable pthread_set_name_np + +pthread_set_name_np adds a Glibc requirement on >= 2.12. +--- + src/thread.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/thread.cpp b/src/thread.cpp +index a1086b0c..9943f354 100644 +--- a/src/thread.cpp ++++ b/src/thread.cpp +@@ -307,7 +307,7 @@ void zmq::thread_t::setThreadName (const char *name_) + */ + if (!name_) + return; +- ++#if 0 + #if defined(ZMQ_HAVE_PTHREAD_SETNAME_1) + int rc = pthread_setname_np (name_); + if (rc) +@@ -323,6 +323,8 @@ void zmq::thread_t::setThreadName (const char *name_) + #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME) + pthread_set_name_np (descriptor, name_); + #endif ++#endif ++ return; + } + + #endif +-- +2.17.1 + diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 0000000..cef6e7b --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1 @@ +Doxyfile \ No newline at end of file diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in new file mode 100644 index 0000000..c5c98b8 --- /dev/null +++ b/doc/Doxyfile.in @@ -0,0 +1,2460 @@ +# Doxyfile 1.8.12 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Versess Coin" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = @PACKAGE_VERSION@ + +# 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 a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "P2P Digital Currency" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = doc/bitcoin_logo_doxygen.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = src/leveldb \ + src/json \ + src/test \ + src/qt/test + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = boost \ + google + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = io.versess.Versess + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = io.versess.Versess + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /