xfs: Check for extent overflow when punching a hole
[xfstests-dev.git] / m4 / package_xfslibs.m4
index cafd9597c2abfdb1f9826eda1390f2d665c9f546..9be56e1103ac75432ab700c077081b6b2725c7e1 100644 (file)
@@ -1,15 +1,35 @@
-AC_DEFUN([AC_PACKAGE_NEED_XFS_LIBXFS_H],
-  [ AC_CHECK_HEADERS([xfs/libxfs.h])
-    if test "$ac_cv_header_xfs_libxfs_h" != "yes"; then
+AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
+  [ AC_CHECK_HEADERS([xfs/xfs.h],,,[
+      #define _GNU_SOURCE
+      #define _FILE_OFFSET_BITS 64
+    ])
+    if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
         echo
-        echo 'FATAL ERROR: cannot find a valid <xfs/libxfs.h> header file.'
-        echo 'Run "make install-qa" from the xfsprogs source.'
+        echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
+        echo 'Run "make install-dev" from the xfsprogs source.'
         exit 1
     fi
   ])
 
+AC_DEFUN([AC_PACKAGE_WANT_LIBXFS_H],
+  [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ],
+    [ have_libxfs=false ], [#define _GNU_SOURCE])
+    AC_SUBST(have_libxfs)
+  ])
+
+AC_DEFUN([AC_PACKAGE_WANT_XLOG_ASSIGN_LSN],
+  [ AC_CHECK_DECL(xlog_assign_lsn,
+      [ have_xlog_assign_lsn=true ], [ have_xlog_assign_lsn=false ], [[
+#define _GNU_SOURCE
+#include <xfs/libxfs.h>]])
+    AC_SUBST(have_xlog_assign_lsn)
+  ])
+
 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
-  [ AC_CHECK_HEADERS([xfs/xqm.h])
+  [ AC_CHECK_HEADERS([xfs/xqm.h],,,[
+        #define _GNU_SOURCE
+        #define _FILE_OFFSET_BITS 64
+    ])
     if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
         echo
         echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
@@ -39,8 +59,6 @@ AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
         exit 1
     ])
     libxfs="-lxfs"
-    test -f `pwd`/../xfsprogs/libxfs/libxfs.la && \
-        libxfs="`pwd`/../xfsprogs/libxfs/libxfs.la"
     test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
        libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
     AC_SUBST(libxfs)
@@ -55,8 +73,6 @@ AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
         exit 1
     ])
     libhdl="-lhandle"
-    test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
-        libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
     test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
        libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
     AC_SUBST(libhdl)
@@ -71,29 +87,18 @@ AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
         exit 1
     ])
     libhdl="-lhandle"
-    test -f `pwd`/../xfsprogs/libhandle/libhandle.la && \
-        libhdl="`pwd`/../xfsprogs/libhandle/libhandle.la"
     test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
        libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
     AC_SUBST(libhdl)
   ])
 
-AC_DEFUN([AC_PACKAGE_NEED_IRIX_LIBHANDLE],
-  [ 
-    AC_MSG_CHECKING([libhandle.a for IRIX])
-    libhdl="`pwd`/../irix/libhandle/libhandle.a"
-    if ! test -f $libhdl; then
-       echo 'no'
-        echo 'FATAL ERROR: could not find IRIX XFS handle library.'
-        exit 1
-    fi
-    echo 'yes'
-    AC_SUBST(libhdl)
-  ])
-
 AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
   [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
-    AC_TRY_LINK([#include <xfs/xfs.h>], [ int x = xfsctl(0, 0, 0, 0); ],
+    AC_TRY_LINK([
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <xfs/xfs.h> ],
+      [ int x = xfsctl(0, 0, 0, 0); ],
       [ echo ok ],
       [ echo
         echo 'FATAL ERROR: cannot find required macros in the XFS headers.'