Links
configure.ac
- Written in m4sh (m4 + shell)
- Program initialization:
AC_INITmacro—needs name, version, maintainer - Initialize automake:
AM_INIT_AUTOMAKE - Make sure that C-compiler exists:
AC_PROG_CC - Build
MakefilefromMakefile.in, replaces@PACKAGE_VERSION@-type variables:AC_CONFIG_FILES([Makefile]) - Output the script:
AC_OUTPUT
AC_INIT([hello-world], [0.1], [tyler@tylercipriani.com])
# Initialize automake
AM_INIT_AUTOMAKE
# Ensure C-compiler exists
AC_PROG_CC
# Specify what files are to be created
AC_CONFIG_FILES([Makefile])
AC_OUTPUTMakefile.am
- The
./configurescript (created byconfigure.ac), expects to findMakefile.in Makefile.inis long and dumb (just like./configure), so we make aMakefile.amautomakegeneratesMakefile.inforeignAUTOMAKEOPTIONS tells that the layout is "non standard"
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = hello-world
hello-world_SOURCES = hello-world.cPut it all together:
- create m4 environment:
aclocal autoconfdoes:configure.ac→configureautomake --add-missingdoes:Makefile.am→Makefile.inautoreconf --install: autoreconf runs autoconf, autoheader, aclocal, automake, libtoolize, and autopoint
Add a comment (Comment Policy)