From: Johannes Nixdorf Date: Sat, 9 Aug 2025 17:13:07 +0000 (+0200) Subject: configure: Base NEED_INTERNAL_STATX on libc headers first X-Git-Tag: v6.17.0~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6cfae337a10106114a78f56738e83e7b6638d61d;p=thirdparty%2Fxfsprogs-dev.git configure: Base NEED_INTERNAL_STATX on libc headers first At compile time the libc headers are preferred, and linux/stat.h is only included if the libc headers don't provide a definition for statx and its types (tested on STATX_TYPE). The configure test should be based on the same logic. This fixes one cause for failing to compile against musl libc. Signed-off-by: Johannes Nixdorf Reviewed-by: Christoph Hellwig Reviewed-by: Petr Vaněk --- diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index b77ac1a7..650b8b7b 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -129,7 +129,15 @@ AC_DEFUN([AC_NEED_INTERNAL_STATX], AC_CHECK_MEMBER(struct statx.stx_atomic_write_unit_max_opt, , need_internal_statx=yes, - [#include ] + [[ +#define _GNU_SOURCE +#include +#include + +#ifndef STATX_TYPE +#include +#endif +]] ) ],need_internal_statx=yes, [#include ]