From: Andrea Corallo Date: Wed, 7 Oct 2020 06:40:00 +0000 (+0200) Subject: * Better libgccjit related error messaging during configure X-Git-Tag: emacs-28.0.90~2727^2~387 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bd2725796578c67075711adc4c1be7c2bf684214;p=emacs.git * 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. --- diff --git a/configure.ac b/configure.ac index b7b0c268c84..100fbba06c9 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: . -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: .])]) @@ -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.