UNIX - Werkzeuge 4. autoconf und automake ======================== Wie kann man sich an unterschiedliche Umgebungen anpassen? Ziele autoconf und automake sind GNU-Tools zur Erstellung von Konfigurationsscripten für UNIX-like-Systeme. Da UNIX-Systeme bekanntermaßen alle etwas unterschiedlich sind, muß Software für die jeweiligen Systeme vor und während der Installation angepaßt werden: Pfade von Programmen Bibliotheken Header-Files Installationsdirectories Konfigurationsfiles Das entstandenen Konfigurationsscripte ist unab- hängig von autoconf und automake, so daß der spätere Anwender dieses Scriptes die Werkzeuge autoconf und automake nicht mehr benutzen muß. Durch das Abarbeiten des Konfigurierungsscriptes "configure" wird die Software für das konkrete System angepaßt. Das entstandene Makefile steuert normalerweise dann die weitere Generierung und Installation der Software. |
next | back | 2017 - 1 | Fri Apr 7 14:46:40 CEST 2017 |
Benötigte Files: Basis aller auto-Werkzeuge ist GNU m4 !!!!! d.h. alle Eingabefiles/Steuerfiles für autoconf und automake sind m4-Files. Vom Projektanten zu erstellende Files: Quelltexte: Alle Quelltexte, die zu dem Projekt gehören Konfigurationsfiles: configure.in - Konfigurationsfile für autoconf Makefile.am - Konfigurationsfile für automake Bindende Dokumentationen: AUTHORS - Textfile COPYING - Textfile ChangeLog - Textfile INSTALL - Textfile NEWS - Textfile README - Textfile Scripte für den Anwender install.sh - Script zum Installieren von Files mkinstalldirs - Script zum Erzeugen von Directories missing - Script zum Erzeugen von fehlenden Files depcomp - Script zum Erzeugen der Abhängigkeiten |
next | back | 2017 - 2 | Fri Apr 7 14:46:40 CEST 2017 |
Arbeitsschritte: 1. Erstellen von "configure.ac" ("configure.in") Dieses File muß vom Projektanten erstellt werden. Dafür kann das Program "autoscan" benutzt werden. Dieses Programm untersucht die Quellen und analysiert die Headerfiles, System- und Bibliotheksaufrufe. Abschließend wird das File "configure.scan" generiert, das als Ausgangspunkt für "configure.ac" benutzt werden kann. "configure.ac" muß angepaßt werden. 2. Erzeugen von "aclocal.m4" Für die weitere Arbeit ist das File aclocal.m4 für die Benutzung des m4-Systems unbedingt notwendig. Dies wird mit Hilfe von "aclocal" erzeugt. 3. Erzeugen von "configure" Mittels "autoconf" wird aus "configure.in" die Files "configure" und "config.status" erzeugt. Das Script "configure" dient dem späterem Anwender zur Anpassung der Software für die Übersetzung und Installation. 4. Erzeugen von "Makefile.in" Mittels "automake" wird aus "Makefile.am" ein File "Makefile.in" gebildet, das vom Script "configure" später auf dem Zielsystem für die Erzeugung des "Makefile" benötigt wird. |
next | back | 2017 - 3 | Fri Apr 7 14:46:40 CEST 2017 |
Beispiel: Das Projekte File(File-Beispiele aus UNIX-Vorlesung). erstellen von Makefile.am: ## Process this file with automake to produce Makefile.in bin_PROGRAMS = access cdpwd changemod conf copy copy1 \ devrdev devzero fileflags ftw2 ftw3 ftw4 \ hello hole longpath ls1 mcopy mycd nonblockw \ pipe pollpipe pollpipe1 seek selectpipe \ selectpipe1 testerror uidgid umask unlink zap \ filetype filesize access_SOURCES = access.c error.o access_LDADD = error.o cdpwd_SOURCES = cdpwd.c pathalloc.o error.o cdpwd_LDADD = error.o pathalloc.o changemod_SOURCES = changemod.c error.o changemod_LDADD = error.o conf_SOURCES = conf.c error.o conf_LDADD = error.o copy_SOURCES = copy.c copy1_SOURCES = copy1.c devrdev_SOURCES = devrdev.c error.o devrdev_LDADD = error.o devzero_SOURCES = devzero.c error.o tellwait.o devzero_LDADD = error.o tellwait.o fileflags_SOURCES = fileflags.c error.o fileflags_LDADD = error.o .... |
next | back | 2017 - 4 | Fri Apr 7 14:46:40 CEST 2017 |
aufrufen von: autoscan es entsteht: configure.scan: # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([copy1.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for libraries. # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/time.h syslog.h unistd.h utime.h]) |
next | back | 2017 - 5 | Fri Apr 7 14:46:40 CEST 2017 |
# Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLOCKS AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_HEADER_TIME AC_TYPE_UID_T AC_C_VOLATILE # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_HEADER_MAJOR AC_FUNC_MALLOC AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_UTIME_NULL AC_FUNC_VPRINTF AC_CHECK_FUNCS([dup2 getcwd mkdir pathconf select strerror utime]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT |
next | back | 2017 - 6 | Fri Apr 7 14:46:40 CEST 2017 |
configure.scan ist ein Prototype für configure.ac cp configure.scan configure.ac in configure.ac muß modifiziert werden: Aktualisieren von AC_INIT AC_INIT([file-Beispiele],[1.0],[xyz@inf.de]) Hinzufügen AM_INIT_AUTOMAKE Streichen (Auskommentieren) von AC_CONFIG_SRCDIR([copy1.c]) AC_CONFIG_HEADER([config.h]) Aufruf von: autoheader es entsteht config.h.in Aufruf von: aclocal es entsteht aclocal.m4 Aufruf von: autoconf es ensteht configure Aufruf von: automake es entsteht Makefile.in Jetzt ist das Projekt fertig zum Verteilen!! Es kann eingepackt werden. |
next | back | 2017 - 7 | Fri Apr 7 14:46:40 CEST 2017 |
Der Anwender muß jetz nur noch folgendes ausführen: Abarbeiten von: ./configure es entsteht Makefile Aufruf von: make und schon ist alles fertig |
next | back | 2017 - 8 | Fri Apr 7 14:46:40 CEST 2017 |
autoscan [Optionen] ... [SRCDIR] Programm zum Erzeugen eines Templates für configure.ac. Es Wird das File configure.scan erzeugt. autoscan durchmustert die Quelltextfiles des aktuellen Directories oder das durch [SRCDIR] spezifizierte Directory. Dabei werden die Quelltextfiles auf Portabilitätsprobleme untersucht und entsprechende Eigenschaften (uses) in configure.scan eingetragen. Optionen: -h, --help Ausgabe des Hilfstextes und exit -V, --version Ausgabe der Versionsnummer und exit -v, --verbose Verbose, ausführlicher Kommentar -d, --debug debug-Mode, temp-Files nicht löschen Direktories von Bibliotheken: -B, --prepend-include=DIR Include-Directory voranstellen -I, --include=DIR Include-Directory einfügen Mehrere -B und -I Optionen sind zulässig. |
next | back | 2017 - 9 | Fri Apr 7 14:46:40 CEST 2017 |
Aufbau von configure.ac # Allgemeiner Teil AC_PREREQ(2.61) AC_INIT([Beispiel], [0.1], [jpb@informatik.hu-berlin.de]) AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_AWK AC_PROG_CPP # Checks for libraries. AC_CHECK_LIB(pthread, pthread_cancel) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, inet_ntoa) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h \ stdlib.h string.h strings.h sys/socket.h sys/time.h \ unistd.h pthread.h]) |
next | back | 2017 - 10 | Fri Apr 7 14:46:40 CEST 2017 |
# Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_HEADER_TIME # Checks for library functions. AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_MMAP AC_CHECK_FUNCS([bzero gethostbyaddr gethostbyname \ gettimeofday inet_ntoa socket pthread_cancel \ pthread_join socket inet_ntoa]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT |
next | back | 2017 - 11 | Fri Apr 7 14:46:40 CEST 2017 |
autoconf [Optionen] ... [TEMPLATE-FILE] Erzeugen eines Konfigurationsscriptes vom Musterfile "TEMPLATE-FILE". Wenn keine Musterfile angegeben ist wird das File configure.ac aus dem lokalem Direktory genommen. Die Ausgabe erfolgt auf STDOUT, wenn ein "TEMPLATE-FILE" angegeben ist, oder sonst in das File "configure". Optionen: -h, --help Ausgabe eines Hilfe-Textes und exit. -V, --version Ausgabe der Verionsinformation und exit. -v, --verbose Verbose, ausführliche Informationen -d, --debug Debug-Modus, temporäre Files nicht löschen -o, --output=FILE Ergebnis in File "FILE" speichern -I, --include=DIR Beachten von Weiteren Eingabefiles in der Directory Dir -f, --force Erzeugen aller Files -W, --warnings=CATEGORY Ausgabe von Warnungen der Kategorie "CATEGORY" Kategorien von Warnungen: `cross' Cross-System `obsolete' Veraltete Konstruktionen `syntax' Syntaxfehler `all' Alle Fehler `no-CATEGORY' inverse von "CATEGORY" `none' Abschalten aller Warnungen `error' Warnungen werden als Error interpretiert Die Umgebungsvariable "WARNINGS" wird ausgewertet |
next | back | 2017 - 12 | Fri Apr 7 14:46:40 CEST 2017 |
Optionen für Bibliotheken: -B, --prepend-include=ACDIR include-Directory, prepend -I, --include=DIR include-Directory, append Tracing -t, --trace=MACRO Bericht von allen Rufen des Makros "MACRO" -i, --initialization Trace von Autoconf's Initialisierungsprozeß Beim Tracing-Mode wird kein Konfigurationsscript "configure" erzeugt |
next | back | 2017 - 13 | Fri Apr 7 14:46:40 CEST 2017 |
automake [Optionen] ... [Makefile]... Erzeugen eines Files Makefile.in für configure aus Makefile.am. Folgende TAGS kommen in Makefile.am z.B. vor: _SOURCES, _LDADD, _LDFLAGS, _LIBRARIES, _PROGRAMS Optionen Operationmodes: --help print this help, then exit -v, --verbose Verbose. --version Ausgabe der Versionsnummer und exit. --no-force Nur nicht aktuelle Files Makefile.in erzeugen -W, --warnings=CATEGORY Ausgabe der Warnungen aus der angegeben Kategorie CATEGORY siehe autoconf. Abhängigkeiten : -i --ignore-deps Abhängigkeiten nicht einfügen --include-deps Abhängigkeiten einfügen Stilrichtungen: --cygnus --foreign --gnits --gnu |
next | back | 2017 - 14 | Fri Apr 7 14:46:40 CEST 2017 |
Sonstige Optionen -a, --add-missing Hinzufügen von Standardfiles zum Paket ohne Option -c - Symbolische Links mit Option -c - Files kopiert --libdir=DIR Directory für Bibliotheksfiles -c, --copy kopieren der fehlenden Files, sonst nur symbolischen Link ziehen, in Verbindung mit -a -f, --force-missing Ändern aller Standardfiles --amdir=DIR Direktory, in dem Makefile.am steht --build-dir=DIR zu untersuchende Dirktory -o DIR, --output-dir=DIR Zieldirektory (für Makefile.in) --srcdir-name=DIR name used for srcdir (for dependencies) Files, die automatisch verteilt werden, wenn sie vorhanden sind: ABOUT-GNU THANKS config.h.top ltcf-cxx.sh INSTALL ABOUT-NLS TODO config.sub ltcf-gcj.sh config.guess AUTHORS acconfig.h configure ltconfig libversion.in BACKLOG acinclude.m4 configure.ac ltmain.sh stamp-h.in COPYING aclocal.m4 configure.in mdate-sh README COPYING.LIB ansi2knr.1 elisp-comp missing config.h.bot ChangeLog ansi2knr.c install-sh mkinstalldirs ltcf-c.sh NEWS config.h.bot ltcf-c.sh stamp-vti |
next | back | 2017 - 15 | Fri Apr 7 14:46:40 CEST 2017 |
aclocal - erzeugen von aclocal.m4 aclocal [OPTIONS] ... aclocal dient zum Erzeugen von `aclocal.m4'. Dabei wird das File `configure.ac' oder `configure.in' gescannt. OPTIONS --acdir=DIR Directory für das AC-File --help Hilfetext -I DIR hinzufüger der Direktory DIR zur Suchliste für .m4 Files --output=FILE Ausgabefile ist 'FILE' (default aclocal.m4) --print-ac-dir Anzeigen des Namens der Directory mit m4 Files --verbose Verbose --version Ausgabe der Versionsnummer von aclocal --force Ausgabefile immer aktualisieren |
next | back | 2017 - 16 | Fri Apr 7 14:46:40 CEST 2017 |
configure - erzeugen des Makefiles auf dem Zielsystem configure [OPTION]... [VAR=VALUE]... "configure" wird mit dem Projekt ausgeliefert (Ergebnis von autoconf). Standardmäßig können Optionen für die Umgebung gesetzt werden. Ausgabe von "./configure --help": Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] |
next | back | 2017 - 17 | Fri Apr 7 14:46:40 CEST 2017 |
By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names |
next | back | 2017 - 18 | Fri Apr 7 14:46:40 CEST 2017 |
Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor LIBS libraries (-lmath -lnsl -lsocket) |
next | back | 2017 - 19 | Fri Apr 7 14:46:40 CEST 2017 |
autoreconf - Update generated configuration files autoreconf [OPTION] ... [CONFIGURE-AC or DIRECTORY] ... vereinigte die Abarbeitung von: autoconf, aclocal, automake, gettextize, libtoolize OPTION -h, --help Hilfetext anzeigen -V, --version Version -v, --verbose Ausführliche Kommentare -d, --debug Debug, temporaere Dateien nicht loeschen -f, --force force -i, --install einfügen fehlender Files -s, --symlink nicht kopieren, symbolische Links erzeugen -I, --Include=DIR zusätzliche Directories einfügen |
next | back | 2017 - 20 | Fri Apr 7 14:46:40 CEST 2017 |
autoupdate - Update a configure.in to a newer Autoconf autoupdate [OPTION] ... [TEMPLATE-FILE...] update der Configurationsfiles von einer altern Version auf ein neue. -h, --help print this help, then exit -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files -I, --include=DIR look for input files in DIR (cumulative) -f, --force consider all files obsolete |
next | back | 2017 - 21 | Fri Apr 7 14:46:40 CEST 2017 |
autoheader - Create a template header for configure autoheader [OPTION] ... [TEMPLATE-FILE] Create a template file of C `#define' statements for `configure' to use. To this end, scan TEMPLATE-FILE, or `configure.ac' if present, or else `configure.in'. -h, --help print this help, then exit -V, --version print version number, then exit -v, --verbose verbosely report processing -d, --debug don't remove temporary files -f, --force consider all files obsolete -W, --warnings=CATEGORY report the warnings falling in CATEGORY `obsolete' obsolete constructs `all' all the warnings `no-CATEGORY' turn off the warnings on CATEGORY `none' turn off all the warnings `error' warnings are error -I, --include=DIR look for files in DIR (cumulative) |
next | back | 2017 - 22 | Fri Apr 7 14:46:40 CEST 2017 |
|
back | 2017 - 23 | Fri Apr 7 14:46:40 CEST 2017 |