Sample describing autotools usage.
-
Create and write
configure.ac
in root directory and aMakefile.am
in root directory and each subdirectory containing source code. -
Run
autoreconf --install
to perform configuration files and Makefile/Makefile.in generation
(autoreconf
runs autotools toolchain in right order:aclocal
,autoconf
,autoheader
,automake
). -
Use
./configure && make && sudo make install
to install package. -
Use
./configure --prefix=/usr
to change installation path. -
Use
make CC=<pathToCompiler> CFLAGS="<compilerFlags>"
to change compiler and compiler options (default togcc
and-g -O2
respectively).
- Official documentation.
- Slides describing autotools workflow.