![Page 1: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/1.jpg)
Das GNU Build SystemAutotools
Roman LeshchinskyDavid Schulz, Shaoke Wu
![Page 2: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/2.jpg)
History of autotools
1980s
Multible variants of Unix
Varios differences (even with POSIX)
Familiarity for software developers with all differences
-> more organized approach needed
![Page 3: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/3.jpg)
Goal: Easy distribution of source code programs
SourceCode
System V
Linux
BSD
Solaris HP-UXAIX
![Page 4: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/4.jpg)
History (2)
1992
Metaconfig, configure, GNU autoconf, Imake
Building process in two steps
Configuration - generates Makefile's
build step – using UNIX make
1994
Autoconf solid framework
But creation of large Makefile.in's nesseccary
Automake was developed
![Page 5: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/5.jpg)
Autoconf Konzept
Probleme
configure
Konfiguration
Computer
Test
Automatische Konfiguration von Programmen
![Page 6: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/6.jpg)
Was macht autoconf
Autoconf erzeugt configure
Input: configure.ac (oder configure.in bei aelteren Versionen )
configure.ac enthaelt Aufruf von Makros
Autoconf benutzt m4
aclocal.m4 definiert eigene Makros
configure.in
aclocla.m4
autoconfconfigure
![Page 7: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/7.jpg)
Aufbau von configure.ac
Reihenfolge egal
AC_INIT
Source-Katalog finden
Kommando Zeilenargumente
AC_OUTPUT
Dateien generieren
AC_INIT(helloworld.c). . . AC_OUTPUT(Makefile)
![Page 8: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/8.jpg)
Welche Tests gibt es?
Programs
Files
Library Files
Types
System Services
![Page 9: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/9.jpg)
./configure Optionen
--prefix=<install-path> --help: alle Optionen auflisten --version: autoconf Version anzeigen
LDFLAGS: linker flags, e.g. -L<lib dir> CFLAGS C compiler flags
Shell Umgebungsvariable:
![Page 10: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/10.jpg)
Automake
Goal: create Makefile.in Remove burden of Makefile maintenance from
individual Developer (put it on automake maintainer)
Input: Makefile.am Only make sence with autoconf Reads configure.in contents Needs perl
(configure.in)
Makefile.am automakeMakefile.in
![Page 11: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/11.jpg)
Makefile.am
Easy to create by developer Syntax: prefix+primary Primarys: PROGRAMS, LIBRARIES, SCRIPTS Arbitrary code ## Automake comment
bin_PROGRAMS = hellohello_SOURCES = hello.c hello.h
SUBDIRS = src
![Page 12: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/12.jpg)
Automake options
--add-missing: create some files automaticly
--copy: dont create links
--foreign: lower strictness level
--help: show options
--verbose: show files being read
--version: show automake version
![Page 13: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/13.jpg)
Makefile.in
Created by automake out of Makefile.am
Makefile conforms with make syntax
Tags to be substituted by configure script
![Page 14: Das GNU Build System Autotools Roman Leshchinsky David Schulz, Shaoke Wu](https://reader036.vdocument.in/reader036/viewer/2022082700/5514eb4d550346b0338b5d59/html5/thumbnails/14.jpg)
Overview
Create configure.ac and Makefile.am
aclocal
autoconf
Automake --add-missing
./configure
make
make install