GNU Autotools - Automake and Autoconf
- 316 views
Slide 2: ...
Since it is tedious to recompile pieces of a program when something changes, people often use the make utility instead.
Make needs a make file that encodes both the dependencies between files and the commands needed to generate files.
When you run the make utility, it examines the modification times of files and determines what needs to be regenerated. Files that are older than the files they depend on must be regenerated.
Slide 3: Targets
With the needed variables, we can deal with the targets, which are files that must be generated. For each target, there are typically 1 or 2 lines in a make file. Those lines specify: its dependencies (easy to determine from a dependency chart) and possibly a command to generate the target (easy to determine from knowledge of separate compilation).
Slide 4 :
It matches the libraries on the user's computer, with those required by the program, just before compiling it from its source code. Using configure scripts is an automated method of generating makefiles before compilation to tailor the software to the system on which the executable is to be compiled and run. The final executable software is most commonly obtained by executing the following commands in a shell that is currently pointing to the directory containing the source code:
Slide 5 :
The configuration scripts that Autoconf produces are by convention called configure. When run, configure creates several files, replacing configuration parameters in them with appropriate values.
To create a configure script with Autoconf, you need to write an Autoconf input file configure.ac (or configure.in) and run autoconf on it.
Slide 6 :
Using autoscan to Create configure.ac
The autoscan program can help you create and/or maintain a configure.ac file for a software package. It searches the source files for common portability problems and creates a file configure.scan which is a preliminary configure.ac for that package, and checks a possibly existing configure.ac for completeness.
When using autoscan to create a configure.ac, you should manually examine configure.scan before renaming it to configure.ac; it probably needs some adjustments.
Slide 7 :
The AC_INIT macro initializes autoconf with information about your project, including the project name, version number, bug-reporting address, tarball name and the project homepage.
The AM_INIT_AUTOMAKE line adds several standard checks and initializes automake.
AC_PROG_CXX checks for a C++ compiler. If your project uses C, you can check for a C compiler withAC_PROG_CC.
AC_CONFIG_FILES lists the files to be generated by configure. By default, each file is generated from a template file of the same name but with an .in extension appended.
AC_OUTPUT finishes configure processing, and generates the output files.
Slide 14 :
Using autoreconf to Update configure Scripts
- Total Views
- Views on SlideShare
- Embed Views