emacs-31 2ac289d0968 2/2: Correct default native-comp tests

"John-David T. Smith" via Mailing list for Emacs changes <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit 2ac289d0968581ea93a37c15abbcc93d794bb7e3
Author: JD Smith <[email protected]>
Commit: JD Smith <[email protected]>

    Correct default native-comp tests
    
    Supersedes 5bd9d1f7df3.
    
    * configure.ac: Store `with_native_compilation' to correctly test
    whether to use the soft or hard (error) checks, as these set the
    variable by side-effect.
---
 configure.ac | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index d2967210bc3..e5f496cfa11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5176,19 +5176,6 @@ You can find the instructions on how to compile and install libgccjit from
 source on this site:
 <https://gcc.gnu.org/wiki/JIT>.])])
 
-HAVE_NATIVE_COMP=no
-LIBGCCJIT_LIBS=
-LIBGCCJIT_CFLAGS=
-if test "$canonical" = i686-pc-cygwin; then
-  if test "${with_cygwin32_native_compilation}" = yes; then
-    with_native_compilation=yes
-  elif test "${with_native_compilation}" != no; then
-    AC_MSG_ERROR([Native compilation is not supported on 32-bit Cygwin.
-If you really want to try it anyway, use the configure option
-'--with-cygwin32-native-compilation'.])
-  fi
-fi
-
 AC_DEFUN([libgccjit_not_found], [
   AC_MSG_WARN([Elisp native compiler can't be enabled as libgccjit was not
 found.
@@ -5222,6 +5209,19 @@ source on this site:
 
   with_native_compilation=no])
 
+HAVE_NATIVE_COMP=no
+LIBGCCJIT_LIBS=
+LIBGCCJIT_CFLAGS=
+if test "$canonical" = i686-pc-cygwin; then
+  if test "${with_cygwin32_native_compilation}" = yes; then
+    with_native_compilation=yes
+  elif test "${with_native_compilation}" != no; then
+    AC_MSG_ERROR([Native compilation is not supported on 32-bit Cygwin.
+If you really want to try it anyway, use the configure option
+'--with-cygwin32-native-compilation'.])
+  fi
+fi
+
 if test "$with_features" = "no" \
    && test "${with_native_compilation}" = "default"; then
   with_native_compilation=no
@@ -5265,14 +5265,15 @@ if test "${with_native_compilation}" != "no"; then
     fi
 
     # Check if libgccjit is available.
+    native_compilation_requested=${with_native_compilation}
     AC_CHECK_LIB([gccjit], [gcc_jit_context_acquire], [],
-        [if test "${with_native_compilation}" = "default"; then
+        [if test "${native_compilation_requested}" = "default"; then
 	   libgccjit_not_found
 	 else
 	   libgccjit_not_found_err
 	 fi])
     AC_CHECK_HEADERS([libgccjit.h], [],
-        [if test "${with_native_compilation}" = "default"; then
+        [if test "${native_compilation_requested}" = "default"; then
 	   libgccjit_dev_not_found
 	 else
 	   libgccjit_dev_not_found_err
@@ -5280,7 +5281,7 @@ if test "${with_native_compilation}" != "no"; then
     if test "${with_native_compilation}" != "no"; then
       # Check if libgccjit really works.
       AC_RUN_IFELSE([libgccjit_smoke_test], [],
-        [if test "${with_native_compilation}" = "default"; then
+        [if test "${native_compilation_requested}" = "default"; then
            libgccjit_broken
 	 else
            libgccjit_broken_err
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.