From 7a2ae4184b890cb66738bdc51c6274b11efecdcd Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 28 May 2009 11:36:27 -0500 Subject: [PATCH] Use xfs.h rather than libxfs.h Use xfs/xfs.h when possible rather than xfs/libxfs.h, now that libxfs.h isn't part of a normal xfsprogs-devel install. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig --- aclocal.m4 | 15 +++++++++++++-- configure.in | 1 + m4/package_xfslibs.m4 | 10 ++++++++++ src/global.h | 4 ++++ src/godown.c | 14 -------------- src/iopat.c | 2 +- src/t_immutable.c | 6 +++++- src/unwritten_mmap.c | 2 +- src/xfsctl.c | 2 +- 9 files changed, 36 insertions(+), 20 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 52f1c7da..6cc5dceb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -405,6 +405,17 @@ AC_DEFUN([AC_PACKAGE_NEED_UUIDCOMPARE], AC_SUBST(libuuid) ]) +AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H], + [ AC_CHECK_HEADERS([xfs/xfs.h]) + if test "$ac_cv_header_xfs_xfs_h" != "yes"; then + echo + echo 'FATAL ERROR: cannot find a valid header file.' + echo 'Install or upgrade the XFS development package.' + echo 'Alternatively, run "make install-dev" from the xfsprogs source.' + exit 1 + fi + ]) + AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H], [ AC_CHECK_HEADERS([xfs/libxfs.h]) if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then @@ -500,8 +511,8 @@ AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE], ]) AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO], - [ AC_MSG_CHECKING([xfsctl from xfs/libxfs.h]) - AC_TRY_LINK([#include ], [ int x = xfsctl(0, 0, 0, 0); ], + [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h]) + AC_TRY_LINK([#include ], [ int x = xfsctl(0, 0, 0, 0); ], [ echo ok ], [ echo echo 'FATAL ERROR: cannot find required macros in the XFS headers.' diff --git a/configure.in b/configure.in index 32a2496b..f0874543 100644 --- a/configure.in +++ b/configure.in @@ -44,6 +44,7 @@ in ;; *) AC_MULTILIB($enable_lib64) + AC_PACKAGE_NEED_XFS_XFS_H AC_PACKAGE_NEED_XFS_LIBXFS_H AC_PACKAGE_NEED_XFS_XQM_H AC_PACKAGE_NEED_XFSCTL_MACRO diff --git a/m4/package_xfslibs.m4 b/m4/package_xfslibs.m4 index cafd9597..2c8d6947 100644 --- a/m4/package_xfslibs.m4 +++ b/m4/package_xfslibs.m4 @@ -1,3 +1,13 @@ +AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H], + [ AC_CHECK_HEADERS([xfs/xfs.h]) + if test "$ac_cv_header_xfs_xfs_h" != "yes"; then + echo + echo 'FATAL ERROR: cannot find a valid header file.' + echo 'Run "make install-qa" from the xfsprogs source.' + exit 1 + fi + ]) + AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H], [ AC_CHECK_HEADERS([xfs/libxfs.h]) if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then diff --git a/src/global.h b/src/global.h index 158c1fac..61862f60 100644 --- a/src/global.h +++ b/src/global.h @@ -26,6 +26,10 @@ #include <../../xfsprogs/include/irix.h> #endif +#ifdef HAVE_XFS_XFS_H +#include +#endif + #ifdef HAVE_XFS_LIBXFS_H #include #endif diff --git a/src/godown.c b/src/godown.c index 4105aeef..07b69807 100644 --- a/src/godown.c +++ b/src/godown.c @@ -18,20 +18,6 @@ #include "global.h" -/* These should be in libxfs.h */ -#ifndef XFS_IOC_GOINGDOWN -#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) -#endif -#ifndef XFS_FSOP_GOING_FLAGS_DEFAULT -#define XFS_FSOP_GOING_FLAGS_DEFAULT 0x0 /* going down */ -#endif -#ifndef XFS_FSOP_GOING_FLAGS_LOGFLUSH -#define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log */ -#endif -#ifndef XFS_FSOP_GOING_FLAGS_NOLOGFLUSH -#define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log */ -#endif - static char *xprogname; diff --git a/src/iopat.c b/src/iopat.c index 1e7d61b3..c06071f9 100644 --- a/src/iopat.c +++ b/src/iopat.c @@ -18,7 +18,7 @@ #include #include -#include +#include struct xfs_flock64 f; int main(int argc, char **argv) diff --git a/src/t_immutable.c b/src/t_immutable.c index 667355b8..07a36cdc 100644 --- a/src/t_immutable.c +++ b/src/t_immutable.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -47,6 +47,10 @@ #define EXT2_APPEND_FL 0x00000020 #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) +#ifndef XFS_SUPER_MAGIC +#define XFS_SUPER_MAGIC 0x58465342 +#endif + extern const char *__progname; static int fsetflag(const char *path, int fd, int on, int immutable) diff --git a/src/unwritten_mmap.c b/src/unwritten_mmap.c index 5e634864..aec6a69e 100644 --- a/src/unwritten_mmap.c +++ b/src/unwritten_mmap.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include /* diff --git a/src/xfsctl.c b/src/xfsctl.c index f8afb162..8fa33488 100644 --- a/src/xfsctl.c +++ b/src/xfsctl.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include /* simple test program to try out a bunch of xfsctls: -- 2.30.2