]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Bunch of configure updates for xfsprogs to allow packages to better be kept
authorNathan Scott <nathans@sgi.com>
Wed, 30 Apr 2003 01:31:48 +0000 (01:31 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 30 Apr 2003 01:31:48 +0000 (01:31 +0000)
in sync in this area.
Add an aclocal.m4 build target for top level directory.

17 files changed:
Makefile
VERSION
aclocal.m4 [new file with mode: 0644]
build/rpm/Makefile
build/tar/Makefile
configure.in
debian/changelog
doc/CHANGES
include/builddefs.in
include/buildmacros
include/buildrules
m4/Makefile [new file with mode: 0644]
m4/manual_format.m4 [new file with mode: 0644]
m4/package_globals.m4 [new file with mode: 0644]
m4/package_types.m4 [new file with mode: 0644]
m4/package_utilies.m4 [new file with mode: 0644]
m4/package_uuiddev.m4 [new file with mode: 0644]

index 74b2b6401b7c664796eb6a3abc312c4ce32a664d..bbc2dab92bede02a13c133cff40871646befe6fb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -38,14 +38,14 @@ include $(TOPDIR)/include/builddefs
 endif
 
 CONFIGURE = configure include/builddefs include/platform_defs.h
-LSRCFILES = configure configure.in Makepkgs install-sh README VERSION
+LSRCFILES = configure configure.in Makepkgs aclocal.m4 install-sh README VERSION
 
 LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
        Logs/* built .census install.* install-dev.* *.gz
 
 SUBDIRS = include libxfs libxlog libhandle libdisk \
        db freeze fsck growfs io imap logprint mkfile mkfs repair rtcp \
-       man doc po debian build
+       m4 man doc po debian build
 
 default: $(CONFIGURE)
 ifeq ($(HAVE_BUILDDEFS), no)
@@ -75,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)
@@ -85,5 +88,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 678f35b87cb08d6c549de2fddfd0415857bd8e4d..911b3ed45ae8465072b284826ffc5d689a845b04 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=4
-PKG_REVISION=7
+PKG_REVISION=8
 PKG_BUILD=0
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..8ad0650
--- /dev/null
@@ -0,0 +1,262 @@
+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_UUID_UUID_H],
+  [ AC_CHECK_HEADERS([uuid/uuid.h])
+    if test "$ac_cv_header_uuid_uuid_h" != yes; then
+       echo
+       echo 'FATAL ERROR: could not find a valid UUID header.'
+       echo 'Install the Universally Unique Identifiers development package.'
+       exit 1
+    fi
+  ])
+
+AC_DEFUN([AC_PACKAGE_NEED_UUIDPARSE_LIBUUID],
+  [ AC_CHECK_LIB(uuid, uuid_parse,, [
+       echo
+       echo 'FATAL ERROR: could not find a valid UUID library.'
+       echo 'Install the Universally Unique Identifiers library package.'
+       exit 1
+    ])
+    libuuid="/usr/lib/libuuid.a"
+    AC_SUBST(libuuid)
+  ])
+
+# 
+# Check if we have a type for the pointer's size integer (__psint_t)
+# 
+AC_DEFUN([AC_TYPE_PSINT],
+  [ AC_MSG_CHECKING([for __psint_t ])
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+    ], [
+         __psint_t  psint;
+    ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
+  ])
+
+# 
+# Check if we have a type for the pointer's size unsigned (__psunsigned_t)
+# 
+AC_DEFUN([AC_TYPE_PSUNSIGNED],
+  [ AC_MSG_CHECKING([for __psunsigned_t ])
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+    ], [
+        __psunsigned_t  psuint;
+    ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
+  ])
+
+# 
+# Check type sizes
+# 
+AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
+  [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
+      AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
+    fi
+    AC_CHECK_SIZEOF(long, 4)
+    AC_CHECK_SIZEOF(char *, 4)
+    if test $ac_cv_sizeof_long -eq 4; then
+      AC_DEFINE(HAVE_32BIT_LONG)
+    fi
+    if test $ac_cv_sizeof_long -eq 8; then
+      AC_DEFINE(HAVE_64BIT_LONG)
+    fi
+    if test $ac_cv_sizeof_char_p -eq 4; then
+      AC_DEFINE(HAVE_32BIT_PTR)
+    fi
+    if test $ac_cv_sizeof_char_p -eq 8; then
+      AC_DEFINE(HAVE_64BIT_PTR)
+    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)
+  ])
+
index 112c2a3d6905fa24c99802f09e8700a908b7bf2a..0403fb5200b6172d093bd83a7c3080f013c4952e 100644 (file)
@@ -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' \
index be23286678ba55e1de4b3dd1334c0e81ca09aa90..5a0fdcaa042ce1420a0988d559406bacf22a4eee 100644 (file)
@@ -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); }' \
index 646af3f1955a0f49643df53b2eb33bb3e27b7751..2ec3239fe5c2d27c40dc119e3139f46673509ad6 100644 (file)
-dnl unpacking check - this file must exist
 AC_INIT(include/libxfs.h)
 AC_CONFIG_HEADER(include/platform_defs.h)
 
-pkg_name="xfsprogs"
-AC_SUBST(pkg_name)
-
-#
-# 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:-'-O1 -g'}       # some gcc's miscompile at -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' | sed -e 's/irix64/irix/'`
-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, /bin/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 readline?
+AC_ARG_ENABLE(gettext,
+[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+       enable_gettext=yes)
+AC_SUBST(enable_gettext)
+
 AC_ARG_ENABLE(readline,
-[ --enable-readline=[yes/no] Enable readline command editing [default=no]],,
+[ --enable-readline=[yes/no] Enable readline command editing [default=no]],
+       test $enable_readline = yes && libreadline="-lreadline -ltermcap",
        enable_readline=no)
-if test $enable_readline = yes; then
-       libreadline="-lreadline -ltermcap"
-fi
 AC_SUBST(libreadline)
 AC_SUBST(enable_readline)
 
-dnl will we be making use of editline?
 AC_ARG_ENABLE(editline,
-[ --enable-editline=[yes/no] Enable editline command editing [default=no]],,
+[ --enable-editline=[yes/no] Enable editline command editing [default=no]],
+       test $enable_editline = yes && libeditline="-ledit -ltermcap",
        enable_editline=no)
-if test $enable_editline = yes; then
-       libeditline="-ledit -ltermcap"
-fi
 AC_SUBST(libeditline)
 AC_SUBST(enable_editline)
 
-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)
-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
+AC_PACKAGE_GLOBALS(xfsprogs)
+AC_PACKAGE_UTILITIES(xfsprogs)
 
-dnl Checks for UUID header and library.
-AC_CHECK_HEADER(uuid/uuid.h,, [
-       echo
-       echo 'FATAL ERROR: could not find a valid UUID header.'
-       echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
-       exit 1
-])
-AC_CHECK_LIB(uuid, uuid_generate,, [
-       echo
-       echo 'FATAL ERROR: could not find a valid UUID library.'
-       echo 'Install either the e2fsprogs-devel (rpm) or the uuid-dev (deb) package.'
-       exit 1
-])
-
-dnl
-dnl Caution: using libuuid shared adds an additional runtime dependency,
-dnl but the rpm spec file and debian control file do _not_ enforce this.
-dnl We want to keep our runtime dependencies to an absolute minimum for
-dnl this particular package, but the option is there.
-dnl
+AC_PACKAGE_NEED_UUID_UUID_H
+AC_PACKAGE_NEED_UUIDPARSE_LIBUUID
 AC_ARG_ENABLE(shared-uuid,
 [ --enable-shared-uuid=[yes/no]        Link shared libuuid [default=no].],
        libuuid="/usr/lib/libuuid.a"
-       if test "$enable_shared_uuid" = yes; then
-               libuuid="-luuid"
-       fi,
+       test "$enable_shared_uuid" = yes && libuuid="-luuid",
        libuuid="/usr/lib/libuuid.a")
 AC_SUBST(libuuid)
 
-dnl Check if we have a type for the pointer's size integer (__psint_t)
-AC_MSG_CHECKING([for __psint_t ])
-AC_TRY_COMPILE(
-[
-    #include <sys/types.h>
-    #include <stdlib.h>
-    #include <stddef.h>
-],
-[
-    __psint_t  psint;
-], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-
-dnl Check if we have a type for the pointer's size unsigned (__psunsigned_t)
-AC_MSG_CHECKING([for __psunsigned_t ])
-AC_TRY_COMPILE(
-[
-    #include <sys/types.h>
-    #include <stdlib.h>
-    #include <stddef.h>
-],
-[
-    __psunsigned_t  psuint;
-], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
-
-dnl Check type sizes
-if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
-       AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
-fi
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(char *, 4)
-if test $ac_cv_sizeof_long -eq 4; then
-       AC_DEFINE(HAVE_32BIT_LONG)
-fi
-if test $ac_cv_sizeof_long -eq 8; then
-       AC_DEFINE(HAVE_64BIT_LONG)
-fi
-if test $ac_cv_sizeof_char_p -eq 4; then
-       AC_DEFINE(HAVE_32BIT_PTR)
-fi
-if test $ac_cv_sizeof_char_p -eq 8; then
-       AC_DEFINE(HAVE_64BIT_PTR)
-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_TYPE_PSINT
+AC_TYPE_PSUNSIGNED
+AC_SIZEOF_POINTERS_AND_LONG
+AC_MANUAL_FORMAT
 
-dnl build definitions for use in Makefiles
 AC_OUTPUT(include/builddefs)
index c15aee392041ecb9294de8773c72b72f5be0bb7f..d3abf73129499278733a7e85f7caf463ada759e9 100644 (file)
@@ -1,8 +1,8 @@
-xfsprogs (2.4.7-1) unstable; urgency=low
+xfsprogs (2.4.8-1) unstable; urgency=low
 
   * New upstream release
 
- -- Nathan Scott <nathans@debian.org>  Tue, 22 Apr 2003 16:58:14 +1000
+ -- Nathan Scott <nathans@debian.org>  Sat, 26 Apr 2003 14:47:16 +1000
 
 xfsprogs (2.4.4-1) unstable; urgency=low
 
index 3891ca3a017df45bee73c87521b6c8e95f94a1a8..741c2f75a5f0efdf49c7e707ffca8586168d91b3 100644 (file)
@@ -1,3 +1,10 @@
+xfsprogs-2.4.8 (26 April 2003)
+       - Rework configure.in to make use of shared macros.
+       - Fix up #include lines to allow compilation of sources
+         with installed headers rather than local headers.
+       - Fix botches in xfs_bmap shell script which prevented any
+         arguments being passed on to xfs_io (from Jan Derfinak).
+
 xfsprogs-2.4.7 (22 April 2003)
        - Clarify XFS system call interfaces, fix up documentation.
 
index 886e07306725420761ebaf46c3ebfc92367dbf89..b6ed182ce5bb0204fa48735cdc6d3bb5f5c2102b 100644 (file)
@@ -69,20 +69,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@
@@ -110,7 +109,7 @@ PLDLIBS = -L/usr/local/lib -lintl
 PCFLAGS = -I/usr/local/include
 endif
 
-GCFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -I$(TOPDIR)/include \
+GCFLAGS += -O1 $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -I$(TOPDIR)/include \
        -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \
        -DPACKAGE=\"$(PKG_NAME)\"
 
index f4e8bec8d479d2aa3baad6116d9617977f61e88f..bce094c29e68066aea45cb0d644c9dcbbe6f7c16 100644 (file)
@@ -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))
index 89cff027d0e1300dd230ded0f6ebbc3306ca7982..5ef98c163c72be7b5e9716df7fb66b500960d1aa 100644 (file)
@@ -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 (file)
index 0000000..3220d19
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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_types.m4 \
+       package_utilies.m4 \
+       package_uuiddev.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 (file)
index 0000000..50c6a91
--- /dev/null
@@ -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 (file)
index 0000000..c83dc2d
--- /dev/null
@@ -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_types.m4 b/m4/package_types.m4
new file mode 100644 (file)
index 0000000..1bd6975
--- /dev/null
@@ -0,0 +1,50 @@
+# 
+# Check if we have a type for the pointer's size integer (__psint_t)
+# 
+AC_DEFUN([AC_TYPE_PSINT],
+  [ AC_MSG_CHECKING([for __psint_t ])
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+    ], [
+         __psint_t  psint;
+    ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
+  ])
+
+# 
+# Check if we have a type for the pointer's size unsigned (__psunsigned_t)
+# 
+AC_DEFUN([AC_TYPE_PSUNSIGNED],
+  [ AC_MSG_CHECKING([for __psunsigned_t ])
+    AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+    ], [
+        __psunsigned_t  psuint;
+    ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
+  ])
+
+# 
+# Check type sizes
+# 
+AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
+  [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
+      AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
+    fi
+    AC_CHECK_SIZEOF(long, 4)
+    AC_CHECK_SIZEOF(char *, 4)
+    if test $ac_cv_sizeof_long -eq 4; then
+      AC_DEFINE(HAVE_32BIT_LONG)
+    fi
+    if test $ac_cv_sizeof_long -eq 8; then
+      AC_DEFINE(HAVE_64BIT_LONG)
+    fi
+    if test $ac_cv_sizeof_char_p -eq 4; then
+      AC_DEFINE(HAVE_32BIT_PTR)
+    fi
+    if test $ac_cv_sizeof_char_p -eq 8; then
+      AC_DEFINE(HAVE_64BIT_PTR)
+    fi
+  ])
diff --git a/m4/package_utilies.m4 b/m4/package_utilies.m4
new file mode 100644 (file)
index 0000000..afad8dc
--- /dev/null
@@ -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_uuiddev.m4 b/m4/package_uuiddev.m4
new file mode 100644 (file)
index 0000000..c4fd3d5
--- /dev/null
@@ -0,0 +1,20 @@
+AC_DEFUN([AC_PACKAGE_NEED_UUID_UUID_H],
+  [ AC_CHECK_HEADERS([uuid/uuid.h])
+    if test "$ac_cv_header_uuid_uuid_h" != yes; then
+       echo
+       echo 'FATAL ERROR: could not find a valid UUID header.'
+       echo 'Install the Universally Unique Identifiers development package.'
+       exit 1
+    fi
+  ])
+
+AC_DEFUN([AC_PACKAGE_NEED_UUIDPARSE_LIBUUID],
+  [ AC_CHECK_LIB(uuid, uuid_parse,, [
+       echo
+       echo 'FATAL ERROR: could not find a valid UUID library.'
+       echo 'Install the Universally Unique Identifiers library package.'
+       exit 1
+    ])
+    libuuid="/usr/lib/libuuid.a"
+    AC_SUBST(libuuid)
+  ])