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])