From b9b0c7ed512575a6c2faa06df60d2486faa5eee5 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 9 Dec 2025 18:03:10 -0800 Subject: [PATCH] Work even if aclocal is invoked by hand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Ulrich Müller (bug#79974). * configure.ac (gl_ALIGNASOF): Arrange for it to be defined even if aclocal is invoked other than via admin/merge-gnulib. Also, change comments from # to dnl as they don’t make much sense in the shell script. --- configure.ac | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f131735460e..80991f3866c 100644 --- a/configure.ac +++ b/configure.ac @@ -3277,12 +3277,20 @@ if test "$emacs_cv_struct_alignment" = yes; then structure to an N-byte boundary.]) fi -# Check for alignas now rather than waiting for gl_INIT to do it, -# as the system_malloc=no test below needs $gl_cv_header_working_stdalign_h. -# Do not simply call gl_INIT here, as the ac_cv_func_pthread_sigmask=yes -# assignment below affects how gl_INIT works. -# Instead, call gl_ALIGNASOF, the only part of gl_INIT needed here. -# Then make gl_ALIGNASOF a no-op so gl_INIT does not duplicate its code. +dnl Work around a glitch if aclocal is invoked outside of autogen.sh. +dnl Such an invocation generates an aclocal.m4 that lacks m4/stdalign.m4. +dnl The following hack checks the otherwise-uninvolved macro gl_STDALIGN_H +dnl so that the hack itself does not generate a diagnostic. +m4_divert_push([KILL]) +m4_ifdef([gl_STDALIGN_H], [], [m4_include([m4/stdalign.m4])]) +m4_divert_pop([KILL]) + +dnl Check for alignas now rather than waiting for gl_INIT to do it, +dnl as the system_malloc=no test below needs $gl_cv_header_working_stdalign_h. +dnl Do not simply call gl_INIT here, as the ac_cv_func_pthread_sigmask=yes +dnl assignment below affects how gl_INIT works. +dnl Instead, call gl_ALIGNASOF, the only part of gl_INIT needed here. +dnl Then make gl_ALIGNASOF a no-op so gl_INIT does not duplicate its code. gl_ALIGNASOF AC_DEFUN([gl_ALIGNASOF])