endif
ifeq ($(LIBJSONC), 0)
- override LDFLAGS += -ljson-c
+ override LDFLAGS += $(shell pkg-config --libs json-c)
+ override CFLAGS += $(shell pkg-config --cflags json-c)
override CFLAGS += -DLIBJSONC
endif
conf.set('LIBUUID', libuuid.found(), description: 'Is libuuid required?')
# Check for libjson-c availability
-libjson = dependency('json-c', required: true)
-conf.set('LIBJSONC', libjson.found(), description: 'Is json-c required?')
+json_c = dependency('json-c', version: '>=0.13', fallback : ['json-c', 'json_c'])
+conf.set('CONFIG_JSONC', json_c.found(), description: 'Is json-c required?')
# Check for libhugetlbfs availability
libhugetlbfs = dependency('hugetlbfs', required: false)
executable(
'nvme',
sources,
- dependencies: [ libnvme_dep, libuuid, libjson ],
+ dependencies: [ libnvme_dep, libuuid, json_c ],
)
#include "plugin.h"
#ifdef LIBJSONC
-#include <json-c/json.h>
+#include <json.h>
#define json_create_object(o) json_object_new_object(o)
#define json_create_array(a) json_object_new_array(a)