From: Jan Tulak Date: Tue, 18 Aug 2015 07:53:18 +0000 (+1000) Subject: build:: Add mntent.h check into autoconf X-Git-Tag: v4.2.0-rc2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ae294ea80eaeb47084cf76754d435f6a6adbfc6;p=thirdparty%2Fxfsprogs-dev.git build:: Add mntent.h check into autoconf Signed-off-by: Jan Tulak Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/configure.ac b/configure.ac index 530650bb6..0aba90c36 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,7 @@ AC_HAVE_FALLOCATE AC_HAVE_FIEMAP AC_HAVE_PREADV AC_HAVE_SYNC_FILE_RANGE +AC_HAVE_MNTENT AC_HAVE_BLKID_TOPO AC_HAVE_READDIR diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index a1bc24593..8be76ec3e 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -25,16 +25,16 @@ #include #include -#include -#include #include #include #include #include -#include #include #include +#ifdef HAVE_MNTENT +# include +#endif #ifndef XFS_XFLAG_NODEFRAG #define XFS_XFLAG_NODEFRAG 0x00002000 /* src dependancy, remove later */ diff --git a/include/builddefs.in b/include/builddefs.in index c644a17f8..e522243aa 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -103,6 +103,7 @@ HAVE_FIEMAP = @have_fiemap@ HAVE_PREADV = @have_preadv@ HAVE_SYNC_FILE_RANGE = @have_sync_file_range@ HAVE_READDIR = @have_readdir@ +HAVE_MNTENT = @have_mntent@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl @@ -130,6 +131,9 @@ PLDLIBS = -L/usr/local/lib -lintl PCFLAGS = -I/usr/local/include $(GCCFLAGS) DEPENDFLAGS = -D__FreeBSD__ endif +ifeq ($(HAVE_MNTENT),yes) +PCFLAGS+= -DHAVE_MNTENT +endif GCFLAGS = $(OPTIMIZER) $(DEBUG) \ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index 919ae0a6b..75aa61ee8 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -202,3 +202,11 @@ AC_DEFUN([AC_HAVE_READDIR], AC_SUBST(have_readdir) ]) +# +# Check if there is mntent.h +# +AC_DEFUN([AC_HAVE_MNTENT], + [ AC_CHECK_HEADERS(mntent.h, + have_mntent=yes) + AC_SUBST(have_mntent) + ])