Bootstrap GNU Autotools Cplusplus Project

A Free Software Skeleton with C++ Superpowers!

The general idea for this how-to is to jump-start your GNU Autotools C++ project without going through all the hoops in getting started. This point of reference allows you to learn from the example shared at: and provides a quick reference location that can be accessed anywhere in the Cosmos with computer technology.

Going through many examples can be tiring and this point of reference is a super start for getting started with GNU Autotools and also a great place to begin with C++.


  • GCC
  • GNU Autotools

Steps to Reproduce A Cpp Autotools Sandbox

  1. Make root project directory e.g. /cpp-sandbox
  2. Make project directories for organizing. e.g. ./build, ./test, ./m4, ./src
  3. Make touch and edit it to your project needs.

    A simple example

    # reduce warnings/errors
    AUTOMAKE_OPTIONS = subdir-objects
    # the name of the binary file
    bin_PROGRAMS = sandbox
    # various *.cpp and *.h files for the root project; the '\' implies a *newline*
    sandbox_SOURCES = \
  4. optional: use autoscan command. Autoscan creates a configure.log and configure.autoscan file that will need to be renamed to too work with autotools formatting regulations.

    The autoscan utility creates a template that can use for your project, rather than remembering and manually typing these features for your new GNU project.
  5. then we let autoreconf do the work: autreconf -vi

    Anytime you modify or create a, you must reconfigure the autoconf system. -v = verbose -i = copy missing aux files. see man autoreconf
  6. cd build and ../configure This keeps autoconf files separate from project files and creates a Makefile.
  7. then, to compile the sandbox program we run make while in the ./build dir.

    If we update our main.cpp, then we only need to re-run make, but if we update the, then we must repeat step 5.
  8. optional: to install the program into core operating system, we use make install. Prefixing must also be configured if needing a custom install location, see man make --prefix.
  9. optional: cleanup and initialize the repository for git version management.
  • Initialize git with git init
  • Add a .gitignore file touch .gitignore
  • Add the following to your .gitignore; this is a default we make use of for our GNU autotools cpp project.
# exclude all build dir files
# exclude any *.o files in src dir
# exclude executables
# exclude any .env files in root project for securities sake
# exclude any project files created from IDE
# Generated Makefile
# (meta build system like autotools,
# can automatically generate from config.status script
# (which is called by configure script))


  1. Creating a Simple Autotools Based Project - Aaron Carlow
  2. Clean Automake:
  3. Git Ignore Documentation:
  4. Source Files

Financial Support & Donations

I drive, design, write code, ponder and deep dive into critical questions of the present epoch.

  • Liberapay is a recurrent donations platform
  • Run by a non-profit organization
  • Source code is public
  • No commission fee
  • ~5% payment processing fee