unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39953: 27.0.50; [PATCH] explicitly fail if Emacs was configured with but cannot compile native JSON support
@ 2020-03-06 12:13 Stéphane Maniaci
  2020-03-06 15:49 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stéphane Maniaci @ 2020-03-06 12:13 UTC (permalink / raw)
  To: 39953

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hello,

I was trying to give the Emacs 27 pre-test a spin, notably for the
native JSON support, and it took me a long time to figure out it
wasn't actually being configured for it as I was missing the Jansson
library headers.

This patch explicitly fails ./configure if `--with-json' is passed but
cannot be fulfilled. Which means users without the Jansson headers
won't be able to compile Emacs unless explicitly disabling it with
`--without-json'; I don't know if that is too extreme, maybe
AC_MSG_WARN would be more appropriate, but as long as it's notified in
some way to the user I'm happy.

It's also my very first patch so please excuse any mistakes in the
protocol/patch.

Cheers,
Stéphane.

[-- Attachment #2: 0001-configure.ac-warn-users-if-they-can-t-compile-native.patch --]
[-- Type: application/octet-stream, Size: 1187 bytes --]

From 5bc2c6d3a3a805a73577c869b1480757b0a85f56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Maniaci?= <stephane.maniaci@gmail.com>
Date: Fri, 6 Mar 2020 11:30:44 +0000
Subject: [PATCH] configure.ac: warn users if they can't compile native JSON
 support

Running ``./configure --with-json'' is successful even when the
required Jansson headers are not present. The only information about
it is the line ``Does Emacs use -ljansson?'' at the end of the process
which might not cognate with the user.

Avoid any confusion by explicitly failing if native JSON support has
been requested but cannot be provided.

* configure.ac: warn users if they can't compile native JSON support.
---
 configure.ac | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index a4daf1414d..8ae0f70140 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2942,6 +2942,8 @@ if test "${with_json}" = yes; then
   if test "${HAVE_JSON}" = yes; then
     AC_DEFINE(HAVE_JSON, 1, [Define if using Jansson.])
     JSON_OBJ=json.o
+  else
+    AC_MSG_ERROR([Native JSON support requested but Jansson headers not found.])
   fi
 
   # Windows loads libjansson dynamically
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-14 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-06 12:13 bug#39953: 27.0.50; [PATCH] explicitly fail if Emacs was configured with but cannot compile native JSON support Stéphane Maniaci
2020-03-06 15:49 ` Eli Zaretskii
2020-03-10  2:14   ` Noam Postavsky
2020-04-11 13:47     ` Noam Postavsky
2020-04-25 14:07       ` Stefan Kangas
2020-08-08 13:54       ` Lars Ingebrigtsen
2020-08-14 17:31         ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).