From 85a011724ae98fd1e5386c52479110e551f16ba3 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 15 May 2014 11:34:56 +1000 Subject: [PATCH] loggen: fix build vs. newer xfsprogs headers v2: just include xfs/libxfs.h for the conftest prerequisites commit cc085d770adb in xfsprogs removed some header files that are included by loggen.c. Add an autoconf test that checks to see whether xfs_log_format.h is present. If it is, include that instead of the deprecated headers and add an alias for XFS_TRANS_MAGIC since that value no longer exists. With this patch, xfstests builds on both f20 and rawhide (f21) boxes. Signed-off-by: Jeff Layton Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- configure.ac | 7 ++++--- src/loggen.c | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 43e60291..53459d87 100644 --- a/configure.ac +++ b/configure.ac @@ -26,14 +26,15 @@ AC_HEADER_STDC sys/types.h \ strings.h \ err.h \ - linux/falloc.h - ]) - AC_CHECK_HEADERS([ sys/fs/xfs_fsops.h \ + linux/falloc.h \ + sys/fs/xfs_fsops.h \ sys/fs/xfs_itable.h \ xfs/platform_defs.h \ btrfs/ioctl.h \ ]) +AC_CHECK_HEADERS([xfs/xfs_log_format.h],,,[#include ]) + AC_PACKAGE_NEED_UUIDCOMPARE case $pkg_platform diff --git a/src/loggen.c b/src/loggen.c index 522c9178..a3d99f8c 100644 --- a/src/loggen.c +++ b/src/loggen.c @@ -25,9 +25,16 @@ * - dxm 29/09/00 */ +#include + #include +#ifdef HAVE_XFS_XFS_LOG_FORMAT_H +#include +#define XFS_TRANS_MAGIC XFS_TRANS_HEADER_MAGIC +#else /* HAVE_XFS_XFS_LOG_FORMAT_H */ #include #include +#endif /* HAVE_XFS_XFS_LOG_FORMAT_H */ #ifndef ASSIGN_ANY_LSN_DISK #define ASSIGN_ANY_LSN_DISK(lsn,cycle,block) \ -- 2.25.1