but also otherįunctions which can be defined by specific packages like libraries and programs
In the configure.ac or configure.in files you can call not only theĭefault macros defined by autoconf and automake. This is handled via the macro AC_SUBST(VARNAME) in configure.ac. %.1 : %.in -e ", $(VERSION),g " $? > the variable will be substituted with whateverĬonfigure detects ( sed in this case) when creating the Makefile. Isn't a standard automake way of handling a certain task. You may also see some standard Makefile constructs showing up whenever there Myapp_SOURCES = myapp_commandline.c myapp.cĪll the standard GNU rules will be generated, so make. 'special' variables being set, rather than every rule being written manually. The basic format is like that of a Makefile. Which is in turn processed by configure to create Makefile, which is in The Makefile.am file is processed by automake to create Makefile.in, configure script generate the relevant files. The file will finish with some output functions:ĪM_CONFIG_HEADER (config.h ) AC_OUTPUT (Makefile src/Makefile nls/Makefile man/Makefile tests/Makefile )
#Install aclocal code
Question - most autotools code is copy/pasted rather than written from scratch,Īnd autoscan (a tool which helps write configure.ac) is sometimes In someĬases, many of the checks done won't even be necessary for the application in Often these will be all jumbled together without any useful comments. You may also see checks for compiler features:ĭnl Check that our compiler can do const and inline AC_C_CONST AC_C_INLINEĭnl Check for standard headers: AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS ( ) dnl Check for libraries: AC_CHECK_LIB (ssl, SSL_free )ĭnl Check for functions: AC_CHECK_FUNCS ( )
#Install aclocal install
Usually, some standard checks will follow:ĭnl Check for toolchain and install components AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_RANLIBįor non-standard applications, you may also see manual checks:ĭnl Check for sed AC_CHECK_PROGS (regex_cmd, sed ) if test x$regex_cmd = " x " then AC_MSG_ERROR ( ) fi Other distributions may handle things differently. The WANT_ variables are a Gentoo feature that originally came from Used to make an unversioned automake call run the correct version. Setting WANT_AUTOMAKE="1.8" in the environment can be
The AM_INIT_AUTOMAKE line tells us which automake version we need.Īgain, there is little chance that an automake-1.7 script will work properly and we shouldĮxport WANT_AUTOCONF="2.5" (or use the autoconf-2.59 script) when calling In the above example, we need =autoconf-2.5*. This is useful, because autoconf is not compatible between versions. The AC_PREREQ line, if present, tells you which autoconf version you If the previous sentence made you uneasy, you should probably stop reading thisĪ typical file might start with something like the following:ĭnl Process this file with autoconf AC_INIT (appname, 0.1 ) AC_PREREQ ( 2.5 ) AC_CONFIG_SRCDIR (src/main.c ) AC_CONFIG_AUX_DIR (config ) AM_INIT_AUTOMAKE ( 1.8 ) Comments are indicated by the string dnl ( dnl isĪctually a macro which discards the remainder of the input - it stands for The configure.ac file is a basic text file.