replace: Move check for libjansson to replace
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 12 Apr 2023 02:05:05 +0000 (12:05 +1000)
committerMartin Schwenke <mschwenke@ddn.com>
Wed, 17 Apr 2024 01:52:53 +0000 (11:52 +1000)
This allows standalone builds to link to it.  It is now checked for
unconditionally.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
lib/replace/wscript
wscript

index 77e655bb68b3bf29148bb52af9641dc25f97c716..df76cde32d45d17e788e966791930ca6e37bbbc8 100644 (file)
@@ -530,6 +530,12 @@ syscall(SYS_copy_file_range,0,NULL,0,NULL,0,0);
     elif not conf.CHECK_FUNCS('attropen'):
             conf.DEFINE('HAVE_XATTR_SUPPORT', 0)
 
+    conf.SET_TARGET_TYPE('jansson', 'EMPTY')
+
+    if conf.CHECK_CFG(package='jansson',
+                      args='--cflags --libs',
+                      msg='Checking for jansson'):
+        conf.CHECK_FUNCS_IN('json_object', 'jansson')
 
     conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
                         checklibc=True, headers='dlfcn.h dl.h')
diff --git a/wscript b/wscript
index 57545c6a57195e15235d087b222a9cbf8f72c6b4..454d2b735e07ff8aec1a8908528c7faf4e9095d8 100644 (file)
--- a/wscript
+++ b/wscript
@@ -391,13 +391,6 @@ def configure(conf):
             Logs.warn("pthreadpool support cannot be enabled when pthread support was not found")
             conf.undefine('WITH_PTHREADPOOL')
 
-    conf.SET_TARGET_TYPE('jansson', 'EMPTY')
-
-    if Options.options.with_json is not False:
-        if conf.CHECK_CFG(package='jansson', args='--cflags --libs',
-                          msg='Checking for jansson'):
-            conf.CHECK_FUNCS_IN('json_object', 'jansson')
-
     if not conf.CONFIG_GET('HAVE_JSON_OBJECT'):
         if Options.options.with_json is not False:
             conf.fatal("Jansson JSON support not found. "