The various GNU autotools provide an abstraction mechanism for building a piece of software over a wide variety of operating systems and machine architectures. Within the Ports Collection, an individual port can make use of these tools via a simple construct:
USE_AUTOTOOLS=tool:version[:operation] ...
At the time of writing, tool can be
one of libtool, libltdl,
autoconf, autoheader,
automake or aclocal.
version specifies the particular
tool revision to be used (see
devel/{automake,autoconf,libtool}[0-9]+ for
valid versions).
operation is an optional extension
to modify how the tool is used.
Multiple tools can be specified at once, either by including
them all on a single line, or using the +=
Makefile construct.
Finally, there is the special tool, called
autotools, which is a convenience function
to bring in all available versions of the autotools to allow
for cross-development work. This can also be accomplished
by installing the devel/autotools port.
Shared libraries using the GNU building framework usually use
libtool to adjust the compilation and
installation of shared libraries to match the specifics of the
underlying operating system. The usual practice is to use copy of
libtool bundled with the application. In case
you need to use external libtool, you can use
the version provided by The Ports Collection:
USE_AUTOTOOLS= libtool:version[:env]With no additional operations,
libtool:version tells
the building framework to patch the configure script with the
system-installed copy of libtool.
The GNU_CONFIGURE is implied.
Further, a number of make and shell
variables will be assigned for onward use by the port. See
bsd.autotools.mk for details.
With the :env operation, only the
environment will be set up.
Finally, LIBTOOLFLAGS and
LIBTOOLFILES can be optionally set to override
the most likely arguments to, and files patched by,
libtool. Most ports are unlikely to need this.
See bsd.autotools.mk for further
details.
Some ports make use of the libltdl library
package, which is part of the libtool suite.
Use of this library does not automatically necessitate the use of
libtool itself, so a separate construct is
provided.
USE_AUTOTOOLS= libltdl:versionCurrently, all this does is to bring in a
LIB_DEPENDS on the appropriate
libltdl port, and is provided as a convenience
function to help eliminate any dependencies on the autotools ports
outside of the USE_AUTOTOOLS framework. There
are no optional operations for this tool.
Some ports do not contain a configure script, but do contain an
autoconf template in the configure.ac file.
You can use the following assignments to let
autoconf create the configure script, and also
have autoheader create template headers for use
by the configure script.
USE_AUTOTOOLS= autoconf:version[:env]and
USE_AUTOTOOLS= autoheader:versionwhich also implies the use of
autoconf:version.
Similarly to libtool, the inclusion of the
optional :env operation simply sets up the
environment for further use. Without it, patching and
reconfiguration of the port is carried out.
The additional optional variables
AUTOCONF_ARGS and
AUTOHEADER_ARGS can be overridden by the port
Makefile if specifically requested. As with
the libtool equivalents, most ports are unlikely
to need this.
Some packages only contain Makefile.am
files. These have to be converted into
Makefile.in files using
automake, and the further processed by
configure to generate an actual
Makefile.
Similarly, packages occasionally do not ship with included
aclocal.m4 files, again required to build the
software. This can be achieved with aclocal,
which scans configure.ac or
configure.in.
aclocal has a similar relationship to
automake as autoheader does
to autoconf, described in the previous section.
aclocal implies the use of
automake, thus we have:
USE_AUTOTOOLS= automake:version[:env]
and
USE_AUTOTOOLS= aclocal:versionwhich also implies the use of
automake:version.
Similarly to libtool and
autoconf, the inclusion of the optional
:env operation simply sets up the environment
for further use. Without it, reconfiguration of the port is
carried out.
As with
autoconf and autoheader, both
automake and aclocal have
optional argument variables, AUTOMAKE_ARGS and
ACLOCAL_ARGS respectively, which may be
overriden by the port Makefile if
required.
All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/
Questions that are not answered by the
documentation may be
sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.