• Like
GNU Autotools - Automake and Autoconf
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

GNU Autotools - Automake and Autoconf


Slide 2: …

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 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

Published in Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. GNU Autotools Avneet Kaur http://avneetkhasla.wordpress.com/
  • 2. Make
  • 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. Executable script designed to aid in developing a program to be run on a wide number of different computers. Configure Script
  • 5. configure → created from “configure.ac” (using Autoconf) configure.ac → created automatically (using Autoscan) or manually Creating ‘configure’
  • 6. Autoscan
  • 7. AC_INIT([Hello], [0.1], [bug- report@hello.example.com], [hello], [http://hello.ex ample.com/]) AM_INIT_AUTOMAKE([1.10 no-define]) AC_CONFIG_HEADERS([config.h]) AC_PROG_CXX AC_CONFIG_FILES([Makefile]) AC_OUTPUT configure.ac should include
  • 8. Autoheader C sources and headers config.h.in
  • 9. Aclocal configure.ac aclocal.m4
  • 10. Automake Makefile.in Makefile.am configure.ac
  • 11. Makefile.am ?
  • 12. $ touch NEWS README AUTHORS ChangeLog OR AM_INIT_AUTOMAKE call in configure.ac instead: AM_INIT_AUTOMAKE([1.10 no-define foreign]) GNU-style projects ?
  • 13. Autoconf configure.ac, Makefile.in, configure.h.in configure config.hMakefile aclocal.m4
  • 14. Autoreconf Autoconf Autoheader Aclocal Automake Libtoolize Autopoint
  • 15. Ultimate Summary Create sources, Makefile.am” autoscan Rename “configure.scan” to “configure.ac” autoheader Add AM_INIT_AUTOMAKE to “configure.ac” aclocal automake --add- missing --copy autoconf ./configure make make install
  • 16. Thank You!