> gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DNO_XMALLOC -DEXEEXT=\"\" > -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -Wall > -DCONTINUE_AFTER_ASSERT -fvisibility=hidden -g -O2 -MT selinux-at.o -MD -MP > -MF $depbase.Tpo -c -o selinux-at.o ../../gllib/selinux-at.c &&\ > mv -f $depbase.Tpo $depbase.Po > In file included from ../../gllib/selinux-at.h:17, > from ../../gllib/selinux-at.c:21: > ./selinux/selinux.h:23:5: error: #if with no expression > 23 | #if > | ^ > make[4]: *** [Makefile:11845: selinux-at.o] Error 1
It can be reproduced with a testdir of all of gnulib: $ ./gnulib-tool --create-testdir --dir=../testdir-all --with-c++-tests --without-privileged-tests --single-configure `./all-modules` The cause is that in the configure file, only one expansion of gl_CHECK_HEADER_SELINUX_SELINUX_H is present, and in a conditional position (due to the use of AS_CASE). The second intended expansion, from module selinux-h, is eliminated because it is an AC_REQUIRE (see m4/selinux-selinux-h.m4 line 15). This patch fixes it. And since gl_CHECK_HEADER_SELINUX_SELINUX_H is supposed to have set USE_SELINUX_SELINUX_H to 0 or 1, it increases robustness to report a shell syntax error if $USE_SELINUX_SELINUX_H happens to be empty. 2024-09-30 Bruno Haible <br...@clisp.org> file-has-acl: Fix compilation error (regression yesterday). * m4/acl.m4 (gl_FILE_HAS_ACL): Require, not invoke, gl_CHECK_HEADER_SELINUX_SELINUX_H. diff --git a/m4/acl.m4 b/m4/acl.m4 index 4328bd20a1..69135f9884 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 -# serial 32 +# serial 33 dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -214,8 +214,8 @@ AC_DEFUN([gl_FILE_HAS_ACL] AS_CASE([$enable_acl,$with_selinux,$ac_cv_header_linux_xattr_h,$ac_cv_func_listxattr], [no,* | *,no,*], [], [*,*,yes,yes], - [gl_CHECK_HEADER_SELINUX_SELINUX_H - AS_IF([test "$USE_SELINUX_SELINUX_H" -ne 0 ], + [AC_REQUIRE([gl_CHECK_HEADER_SELINUX_SELINUX_H]) + AS_IF([test $USE_SELINUX_SELINUX_H = 1], [FILE_HAS_ACL_LIB="$FILE_HAS_ACL_LIB $LIB_SELINUX" gl_file_has_acl_uses_selinux=yes])])