Setting up a real-life GTK application

Learning to write a GTK program using a tutorial is all well and good. At some point, though, you will have gone through enough beginners' tutorials that you won't learn any more from them. How do you make the step from simple tutorial program to whole application?

This section will show you how to prepare to write an application that does the simple job of displaying information about a file. You will learn how to set up your build system using GNU Autotools, something that most tutorials don't cover, because using Autotools for a one-file sample program is overkill. For larger programs, however, you cannot do without Autotools, or another automated build system.

Why Autotools?

There is no such thing as indifference towards Autotools. They are loved by thousands and hated by millions, so to speak. My suspicion is that the haters don't understand what Autotools do: they aid you in implementing the GNU Coding Standards. They are not meant to aid you in implementing your own preferred build workflow. This is probably the reason for a lot of the frustration.

Looking at the complaints objectively, though, one cannot deny that the Autotools have a steep learning curve. This is partly because of a lack of tutorial-style documentation. If you want to learn, your only recourse is to read the entire manual (no easy task), or learn by copying incantations from existing projects and lots of trial and error.

There are two resources, unfortunately little-known, to which one can turn for an introduction to Autotools. One is John Calcote's excellent Autotools: A Practitioner's Guide to Automake, Autoconf and Libtool. Chapters from this book have also been published online, at Free Software Magazine. The other is Alexandre Duret-Lutz' Autotools Tutorial, available online. In its form of presentation slides, it is a little difficult to read like a book, but its diagrams and code examples are very helpful.

Once you have set up the application, you will learn to actually write it in the next tutorial.

This tutorial is large and therefore it is divided into several sections. You can go through the whole tutorial in order, or if you like, you can do just one section by copying the code from the previous section and starting from there. Each section has a link to the code that you need to start out with.