mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
adcc60c6bf
The next version of xfslibs will require that its users enable transparent largefile support. This broke building xfstests on 32-bit Linux because _FILE_OFFSET_BITS=64 was not getting defined when testing for xfs headers. Fix this by defining _FILE_OFFSET_BITS=64 when doing configure checks for the xfs headers. It was not necessary to define _FILE_OFFSET_BITS=64 for the actual build because it's already done, in builddefs.in. The problem could also be solved by adding AC_SYS_LARGEFILE to configure.ac. It's debatable, but I chose not to do that because it might give the impression that it affects the actual compilation of the test programs and not just the configure checks. (Since not all .c files include config.h first, a _FILE_OFFSET_BITS definition in config.h wouldn't always take effect.) Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
123 lines
3.8 KiB
Plaintext
123 lines
3.8 KiB
Plaintext
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/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],,,[
|
|
#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.'
|
|
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_HANDLE_H],
|
|
[ AC_CHECK_HEADERS([xfs/handle.h])
|
|
if test "$ac_cv_header_xfs_handle_h" != "yes"; then
|
|
echo
|
|
echo 'FATAL ERROR: cannot find a valid <xfs/handle.h> 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_LIBXFSINIT_LIBXFS],
|
|
[ AC_CHECK_LIB(xfs, libxfs_init,, [
|
|
echo
|
|
echo 'FATAL ERROR: could not find a valid XFS base library.'
|
|
echo 'Install or upgrade the XFS library package.'
|
|
echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
|
|
exit 1
|
|
])
|
|
libxfs="-lxfs"
|
|
test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
|
|
libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
|
|
AC_SUBST(libxfs)
|
|
])
|
|
|
|
AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
|
|
[ AC_CHECK_LIB(handle, open_by_fshandle,, [
|
|
echo
|
|
echo 'FATAL ERROR: could not find a current XFS handle library.'
|
|
echo 'Install or upgrade the XFS library package.'
|
|
echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
|
|
exit 1
|
|
])
|
|
libhdl="-lhandle"
|
|
test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
|
|
libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
|
|
AC_SUBST(libhdl)
|
|
])
|
|
|
|
AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
|
|
[ AC_CHECK_LIB(handle, attr_list_by_handle,, [
|
|
echo
|
|
echo 'FATAL ERROR: could not find a current XFS handle library.'
|
|
echo 'Install or upgrade the XFS library package.'
|
|
echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
|
|
exit 1
|
|
])
|
|
libhdl="-lhandle"
|
|
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([
|
|
#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.'
|
|
echo 'Upgrade your XFS programs (xfsprogs) development package.'
|
|
echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
|
|
exit 1
|
|
])
|
|
])
|