Description: Use Debian package libjsonparser rather than bundled json.c
Author: Alastair McKinstry <mckinstry@debian.org>
Last-Updated: 2020-12-08
Forwarded: no

Index: cctools-7.1.2/chirp/src/chirp_job.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_job.c
+++ cctools-7.1.2/chirp/src/chirp_job.c
@@ -22,7 +22,7 @@
 
 #include "buffer.h"
 #include "debug.h"
-#include "json.h"
+#include <json-parser/json.h>
 #include "json_aux.h"
 #include "macros.h"
 #include "path.h"
Index: cctools-7.1.2/chirp/src/chirp_job.h
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_job.h
+++ cctools-7.1.2/chirp/src/chirp_job.h
@@ -7,7 +7,7 @@
 #ifndef CHIRP_JOB_H
 #define CHIRP_JOB_H
 
-#include "json.h"
+#include <json-parser/json.h>
 
 #include "chirp_types.h"
 
Index: cctools-7.1.2/chirp/src/chirp_server.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/chirp_server.c
+++ cctools-7.1.2/chirp/src/chirp_server.c
@@ -30,7 +30,7 @@
 #include "getopt_aux.h"
 #include "host_disk_info.h"
 #include "host_memory_info.h"
-#include "json.h"
+#include <json-parser/json.h>
 #include "jx.h"
 #include "jx_print.h"
 #include "link.h"
Index: cctools-7.1.2/chirp/src/confuga_job.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_job.c
+++ cctools-7.1.2/chirp/src/confuga_job.c
@@ -7,7 +7,7 @@ See the file COPYING for details.
 #include "confuga_fs.h"
 
 #include "debug.h"
-#include "json.h"
+#include <json-parser/json.h>
 #include "json_aux.h"
 
 #include "catch.h"
Index: cctools-7.1.2/chirp/src/confuga_replica.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/confuga_replica.c
+++ cctools-7.1.2/chirp/src/confuga_replica.c
@@ -13,7 +13,7 @@ See the file COPYING for details.
 #include "catalog_query.h"
 #include "catch.h"
 #include "debug.h"
-#include "json.h"
+#include <json-parser/json.h>
 #include "json_aux.h"
 #include "nvpair.h"
 #include "sha1.h"
Index: cctools-7.1.2/chirp/src/json_aux.c
===================================================================
--- cctools-7.1.2.orig/chirp/src/json_aux.c
+++ cctools-7.1.2/chirp/src/json_aux.c
@@ -1,6 +1,6 @@
 #include "buffer.h"
 #include "copy_stream.h"
-#include "json.h"
+#include <json-parser/json.h>
 #include "json_aux.h"
 
 #include <assert.h>
Index: cctools-7.1.2/chirp/src/json_aux.h
===================================================================
--- cctools-7.1.2.orig/chirp/src/json_aux.h
+++ cctools-7.1.2/chirp/src/json_aux.h
@@ -2,7 +2,7 @@
 #define JSON_AUX_H
 
 #include "buffer.h"
-#include "json.h"
+#include <json-parser/json.h>
 
 #define jistype(o,t) ((o)->type == (t))
 
Index: cctools-7.1.2/chirp/src/Makefile
===================================================================
--- cctools-7.1.2.orig/chirp/src/Makefile
+++ cctools-7.1.2/chirp/src/Makefile
@@ -7,7 +7,7 @@ include ../../rules.mk
 LOCAL_CCFLAGS = -DSQLITE_DEFAULT_MMAP_SIZE=1073741824 -DSQLITE_TEMP_STORE=3 -DSQLITE_THREADSAFE=0 -fstack-protector-all
 
 # Globus is needed by all executables via libdttools.a/auth_globus.o
-LOCAL_LINKAGE = $(CCTOOLS_GLOBUS_LDFLAGS) -lsqlite3
+LOCAL_LINKAGE = $(CCTOOLS_GLOBUS_LDFLAGS) -lsqlite3 -ljsonparser
 
 EXTERNAL_DEPENDENCIES = ../../dttools/src/libdttools.a
 LIBRARIES = libchirp.a libconfuga.a
@@ -21,7 +21,7 @@ PROGRAMS_CONFUGA = confuga_adm
 PUBLIC_HEADERS = chirp_global.h chirp_multi.h chirp_reli.h chirp_client.h chirp_stream.h chirp_protocol.h chirp_matrix.h chirp_types.h chirp_recursive.h confuga.h
 SCRIPTS = chirp_audit_cluster chirp_server_hdfs
 SOURCES_CONFUGA = confuga.c confuga_namespace.c confuga_replica.c confuga_node.c confuga_job.c confuga_file.c confuga_gc.c
-SOURCES_LIBRARY = chirp_global.c chirp_multi.c chirp_recursive.c chirp_reli.c chirp_client.c chirp_matrix.c chirp_stream.c chirp_ticket.c json.c json_aux.c
+SOURCES_LIBRARY = chirp_global.c chirp_multi.c chirp_recursive.c chirp_reli.c chirp_client.c chirp_matrix.c chirp_stream.c chirp_ticket.c  json_aux.c
 SOURCES_SERVER =  chirp_stats.c chirp_thirdput.c chirp_alloc.c chirp_audit.c chirp_acl.c chirp_group.c chirp_filesystem.c chirp_fs_hdfs.c chirp_fs_local.c chirp_fs_local_scheduler.c chirp_fs_chirp.c chirp_fs_confuga.c chirp_job.c chirp_sqlite.c
 TARGETS = $(PROGRAMS) $(LIBRARIES)
 
Index: cctools-7.1.2/configure
===================================================================
--- cctools-7.1.2.orig/configure
+++ cctools-7.1.2/configure
@@ -1294,7 +1294,7 @@ if [ "$optstatic" = 1 ]
 then
 	static_libraries="../../dttools/src/libdttools.a ${zlib_path}/lib/libz.a"
 else
-	external_libraries="${external_libraries} -lstdc++ -lpthread -lz -lc -lm"
+	external_libraries="${external_libraries} -lstdc++ -lpthread -lz -lc -lm -ljsonparser"
 fi
 
 if [ $BUILD_SYS = DARWIN ]
