From: Jan Tulak Date: Tue, 13 Oct 2015 23:58:03 +0000 (+1100) Subject: build: Add autoconf check for fsetxattr call X-Git-Tag: v4.3.0-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c14c7b795c0bdb92d925bab44e8239867b2883c6;p=thirdparty%2Fxfsprogs-dev.git build: Add autoconf check for fsetxattr call OS X has fsetxattr() in another header and with different arguments. For now, check for the Linux variant and if not available, skip the code using the call. Signed-off-by: Jan Tulak Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/configure.ac b/configure.ac index aa241cd4b..5d8486e64 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,7 @@ AC_HAVE_SYNC_FILE_RANGE AC_HAVE_MNTENT AC_HAVE_FLS AC_HAVE_READDIR +AC_HAVE_FSETXATTR if test "$enable_blkid" = yes; then AC_HAVE_BLKID_TOPO diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index b6737614c..e1b7bd6c0 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -1025,6 +1025,7 @@ fsr_setup_attr_fork( int tfd, xfs_bstat_t *bstatp) { +#ifdef HAVE_FSETXATTR struct stat64 tstatbuf; int i; int diff = 0; @@ -1199,6 +1200,7 @@ out: if (dflag && diff) fsrprintf(_("failed to match fork offset\n"));; +#endif /* HAVE_FSETXATTR */ return 0; } diff --git a/include/builddefs.in b/include/builddefs.in index 6c16a651c..25b8816ba 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -106,6 +106,7 @@ HAVE_SYNC_FILE_RANGE = @have_sync_file_range@ HAVE_READDIR = @have_readdir@ HAVE_MNTENT = @have_mntent@ HAVE_FLS = @have_fls@ +HAVE_FSETXATTR = @have_fsetxattr@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl @@ -139,6 +140,9 @@ endif ifeq ($(HAVE_MNTENT),yes) PCFLAGS+= -DHAVE_MNTENT endif +ifeq ($(HAVE_FSETXATTR),yes) +PCFLAGS+= -DHAVE_FSETXATTR +endif ifeq ($(ENABLE_BLKID),yes) PCFLAGS+= -DENABLE_BLKID endif diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index 4a963745c..5e900abe6 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -214,6 +214,19 @@ AC_DEFUN([AC_HAVE_FLS], AC_SUBST(have_fls) ]) +# +# Check if we have a fsetxattr call (Mac OS X) +# +AC_DEFUN([AC_HAVE_FSETXATTR], + [ AC_CHECK_DECL([fsetxattr], + have_fsetxattr=yes, + [], + [#include + #include ] + ) + AC_SUBST(have_fsetxattr) + ]) + # # Check if there is mntent.h #