loggen: fix build vs. newer xfsprogs headers
authorJeff Layton <jlayton@poochiereds.net>
Thu, 15 May 2014 01:34:56 +0000 (11:34 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 15 May 2014 01:34:56 +0000 (11:34 +1000)
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 <jlayton@poochiereds.net>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
configure.ac
src/loggen.c

index 43e6029193a6a22136032245700310003bf3de15..53459d87f930d43afa23a194f8dce135efe1c485 100644 (file)
@@ -26,14 +26,15 @@ AC_HEADER_STDC
                        sys/types.h             \
                        strings.h               \
                        err.h                   \
                        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           \
     ])
 
                        sys/fs/xfs_itable.h     \
                        xfs/platform_defs.h     \
                        btrfs/ioctl.h           \
     ])
 
+AC_CHECK_HEADERS([xfs/xfs_log_format.h],,,[#include <xfs/libxfs.h>])
+
 AC_PACKAGE_NEED_UUIDCOMPARE
 
 case $pkg_platform
 AC_PACKAGE_NEED_UUIDCOMPARE
 
 case $pkg_platform
index 522c9178ee26742ac6a227f76e633eac200bf3e9..a3d99f8c915fdf9b57a563d3f708226107dde3c5 100644 (file)
  *                                                  - dxm 29/09/00
  */
 
  *                                                  - dxm 29/09/00
  */
 
+#include <config.h>
+
 #include <xfs/libxfs.h>
 #include <xfs/libxfs.h>
+#ifdef HAVE_XFS_XFS_LOG_FORMAT_H
+#include <xfs/xfs_log_format.h>
+#define XFS_TRANS_MAGIC        XFS_TRANS_HEADER_MAGIC
+#else /* HAVE_XFS_XFS_LOG_FORMAT_H */
 #include <xfs/xfs_log.h>
 #include <xfs/xfs_log_priv.h>
 #include <xfs/xfs_log.h>
 #include <xfs/xfs_log_priv.h>
+#endif /* HAVE_XFS_XFS_LOG_FORMAT_H */
 
 #ifndef ASSIGN_ANY_LSN_DISK
 #define ASSIGN_ANY_LSN_DISK(lsn,cycle,block)  \
 
 #ifndef ASSIGN_ANY_LSN_DISK
 #define ASSIGN_ANY_LSN_DISK(lsn,cycle,block)  \