summaryrefslogtreecommitdiff
path: root/pkgtools/autoswc
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2004-02-21 23:28:32 +0000
committerjmmv <jmmv@pkgsrc.org>2004-02-21 23:28:32 +0000
commit24c387b861e54d07eeeef9f822395b38158be990 (patch)
treeb49e724dd4a117dbb5afcc7de5a3b2bc1dae72c8 /pkgtools/autoswc
parentf3c82ddf4b78243544c144e9980830da14b4c540 (diff)
downloadpkgsrc-24c387b861e54d07eeeef9f822395b38158be990.tar.gz
Reimport of autoswc, version 1.0, coming from sysutils:
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. Reason for the move: pkgtools' Makefile says this category is for packages used within pkgsrc. autoswc is specially designed to work for pkgsrc, so it is better placed here. And it may get more exposure ;-)
Diffstat (limited to 'pkgtools/autoswc')
-rw-r--r--pkgtools/autoswc/DESCR3
-rw-r--r--pkgtools/autoswc/Makefile72
-rw-r--r--pkgtools/autoswc/PLIST7
-rw-r--r--pkgtools/autoswc/files/autoswc.8130
-rw-r--r--pkgtools/autoswc/files/autoswc.mk50
-rw-r--r--pkgtools/autoswc/files/autoswc.sh209
-rw-r--r--pkgtools/autoswc/files/config.site41
-rw-r--r--pkgtools/autoswc/files/configure.ac253
8 files changed, 765 insertions, 0 deletions
diff --git a/pkgtools/autoswc/DESCR b/pkgtools/autoswc/DESCR
new file mode 100644
index 00000000000..e8cc474199b
--- /dev/null
+++ b/pkgtools/autoswc/DESCR
@@ -0,0 +1,3 @@
+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.
diff --git a/pkgtools/autoswc/Makefile b/pkgtools/autoswc/Makefile
new file mode 100644
index 00000000000..57775ca8c1a
--- /dev/null
+++ b/pkgtools/autoswc/Makefile
@@ -0,0 +1,72 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/02/21 23:28:32 jmmv Exp $
+
+DISTNAME= autoswc-1.0
+CATEGORIES= sysutils
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= jmmv@NetBSD.org
+COMMENT= Generates system wide cache files for GNU autoconf
+
+DEPENDS= autoconf>=2.59:../../devel/autoconf
+DEPENDS+= automake>=1.8.2:../../devel/automake
+DEPENDS+= libtool-base>=1.5.2:../../devel/libtool-base
+
+NO_BUILDLINK= YES
+NO_CHECKSUM= YES
+NO_CONFIGURE= YES
+NO_MTREE= YES
+USE_PKGINSTALL= YES
+WRKSRC= ${WRKDIR}
+
+PKG_SYSCONFSUBDIR= autoswc
+CACHEDIR= /var/db/autoswc
+MKCONF= /etc/mk.conf
+OWN_DIRS= ${CACHEDIR}
+
+EVAL_PREFIX+= PREFIX.autoconf=autoconf
+PREFIX.autoconf_DEFAULT= ${LOCALBASE}
+EVAL_PREFIX+= PREFIX.automake=automake
+PREFIX.automake_DEFAULT= ${LOCALBASE}
+EVAL_PREFIX+= PREFIX.libtool=libtool
+PREFIX.libtool_DEFAULT= ${LOCALBASE}
+
+SUBST_CLASSES+= build
+SUBST_MESSAGE.build= "Building autoswc."
+SUBST_STAGE.build= do-build
+SUBST_FILES.build= autoswc
+SUBST_FILES.build+= autoswc.8
+SUBST_FILES.build+= autoswc.mk
+SUBST_FILES.build+= config.site
+SUBST_SED.build= -e 's|@ACLOCAL@|${PREFIX.automake}/bin/aclocal|g'
+SUBST_SED.build+= -e 's|@AUTOCONF@|${PREFIX.autoconf}/bin/autoconf|g'
+SUBST_SED.build+= -e 's|@AUTOMAKE@|${PREFIX.automake}/bin/automake|g'
+SUBST_SED.build+= -e 's|@CACHEDIR@|${CACHEDIR}|g'
+SUBST_SED.build+= -e 's|@LIBTOOLIZE@|${PREFIX.libtool}/bin/libtoolize|g'
+SUBST_SED.build+= -e 's|@MAKE@|${MAKE}|g'
+SUBST_SED.build+= -e 's|@MKCONF@|${MKCONF}|g'
+SUBST_SED.build+= -e 's|@PREFIX@|${PREFIX}|g'
+SUBST_SED.build+= -e 's|@SH@|${SH}|g'
+SUBST_SED.build+= -e 's|@SYSCONFDIR@|${PKG_SYSCONFDIR}|g'
+
+INSTALL_DIRS= man/man8 sbin
+
+do-extract:
+ ${CP} ${FILESDIR}/autoswc.8 ${WRKSRC}
+ ${CP} ${FILESDIR}/autoswc.mk ${WRKSRC}
+ ${CP} ${FILESDIR}/autoswc.sh ${WRKSRC}/autoswc
+ ${CP} ${FILESDIR}/config.site ${WRKSRC}
+
+do-build:
+ @${DO_NADA}
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/autoswc ${PREFIX}/sbin
+ ${INSTALL_DATA} ${WRKSRC}/autoswc.8 ${PREFIX}/man/man8
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/autoswc
+ ${INSTALL_DATA} ${WRKSRC}/autoswc.mk ${PREFIX}/share/autoswc
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/autoswc
+ ${INSTALL_DATA} ${WRKSRC}/config.site ${PREFIX}/share/autoswc
+ ${INSTALL_DATA} ${FILESDIR}/configure.ac ${PREFIX}/share/autoswc
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/pkgtools/autoswc/PLIST b/pkgtools/autoswc/PLIST
new file mode 100644
index 00000000000..814a9502b35
--- /dev/null
+++ b/pkgtools/autoswc/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/02/21 23:28:32 jmmv Exp $
+man/man8/autoswc.8
+sbin/autoswc
+share/autoswc/autoswc.mk
+share/autoswc/config.site
+share/autoswc/configure.ac
+@dirrm share/autoswc
diff --git a/pkgtools/autoswc/files/autoswc.8 b/pkgtools/autoswc/files/autoswc.8
new file mode 100644
index 00000000000..037b66db103
--- /dev/null
+++ b/pkgtools/autoswc/files/autoswc.8
@@ -0,0 +1,130 @@
+.\" $NetBSD: autoswc.8,v 1.1.1.1 2004/02/21 23:28:36 jmmv Exp $
+.\"
+.\" autoswc - Generates system wide cache files for GNU autoconf
+.\" Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Neither the name of The NetBSD Foundation nor the names of its
+.\" contributors may be used to endorse or promote products derived
+.\" from this software without specific prior written permission.
+.\" 3. Neither the name of author nor the names of its contributors may
+.\" be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd February 21, 2004
+.Dt AUTOSWC 8
+.Os
+.Sh NAME
+.Nm autoswc
+.Nd generates system wide cache files for GNU autoconf
+.Sh SYNOPSIS
+.Nm
+.Op Fl c Ar ac_file
+.Op Fl n Ar cache_name
+.Sh DESCRIPTION
+.Nm
+is an utility that automatically generates system wide cache files for use
+with configure scripts created by
+.Nm GNU autoconf ,
+and specially by those executed within
+.Nm pkgsrc .
+.Pp
+.Nm
+starts by reading the configuration script template.
+It will use
+.Pa @SYSCONFDIR@/configure.ac
+if found, or fallback to
+.Pa @PREFIX@/share/autoswc/configure.ac
+otherwise (a custom file may be given using the
+.Fl 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
+.Nm GNU autoconf ,
+.Nm GNU automake
+and/or
+.Nm GNU libtool
+macros.
+There is no need to manually execute any of the
+.Sq AC_INIT ,
+.Sq AM_INIT_AUTOMAKE ,
+.Sq AC_CACHE_SAVE
+and
+.Sq AC_OUTPUT
+macros, as they are automatically inserted in the right place during
+execution.
+.Pp
+The default cache file is stored inside the
+.Pa @CACHEDIR@
+directory, using
+.Pa config.cache.default
+as the file name.
+The
+.Sq default
+part can be changed using the
+.Fl n
+flag, which takes the base name of the cache file.
+.Pp
+To tell
+.Nm pkgsrc
+to use the system wide cache, all you need to do is append the following
+line to your
+.Pa @MKCONF@
+file:
+.Bd -literal -offset indent
+\&.sinclude "@PREFIX@/share/autoswc/autoswc.mk"
+.Ed
+.Pp
+In case you used the
+.Fl n
+flag, you also need to define the
+.Va AUTOSWC_CACHE_NAME
+variable in this file, setting it to the value passed to the flag.
+.Sh NOTES
+Be very careful about what you add to
+.Pa configure.ac .
+You should only check for things that are unlikely to change over time,
+as functions in the
+.Lb 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.
+.Pp
+It is recommended that you rebuild the cache file periodically.
+You can configure a simple
+.Xr cron 8
+job to it, which just needs to launch this utility.
+.Pp
+If you hit a compilation problem in any package when using
+.Nm ,
+be
+.Em 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
+.Va AUTOSWC_DISABLE
+variable set, like in the following example:
+.Bd -literal -offset indent
+$ @MAKE@ clean
+$ @MAKE@ AUTOSWC_DISABLE=YES
+.Ed
+.Sh AUTHORS
+.An Julio M. Merino Vidal Aq jmmv@netbsd.org
diff --git a/pkgtools/autoswc/files/autoswc.mk b/pkgtools/autoswc/files/autoswc.mk
new file mode 100644
index 00000000000..ea65a26f9a4
--- /dev/null
+++ b/pkgtools/autoswc/files/autoswc.mk
@@ -0,0 +1,50 @@
+# $NetBSD: autoswc.mk,v 1.1.1.1 2004/02/21 23:28:36 jmmv Exp $
+#
+# autoswc - Generates system wide cache files for GNU autoconf
+# Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of author nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+.if !defined(AUTOSWC_MK)
+AUTOSWC_MK= # defined
+
+. if !defined(AUTOSWC_DISABLE)
+AUTOSWC_CACHE_FILE?= @CACHEDIR@/config.cache.${AUTOSWC_CACHE_NAME}
+AUTOSWC_CACHE_NAME?= default
+
+. if exists(@SYSCONFDIR@/config.site)
+AUTOSWC_CONFIG_SITE?= @SYSCONFDIR@/config.site
+. else
+AUTOSWC_CONFIG_SITE?= @PREFIX@/share/autoswc/config.site
+. endif
+
+CONFIGURE_ENV+= AUTOSWC_CACHE_FILE="${AUTOSWC_CACHE_FILE}"
+CONFIGURE_ENV+= AUTOSWC_CACHE_NAME="${AUTOSWC_CACHE_NAME}"
+CONFIGURE_ENV+= CONFIG_SITE="${AUTOSWC_CONFIG_SITE}"
+. endif
+
+.endif # AUTOSWC_MK
diff --git a/pkgtools/autoswc/files/autoswc.sh b/pkgtools/autoswc/files/autoswc.sh
new file mode 100644
index 00000000000..e0316845fd4
--- /dev/null
+++ b/pkgtools/autoswc/files/autoswc.sh
@@ -0,0 +1,209 @@
+#!@SH@
+#
+# $NetBSD: autoswc.sh,v 1.1.1.1 2004/02/21 23:28:36 jmmv Exp $
+#
+# autoswc - Generates system wide cache files for GNU autoconf
+# Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of author nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+ProgName=${0##*/}
+
+err() {
+ echo "${ProgName}: $*" 1>&2
+ exit 1
+}
+
+info() {
+ echo "${ProgName}: $*" 1>&2
+}
+
+mktempdir() {
+ local d tmpdir
+
+ # Check if mktemp exists in the current system.
+ for d in $(echo ${PATH} | tr ':' ' '); do
+ if [ -x $d/mktemp ]; then
+ $d/mktemp -d /tmp/autoswc.XXXX
+ return
+ fi
+ done
+
+ # Emulate mktemp; this is not safe.
+ info "mktemp(1) not found; race conditions may appear"
+ tmpdir=/tmp/autoswc.$$
+ mkdir -p ${tmpdir}
+ chmod 700 ${tmpdir}
+ echo ${tmpdir}
+}
+
+usage() {
+ echo "Usage: ${ProgName} [-c ac_file] [-n cache_name]" 1>&2
+ exit 1
+}
+
+# -------------------------------------------------------------------------
+
+# Main program
+
+cachename="default"
+
+confsrc="@PREFIX@/share/autoswc/configure.ac"
+[ -f "@SYSCONFDIR@/configure.ac" ] && confsrc="@SYSCONFDIR@/configure.ac"
+
+# Parse command line options
+args=$(getopt c:n: $*)
+[ $? -ne 0 ] && usage
+set -- ${args}
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -c)
+ confsrc="$2"; shift
+ ;;
+ -n)
+ cachename="$2"; shift
+ ;;
+ --)
+ shift; break
+ ;;
+ esac
+ shift
+done
+[ $# -gt 0 ] && usage
+
+# Set the cache name.
+confcache="@CACHEDIR@/config.cache.${cachename}"
+
+# Check if we will be able to store the resulting cache file.
+# The permissions may change during the execution of this script, but this
+# won't bring us problems. This check is just done to save some time in
+# case we got the wrong user running autoswc.
+touch ${confcache} >/dev/null 2>&1 || err "can't update ${confcache}"
+
+# Ensure that the source configure.ac exists.
+[ ! -f ${confsrc} ] && err "${confsrc} does not exist"
+
+# Create work directory.
+wrkdir=$(mktempdir)
+info "using ${wrkdir} as work directory"
+cd ${wrkdir}
+
+# Create work project. This includes:
+# - Makefile.am - empty, just needs to be present.
+# - configure.ac - the user-defined configure.ac file, modified to include
+# basic and required macros.
+# - NEWS README AUTHORS ChangeLog - empty, just need to be present.
+echo "# empty" >Makefile.am
+
+echo "AC_INIT(configure.ac)" >configure.ac
+echo "AM_INIT_AUTOMAKE" >>configure.ac
+cat ${confsrc} >>configure.ac
+echo "AC_CACHE_SAVE" >>configure.ac
+echo "AC_OUTPUT(Makefile)" >>configure.ac
+
+touch NEWS README AUTHORS ChangeLog
+
+# Generate scripts and add missing files.
+info "running @ACLOCAL@..."
+@ACLOCAL@
+if grep LIBTOOL configure.ac >/dev/null 2>&1; then
+ info "running @LIBTOOLIZE@..."
+ @LIBTOOLIZE@ --force
+fi
+info "running @AUTOMAKE@..."
+@AUTOMAKE@ --add-missing --force-missing
+info "running @AUTOCONF@..."
+@AUTOCONF@
+
+# Run the configure script.
+[ ! -f configure ] && err "autoconf failed"
+CONFIG_SITE= ./configure --cache-file=config.cache || \
+ err "configure failed"
+mv config.cache config.cache.in
+
+# Prune the cache file from entries that will abort configure scripts when
+# running from within pkgsrc. This is not 100% safe, because configure is
+# right in warning from changed values, but is needed to get this working.
+grep -v "^ac_cv_env" <config.cache.in >config.cache
+
+# Update the cache file. We don't give it write permissions since we don't
+# want third-party configure scripts update it with unwanted results.
+install -c -m 444 config.cache ${confcache} || err "can't update ${confcache}"
+
+cd -
+
+rm -rf ${wrkdir}
+
+# Start of summary.
+cat <<EOF
+
+===========================================================================
+AUTOSWC - SUMMARY FOR \`${cachename}' CACHE
+
+ ${confcache} updated successfully.
+
+EOF
+
+# Warn the user if autoswc.mk is not included from mk.conf.
+if ! egrep '^.-?[ \t]*s?include[ \t]+"@PREFIX@/share/autoswc/autoswc.mk"' \
+ @MKCONF@ >/dev/null 2>&1; then
+ cat <<EOF
+ The @MKCONF@ file seems to not include autoswc.mk. This means that
+ configure scripts will not find the generated cache file. Add the
+ following line to it:
+
+ .sinclude "@PREFIX@/share/autoswc/autoswc.mk"
+
+EOF
+fi
+
+# Tell the user to define AUTOSWC_CACHE_NAME if he used a custom cache
+# name.
+if [ ${cachename} != default ]; then
+ cat <<EOF
+ You have used a non-standard cache name. To let configure scripts
+ find it, you should add the following line somewhere in your
+ @MKCONF@ file, in case it is not there yet:
+
+ AUTOSWC_CACHE_NAME= ${cachename}
+
+EOF
+fi
+
+# Warn the user about the dangers of using a system wide cache file.
+cat <<EOF
+ Please remember that by using a system wide cache file, you assume
+ that the results stored in it may get outdated and cause strange build
+ failures in third-party packages. When reporting bugs, be absolutely
+ sure it is not your fault. Check the autoswc(8) manpage for more
+ details.
+===========================================================================
+EOF
+
+exit 0
+
+# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
diff --git a/pkgtools/autoswc/files/config.site b/pkgtools/autoswc/files/config.site
new file mode 100644
index 00000000000..c59b3703f50
--- /dev/null
+++ b/pkgtools/autoswc/files/config.site
@@ -0,0 +1,41 @@
+# $NetBSD: config.site,v 1.1.1.1 2004/02/21 23:28:36 jmmv Exp $
+#
+# autoswc - Generates system wide cache files for GNU autoconf
+# Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of author nor the names of its contributors may
+# be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Set default values.
+: ${AUTOSWC_CACHE_NAME:=default}
+: ${AUTOSWC_CACHE_FILE:=@CACHEDIR@/config.cache.${AUTOSWC_CACHE_NAME}}
+
+# Set which cache file to use, if not already set.
+if test "${cache_file}" = /dev/null; then
+ cache_file="${AUTOSWC_CACHE_FILE}"
+fi
+
+# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
diff --git a/pkgtools/autoswc/files/configure.ac b/pkgtools/autoswc/files/configure.ac
new file mode 100644
index 00000000000..42930b487f6
--- /dev/null
+++ b/pkgtools/autoswc/files/configure.ac
@@ -0,0 +1,253 @@
+dnl $NetBSD: configure.ac,v 1.1.1.1 2004/02/21 23:28:36 jmmv Exp $
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for host details.
+AC_CANONICAL_HOST
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for compilers and preprocessors.
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_CXXCPP
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for libtool and the maximum command line length supported by the
+dnl system, as this takes a long time.
+AM_PROG_LIBTOOL
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for compiler features.
+AC_C_BACKSLASH_A
+AC_C_BIGENDIAN
+AC_C_CONST
+AC_C_RESTRICT
+AC_C_VOLATILE
+AC_C_INLINE
+AC_C_CHAR_UNSIGNED
+AC_C_LONG_DOUBLE
+AC_C_STRINGIZE
+AC_C_PROTOTYPES
+AC_PROG_CC_C_O
+AC_PROG_GCC_TRADITIONAL
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for standard header files.
+AC_HEADER_DIRENT
+AC_HEADER_MAJOR
+AC_HEADER_STAT
+AC_HEADER_STDBOOL
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_HEADER_TIME
+AC_HEADER_TIOCGWINSZ
+AC_CHECK_HEADERS([sys/cdefs.h \
+ sys/ioctl.h \
+ sys/mount.h \
+ sys/param.h \
+ sys/resource.h \
+ sys/stat.h \
+ sys/statvfs.h \
+ sys/sysctl.h \
+ sys/types.h \
+ sys/utsname.h \
+ sys/varargs.h \
+ sys/vfs.h \
+ argz.h \
+ assert.h \
+ ctype.h \
+ err.h \
+ fcntl.h \
+ fstab.h \
+ inttypes.h \
+ libgen.h \
+ limits.h \
+ malloc.h \
+ mntent.h \
+ mount.h \
+ paths.h \
+ signal.h \
+ stdarg.h \
+ stddef.h \
+ stdint.h \
+ strings.h \
+ util.h \
+ varargs.h \
+ wctype.h],,,
+ [[#if HAVE_SYS_CDEFS_H
+ # include <sys/cdefs.h>
+ #endif
+ #if HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif]])
+AC_LANG_PUSH(C++)
+AC_CHECK_HEADERS([bitset \
+ deque \
+ fstream \
+ iostream \
+ list \
+ map \
+ queue \
+ set \
+ stack \
+ string \
+ vector])
+AC_LANG_POP(C++)
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for standard functions.
+AC_FUNC_ALLOCA
+AC_FUNC_CHOWN
+AC_FUNC_CLOSEDIR_VOID
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FNMATCH
+AC_FUNC_FORK
+AC_FUNC_FSEEKO
+AC_FUNC_GETGROUPS
+AC_FUNC_GETMNTENT
+AC_FUNC_GETPGRP
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_FUNC_MBRTOWC
+AC_FUNC_MKTIME
+AC_FUNC_MMAP
+AC_FUNC_OBSTACK
+AC_FUNC_REALLOC
+AC_FUNC_SELECT_ARGTYPES
+AC_FUNC_SETPGRP
+AC_FUNC_STAT
+AC_FUNC_LSTAT
+AC_FUNC_SETVBUF_REVERSED
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_FUNC_STRERROR_R
+AC_FUNC_STRFTIME
+AC_FUNC_STRNLEN
+AC_FUNC_UTIME_NULL
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS([__argz_count \
+ __argz_next \
+ __argz_stringify \
+ __fsetlocking \
+ basename \
+ bzero \
+ connect \
+ dirname \
+ dup2 \
+ err \
+ errx \
+ feof_unlocked \
+ fgets_unlocked \
+ getc_unlocked \
+ getcwd \
+ getdelim \
+ getdtablesize \
+ getegid \
+ geteuid \
+ getgid \
+ gethostbyname \
+ getmode \
+ getprogname \
+ gettimeofday \
+ getuid \
+ inet_pton \
+ lockf \
+ lseek64 \
+ memchr \
+ memcpy \
+ memmove \
+ memset \
+ mempcpy \
+ mmap \
+ mkdir \
+ mkfifo \
+ mkstemp \
+ mkstemps \
+ mktemp \
+ munmap \
+ open64 \
+ poll \
+ putenv \
+ readdir_r \
+ remove \
+ setegid \
+ setenv \
+ seteuid \
+ setmode \
+ setprogname \
+ setresgid \
+ setresuid \
+ shmat \
+ sigaction \
+ sigset \
+ snprintf \
+ socket \
+ statvfs \
+ stpcpy \
+ strcasecmp \
+ strchr \
+ strrchr \
+ strdup \
+ strerror \
+ stricmp \
+ strlcat \
+ strlcpy \
+ strncasecmp \
+ strncat \
+ strncpy \
+ strndup \
+ strspn \
+ strstr \
+ strtoul \
+ tsearch \
+ uname \
+ vasprintf \
+ vsnprintf \
+ waitpid \
+ wait3 \
+ warn \
+ warnx])
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for standard types.
+AC_CHECK_TYPES([gid_t,
+ int16_t,
+ int32_t,
+ int64_t,
+ int8_t,
+ mode_t,
+ off_t,
+ ptrdiff_t,
+ rlim_t,
+ sig_t,
+ size_t,
+ ssize_t,
+ u_int16_t,
+ u_int32_t,
+ u_int64_t,
+ u_int8_t,
+ uid_t,
+ uint16_t,
+ uint32_t,
+ uint64_t,
+ uint8_t])
+
+dnl -----------------------------------------------------------------------
+
+dnl Check for standard sizes.
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+dnl vim: syntax=config:expandtab:shiftwidth=4:softtabstop=4