AUTOSWC(8)

NAME
autoswc - generates system wide cache files for GNU autoconf

SYNOPSIS
autoswc [-c ac_file] [-n cache_name]

DESCRIPTION
autoswc is an utility that automatically generates system wide cache files for use with configure scripts created by GNU autoconf, and specially by those executed within pkgsrc.

autoswc starts by reading the configuration script template. It will use /usr/pkg/etc/autoswc/configure.ac if found, or fallback to /usr/pkg/share/autoswc/configure.ac otherwise (a custom file may be given using the -c flag, though). This issues all checks that the user wants to store in the system wide cache file, and are basically calls to standard GNU autoconf, GNU automake and/or GNU libtool macros. There is no need to manually execute any of the ‘AC_INIT’, ‘AM_INIT_AUTOMAKE’, ‘AC_CACHE_SAVE’ and ‘AC_OUTPUT’ macros, as they are automatically inserted in the right place during execution.

The default cache file is stored inside the /var/db/autoswc directory, using config.cache.default as the file name. The ‘default’ part can be changed using the -n flag, which takes the base name of the cache file.

To tell pkgsrc to use the system wide cache, all you need to do is append the following line to your /etc/mk.conf file:

    .sinclude "/usr/pkg/share/autoswc/autoswc.mk"

In case you used the -n flag, you also need to define the AUTOSWC_CACHE_NAME variable in this file, setting it to the value passed to the flag.

NOTES
Be very careful about what you add to configure.ac. You should only check for things that are unlikely to change over time, as functions in the libc and its header files. Failure to do so can easily lead to cache files that get outdated very easily during installation of new packages, and cause unexpected configuration errors.

It is recommended that you rebuild the cache file periodically. You can configure a simple cron(8) job to it, which just needs to launch this utility.

If you hit a compilation problem in any package when using autoswc, be absolutely sure it is not beeing caused by an outdated cache before reporting problems. The safest and easiest way to do this is to clean the package in question and restart the build with the AUTOSWC_DISABLE variable set, like in the following example:

    $ /usr/bin/make clean
    $ /usr/bin/make AUTOSWC_DISABLE=YES

AUTHORS
Julio M. Merino Vidal <jmmv@netbsd.org>