bitcoin/bitcoin — pull request #2748 by theuni (2013-06-07 08:55:20+00:00)
Title: Autotools RFC: Round 1

Here is the first go at an Autotools build system replacement. It is meant to be a drop-in replacement for the current system(s), providing the same features with no net changes. It can also live side-by-side with the old system while sharing the same build-related variables in order to facilitate a smooth transition.

I hope the benefits are obvious enough: A single/shared build procedure, portability, ease of packaging, ease for downstreams, ease for repository maintainers, cross-compilation, etc. I don't vouch for Autotools in any way, in fact, this configure.am is downright ugly (mainly just because of mingw though), but it's portable and well-established.

I've opted not to write the documentation yet, because I would like to see what comments/concerns come out of the first round of review before committing to anything.

This does away with the need for qmake, as the Makefile is capable of generating everything it needs in a portable way.

Qt-creator can be used with the Autotools plugin, and is working nicely. For those who wish to use it this way, install the Autotools plugin from the 'about' menu, then open Makefile.am as a project. It handles the build procedure, so there is no need to mess with the command-line procedures listed below.

Building from CLI:
For Linux, assuming the dependencies have been met, the build procedure looks like this:
```
./autogen.sh
./configure
make
```

Same for OS X, but the pkg-config path needs to be hooked up from macports first:
```
echo "/opt/local/share/aclocal" | sudo tee -a /usr/share/aclocal/dirlist
```

For mingw it's the same, but you will need to provide lots of paths in the form of:
```
./autogen.sh
CPPFLAGS="-I/path/to/include -I/path/to/other/include" LDFLAGS="-L/path/to/libs -L/path/to/other/libs" ./configure
make
```

In addition, there are helpers for qt and boost to help with finding some locations.
Use ./configure --help to see the available options.

Native windows built is untested, as I don't have a windows environment at my disposal.

I have verified that linux builds are deterministic insofar as a fresh git clone will build bit-exact binaries to match another clean checkout on the same machine. To my knowledge, that means that gitian shouldn't have any trouble making the switch (after the descriptors are updated to use autotools).

'make check' will run the unit tests and print the results.

I've done my best to avoid adding any new behavior or features, and I would much prefer to aim for feature-parity before making any improvements.

TODO:
- Update gitian descriptors.
- Add documentation to reflect comments here
- Cosmetics