emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp bd27257 1/3: * Better libgccjit related error messag


From: Andrea Corallo
Subject: feature/native-comp bd27257 1/3: * Better libgccjit related error messaging during configure
Date: Wed, 7 Oct 2020 10:45:05 -0400 (EDT)

branch: feature/native-comp
commit bd2725796578c67075711adc4c1be7c2bf684214
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Better libgccjit related error messaging during configure
    
        * configure.ac: Distinguish the case when libgccjit is missing,
        its headers are missing, or libgccjit is broken.  Message the user
        based on that.
---
 configure.ac | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index b7b0c26..100fbba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3779,15 +3779,25 @@ AC_DEFUN([libgccjit_smoke_test], [
 
 AC_DEFUN([libgccjit_not_found], [
   AC_MSG_ERROR([elisp native compiler requested but libgccjit not found.
+Please try installing libgccjit or similar package.
 If you are sure you want Emacs compiled without elisp native compiler, pass
   --without-nativecomp
 to configure.])])
 
+AC_DEFUN([libgccjit_dev_not_found], [
+  AC_MSG_ERROR([elisp native compiler requested but libgccjit header files were
+not found.
+Please try installing libgccjit-dev or similar package.
+If you are sure you want Emacs compiled without elisp native compiler, pass
+--without-nativecomp
+to configure.])])
+
 AC_DEFUN([libgccjit_broken], [
   AC_MSG_ERROR([Installed libgccjit has failed passing the smoke test.
 You can verify it yourself compiling:
 <https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
-Please report the issue to your distribution.
+Please report the issue to your distribution if libgccjit was installed through
+that.
 Here instructions on how to compile and install libgccjit from source:
 <https://gcc.gnu.org/wiki/JIT>.])])
 
@@ -3800,10 +3810,13 @@ if test "${with_nativecomp}" != "no"; then
     if test "${HAVE_ZLIB}" = no; then
        AC_MSG_ERROR(['--with-nativecomp' requires zlib])
     fi
+    # Check if libgccjit is available.
+    AC_CHECK_LIB(gccjit, gcc_jit_context_acquire, [], [libgccjit_not_found])
+    AC_CHECK_HEADERS(libgccjit.h, [], [libgccjit_dev_not_found])
     emacs_save_LIBS=$LIBS
     LIBS="-lgccjit"
-    AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken],
-      [AC_LINK_IFELSE([libgccjit_smoke_test], [], [libgccjit_not_found])])
+    # Check if libgccjit really works.
+    AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken])
     LIBS=$emacs_save_LIBS
     HAVE_NATIVE_COMP=yes
     # mingw32 loads the library dynamically.



reply via email to

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