autotools: switch to autotools buildsystem
This commit is contained in:
@@ -5,10 +5,12 @@ Some notes on how to build Bitcoin in Unix.
|
||||
To Build
|
||||
---------------------
|
||||
|
||||
cd src/
|
||||
make -f makefile.unix # Headless bitcoin
|
||||
./autogen.sh
|
||||
./configure
|
||||
make
|
||||
|
||||
See [readme-qt.md](readme-qt.md) for instructions on building Bitcoin-Qt, the graphical user interface.
|
||||
This will build bitcoin-qt as well if the dependencies are met.
|
||||
See [readme-qt.md](readme-qt.md) for more information.
|
||||
|
||||
Dependencies
|
||||
---------------------
|
||||
@@ -22,15 +24,15 @@ Dependencies
|
||||
|
||||
[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping. It can be downloaded from [here](
|
||||
http://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
|
||||
turned off by default. Set USE_UPNP to a different value to control this:
|
||||
turned off by default. See the configure options for upnp behavior desired:
|
||||
|
||||
USE_UPNP= No UPnP support miniupnp not required
|
||||
USE_UPNP=0 (the default) UPnP support turned off by default at runtime
|
||||
USE_UPNP=1 UPnP support turned on by default at runtime
|
||||
--with-miniupnpc No UPnP support miniupnp not required
|
||||
--disable-upnp-default (the default) UPnP support turned off by default at runtime
|
||||
--enable-upnp-default UPnP support turned on by default at runtime
|
||||
|
||||
IPv6 support may be disabled by setting:
|
||||
|
||||
USE_IPV6=0 Disable IPv6 support
|
||||
--disable-ipv6 Disable IPv6 support
|
||||
|
||||
Licenses of statically linked libraries:
|
||||
Berkeley DB New BSD license with additional requirement that linked
|
||||
@@ -70,7 +72,7 @@ for other Ubuntu & Debian:
|
||||
|
||||
Optional:
|
||||
|
||||
sudo apt-get install libminiupnpc-dev (see USE_UPNP compile flag)
|
||||
sudo apt-get install libminiupnpc-dev (see --with-miniupnpc and --enable-upnp-default)
|
||||
|
||||
|
||||
Dependency Build Instructions: Gentoo
|
||||
@@ -83,8 +85,9 @@ Note: If you just want to install bitcoind on Gentoo, you can add the Bitcoin ov
|
||||
|
||||
Take the following steps to build (no UPnP support):
|
||||
|
||||
cd ${BITCOIN_DIR}/src
|
||||
make -f makefile.unix USE_UPNP= USE_IPV6=1 BDB_INCLUDE_PATH='/usr/include/db4.8'
|
||||
cd ${BITCOIN_DIR}
|
||||
./autogen.sh
|
||||
./configure --without-miniupnpc CXXFLAGS="-i/usr/include/db4.8"
|
||||
strip bitcoind
|
||||
|
||||
|
||||
@@ -123,7 +126,13 @@ If you need to build Boost yourself:
|
||||
Security
|
||||
--------
|
||||
To help make your bitcoin installation more secure by making certain attacks impossible to
|
||||
exploit even if a vulnerability is found, you can take the following measures:
|
||||
exploit even if a vulnerability is found, binaries are hardened by default.
|
||||
This can be disabled with:
|
||||
|
||||
./configure --enable-hardening
|
||||
|
||||
|
||||
Hardening enables the following features:
|
||||
|
||||
* Position Independent Executable
|
||||
Build position independent code to take advantage of Address Space Layout Randomization
|
||||
@@ -135,10 +144,6 @@ exploit even if a vulnerability is found, you can take the following measures:
|
||||
On an Amd64 processor where a library was not compiled with -fPIC, this will cause an error
|
||||
such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;"
|
||||
|
||||
To build with PIE, use:
|
||||
|
||||
make -f makefile.unix ... -e PIE=1
|
||||
|
||||
To test that you have built PIE executable, install scanelf, part of paxutils, and use:
|
||||
|
||||
scanelf -e ./bitcoin
|
||||
|
||||
@@ -31,14 +31,8 @@ For Qt 5 you need the following, otherwise you get an error with lrelease when r
|
||||
|
||||
apt-get install qt5-qmake libqt5gui5 libqt5core5 libqt5dbus5 qttools5-dev-tools
|
||||
|
||||
then execute the following:
|
||||
|
||||
qmake
|
||||
make
|
||||
|
||||
Alternatively, install [Qt Creator](http://qt-project.org/downloads/) and open the `bitcoin-qt.pro` file.
|
||||
An executable named `bitcoin-qt` will be built.
|
||||
|
||||
Once these are installed, they will be found by configure and bitcoin-qt will be
|
||||
built by default.
|
||||
|
||||
|
||||
### Mac OS X
|
||||
@@ -55,52 +49,31 @@ An executable named `bitcoin-qt` will be built.
|
||||
brew update
|
||||
brew install boost miniupnpc openssl berkeley-db4 protobuf
|
||||
|
||||
- If using HomeBrew, edit `bitcoin-qt.pro` to account for library location differences. There's a diff in `contrib/homebrew/bitcoin-qt-pro.patch` that shows what you need to change, or you can just patch by doing
|
||||
|
||||
patch -p1 < contrib/homebrew/bitcoin.qt.pro.patch
|
||||
|
||||
- Open the bitcoin-qt.pro file in Qt Creator and build as normal (cmd+B)
|
||||
|
||||
|
||||
Build Configuration Options
|
||||
---------------------
|
||||
|
||||
### UPnP port forwarding
|
||||
|
||||
To use UPnP for port forwarding behind a NAT router (recommended, as more connections overall allow for a faster and more stable bitcoin experience), pass the following argument to qmake:
|
||||
UPnP support is compiled in when possible and turned off by default. See the
|
||||
configure options for upnp behavior desired:
|
||||
|
||||
|
||||
|
||||
qmake "USE_UPNP=1"
|
||||
|
||||
(in **Qt Creator**, you can find the setting for additional qmake arguments under "Projects" -> "Build Settings" -> "Build Steps", then click "Details" next to **qmake**)
|
||||
|
||||
This requires miniupnpc for UPnP port mapping. It can be downloaded from [here](
|
||||
http://miniupnp.tuxfamily.org/files/). UPnP support is not compiled in by default.
|
||||
|
||||
Set USE_UPNP to a different value to control this:
|
||||
|
||||
|
||||
USE_UPNP=- no UPnP support, miniupnpc not required;
|
||||
USE_UPNP=0 (the default) built with UPnP, support turned off by default at runtime;
|
||||
USE_UPNP=1 build with UPnP support turned on by default at runtime.
|
||||
--with-miniupnpc No UPnP support miniupnp not required
|
||||
--disable-upnp-default (the default) UPnP support turned off by default at runtime
|
||||
--enable-upnp-default UPnP support turned on by default at runtime
|
||||
|
||||
### Notification support for recent (k)ubuntu versions
|
||||
|
||||
To see desktop notifications on (k)ubuntu versions starting from 10.04, enable usage of the
|
||||
FreeDesktop notification interface through DBUS using the following qmake option:
|
||||
DBUS support is enabled by default if dependencies are met.
|
||||
|
||||
|
||||
|
||||
qmake "USE_DBUS=1"
|
||||
See the --with-qtdbus configure option.
|
||||
|
||||
### Generation of QR codes
|
||||
|
||||
[libqrencode](http://fukuchi.org/works/qrencode/) may be used to generate QRCode images for payment requests. Pass the USE_QRCODE flag to qmake to control this:
|
||||
[libqrencode](http://fukuchi.org/works/qrencode/) may be used to generate QRCode images for payment requests.
|
||||
|
||||
QR code support is enabled by default if dependencies are met.
|
||||
|
||||
USE_QRCODE=0 (the default) No QRCode support - libarcode not required
|
||||
USE_QRCODE=1 QRCode support enabled
|
||||
See the --with-qrencode configure option.
|
||||
|
||||
Warnings
|
||||
---------------------
|
||||
|
||||
@@ -1,35 +1,18 @@
|
||||
Compiling/running bitcoind unit tests
|
||||
Compiling/running unit tests
|
||||
------------------------------------
|
||||
|
||||
bitcoind unit tests are in the `src/test/` directory; they
|
||||
use the Boost::Test unit-testing framework.
|
||||
Unit tests will be automatically compiled if dependencies were met in configure
|
||||
and tests weren't explicitly disabled.
|
||||
|
||||
To compile and run the tests:
|
||||
After configuring, they can be run with 'make check'.
|
||||
|
||||
cd src
|
||||
make -f makefile.unix test_bitcoin # Replace makefile.unix if you're not on unix
|
||||
./test_bitcoin # Runs the unit tests
|
||||
To run the bitcoind tests manually, launch src/test/test_bitcoin .
|
||||
|
||||
If all tests succeed the last line of output will be:
|
||||
`*** No errors detected`
|
||||
|
||||
To add more tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
|
||||
To add more bitcoind tests, add `BOOST_AUTO_TEST_CASE` functions to the existing
|
||||
.cpp files in the test/ directory or add new .cpp files that
|
||||
implement new BOOST_AUTO_TEST_SUITE sections (the makefiles are
|
||||
set up to add test/*.cpp to test_bitcoin automatically).
|
||||
implement new BOOST_AUTO_TEST_SUITE sections.
|
||||
|
||||
To run the bitcoin-qt tests manualy, launch src/qt/test/bitcoin-qt_test
|
||||
|
||||
Compiling/running Bitcoin-Qt unit tests
|
||||
---------------------------------------
|
||||
|
||||
Bitcoin-Qt unit tests are in the src/qt/test/ directory; they
|
||||
use the Qt unit-testing framework.
|
||||
|
||||
To compile and run the tests:
|
||||
|
||||
qmake bitcoin-qt.pro BITCOIN_QT_TEST=1
|
||||
make
|
||||
./bitcoin-qt_test
|
||||
|
||||
To add more tests, add them to the `src/qt/test/` directory,
|
||||
the `src/qt/test/test_main.cpp` file, and bitcoin-qt.pro.
|
||||
To add more bitcoin-qt tests, add them to the `src/qt/test/` directory and
|
||||
the `src/qt/test/test_main.cpp` file.
|
||||
|
||||
Reference in New Issue
Block a user