emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0abda55 1/2: Port configure.ac to future Gnulib


From: Paul Eggert
Subject: master 0abda55 1/2: Port configure.ac to future Gnulib
Date: Mon, 13 Jan 2020 19:27:09 -0500 (EST)

branch: master
commit 0abda558bc547991cddd9667be722eaeb428dca8
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port configure.ac to future Gnulib
    
    Rewrite an ancient Alpha ELF check to port to a future Gnulib
    version that may require AC_CHECK_DECL to be set up properly as
    per the ‘Expanded Before Required’ section of the Autoconf manual
    Autoconf doesn’t guarantee that AC_CHECK_DECL will work properly
    if called conditionally (e.g., inside a shell ‘case’ statement)
    and the condition is false.  Problem reported by Bruno Haible in:
    https://lists.gnu.org/r/bug-gnulib/2020-01/msg00088.html
    * configure.ac (LD_SWITCH_MACHINE): Migrate ELF check later,
    when AC_CHECK_DECL is properly set up.
---
 configure.ac | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 08a4502..f040b74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1508,6 +1508,7 @@ case "$opsys" in
    UNEXEC_OBJ=unexelf.o
    ;;
 esac
+AC_SUBST(UNEXEC_OBJ)
 
 LD_SWITCH_SYSTEM=
 test "$with_unexec" = no || case "$opsys" in
@@ -1561,8 +1562,6 @@ C_SWITCH_MACHINE=
 test $with_unexec = yes &&
 case $canonical in
  alpha*)
-  AC_CHECK_DECL([__ELF__])
-  if test "$ac_cv_have_decl___ELF__" = "yes"; then
     ## With ELF, make sure that all common symbols get allocated to in the
     ## data section.  Otherwise, the dump of temacs may miss variables in
     ## the shared library that have been initialized.  For example, with
@@ -1573,18 +1572,10 @@ case $canonical in
     else
       AC_MSG_ERROR([Non-GCC compilers are not supported.])
     fi
-  else
-      dnl This was the unexalpha.c case.  Removed in 24.1, 2010-07-24,
-      dnl albeit under the mistaken assumption that said file
-      dnl was no longer used.
-      AC_MSG_ERROR([Non-ELF systems are not supported since Emacs 24.1.])
-  fi
   ;;
 esac
 AC_SUBST(C_SWITCH_MACHINE)
 
-AC_SUBST(UNEXEC_OBJ)
-
 C_SWITCH_SYSTEM=
 ## Some programs in src produce warnings saying certain subprograms
 ## are too complex and need a MAXMEM value greater than 2000 for
@@ -4216,6 +4207,12 @@ dnl No need to check for posix_memalign if aligned_alloc 
works.
 AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
 AC_CHECK_DECLS([aligned_alloc], [], [], [[#include <stdlib.h>]])
 
+case $with_unexec,$canonical in
+  yes,alpha*)
+    AC_CHECK_DECL([__ELF__], [],
+      [AC_MSG_ERROR([Non-ELF systems are not supported on this platform.])]);;
+esac
+
 # Dump loading
 AC_CHECK_FUNCS([posix_madvise])
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]