Autoconf, Automake, and Libtool
Table of Contents
The GNU Project Build Tools
Magic Happens Here
Introduction
What this book is
What the book is not
Who should read this book
How this book is organized
Conventions used in this book
History
The Diversity of Unix Systems
The First Configure Programs
Configure Development
Automake Development
Libtool Development
Microsoft Windows
How to run configure and make
Configuring
Files generated by configure
The most useful Makefile targets
Configuration Names
Introducing
Makefile
s
Targets and dependencies
Makefile syntax
Macros
Suffix rules
A Minimal GNU Autotools Project
User-Provided Input Files
Generated Output Files
Maintaining Input Files
Packaging Generated Files
Documentation and ChangeLogs
Writing
configure.in
What is Portability?
Brief introduction to portable sh
Ordering Tests
What to check for
Using Configuration Names
Introducing GNU Automake
General Automake principles
Introduction to Primaries
The easy primaries
Programs and libraries
Frequently Asked Questions
Multiple directories
Testing
Bootstrapping
A Small GNU Autotools Project
GNU Autotools in Practice
Project Directory Structure
C Header Files
C++ Compilers
Function Definitions
Fallback Function Implementations
K&R Compilers
A Simple Shell Builders Library
Portability Infrastructure
Library Implementation
Beginnings of a
configure.in
A Sample Shell Application
sic_repl.c
sic_syntax.c
sic_builtin.c
sic.c
&
sic.h
Introducing GNU Libtool
Creating
libtool
The Libtool Library
Position Independent Code
Creating Shared Libraries
Creating Static Libraries
Creating Convenience Libraries
Linking an Executable
Linking a Library
Inter-library Dependencies
Using Convenience Libraries
Executing Uninstalled Binaries
Installing a Library
Installing an Executable
Uninstalling
Using GNU Libtool with
configure.in
and
Makefile.am
Integration with
configure.in
Extra Configure Options
Extra Macros for Libtool
Integration with
Makefile.am
Creating Libtool Libraries with Automake
Linking against Libtool Libraries with Automake
Using libtoolize
Library Versioning
Convenience Libraries
A Large GNU Autotools Project
Using Libtool Libraries
Removing
--foreign
Installing Header Files
Including Texinfo Documentation
Adding a Test Suite
Rolling Distribution Tarballs
Introduction to Distributions
What goes in
The distcheck rule
Some caveats
Implementation
Installing and Uninstalling Configured Packages
Where files are installed
Fine-grained control of install
Install hooks
Uninstall
Writing Portable C with GNU Autotools
C Language Portability
ISO C
C Data Type Sizes
C Endianness
C Structure Layout
C Floating Point
GNU cc Extensions
Cross-Unix Portability
Cross-Unix Function Calls
Cross-Unix System Interfaces
Unix/Windows Portability
Unix/Windows Emulation
Unix/Windows Portable Scripting Language
Unix/Windows User Interface Library
Unix/Windows Specific Code
Unix/Windows Issues
Writing Portable C++ with GNU Autotools
Brief History of C++
Changeable C++
Built-in bool type
Exceptions
Casts
Variable Scoping in For Loops
Namespaces
The
explicit
Keyword
The
mutable
Keyword
The
typename
Keyword
Runtime Type Identification (RTTI)
Templates
Default template arguments
Standard library headers
Standard Template Library
Compiler Quirks
Template Instantiation
Name Mangling
How GNU Autotools Can Help
Testing C++ Implementations with Autoconf
Automake C++ support
Libtool C++ support
Further Reading
Dynamic Loading
Dynamic Modules
Module Access Functions
Finding a Module
A Simple GNU/Linux Module Loader
A Simple GNU/Linux Dynamic Module
Using GNU libltdl
Introducing libltdl
Using libltdl
Configury
Memory Management
Module Loader
Dependent Libraries
Dynamic Module
Portable Library Design
dlpreopen Loading
User Module Loaders
Loader Mechanism
Loader Management
Loader Errors
Advanced GNU Automake Usage
Conditionals
Language support
Automatic dependency tracking
A Complex GNU Autotools Project
A Module Loading Subsystem
Initialising the Module Loader
Managing Module Loader Errors
Loading a Module
Unloading a Module
A Loadable Module
Interpreting Commands from a File
Integrating Dmalloc
M4
What does M4 do?
How GNU Autotools uses M4
Fundamentals of M4 processing
Token scanning
Macros and macro expansion
Quoting
Features of M4
Discarding input
Macro management
Conditionals
Looping
Diversions
Including files
Writing macros within the GNU Autotools framework
Syntactic conventions
Debugging with M4
Writing Portable Bourne Shell
Why Use the Bourne Shell?
Implementation
Size Limitations
#!
:
()
.
[
$
* versus .*
Environment
Utilities
Writing New Macros for Autoconf
Autoconf Preliminaries
Reusing Existing Macros
Guidelines for writing macros
Non-interactive behavior
Testing system features at application runtime
Output from macros
Naming macros
Macro interface
Implementation specifics
Writing shell code
Using M4 correctly
Caching results
Future directions for macro writers
Autoconf macro archive
Primitive macros to aid in building macros
Migrating an Existing Package to GNU Autotools
Why autconfiscate
Overview of the Two Approaches
Example: Quick And Dirty
Example: The Full Pull
Using GNU Autotools with Cygnus Cygwin
Preliminaries
Installing GNU Autotools on Cygwin
Writing A Cygwin Friendly Package
Text vs Binary Modes
File System Limitations
Executable Filename Extensions
DLLs with Libtool
DLL Support with GNU Autotools
A Makefile.am for DLLs
A configure.in for DLLs
Handling Data Exports from DLLs
Runtime Loading of DLLs
Package Installation
Cross Compilation with GNU Autotools
Host and Target
Specifying the Target
Using the Target Type
Building with a Cross Compiler
Canadian Cross Example
Canadian Cross Concepts
Build Cross Host Tools
Build and Host Options
Canadian Cross Tools
Supporting Building with a Cross Compiler
Installing GNU Autotools
Prerequisite tools
Downloading GNU Autotools
Installing the tools
PLATFORMS
Generated File Dependencies
aclocal
autoheader
automake and libtoolize
autoconf
configure
make
Autoconf Macro Reference
OPL
Index
Next >>>
The GNU Project Build Tools