Archive for the 'Autotools' Category

Published by Niels on 17 Jan 2014

Autotools Cookbook Notes, Part 3

In the previous instalment, Autotools were used to create a separate library from our source code. This time I will show how to add unit tests.

Unit testing is a very important tool for every software engineer and fortunately the Autotools provide us with an easy way to create and use unit tests. After creating the tests running them is as easy as running the following command on the command line:

make check

I will continue where I left of with the Autotools setup for libraries to show how to incorporate unit tests in your project based on the CppUnit. Why not one of the more recent C++ unit test environments such as the Boost Test Library or CxxTest? Simply because I am more experienced using CppUnit and know how to set up Autotools with it. In later instalments I will add setups for other testing frameworks but these setups will probably deviate not too much from the setup using CppUnit.

It is of course assumed that the CppUnit test framework is already installed on your machine. If not then the internet provides sufficient information on how to do so. Continue Reading »

Published by Niels on 26 Dec 2010

Autotools Cookbook Notes, Part 2

In the previous instalment a skeleton Autotools project was created. In this instalment the usage of libraries for the application code will be added. I like putting my application data into libraries as it makes it more convenient to reuse the code, e.g. when doing unit testing (which will be shown in a later instalment).

In this instalment a skeleton setup for handling libraries using Libtool will be presented. At the end the methods to link against the static or dynamic libraries will be shown. The created library will be a very trivial one but the created skeleton should be enough to expand on this.
Continue Reading »

Published by Niels on 25 Dec 2010

Autotools Cookbook Notes, Part 1

For most software projects that go past the trivial state a build environment can assist in helping with finding dependencies, providing alternatives, documentation creation, unit testing, etc. One of the most flexible environments are provided by the GNU Autotools, but setting up a new Autotools project can be a bit cumbersome. It always seem to give me the feeling that I have to rediscover everything about the GNU Autotools and to avoid making the same mistakes over and over again I kept a lot of notes. The disadvantage of personal notes are of course:

  • They get disorganized
  • They are hard to keep up-to-date
  • They are not always available
  • It is difficult to transfer the knowledge contained in them to another person

So therefore I decided to do what I always do to solve these issues: I publish the knowledge on a subject that I obtained so far on my homepage. It will be series of instalments, each building on the knowledge from the previous instalments. In this first instalment a trivial ‘Hello, World!’ project will be created. Later instalments will provide information on:

But more subjects might be added in the future. It is also most likely that new insights will be added to already published parts and I will try to indicate the new additions as good as possible.

Since I consider these my personal notes they are not a replacement for the full GNU Autotools documentation and other resources. For more in-depth information the following on- and off-line resources are recommended:

Although I consider these my notes, complete with rough-edges and warts and all, and by no means a complete tutorial on the subject I do still appreciate any remarks or comments. Nowhere will a setup guide for the used tools be given. These differ to much from system to system and with the use of Google resources with better information than I can provide should be available.

Continue Reading »