从源码编译比特币核心比特币核心(第三章)

币谈 ☉ 文
2018-02-09 @ 哈希力量严选

从源码编译比特币核心比特币核心(第三章)GKC哈希力量 | 智能的力量

仔细阅读 build 文档第一部分中 build 的必备条件。这些是在你编译之前你的系统上必须具备的库文件。如果缺少这些必备条件,构建过程将会出现错误并导致失败。如果因为缺少一个必备条件而发生这种情况,你可以先安装它,然后在你停下的地方重新构建。假设这些必备条件已经具备,你就可以开始构建过程,通过 authgen.sh 脚本,生成一组构建脚本。
GKC哈希力量 | 智能的力量

从源码编译比特币核心比特币核心(第三章)GKC哈希力量 | 智能的力量

从 v0.9 版本开始,比特币核心的构建过程改 autogen/configure/make 体系。旧版本是用一个简单的 Makefile,并且和下面的例子稍微有一点不同。请遵照你想要编译版本的说明文档。v0.9 版本引入autogen/configure/make 构建体系可能用于未来所有版本的代码,是下面的例子中演示的系统
GKC哈希力量 | 智能的力量

$ ./autogen.shGKC哈希力量 | 智能的力量

configure.ac:12: installing `src/build-aux/config.guess' configure.ac:12: installing `src/build-aux/config.sub' configure.ac:37: installing `src/build-aux/install-sh' configure.ac:37: installing `src/build-aux/missing' src/Makefile.am: installing `src/build-aux/depcomp'GKC哈希力量 | 智能的力量

$GKC哈希力量 | 智能的力量

autogen.sh 脚本创建了一系列的自动配置脚本,会询问你的系统以发现正确的设置,确保你已安装必要的库来编译源 码。这里面最重要的是 configure 脚本,它会提供许多不同的选项来定制构建过程。输入./configure --help 可以查看各种不同的选项:GKC哈希力量 | 智能的力量

$ ./configure --helpGKC哈希力量 | 智能的力量

`configure' configures Bitcoin Core 0.9.0 to adapt tomany kinds of systems.GKC哈希力量 | 智能的力量

Usage: ./configure [OPTION]... [VAR=VALUE]...GKC哈希力量 | 智能的力量

To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE.GKC哈希力量 | 智能的力量

Seebelowfordescriptionsofsomeoftheusefulvariables. Defaults for the options are specified inbrackets.GKC哈希力量 | 智能的力量

Configuration:GKC哈希力量 | 智能的力量

-h,--help display this help andexitGKC哈希力量 | 智能的力量

--help=short display options specific to this packageGKC哈希力量 | 智能的力量

--help=recursive display the short help of all the includedpackagesGKC哈希力量 | 智能的力量

-V, --version display version information and exit [...manymoreoptionsandvariablesaredisplayedbelow...] OptionalFeatures:GKC哈希力量 | 智能的力量

--disable-option-checking ignoreunrecognizedGKC哈希力量 | 智能的力量

--enable/--with optionsGKC哈希力量 | 智能的力量

--disable-FEATURE do not include FEATURE (sameasGKC哈希力量 | 智能的力量

--enable-FEATURE=no)GKC哈希力量 | 智能的力量

--enable-FEATURE[=ARG] include FEATURE [ARG=yes] [... more options...]GKC哈希力量 | 智能的力量

Use these variables to override the choices made byGKC哈希力量 | 智能的力量

`configure'ortohelpittofindlibrariesandprogramswith nonstandard names/locations.GKC哈希力量 | 智能的力量

Report bugs to .GKC哈希力量 | 智能的力量

$GKC哈希力量 | 智能的力量