summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
-rwxr-xr-xMakepkgs4
-rw-r--r--VERSION2
-rw-r--r--aclocal.m4191
-rw-r--r--configure.in202
-rw-r--r--debian/changelog4
-rw-r--r--doc/CHANGES3
-rw-r--r--include/builddefs.in3
-rw-r--r--include/buildmacros1
-rw-r--r--include/buildrules4
-rw-r--r--m4/Makefile45
-rw-r--r--m4/manual_format.m417
-rw-r--r--m4/package_globals.m443
-rw-r--r--m4/package_utilies.m4115
14 files changed, 433 insertions, 214 deletions
diff --git a/Makefile b/Makefile
index 4272de0..9284767 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as
@@ -38,13 +38,14 @@ include $(TOPDIR)/include/builddefs
endif
CONFIGURE = configure include/builddefs include/config.h
-LSRCFILES = configure configure.in Makepkgs install-sh README VERSION exports
+LSRCFILES = configure configure.in aclocal.m4 Makepkgs install-sh exports \
+ README VERSION
LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
Logs/* built .census install.* install-dev.* install-lib.* *.gz
SUBDIRS = include libattr attr getfattr setfattr \
- examples test man doc po debian build
+ examples test m4 man doc po debian build
default: $(CONFIGURE)
ifeq ($(HAVE_BUILDDEFS), no)
@@ -74,6 +75,9 @@ $(CONFIGURE):
$$LOCAL_CONFIGURE_OPTIONS
touch .census
+aclocal.m4::
+ aclocal --acdir=$(TOPDIR)/m4 --output=$@
+
install: default
$(SUBDIRS_MAKERULE)
$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
@@ -84,5 +88,4 @@ install-dev install-lib: default
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
- rm -rf autom4te.cache
- [ ! -d Logs ] || rmdir Logs
+ rm -rf autom4te.cache Logs
diff --git a/Makepkgs b/Makepkgs
index e3f9e0c..1c094b2 100755
--- a/Makepkgs
+++ b/Makepkgs
@@ -53,9 +53,9 @@ fi
# build RPM packages - manual clean before starting
echo "== clean, log is $LOGDIR/clean"
if $verbose ; then
- $MAKE clean 2>&1 | tee $LOGDIR/clean
+ $MAKE realclean 2>&1 | tee $LOGDIR/clean
else
- $MAKE clean > $LOGDIR/clean 2>&1 || exit 1
+ $MAKE realclean > $LOGDIR/clean 2>&1 || exit 1
fi
echo
diff --git a/VERSION b/VERSION
index cb5e820..8dde1cb 100644
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
#
PKG_MAJOR=2
PKG_MINOR=4
-PKG_REVISION=2
+PKG_REVISION=3
PKG_BUILD=0
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..2eafbe7
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,191 @@
+# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*-
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+#
+# Generic macro, sets up all of the global packaging variables.
+# The following environment variables may be set to override defaults:
+# DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
+#
+AC_DEFUN([AC_PACKAGE_GLOBALS],
+ [ pkg_name="$1"
+ AC_SUBST(pkg_name)
+
+ . ./VERSION
+ pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
+ AC_SUBST(pkg_version)
+ pkg_release=$PKG_BUILD
+ AC_SUBST(pkg_release)
+
+ DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
+ debug_build="$DEBUG"
+ AC_SUBST(debug_build)
+
+ OPTIMIZER=${OPTIMIZER:-'-g'} dnl -O2
+ opt_build="$OPTIMIZER"
+ AC_SUBST(opt_build)
+
+ MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
+ malloc_lib="$MALLOCLIB"
+ AC_SUBST(malloc_lib)
+
+ PKG_USER=${INSTALL_USER:-'root'}
+ pkg_user="$PKG_USER"
+ AC_SUBST(pkg_user)
+
+ PKG_GROUP=${INSTALL_GROUP:-'root'}
+ pkg_group="$PKG_GROUP"
+ AC_SUBST(pkg_group)
+
+ pkg_distribution=`uname -s`
+ test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
+ AC_SUBST(pkg_distribution)
+
+ pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
+ test -z "$PLATFORM" || pkg_platform="$PLATFORM"
+ AC_SUBST(pkg_platform)
+ ])
+
+#
+# Check for specified utility (env var) - if unset, fail.
+#
+AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
+ [ if test -z "$2"; then
+ echo
+ echo FATAL ERROR: $3 does not seem to be installed.
+ echo $1 cannot be built without a working $4 installation.
+ exit 1
+ fi
+ ])
+
+#
+# Generic macro, sets up all of the global build variables.
+# The following environment variables may be set to override defaults:
+# CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
+# MSGFMT MSGMERGE RPM
+#
+AC_DEFUN([AC_PACKAGE_UTILITIES],
+ [ if test -z "$CC"; then
+ AC_PROG_CC
+ fi
+ cc="$CC"
+ AC_SUBST(cc)
+ AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
+
+ if test -z "$MAKE"; then
+ AC_PATH_PROG(MAKE, make, /usr/bin/make)
+ fi
+ make=$MAKE
+ AC_SUBST(make)
+ AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
+
+ if test -z "$LIBTOOL"; then
+ AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
+ fi
+ libtool=$LIBTOOL
+ AC_SUBST(libtool)
+ AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
+
+ if test -z "$TAR"; then
+ AC_PATH_PROG(TAR, tar)
+ fi
+ tar=$TAR
+ AC_SUBST(tar)
+ if test -z "$ZIP"; then
+ AC_PATH_PROG(ZIP, gzip, /bin/gzip)
+ fi
+ zip=$ZIP
+ AC_SUBST(zip)
+ if test -z "$MAKEDEPEND"; then
+ AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
+ fi
+ makedepend=$MAKEDEPEND
+ AC_SUBST(makedepend)
+ if test -z "$AWK"; then
+ AC_PATH_PROG(AWK, awk, /bin/awk)
+ fi
+ awk=$AWK
+ AC_SUBST(awk)
+ if test -z "$SED"; then
+ AC_PATH_PROG(SED, sed, /bin/sed)
+ fi
+ sed=$SED
+ AC_SUBST(sed)
+ if test -z "$ECHO"; then
+ AC_PATH_PROG(ECHO, echo, /bin/echo)
+ fi
+ echo=$ECHO
+ AC_SUBST(echo)
+ if test -z "$SORT"; then
+ AC_PATH_PROG(SORT, sort, /bin/sort)
+ fi
+ sort=$SORT
+ AC_SUBST(sort)
+
+ dnl check if symbolic links are supported
+ AC_PROG_LN_S
+
+ if test "$enable_gettext" = yes; then
+ if test -z "$MSGFMT"; then
+ AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
+ fi
+ msgfmt=$MSGFMT
+ AC_SUBST(msgfmt)
+ AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
+ if test -z "$MSGMERGE"; then
+ AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
+ fi
+ msgmerge=$MSGMERGE
+ AC_SUBST(msgmerge)
+ AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
+ fi
+
+ if test -z "$RPM"; then
+ AC_PATH_PROG(RPM, rpm, /bin/rpm)
+ fi
+ rpm=$RPM
+ AC_SUBST(rpm)
+ dnl .. and what version is rpm
+ rpm_version=0
+ test -x $RPM && rpm_version=`$RPM --version \
+ | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
+ AC_SUBST(rpm_version)
+ dnl At some point in rpm 4.0, rpm can no longer build rpms, and
+ dnl rpmbuild is needed (rpmbuild may go way back; not sure)
+ dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
+ if test $rpm_version -ge 4; then
+ AC_PATH_PROG(RPMBUILD, rpmbuild)
+ rpmbuild=$RPMBUILD
+ else
+ rpmbuild=$RPM
+ fi
+ AC_SUBST(rpmbuild)
+ ])
+
+#
+# Find format of installed man pages.
+# Always gzipped on Debian, but not Redhat pre-7.0.
+# We don't deal with bzip2'd man pages, which Mandrake uses,
+# someone will send us a patch sometime hopefully. :-)
+#
+AC_DEFUN([AC_MANUAL_FORMAT],
+ [ have_zipped_manpages=false
+ for d in ${prefix}/share/man ${prefix}/man ; do
+ if test -f $d/man1/man.1.gz
+ then
+ have_zipped_manpages=true
+ break
+ fi
+ done
+ AC_SUBST(have_zipped_manpages)
+ ])
+
diff --git a/configure.in b/configure.in
index 96aec53..b482502 100644
--- a/configure.in
+++ b/configure.in
@@ -1,219 +1,23 @@
-dnl unpacking check - this file must exist
AC_INIT(include/attributes.h)
AC_CONFIG_HEADER(include/config.h)
-
-pkg_name="attr"
-AC_SUBST(pkg_name)
-
AC_PREFIX_DEFAULT(/usr)
-#
-# Note: the following environment variables may be set to override the
-# defaults (to change paths and/or executables, build parameters, etc):
-#
-# DEBUG OPTIMIZER MALLOCLIB
-# PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
-# MAKE CC LD TAR ZIP AWK SED ECHO RPM LIBTOOL
-# MSGFMT MSGMERGE XGETTEXT
-#
-
-DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG
-OPTIMIZER=${OPTIMIZER:-'-g'} # -O2
-MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a
-
-dnl Debug build?
-debug_build="$DEBUG"
-AC_SUBST(debug_build)
-
-dnl Optimization options?
-opt_build="$OPTIMIZER"
-AC_SUBST(opt_build)
-
-dnl Alternate malloc library?
-malloc_lib="$MALLOCLIB"
-AC_SUBST(malloc_lib)
-
-dnl Set version
-. ./VERSION
-
-pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
-pkg_release=$PKG_BUILD
-AC_SUBST(pkg_version)
-AC_SUBST(pkg_release)
-
-pkg_platform=`uname -s`
-pkg_distribution="Generic $pkg_platform"
-pkg_platform=`echo $pkg_platform | tr 'A-Z' 'a-z'`
-test -z "$PLATFORM" || pkg_platform="$PLATFORM"
-test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
-AC_SUBST(pkg_distribution)
-AC_SUBST(pkg_platform)
-
-pkg_user=root
-test -z "$INSTALL_USER" || pkg_user="$INSTALL_USER"
-AC_SUBST(pkg_user)
-
-pkg_group=root
-test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP"
-AC_SUBST(pkg_group)
-
-dnl check if user wants their own C compiler
-if test -z "$CC"; then
- AC_PROG_CC
-fi
-cc=$CC
-AC_SUBST(cc)
-
-dnl check if users wants their own make
-if test -z "$MAKE"; then
- AC_PATH_PROG(MAKE, make, /usr/bin/make)
-fi
-make=$MAKE
-AC_SUBST(make)
-
-dnl check if users wants their own linker
-if test -z "$LD"; then
- AC_PATH_PROG(LD, ld, /usr/bin/ld)
-fi
-ld=$LD
-AC_SUBST(ld)
-
-dnl check if the tar program is available
-if test -z "$TAR"; then
- AC_PATH_PROG(TAR, tar)
-fi
-tar=$TAR
-AC_SUBST(tar)
-
-dnl check if the gzip program is available
-if test -z "$ZIP"; then
- AC_PATH_PROG(ZIP, gzip, /bin/gzip)
-fi
-zip=$ZIP
-AC_SUBST(zip)
-
-dnl check if the makedepend program is available
-if test -z "$MAKEDEPEND"; then
- AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
-fi
-makedepend=$MAKEDEPEND
-AC_SUBST(makedepend)
-
-dnl check if the rpm program is available
-if test -z "$RPM"; then
- AC_PATH_PROG(RPM, rpm, /bin/rpm)
-fi
-rpm=$RPM
-AC_SUBST(rpm)
-
-dnl .. and what version is rpm
-rpm_version=0
-test -x $RPM && \
- rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'`
-AC_SUBST(rpm_version)
-
-dnl At some point in rpm 4.0, rpm can no longer build rpms, and
-dnl rpmbuild is needed (rpmbuild may go way back; not sure)
-dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
-
-if test $rpm_version -ge 4; then
- AC_PATH_PROG(RPMBUILD, rpmbuild)
- rpmbuild=$RPMBUILD
-else
- rpmbuild=$RPM
-fi
-AC_SUBST(rpmbuild)
-
-dnl check if symbolic links are supported
-AC_PROG_LN_S
-
-dnl check if user wants their own awk, sed and echo
-if test -z "$AWK"; then
- AC_PATH_PROG(AWK, awk, /bin/awk)
-fi
-awk=$AWK
-AC_SUBST(awk)
-if test -z "$SED"; then
- AC_PATH_PROG(SED, sed, /bin/sed)
-fi
-sed=$SED
-AC_SUBST(sed)
-if test -z "$ECHO"; then
- AC_PATH_PROG(ECHO, echo, /bin/echo)
-fi
-echo=$ECHO
-AC_SUBST(echo)
-
-dnl ensure libtool is installed
-if test -z "$LIBTOOL"; then
- AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
-fi
-if test -z "$LIBTOOL"; then
- echo
- echo 'FATAL ERROR: libtool does not seem to be installed.'
- echo $pkg_name cannot be built without a working libtool installation.
- exit 1
-fi
-libtool=$LIBTOOL
-AC_SUBST(libtool)
-
-dnl libtool to build libraries static only?
AC_ARG_ENABLE(shared,
[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
enable_shared=yes)
AC_SUBST(enable_shared)
-dnl will we be making use of gettext?
AC_ARG_ENABLE(gettext,
[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
enable_gettext=yes)
-if test $enable_gettext = yes; then
- AC_DEFINE(ENABLE_GETTEXT)
-fi
AC_SUBST(enable_gettext)
-dnl check if the msgfmt, msgmerge, xgettext programs are available
-if test "$enable_gettext" = yes; then
- if test -z "$MSGFMT"; then
- AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
- fi
- msgfmt=$MSGFMT
- AC_SUBST(msgfmt)
- if test -z "$MSGMERGE"; then
- AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
- fi
- msgmerge=$MSGMERGE
- AC_SUBST(msgmerge)
- if test -z "$XGETTEXT"; then
- AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext)
- fi
- xgettext=$XGETTEXT
- AC_SUBST(xgettext)
-
- if test -z "$XGETTEXT"; then
- echo
- echo 'FATAL ERROR: xgettext does not seem to be installed.'
- echo $pkg_name cannot be built without a working gettext installation.
- exit 1
- fi
-fi
-
-dnl man pages (source)
-dnl also check if man page source is gzipped
-dnl (usually on Debian, but not Redhat pre-7.0)
-have_zipped_manpages=false
-for d in ${prefix}/share/man ${prefix}/man ; do
- if test -f $d/man1/man.1.gz; then
- have_zipped_manpages=true
- break
- fi
-done
-AC_SUBST(have_zipped_manpages)
+AC_PACKAGE_GLOBALS(attr)
+AC_PACKAGE_UTILITIES(attr)
+AC_MANUAL_FORMAT
-dnl Some more stuff for the ACL copying functions
AC_C_CONST
AC_TYPE_MODE_T
AC_FUNC_ALLOCA
-dnl build definitions for use in Makefiles
AC_OUTPUT(include/builddefs)
diff --git a/debian/changelog b/debian/changelog
index b3b3621..339e26e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-attr (2.4.2-1) unstable; urgency=low
+attr (2.4.3-1) unstable; urgency=low
* New upstream release
* Note: COMPAT_XFSROOT environment variable is no longer needed
- -- Nathan Scott <nathans@debian.org> Mon, 14 Apr 2003 09:00:18 +1000
+ -- Nathan Scott <nathans@debian.org> Sat, 26 Apr 2003 04:36:01 +1000
attr (2.4.0-1) unstable; urgency=low
diff --git a/doc/CHANGES b/doc/CHANGES
index 2e570dc..e532837 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,3 +1,6 @@
+attr-2.4.3 (26 April 2003)
+ - Rework configure.in to make use of shared macros.
+
attr-2.4.2 (14 April 2003)
- Found a better way to handle the trusted/xfsroot namespace
transition, from a suggestion from Andreas. COMPAT_XFSROOT
diff --git a/include/builddefs.in b/include/builddefs.in
index d238e8f..716acff 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -61,20 +61,19 @@ PKG_DOC_DIR = @datadir@/doc/@pkg_name@
PKG_LOCALE_DIR = @datadir@/locale
CC = @cc@
-LD = @ld@
AWK = @awk@
SED = @sed@
TAR = @tar@
ZIP = @zip@
MAKE = @make@
ECHO = @echo@
+SORT = @sort@
LN_S = @LN_S@
LIBTOOL = @LIBTOOL@
MAKEDEPEND = @makedepend@
MSGFMT = @msgfmt@
MSGMERGE = @msgmerge@
-XGETTEXT = @xgettext@ --omit-header --language=C --keyword=_
RPM = @rpm@
RPMBUILD = @rpmbuild@
diff --git a/include/buildmacros b/include/buildmacros
index f4e8bec..bce094c 100644
--- a/include/buildmacros
+++ b/include/buildmacros
@@ -63,7 +63,6 @@ DIST_DIR = $(TOPDIR)/dist
CCF = $(CC) $(CFLAGS) $(CPPFLAGS)
MAKEF = $(MAKE) $(MAKEOPTS)
CXXF = $(CXX) $(CXXFLAGS)
-LDF = $(LD) $(LDFLAGS)
# For libtool.
LIBNAME = $(basename $(LTLIBRARY))
diff --git a/include/buildrules b/include/buildrules
index 89cff02..5ef98c1 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2001-2002 Silicon Graphics, Inc. All Rights Reserved.
+# Copyright (c) 1999, 2001-2003 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
@@ -57,7 +57,7 @@ endif
ifdef LINGUAS
%.pot: $(XGETTEXTFILES)
- $(XGETTEXT) -o $@ $(XGETTEXTFILES)
+ xgettext --omit-header --language=C --keyword=_ -o $@ $(XGETTEXTFILES)
%.tmpo: %.po
$(MSGMERGE) -o $@ $< $(PKG_NAME).pot
diff --git a/m4/Makefile b/m4/Makefile
new file mode 100644
index 0000000..52fe275
--- /dev/null
+++ b/m4/Makefile
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+# Mountain View, CA 94043, or:
+#
+# http://www.sgi.com
+#
+# For further information regarding this notice, see:
+#
+# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+#
+
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+LSRCFILES = \
+ manual_format.m4 \
+ package_globals.m4 \
+ package_utilies.m4
+
+default:
+
+include $(BUILDRULES)
+
+install install-dev install-lib: default
diff --git a/m4/manual_format.m4 b/m4/manual_format.m4
new file mode 100644
index 0000000..50c6a91
--- /dev/null
+++ b/m4/manual_format.m4
@@ -0,0 +1,17 @@
+#
+# Find format of installed man pages.
+# Always gzipped on Debian, but not Redhat pre-7.0.
+# We don't deal with bzip2'd man pages, which Mandrake uses,
+# someone will send us a patch sometime hopefully. :-)
+#
+AC_DEFUN([AC_MANUAL_FORMAT],
+ [ have_zipped_manpages=false
+ for d in ${prefix}/share/man ${prefix}/man ; do
+ if test -f $d/man1/man.1.gz
+ then
+ have_zipped_manpages=true
+ break
+ fi
+ done
+ AC_SUBST(have_zipped_manpages)
+ ])
diff --git a/m4/package_globals.m4 b/m4/package_globals.m4
new file mode 100644
index 0000000..c83dc2d
--- /dev/null
+++ b/m4/package_globals.m4
@@ -0,0 +1,43 @@
+#
+# Generic macro, sets up all of the global packaging variables.
+# The following environment variables may be set to override defaults:
+# DEBUG OPTIMIZER MALLOCLIB PLATFORM DISTRIBUTION INSTALL_USER INSTALL_GROUP
+#
+AC_DEFUN([AC_PACKAGE_GLOBALS],
+ [ pkg_name="$1"
+ AC_SUBST(pkg_name)
+
+ . ./VERSION
+ pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION}
+ AC_SUBST(pkg_version)
+ pkg_release=$PKG_BUILD
+ AC_SUBST(pkg_release)
+
+ DEBUG=${DEBUG:-'-DDEBUG'} dnl -DNDEBUG
+ debug_build="$DEBUG"
+ AC_SUBST(debug_build)
+
+ OPTIMIZER=${OPTIMIZER:-'-g'} dnl -O2
+ opt_build="$OPTIMIZER"
+ AC_SUBST(opt_build)
+
+ MALLOCLIB=${MALLOCLIB:-''} dnl /usr/lib/libefence.a
+ malloc_lib="$MALLOCLIB"
+ AC_SUBST(malloc_lib)
+
+ PKG_USER=${INSTALL_USER:-'root'}
+ pkg_user="$PKG_USER"
+ AC_SUBST(pkg_user)
+
+ PKG_GROUP=${INSTALL_GROUP:-'root'}
+ pkg_group="$PKG_GROUP"
+ AC_SUBST(pkg_group)
+
+ pkg_distribution=`uname -s`
+ test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
+ AC_SUBST(pkg_distribution)
+
+ pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'`
+ test -z "$PLATFORM" || pkg_platform="$PLATFORM"
+ AC_SUBST(pkg_platform)
+ ])
diff --git a/m4/package_utilies.m4 b/m4/package_utilies.m4
new file mode 100644
index 0000000..afad8dc
--- /dev/null
+++ b/m4/package_utilies.m4
@@ -0,0 +1,115 @@
+#
+# Check for specified utility (env var) - if unset, fail.
+#
+AC_DEFUN([AC_PACKAGE_NEED_UTILITY],
+ [ if test -z "$2"; then
+ echo
+ echo FATAL ERROR: $3 does not seem to be installed.
+ echo $1 cannot be built without a working $4 installation.
+ exit 1
+ fi
+ ])
+
+#
+# Generic macro, sets up all of the global build variables.
+# The following environment variables may be set to override defaults:
+# CC MAKE LIBTOOL TAR ZIP MAKEDEPEND AWK SED ECHO SORT
+# MSGFMT MSGMERGE RPM
+#
+AC_DEFUN([AC_PACKAGE_UTILITIES],
+ [ if test -z "$CC"; then
+ AC_PROG_CC
+ fi
+ cc="$CC"
+ AC_SUBST(cc)
+ AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler])
+
+ if test -z "$MAKE"; then
+ AC_PATH_PROG(MAKE, make, /usr/bin/make)
+ fi
+ make=$MAKE
+ AC_SUBST(make)
+ AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make])
+
+ if test -z "$LIBTOOL"; then
+ AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin)
+ fi
+ libtool=$LIBTOOL
+ AC_SUBST(libtool)
+ AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool])
+
+ if test -z "$TAR"; then
+ AC_PATH_PROG(TAR, tar)
+ fi
+ tar=$TAR
+ AC_SUBST(tar)
+ if test -z "$ZIP"; then
+ AC_PATH_PROG(ZIP, gzip, /bin/gzip)
+ fi
+ zip=$ZIP
+ AC_SUBST(zip)
+ if test -z "$MAKEDEPEND"; then
+ AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true)
+ fi
+ makedepend=$MAKEDEPEND
+ AC_SUBST(makedepend)
+ if test -z "$AWK"; then
+ AC_PATH_PROG(AWK, awk, /bin/awk)
+ fi
+ awk=$AWK
+ AC_SUBST(awk)
+ if test -z "$SED"; then
+ AC_PATH_PROG(SED, sed, /bin/sed)
+ fi
+ sed=$SED
+ AC_SUBST(sed)
+ if test -z "$ECHO"; then
+ AC_PATH_PROG(ECHO, echo, /bin/echo)
+ fi
+ echo=$ECHO
+ AC_SUBST(echo)
+ if test -z "$SORT"; then
+ AC_PATH_PROG(SORT, sort, /bin/sort)
+ fi
+ sort=$SORT
+ AC_SUBST(sort)
+
+ dnl check if symbolic links are supported
+ AC_PROG_LN_S
+
+ if test "$enable_gettext" = yes; then
+ if test -z "$MSGFMT"; then
+ AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt)
+ fi
+ msgfmt=$MSGFMT
+ AC_SUBST(msgfmt)
+ AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext)
+ if test -z "$MSGMERGE"; then
+ AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge)
+ fi
+ msgmerge=$MSGMERGE
+ AC_SUBST(msgmerge)
+ AC_PACKAGE_NEED_UTILITY($1, "$msgmerge", msgmerge, gettext)
+ fi
+
+ if test -z "$RPM"; then
+ AC_PATH_PROG(RPM, rpm, /bin/rpm)
+ fi
+ rpm=$RPM
+ AC_SUBST(rpm)
+ dnl .. and what version is rpm
+ rpm_version=0
+ test -x $RPM && rpm_version=`$RPM --version \
+ | awk '{print $NF}' | awk -F. '{V=1; print $V}'`
+ AC_SUBST(rpm_version)
+ dnl At some point in rpm 4.0, rpm can no longer build rpms, and
+ dnl rpmbuild is needed (rpmbuild may go way back; not sure)
+ dnl So, if rpm version >= 4.0, look for rpmbuild. Otherwise build w/ rpm
+ if test $rpm_version -ge 4; then
+ AC_PATH_PROG(RPMBUILD, rpmbuild)
+ rpmbuild=$RPMBUILD
+ else
+ rpmbuild=$RPM
+ fi
+ AC_SUBST(rpmbuild)
+ ])