From: Petr Salinger Date: Wed, 24 Mar 2010 03:21:15 +0000 (+1100) Subject: Resolve build issues on Debian GNU/kFreeBSD port. X-Git-Tag: v3.1.2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ee06c8d3639132cc8dd8685d053799c5eaa62f6;p=thirdparty%2Fxfsprogs-dev.git Resolve build issues on Debian GNU/kFreeBSD port. Additional platform target added to build system, with similar build options to Linux but ultimately making BSD syscalls (and hence leveragin the existing FreeBSD port in places too). Reviewed-by: Eric Sandeen Reviewed-by: Nathan Scott Signed-off-by: Nathan Scott --- diff --git a/include/builddefs.in b/include/builddefs.in index cc75b5d29..2c5b51c82 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -105,6 +105,9 @@ ifeq ($(PKG_PLATFORM),linux) PCFLAGS = -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 $(GCCFLAGS) DEPENDFLAGS = -D__linux__ endif +ifeq ($(PKG_PLATFORM),gnukfreebsd) +PCFLAGS = -D_GNU_SOURCE $(GCCFLAGS) +endif ifeq ($(PKG_PLATFORM),darwin) PCFLAGS = -traditional-cpp $(GCCFLAGS) DEPENDFLAGS = -D__APPLE__ diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 4f8ebe586..0196cc443 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -66,6 +66,8 @@ typedef struct filldir filldir_t; #include #elif defined(__FreeBSD__) #include +#elif defined(__FreeBSD_kernel__) +#include #elif defined(__APPLE__) #include #elif defined(__sgi__) || defined(__sgi) diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c index 63a88ba59..e278f97e8 100644 --- a/libxfs/freebsd.c +++ b/libxfs/freebsd.c @@ -29,12 +29,12 @@ extern char *progname; int platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) { - struct stat st; + struct stat64 st; int cnt, i; struct statfs *fsinfo; if (!s) { - if (stat(block, &st) < 0) + if (stat64(block, &st) < 0) return 0; s = &st; } diff --git a/m4/package_globals.m4 b/m4/package_globals.m4 index 415564b9b..e469671c8 100644 --- a/m4/package_globals.m4 +++ b/m4/package_globals.m4 @@ -41,7 +41,7 @@ AC_DEFUN([AC_PACKAGE_GLOBALS], test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION" AC_SUBST(pkg_distribution) - pkg_platform=`uname -s | tr 'A-Z' 'a-z' | sed -e 's/irix64/irix/'` + pkg_platform=`uname -s | tr 'A-Z' 'a-z' | tr -d / | sed -e 's/irix64/irix/'` test -z "$PLATFORM" || pkg_platform="$PLATFORM" AC_SUBST(pkg_platform) ])