aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2003-04-29 03:12:13 +0000
committerNathan Scott <nathans@sgi.com>2003-04-29 03:12:13 +0000
commit7a9c27eeac7646cf2c251c916fbfe41de585fc1e (patch)
tree0370c84e0a29b34531f69bb07a8841062ecb17fa
parenta723b2012ddc5d744c2fbedc724a48d641c8277c (diff)
downloaddmapi-dev-7a9c27eeac7646cf2c251c916fbfe41de585fc1e.tar.gz
Bunch of configure updates for dmapi to allow packages to better be kept
in sync in this area. Add an aclocal.m4 build target for top level directory.
-rw-r--r--Makefile12
-rw-r--r--VERSION2
-rw-r--r--aclocal.m4202
-rw-r--r--build/rpm/Makefile10
-rw-r--r--build/tar/Makefile2
-rw-r--r--configure.in179
-rw-r--r--debian/changelog4
-rw-r--r--doc/CHANGES3
-rw-r--r--include/builddefs.in2
-rw-r--r--include/buildmacros1
-rw-r--r--include/buildrules4
-rw-r--r--m4/Makefile46
-rw-r--r--m4/manual_format.m417
-rw-r--r--m4/package_globals.m443
-rw-r--r--m4/package_utilies.m4115
-rw-r--r--m4/package_xfslibs.m463
16 files changed, 513 insertions, 192 deletions
diff --git a/Makefile b/Makefile
index 2e59ba3..5adf957 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,12 +38,12 @@ include $(TOPDIR)/include/builddefs
endif
CONFIGURE = configure include/builddefs
-LSRCFILES = configure configure.in Makepkgs install-sh README VERSION
+LSRCFILES = configure configure.in aclocal.m4 Makepkgs install-sh README VERSION
LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
Logs/* built .census install.* install-dev.* *.gz
-SUBDIRS = include libdm man doc debian build
+SUBDIRS = include libdm m4 man doc debian build
default: $(CONFIGURE)
ifeq ($(HAVE_BUILDDEFS), no)
@@ -73,6 +73,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)
@@ -83,5 +86,4 @@ install-dev: default
realclean distclean: clean
rm -f $(LDIRT) $(CONFIGURE)
- rm -rf autom4te.cache
- [ ! -d Logs ] || rmdir Logs
+ rm -rf autom4te.cache Logs
diff --git a/VERSION b/VERSION
index 90e712b..ccbe809 100644
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
#
PKG_MAJOR=2
PKG_MINOR=0
-PKG_REVISION=7
+PKG_REVISION=8
PKG_BUILD=0
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..a471775
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,202 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl 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)
+ ])
+
+AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
+ [ AC_CHECK_HEADERS([xfs/handle.h])
+ if test "$ac_cv_header_xfs_handle_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: XFS header <xfs/handle.h> does not exist.'
+ echo 'Install the XFS programs (xfsprogs) development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
+
+#
+# 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/build/rpm/Makefile b/build/rpm/Makefile
index 112c2a3..0403fb5 100644
--- a/build/rpm/Makefile
+++ b/build/rpm/Makefile
@@ -51,18 +51,18 @@ dist : default $(SPECF) rpm-$(RPM_VERSION).rc
# is not supported by rpm v.3, we have to resort to such ugly hacks
ifneq ($(RPM_VERSION),2)
rpm-$(RPM_VERSION).rc : rpmmacros
- sed -e '/^macrofiles:/s|~/.rpmmacros|rpmmacros|' </usr/lib/rpm/rpmrc >$@
+ @$(SED) -e '/^macrofiles:/s|~/.rpmmacros|rpmmacros|' </usr/lib/rpm/rpmrc >$@
rpmmacros : macros.template
- @sed -e 's|%topdir%|$(TREEROOT)|g' < $< > $@
+ @$(SED) -e 's|%topdir%|$(TREEROOT)|g' < $< > $@
else
rpm-2.rc: rpm-2.rc.template
- @sed -e 's|%topdir%|$(TOPDIR)|g' < $< > $@
+ @$(SED) -e 's|%topdir%|$(TOPDIR)|g' < $< > $@
endif
# Generate the rpm specfile format file list from the install-sh manifest
rpmfiles rpmfiles-dev rpmfiles-lib:
- sort -u $$DIST_MANIFEST | $(AWK) > $@ '\
+ $(SORT) -u $$DIST_MANIFEST | $(AWK) > $@ '\
$$1 == "d" { printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $$2, $$3, $$4, $$5); } \
$$1 == "f" { if (match ($$6, "$(PKG_MAN_DIR)") || \
match ($$6, "$(PKG_DOC_DIR)")) \
@@ -81,7 +81,7 @@ $$1 == "l" { if (match ($$3, "$(PKG_MAN_DIR)") || \
.PHONY: $(SPECF)
${SPECF} : ${SPECF}.in
- sed -e's|@pkg_name@|$(PKG_NAME)|g' \
+ $(SED) -e's|@pkg_name@|$(PKG_NAME)|g' \
-e's|@pkg_version@|$(PKG_VERSION)|g' \
-e's|@pkg_release@|$(PKG_RELEASE)|g' \
-e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \
diff --git a/build/tar/Makefile b/build/tar/Makefile
index be23286..5a0fdca 100644
--- a/build/tar/Makefile
+++ b/build/tar/Makefile
@@ -42,7 +42,7 @@ include $(BUILDRULES)
dist : default
@HERE=`pwd`; cd $${DIST_ROOT:-/}; \
- sort $$HERE/../bin-manifest | uniq | $(AWK) ' \
+ $(SORT) -u $$HERE/../bin-manifest | $(AWK) ' \
$$1 == "f" { printf (".%s\n", $$6); } \
$$1 == "d" { next; } \
$$1 == "l" { printf (".%s\n", $$3); }' \
diff --git a/configure.in b/configure.in
index f3e05ce..06438c2 100644
--- a/configure.in
+++ b/configure.in
@@ -1,183 +1,14 @@
-dnl unpacking check - this file must exist
AC_INIT(include/dmapi.h)
-pkg_name="dmapi"
-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
-#
-
-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)
-
-AC_CHECK_HEADER(xfs/handle.h,, [
- echo
- echo 'FATAL ERROR: could not find a valid XFS handle header.'
- echo 'Install either the xfsprogs-devel (rpm) or the xfslibs-dev (deb) package.'
- echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
- exit 1
-])
-
-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 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(dmapi)
+AC_PACKAGE_UTILITIES(dmapi)
+AC_PACKAGE_NEED_XFS_HANDLE_H
+AC_MANUAL_FORMAT
-dnl build definitions for use in Makefiles
AC_OUTPUT(include/builddefs)
diff --git a/debian/changelog b/debian/changelog
index f1f736c..0b77d0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-dmapi (2.0.7-1) unstable; urgency=low
+dmapi (2.0.8-1) unstable; urgency=low
* New upstream release
- -- Nathan Scott <nathans@debian.org> Mon, 14 Apr 2003 09:41:09 +1000
+ -- Nathan Scott <nathans@debian.org> Sat, 26 Apr 2003 04:36:01 +1000
dmapi (2.0.6-1) unstable; urgency=low
diff --git a/doc/CHANGES b/doc/CHANGES
index 62f3de7..158ea8a 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,3 +1,6 @@
+dmapi-2.0.8 (26 April 2003)
+ - Rework configure.in to make use of shared macros.
+
dmapi-2.0.7 (14 April 2003)
- Fix configure tests that used AC_PATH_PROG incorrectly.
diff --git a/include/builddefs.in b/include/builddefs.in
index 5957c51..314f177 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -59,13 +59,13 @@ 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@
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..06e94e6
--- /dev/null
+++ b/m4/Makefile
@@ -0,0 +1,46 @@
+#
+# 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 \
+ package_xfslibs.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)
+ ])
diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4
new file mode 100644
index 0000000..7831bc4
--- /dev/null
+++ b/m4/package_xfslibs.m4
@@ -0,0 +1,63 @@
+AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
+ [ AC_CHECK_HEADERS([xfs/libxfs.h])
+ if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: XFS header <xfs/libxfs.h> does not exist.'
+ echo 'Install the XFS programs (xfsprogs) development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
+AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
+ [ AC_CHECK_HEADERS([xfs/handle.h])
+ if test "$ac_cv_header_xfs_handle_h" != "yes"; then
+ echo
+ echo 'FATAL ERROR: XFS header <xfs/handle.h> does not exist.'
+ echo 'Install the XFS programs (xfsprogs) development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ fi
+ ])
+
+AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
+ [ AC_CHECK_LIB(xfs, libxfs_init,, [
+ echo
+ echo 'FATAL ERROR: could not find a valid XFS base library.'
+ echo 'Install the XFS programs (xfsprogs) library package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ ])
+ libxfs="-lxfs"
+ test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
+ libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
+ test -f /usr/lib/libxfs.la && libxfs="/usr/lib/libxfs.la"
+ AC_SUBST(libxfs)
+ ])
+
+AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
+ [ AC_CHECK_LIB(handle, attr_list_by_handle,, [
+ echo
+ echo 'FATAL ERROR: could not find a current XFS handle library.'
+ echo 'Install the XFS programs (xfsprogs) library package.'
+ echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
+ exit 1
+ ])
+ libhdl="-lhandle"
+ test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
+ libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
+ test -f /usr/lib/libhandle.la && libhdl="/usr/lib/libhandle.la"
+ AC_SUBST(libhdl)
+ ])
+
+AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
+ [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h])
+ AC_TRY_LINK([#include <xfs/libxfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
+ [ echo ok ],
+ [ echo
+ echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
+ echo 'Upgrade your XFS programs (xfsprogs) development package.'
+ echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
+ exit 1
+ ])
+ ])