GNU Autotools - Automake and Autoconf


Published on

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:
make install

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 (or and run autoconf on it.

Slide 6 :
Using autoscan to Create
The autoscan program can help you create and/or maintain a file for a software package. It searches the source files for common portability problems and creates a file configure.scan which is a preliminary for that package, and checks a possibly existing for completeness.
When using autoscan to create a, you should manually examine configure.scan before renaming it to; 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

Published in: Education, Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

GNU Autotools - Automake and Autoconf

  1. 1. GNU Autotools Avneet Kaur
  2. 2. Make
  3. 3. Makefile target: prerequisite-list TAB construction-commands project: main.o project.o g++ main.o project.o -o project main.o: main.cpp g++ -c main.cpp project.o: project.cpp g++ -c project.cpp $ make Syntax Example Compilation
  4. 4. Executable script designed to aid in developing a program to be run on a wide number of different computers. Configure Script
  5. 5. configure → created from “” (using Autoconf) → created automatically (using Autoscan) or manually Creating ‘configure’
  6. 6. Autoscan
  7. 7. AC_INIT([Hello], [0.1], [bug-], [hello], [http://hello.ex]) AM_INIT_AUTOMAKE([1.10 no-define]) AC_CONFIG_HEADERS([config.h]) AC_PROG_CXX AC_CONFIG_FILES([Makefile]) AC_OUTPUT should include
  8. 8. Autoheader C sources and headers
  9. 9. Aclocal aclocal.m4
  10. 10. Automake
  11. 11. ?
  12. 12. $ touch NEWS README AUTHORS ChangeLog OR AM_INIT_AUTOMAKE call in instead: AM_INIT_AUTOMAKE([1.10 no-define foreign]) GNU-style projects ?
  13. 13. Autoconf,, configure config.hMakefile aclocal.m4
  14. 14. Autoreconf Autoconf Autoheader Aclocal Automake Libtoolize Autopoint
  15. 15. Ultimate Summary Create sources,” autoscan Rename “configure.scan” to “” autoheader Add AM_INIT_AUTOMAKE to “” aclocal automake --add- missing --copy autoconf ./configure make make install
  16. 16. Thank You!