The GNU Autotools make it easy for developers to create software that is portable across many Unix-like operating systems. Although the Autotools are used by thousands of open source software packages, they have a notoriously steep learning curve. And good luck to the beginner who wants to find anything beyond a basic reference work online.
Autotools Autotools is the first book to offer programmers a tutorial-based guide to the GNU build system. Author John Calcote begins with an overview of high-level concepts and a quick hands-on tour of the philosophy and design of the Autotools. He then tackles more advanced details, like using the M4 macro processor with Autoconf, extending the framework provided by Automake, and building Java and C# sources. He concludes the book with detailed solutions to the most frequent problems encountered by first-time Autotools users.
You'll learn how to:
Master the Autotools build system to maximize your software's portability
Generate Autoconf configuration scripts to simplify the compilation process
Produce portable makefiles with Automake
Build cross-platform software libraries with Libtool
Write your own Autoconf macros
Autotools focuses on two projects: Jupiter, a simple "Hello, world!" program, and FLAIM, an existing, complex open source effort containing four separate but interdependent subprojects. Follow along as the author takes Jupiter's build system from a basic makefile to a full-fledged Autotools project, and then as he converts the FLAIM projects from complex hand-coded makefiles to the powerful and flexible GNU build system.
Chapter 1 A BRIEF INTRODUCTION TO THE GNU AUTOTOOLS
Who Should Use the Autotools?
When Should You Not Use the Autotools?
Apple Platforms and Mac OS X
The Choice of Language
Generating Your Package Build System
Building Your Package
Installing the Most Up-to-Date Autotools
Chapter 2 UNDERSTANDING THE GNU CODING STANDARDS
Creating a New Project Directory Structure
Creating a Source Distribution Archive
Automatically Testing a Distribution
Unit Testing, Anyone?
The Filesystem Hierarchy Standard
Supporting Standard Targets and Variables
Getting Your Project into a Linux Distro
Build vs. Installation Prefix Overrides
Configuring Your Package
Chapter 3 CONFIGURING YOUR PROJECT WITH AUTOCONF
Autoconf Configuration Scripts
The Shortest configure.ac File
Comparing M4 to the C Preprocessor
The Nature of M4 Macros
Adding Some Real Functionality
Generating Files from Templates
Adding VPATH Build Functionality
Let's Take a Breather
An Even Quicker Start with autoscan
Initialization and Package Information
The Instantiating Macros
Back to Remote Builds for a Moment
Chapter 4 MORE FUN WITH AUTOCONF: CONFIGURING USER OPTIONS
Substitutions and Definitions
Checking for Compilers
Checking for Other Programs
A Common Problem with Autoconf
Checks for Libraries and Header Files
Supporting Optional Features and Packages
Checks for Type and Structure Definitions
The AC_OUTPUT Macro
Chapter 5 AUTOMATIC MAKEFILES WITH AUTOMAKE
Getting Down to Business
What's in a Makefile.am File?
Analyzing Our New Build System
Unit Tests: Supporting make check
Reducing Complexity with Convenience Libraries
Building the New Library
What Goes into a Distribution?
Cutting Through the Noise
Chapter 6 BUILDING LIBRARIES WITH LIBTOOL
The Benefits of Shared Libraries
How Shared Libraries Work
Adding Shared Libraries to Jupiter
Chapter 7 LIBRARY INTERFACE VERSIONING AND RUNTIME DYNAMIC LINKING
The Libtool Library Versioning Scheme
Chapter 8 FLAIM: AN AUTOTOOLS EXAMPLE
What Is FLAIM?
An Initial Look
The FLAIM Subprojects
Designing the XFLAIM Build System
Chapter 9 FLAIM PART II: PUSHING THE ENVELOPE
Building Java Sources Using the Autotools
Building the C# Sources
Configuring Compiler Options
Hooking Doxygen into the Build Process
Adding Nonstandard Targets
Chapter 10 USING THE M4 MACRO PROCESSOR WITH AUTOCONF
M4 Text Processing
The Recursive Nature of M4
Autoconf and M4
Writing Autoconf Macros
Chapter 11 A CATALOG OF TIPS AND REUSABLE SOLUTIONS FOR CREATING GREAT PROJECTS
Item 1: Keeping Private Details out of Public Interfaces
Item 2: Implementing Recursive Extension Targets
Item 3: Using a Repository Revision Number in a Package Version
Item 4: Ensuring Your Distribution Packages Are Clean
Item 5: Hacking Autoconf Macros
Item 6: Cross-Compiling
Item 7: Emulating Autoconf Text Replacement Techniques
Item 8: Using the ac-archive Project
Item 9: Using pkg-config with Autotools
Item 10: Using Incremental Installation Techniques
Item 11: Using Generated Source Code
Item 12: Disabling Undesirable Targets
Item 13: Watch Those Tab Characters!
Item 14: Packaging Choices
No Starch Press
Safari Books Online
| ISBN 10:
| ISBN 10:
John Calcote is a Senior Software Engineer and Architect at Novell, Inc. He's been writing and developing portable networking and system-level software for nearly 20 years and is active in developing, debugging, and analyzing diverse open source software packages. He is currently a project administrator of the OpenSLP, OpenXDAS, and DNX projects (open source software available at http://www.sourceforge.net), as well as the Novell-sponsored FLAIM database project (open source software available at http://developer.novell.com).
I've been a GNU/Linux user for almost a decade and I use the package repository available on the local system daily for upgrades and new installations, from time to time a local compilation is required. When I earlier this year was reading "21st Century C" by Ben Klemens a chapter in the book gave me a short high-level introduction to what actually is behind the invaluable "./configure", "make" and "make install" commands. For a recent new C project, Autotools was chosen and I needed a deeper understanding of Autotools so I turned to "John Calcote" Autotools book as an intermediate developer and beginner when it comes to configuring build systems and packaging applications.
John goes through everything from the basic building blocks of the Autotools suite (autoconf, automake and libtool) to converting a pre-existing application to be built with autotools. After reading this book I was able to set up a simple build system with unit tests and immediately take advantage of a continous delivery system calling "make check/distcheck/dist" warning me when something goes wrong or creating a distributable tarball. I now also understand the purpose and responsibility of the invaluable "./configure", "make" and "make install" commands that I often use as a user.
I was afraid that a book from 2010 would be too old but so far I've not seen any outdated information that sent me off in completely wrong direction. The one big improvement I see that could be made better is the figures available in the book. I had and still have a hard time understanding how different parts of the autotools interact with each other in detail, maybe that will be clearer on a second read-thru and when I start using the tools more on a daily basis. As a first time reader I would have liked that the figures used throughout the book (especially in chapter 1) would grow by the section instead of immediately showing the complete picture. A step by step increase of complexity in the figures would probably have conveyed more information to me as I read.
Bottom Line Yes, I would recommend this to a friend