bootstrap-cxx implements the basic tools needed to quickly write autotools-enabled C++11 applications. It is opinionated in the choices it makes regarding logging and unit-testing, and simply serves as a basis to quickly get going.
On Fedora 22, the following should get you going:
sudo dnf install gcc-c++ libstdc++-devel \
automake autoconf libtool sysconftool \
pkgconfig \
glog-devel gflags-develThe following is a list of the tools used in this repository:
- autotools, the main build system;
- Catch, the unit-test framework;
- glog, the Google logging framework.
Run the following command to initialise the build system:
./autogen.sh && ./configure
./autogen.sh needs to be run anytime you change configure.ac. After the
initial run, simply calling make will re-run ./configure if required.
To compile the code, simply run make -jN, where N is the number of cores you
want to use (for example, on a quad-core system, use make -j4). To run the
unit tests, run make -jN check.
The main customisation is going to take place in configure.ac. The third and
fourth lines would be where you'd put your projects details:
- package name ("My Great App");
- version ("1.6.8");
The last three are completely optional:
- bug-reporting email address;
- tarname (base name for the archive file);
- project URL.
Note: Instead of hard-coding your project name in the source, use the define'd values in config.hh:
#include "config.hh"
cout << "My project is: " << PACKAGE_NAME << endl;PACKAGE_NAME comes directly from the first argument (package name) passed to
AC_INIT.
The second area of customisation is the name of the binaries/libraries you'll
be compiling. Look at Makefile.am, and notice the 6th line: this is where you
define the name of your binary. You tell Automake which source files to compile
by changing the lines around bootstrap_cxx_SOURCES. Check the autotools
manual for more details.
Feel free to use this for whatever projects you'd like. There's not much to license in this repository, but for the sake of completeness, I'm putting this under the MIT License. See the LICENSE file for more details.