[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: building without json prerequisite
From: |
Jose E. Marchesi |
Subject: |
Re: building without json prerequisite |
Date: |
Tue, 14 Jul 2020 21:12:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Bruno.
The HACKING file says that the JSON-C library is optional:
"If this library is not found, poke will build without MI support."
That's not what happens now. Instead, a build failure occurs during
"make check":
gcc -DHAVE_CONFIG_H -I. -I../../poke -I../../gl -I../../gl
-I../../poke -I../../poke -I/inst-x86_64-64/include -Wall -g -O2 -MT
../../poke/mi_json-pk-mi-json.o -MD -MP -MF
../../poke/.deps/mi_json-pk-mi-json.Tpo -c -o
../../poke/mi_json-pk-mi-json.o `test -f '../../poke/pk-mi-json.c' ||
echo './'`../../poke/pk-mi-json.c
../../poke/pk-mi-json.c:23:18: fatal error: json.h: No such file or
directory
compilation terminated.
make[3]: *** [Makefile:1858: ../../poke/mi_json-pk-mi-json.o] Error 1
make[3]: Leaving directory '/POKE/poke/testsuite/poke.mi-json'
make[2]: *** [Makefile:1963: check-am] Error 2
The attached patch
1) avoids building code that won't build,
2) avoids a "make check" error message
Running /POKE/poke/testsuite/poke.mi-json/mi-json.exp ...
ERROR: The executable, "poke.mi-json/mi-json" is missing
ERROR: mi-json had an execution error
With this, the continuous integration should work fine again.
OK to push?
OK for master.
Thanks!
>From b5597d6671ed9393f089ab071b9f54157b6280f2 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Tue, 14 Jul 2020 20:44:38 +0200
Subject: [PATCH] Fix build failure during "make check" without libjson-c.
* testsuite/poke.mi-json/Makefile.am: Don't build anything if POKE_MI is
false.
* testsuite/poke.mi-json/mi-json.exp: Don't run any test if
poke.mi-json/mi-json wasn't built.
---
ChangeLog | 8 ++++++++
testsuite/poke.mi-json/Makefile.am | 4 ++++
testsuite/poke.mi-json/mi-json.exp | 9 ++++++---
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 71a8d8d..d23f4bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-07-14 Bruno Haible <bruno@clisp.org>
+
+ Fix build failure during "make check" without libjson-c.
+ * testsuite/poke.mi-json/Makefile.am: Don't build anything if POKE_MI is
+ false.
+ * testsuite/poke.mi-json/mi-json.exp: Don't run any test if
+ poke.mi-json/mi-json wasn't built.
+
2020-07-14 Jose E. Marchesi <jemarch@gnu.org>
* poke/poke.c (pk_print_version): Change jemarch for "the poke
diff --git a/testsuite/poke.mi-json/Makefile.am
b/testsuite/poke.mi-json/Makefile.am
index c710e5a..2e1ae7a 100644
--- a/testsuite/poke.mi-json/Makefile.am
+++ b/testsuite/poke.mi-json/Makefile.am
@@ -15,6 +15,8 @@
AUTOMAKE_OPTIONS = subdir-objects
+if POKE_MI
+
check_PROGRAMS = mi-json
mi_json_SOURCES = mi-json.c \
@@ -26,3 +28,5 @@ mi_json_CPPFLAGS = -I$(top_builddir)/gl
-I$(top_srcdir)/gl \
mi_json_CFLAGS = $(JSON_C_CFLAGS)
mi_json_LDADD = $(JSON_C_LIBS) $(top_builddir)/gl/libgnu.la
+
+endif
diff --git a/testsuite/poke.mi-json/mi-json.exp
b/testsuite/poke.mi-json/mi-json.exp
index f28f539..5c3beb7 100644
--- a/testsuite/poke.mi-json/mi-json.exp
+++ b/testsuite/poke.mi-json/mi-json.exp
@@ -1,6 +1,9 @@
load_lib "dejagnu.exp"
-# Execute the test cases, and analyse the output
-if { [host_execute "poke.mi-json/mi-json"] ne "" } {
- perror "mi-json had an execution error" 0
+# Skip this test if poke.mi-json/mi-json wasn't built.
+if { [file exists "poke.mi-json/mi-json"] } {
+ # Execute the test cases, and analyse the output
+ if { [host_execute "poke.mi-json/mi-json"] ne "" } {
+ perror "mi-json had an execution error" 0
+ }
}