diff --git a/configure.ac b/configure.ac index 2c29633a6a9..eeb3f4bbd7d 100644 --- a/configure.ac +++ b/configure.ac @@ -3226,31 +3226,6 @@ to configure.]) fi fi -# Configure gnulib. -# -# Do this after any CC or CFLAGS changes that affect Gnulib, -# and before any tests that depend on gnulib tests, -# e.g., the system_malloc=no test below. -# -# Do not affect CFLAGS or LIBS permanently. -# Instead, temporarily revert them to their pre-pkg-config values, -# because gnulib needs to work with both src (which uses the -# pkg-config stuff) and lib-src (which does not). For example, gnulib -# may need to determine whether CLOCK_TIME_LIB should contain -lrt, -# and it therefore needs to run in an environment where LIBS does not -# already contain -lrt merely because 'pkg-config --libs' printed '-lrt' -# for some package unrelated to lib-src. -SAVE_CFLAGS=$CFLAGS -SAVE_LIBS=$LIBS -CFLAGS=$pre_PKG_CONFIG_CFLAGS -LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS" -gl_ASSERT_NO_GNULIB_POSIXCHECK -gl_ASSERT_NO_GNULIB_TESTS -gl_EEMALLOC -gl_INIT -CFLAGS=$SAVE_CFLAGS -LIBS=$SAVE_LIBS - # Does the opsystem file prohibit the use of the GNU malloc? # Assume not, until told otherwise. GNU_MALLOC=yes @@ -3302,6 +3277,15 @@ 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. +gl_ALIGNASOF +AC_DEFUN([gl_ALIGNASOF]) + system_malloc=yes # If it appears as if the system malloc can't be trusted to return @@ -7384,6 +7368,25 @@ if test "$with_features" = no && test "$enable_acl" != yes; then enable_acl=no fi +# Configure gnulib. Although this does not affect CFLAGS or LIBS permanently, +# it temporarily reverts them to their pre-pkg-config values, +# because gnulib needs to work with both src (which uses the +# pkg-config stuff) and lib-src (which does not). For example, gnulib +# may need to determine whether CLOCK_TIME_LIB should contain -lrt, +# and it therefore needs to run in an environment where LIBS does not +# already contain -lrt merely because 'pkg-config --libs' printed '-lrt' +# for some package unrelated to lib-src. +SAVE_CFLAGS=$CFLAGS +SAVE_LIBS=$LIBS +CFLAGS=$pre_PKG_CONFIG_CFLAGS +LIBS="$LIB_PTHREAD $pre_PKG_CONFIG_LIBS" +gl_ASSERT_NO_GNULIB_POSIXCHECK +gl_ASSERT_NO_GNULIB_TESTS +gl_EEMALLOC +gl_INIT +CFLAGS=$SAVE_CFLAGS +LIBS=$SAVE_LIBS + # Set up libgmp on Android. Make sure to override what gnulib has # found. LIBGMP_CFLAGS=