Make DUFLAGS be overrideable during configure

Not all du implementations on linux accept --apparent-size, so let the
user configure the arguments passed to du if required.

This fixes FS#47943.

Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Alastair Hughes 2016-08-20 08:52:39 +12:00 committed by Allan McRae
parent 97459e9eb7
commit 36f456ccae

View file

@ -338,12 +338,12 @@ AC_CHECK_MEMBERS([struct statfs.f_flags],,,[[#include <sys/param.h>
GCC_VISIBILITY_CC GCC_VISIBILITY_CC
# Host-dependant definitions # Host-dependant definitions
DEFAULT_DUFLAGS=" -sk --apparent-size"
INODECMD="stat -c '%i %n'" INODECMD="stat -c '%i %n'"
OWNERCMD="stat -c '%u:%g'" OWNERCMD="stat -c '%u:%g'"
MODECMD="stat -c '%a'" MODECMD="stat -c '%a'"
SIZECMD="stat -c %s" SIZECMD="stat -c %s"
SEDINPLACE="sed --follow-symlinks -i" SEDINPLACE="sed --follow-symlinks -i"
DUFLAGS="-sk --apparent-size"
STRIP_BINARIES="--strip-all" STRIP_BINARIES="--strip-all"
STRIP_SHARED="--strip-unneeded" STRIP_SHARED="--strip-unneeded"
STRIP_STATIC="--strip-debug" STRIP_STATIC="--strip-debug"
@ -354,7 +354,7 @@ case "${host_os}" in
MODECMD="stat -f '%Lp'" MODECMD="stat -f '%Lp'"
SIZECMD="stat -f %z" SIZECMD="stat -f %z"
SEDINPLACE="sed -i \"\"" SEDINPLACE="sed -i \"\""
DUFLAGS="-sk" DEFAULT_DUFLAGS=" -sk"
;; ;;
darwin*) darwin*)
host_os_darwin=yes host_os_darwin=yes
@ -363,13 +363,12 @@ case "${host_os}" in
MODECMD="/usr/bin/stat -f '%Lp'" MODECMD="/usr/bin/stat -f '%Lp'"
SIZECMD="/usr/bin/stat -f %z" SIZECMD="/usr/bin/stat -f %z"
SEDINPLACE="/usr/bin/sed -i ''" SEDINPLACE="/usr/bin/sed -i ''"
DUFLAGS="-sk" DEFAULT_DUFLAGS=" -sk"
STRIP_BINARIES="" STRIP_BINARIES=""
STRIP_SHARED="-S" STRIP_SHARED="-S"
STRIP_STATIC="-S" STRIP_STATIC="-S"
;; ;;
esac esac
AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes") AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] ) AC_PATH_PROGS([DUPATH], [du], [du], [/usr/bin$PATH_SEPARATOR/bin] )
AC_SUBST(INODECMD) AC_SUBST(INODECMD)
@ -377,11 +376,16 @@ AC_SUBST(OWNERCMD)
AC_SUBST(MODECMD) AC_SUBST(MODECMD)
AC_SUBST(SIZECMD) AC_SUBST(SIZECMD)
AC_SUBST(SEDINPLACE) AC_SUBST(SEDINPLACE)
AC_SUBST(DUFLAGS)
AC_SUBST(STRIP_BINARIES) AC_SUBST(STRIP_BINARIES)
AC_SUBST(STRIP_SHARED) AC_SUBST(STRIP_SHARED)
AC_SUBST(STRIP_STATIC) AC_SUBST(STRIP_STATIC)
# Flags for du
if test "${DUFLAGS+set}" != "set"; then
DUFLAGS="${DEFAULT_DUFLAGS}"
fi
AC_ARG_VAR(DUFLAGS, [flags for du, overriding the default])
# Variables plugged into makepkg.conf # Variables plugged into makepkg.conf
CARCH="${host%%-*}" CARCH="${host%%-*}"
CHOST="${host}" CHOST="${host}"