Libbitcoin Build: Difference between revisions
No edit summary |
m →Dependencies: update URL to moved GSL repo (owner passed away without transfer). |
||
(6 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
==Generated Artifacts== | ==Generated Artifacts== | ||
.travis.yml | .travis.yml | ||
appveyor.yml | |||
autogen.sh | autogen.sh | ||
configure.ac | configure.ac | ||
Line 13: | Line 14: | ||
==Design Overview== | ==Design Overview== | ||
The Libbitcoin build system uses [https://github.com/imatix/gsl GSL] for generation of build artifacts from a declarative XML model of each repository<ref>[https://github.com/libbitcoin/libbitcoin-build/blob/master/generate.xml Libbitcoin Declarative Build Model]</ref>. The system also enumerates source files within each repository in order to generate a master [library].hpp and Makefile.am. Visual Studio projects and solutions are not currently generated<ref>[https://github.com/libbitcoin/libbitcoin-build/blob/master/README.md Libbitcoin Build README.md]</ref>. | The Libbitcoin build system uses [https://github.com/imatix/gsl GSL] for generation of build artifacts from a declarative XML model of each repository<ref>[https://github.com/libbitcoin/libbitcoin-build/blob/master/generate.xml Libbitcoin Declarative Build Model]</ref>. The system also enumerates source files within each repository in order to generate a master [library].hpp and Makefile.am. Visual Studio projects and solutions are not currently generated<ref>[https://github.com/libbitcoin/libbitcoin-build/blob/master/README.md Libbitcoin Build README.md]</ref>.. | ||
==Change Control Process== | ==Change Control Process== | ||
Line 19: | Line 20: | ||
==Example Repository Model== | ==Example Repository Model== | ||
<repository name="libbitcoin-consensus" version=" | <repository name="libbitcoin-consensus" version="2.0.0" email="eric@voskuil.org" > | ||
<package library="bitcoin-consensus" description="Libbitcoin Consensus Library" url="https://github.com/libbitcoin/libbitcoin-consensus" /> | <package library="bitcoin-consensus" description="Libbitcoin Consensus Library" url="https://github.com/libbitcoin/libbitcoin-consensus" /> | ||
Line 26: | Line 27: | ||
<option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." /> | <option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." /> | ||
<option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." /> | <option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." /> | ||
<option type="enable" name="ndebug" default="yes" define="NDEBUG" description="Compile without debug assertions." /> | <option type="enable" name="ndebug" default="yes" define="NDEBUG" description="Compile without debug assertions." /> | ||
<option type="enable" name="shared" default="yes" define="BOOST_TEST_DYN_LINK" inherited="true" description="Required for dynamically linking boost test." /> | <option type="enable" name="shared" default="yes" define="BOOST_TEST_DYN_LINK" inherited="true" description="Required for dynamically linking boost test." /> | ||
<dependency name="boost" compiler="gcc" version="1.55.0" option="tests" /> | <dependency name="boost" compiler="gcc" version="1.55.0" option="tests" /> | ||
<dependency name="boost" compiler="clang" version="1. | <dependency name="boost" compiler="clang" version="1.56.0" option="tests" /> | ||
<dependency name="boost_unit_test_framework" option="tests" /> | <dependency name="boost_unit_test_framework" option="tests" /> | ||
<dependency name="secp256k1" version="0.0.1" /> | |||
<dependency name="secp256k1" version="0.0.1 | |||
<flag name="Wall" comment="Warn on all stuff." context="c" /> | <flag name="Wall" comment="Warn on all stuff." context="c" /> | ||
Line 46: | Line 40: | ||
<flag name="Wno-missing-braces" comment="Conform to style." context="c++" /> | <flag name="Wno-missing-braces" comment="Conform to style." context="c++" /> | ||
<flag name="Wno-mismatched-tags" compiler="clang" comment="Conflict in stdlib under clang." context="c++" /> | <flag name="Wno-mismatched-tags" compiler="clang" comment="Conflict in stdlib under clang." context="c++" /> | ||
<flag name="fstack-protector" comment="Protect stack." context="link" /> | <flag name="fstack-protector" comment="Protect stack." context="link" /> | ||
<flag name="fstack-protector-all" comment="Protect stack comprehensively." context="link" /> | <flag name="fstack-protector-all" comment="Protect stack comprehensively." context="link" /> | ||
Line 67: | Line 60: | ||
</product> | </product> | ||
<product prefix="lib" path="src" name="bitcoin-consensus" uuid="6c521d95-00ce-4120-97d1-430e2870d738" > | <product prefix="lib" path="src" name="bitcoin-consensus" uuid="6c521d95-00ce-4120-97d1-430e2870d738" > | ||
<library name="secp256k1" /> | <library name="secp256k1" /> | ||
<headers path="include" /> | <headers path="include" /> | ||
<headers path="src" /> | <headers path="src" /> | ||
<headers path="src/clone" /> | |||
<sources path="src" /> | <sources path="src" /> | ||
</product> | </product> | ||
<product prefix="bin" path="test" name="libbitcoin_consensus_test" test="true" option="tests" uuid="d282ef8c-6217-483c-ac47-864b2fba50fd" > | <product prefix="bin" path="test" name="libbitcoin_consensus_test" test="true" option="tests" uuid="d282ef8c-6217-483c-ac47-864b2fba50fd" > | ||
<runner | <runner/> | ||
<library name="bitcoin-consensus" /> | <library name="bitcoin-consensus" /> | ||
<library name="boost" /> | <library name="boost" /> | ||
Line 80: | Line 73: | ||
<headers path="include" /> | <headers path="include" /> | ||
<headers path="src" /> | <headers path="src" /> | ||
<headers path="src/clone" /> | |||
<sources path="test" /> | <sources path="test" /> | ||
</product> | </product> | ||
<product prefix="include" container="bitcoin" > | <product prefix="include" container="bitcoin" > | ||
<files path="include/bitcoin" /> | <files path="include/bitcoin" /> | ||
</product> | </product> | ||
</make> | </make> | ||
<install> | <install> | ||
<build name="boost" version="1.56.0" parallel="true"> | |||
<build name="boost" version="1. | |||
<option value="--with-system" /> | <option value="--with-system" /> | ||
<option value="--with-test" /> | <option value="--with-test" /> | ||
</build> | </build> | ||
<build name="secp256k1" github="libbitcoin" repository="secp256k1" branch="version4" parallel="true" > | |||
<build name="secp256k1" github="libbitcoin" repository="secp256k1" branch=" | |||
<option value="--disable-tests" /> | <option value="--disable-tests" /> | ||
<option value="-- | <option value="--enable-module-recovery" /> | ||
</build> | </build> | ||
<build name="bitcoin-consensus" github="libbitcoin" repository="libbitcoin-consensus" branch=" | <build name="bitcoin-consensus" github="libbitcoin" repository="libbitcoin-consensus" branch="version2" parallel="true" > | ||
<option value="${with_boost}" /> | <option value="${with_boost}" /> | ||
<option value="${with_pkgconfigdir}" /> | <option value="${with_pkgconfigdir}" /> | ||
Line 130: | Line 98: | ||
<matrix> | <matrix> | ||
<job system="osx" compiler="clang" link="static" > | <job system="osx" compiler="clang" link="static" > | ||
<option value="--disable-shared" /> | <option value="--disable-shared" /> | ||
<option value="--build-boost" /> | <option value="--build-boost" /> | ||
<option value="--prefix=$ | <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> | ||
</job> | </job> | ||
<job system="linux" compiler="clang" link="static" > | <job system="linux" compiler="clang" link="static" > | ||
<option value="--disable-shared" /> | <option value="--disable-shared" /> | ||
<option value="--build-boost" /> | <option value="--build-boost" /> | ||
<option value="--prefix=$ | <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> | ||
<option value=" | <option value="CFLAGS='-Os'" /> | ||
<option value=" | <option value="CXXFLAGS='-Os'" /> | ||
</job> | </job> | ||
<job system="linux" compiler="gcc" link="static" coverage="true" > | <job system="linux" compiler="gcc" link="static" coverage="true" > | ||
< | <exclude path="clone/*" /> | ||
<option value="--disable-shared" /> | <option value="--disable-shared" /> | ||
<option value="--build-boost" /> | <option value="--build-boost" /> | ||
<option value="--build-dir=my-build" /> | <option value="--build-dir=my-build" /> | ||
<option value=" | <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> | ||
<option value="CFLAGS='-O0 -g --coverage'" /> | |||
<option value="CXXFLAGS='-O0 -g --coverage'" /> | |||
</job> | </job> | ||
<job system="osx" compiler="clang" link="dynamic" > | <job system="osx" compiler="clang" link="dynamic" > | ||
<get name="boost" /> | |||
</job> | </job> | ||
<job system="linux" compiler="clang" link="dynamic" sudo="true" > | <job system="linux" compiler="clang" link="dynamic" sudo="true" > | ||
<get name="boost1. | <!-- This version isn't available in the repository. --> | ||
<!--<get name="boost1.56" />--> | |||
<option value="-- | <option value="--build-boost" /> | ||
<option value="--disable-ndebug" /> | <option value="--disable-ndebug" /> | ||
<option value="--disable-static" /> | <option value="--disable-static" /> | ||
<option value=" | <option value="CFLAGS='-Os'" /> | ||
<option value=" | <option value="CXXFLAGS='-Os'" /> | ||
</job> | </job> | ||
<job system="linux" compiler="gcc" link="dynamic" sudo="true" > | <job system="linux" compiler="gcc" link="dynamic" sudo="true" > | ||
<option value="--disable-static" /> | <option value="--disable-static" /> | ||
<option value="--build-boost" /> | <option value="--build-boost" /> | ||
<option value="CFLAGS='-Os -s'" /> | |||
<option value="CXXFLAGS='-Os -s'" /> | <option value="CXXFLAGS='-Os -s'" /> | ||
</job> | </job> | ||
Line 195: | Line 141: | ||
==Dependencies== | ==Dependencies== | ||
* [https://github.com/ | * [https://github.com/zeromq/gsl GSL/4.1 - Universal Code Generator] | ||
==See Also== | ==See Also== |
Latest revision as of 01:27, 9 March 2021
The libbitcoin-build repository is used by Libbitcoin maintainers to generate Autotols and other build artifacts from declarative sources. The purpose of the library is to maintain build quality and consistency across the Libbitcoin repositories without unnecessarily restricting contributions.
Generated Artifacts
.travis.yml appveyor.yml autogen.sh configure.ac install.sh [library].pc.in [library]_test_runner.sh Makefile.am include/bitcoin/[library].hpp include/bitcoin/[library]/version.hpp
Design Overview
The Libbitcoin build system uses GSL for generation of build artifacts from a declarative XML model of each repository[1]. The system also enumerates source files within each repository in order to generate a master [library].hpp and Makefile.am. Visual Studio projects and solutions are not currently generated[2]..
Change Control Process
Maintainers generate and push resulting artifacts to each of the other repositories so that contributors have familiar context. Contributors to a given repository can edit the generated artifacts and later maintainers can determine whether to retain changes by incorporating them into the model. This allows less experienced contributors to introduce changes for review without introducing fragility into user-facing build, install and packaging processes.
Example Repository Model
<repository name="libbitcoin-consensus" version="2.0.0" email="eric@voskuil.org" > <package library="bitcoin-consensus" description="Libbitcoin Consensus Library" url="https://github.com/libbitcoin/libbitcoin-consensus" /> <configure> <option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." /> <option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." /> <option type="enable" name="ndebug" default="yes" define="NDEBUG" description="Compile without debug assertions." /> <option type="enable" name="shared" default="yes" define="BOOST_TEST_DYN_LINK" inherited="true" description="Required for dynamically linking boost test." /> <dependency name="boost" compiler="gcc" version="1.55.0" option="tests" /> <dependency name="boost" compiler="clang" version="1.56.0" option="tests" /> <dependency name="boost_unit_test_framework" option="tests" /> <dependency name="secp256k1" version="0.0.1" /> <flag name="Wall" comment="Warn on all stuff." context="c" /> <flag name="Wextra" comment="Warn on extra stuff." context="c" /> <flag name="Wpedantic" alternate="pedantic" comment="Be really annoying." context="c" /> <flag name="Wno-missing-braces" comment="Conform to style." context="c++" /> <flag name="Wno-mismatched-tags" compiler="clang" comment="Conflict in stdlib under clang." context="c++" /> <flag name="fstack-protector" comment="Protect stack." context="link" /> <flag name="fstack-protector-all" comment="Protect stack comprehensively." context="link" /> <flag name="fvisibility-hidden" compiler="gcc" comment="Hide internal functions from external libs." context="c++" /> <flag name="fvisibility-inlines-hidden" compiler="gcc" comment="Hide inlines from external libs." context="c++" /> </configure> <make> <product prefix="pkgconfig" > <file path="libbitcoin-consensus.pc" /> </product> <product prefix="doc" > <file path="AUTHORS" /> <file path="COPYING" /> <file path="ChangeLog" /> <file path="INSTALL" /> <file path="NEWS" /> <file path="README" /> </product> <product prefix="lib" path="src" name="bitcoin-consensus" uuid="6c521d95-00ce-4120-97d1-430e2870d738" > <library name="secp256k1" /> <headers path="include" /> <headers path="src" /> <headers path="src/clone" /> <sources path="src" /> </product> <product prefix="bin" path="test" name="libbitcoin_consensus_test" test="true" option="tests" uuid="d282ef8c-6217-483c-ac47-864b2fba50fd" > <runner/> <library name="bitcoin-consensus" /> <library name="boost" /> <library name="boost_unit_test_framework" /> <headers path="include" /> <headers path="src" /> <headers path="src/clone" /> <sources path="test" /> </product> <product prefix="include" container="bitcoin" > <files path="include/bitcoin" /> </product> </make> <install> <build name="boost" version="1.56.0" parallel="true"> <option value="--with-system" /> <option value="--with-test" /> </build> <build name="secp256k1" github="libbitcoin" repository="secp256k1" branch="version4" parallel="true" > <option value="--disable-tests" /> <option value="--enable-module-recovery" /> </build> <build name="bitcoin-consensus" github="libbitcoin" repository="libbitcoin-consensus" branch="version2" parallel="true" > <option value="${with_boost}" /> <option value="${with_pkgconfigdir}" /> </build> </install> <matrix> <job system="osx" compiler="clang" link="static" > <option value="--disable-shared" /> <option value="--build-boost" /> <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> </job> <job system="linux" compiler="clang" link="static" > <option value="--disable-shared" /> <option value="--build-boost" /> <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> <option value="CFLAGS='-Os'" /> <option value="CXXFLAGS='-Os'" /> </job> <job system="linux" compiler="gcc" link="static" coverage="true" > <exclude path="clone/*" /> <option value="--disable-shared" /> <option value="--build-boost" /> <option value="--build-dir=my-build" /> <option value="--prefix=$TRAVIS_BUILD_DIR/my-prefix" /> <option value="CFLAGS='-O0 -g --coverage'" /> <option value="CXXFLAGS='-O0 -g --coverage'" /> </job> <job system="osx" compiler="clang" link="dynamic" > <get name="boost" /> </job> <job system="linux" compiler="clang" link="dynamic" sudo="true" > <option value="--build-boost" /> <option value="--disable-ndebug" /> <option value="--disable-static" /> <option value="CFLAGS='-Os'" /> <option value="CXXFLAGS='-Os'" /> </job> <job system="linux" compiler="gcc" link="dynamic" sudo="true" > <option value="--disable-static" /> <option value="--build-boost" /> <option value="CFLAGS='-Os -s'" /> <option value="CXXFLAGS='-Os -s'" /> </job> </matrix> </repository>