summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormabrand <mabrand@mabrand.nl>2012-08-12 13:20:36 (GMT)
committermabrand <mabrand@mabrand.nl>2012-08-12 13:20:36 (GMT)
commit061d064c47a0a04b8b989cc6271e7de9b85f2ed1 (patch)
treec4fd0023a49f890753411a02adbf045398f71a27 /src
parent854021149cf2b368547f296cf646199d073a15c0 (diff)
parent5763978027d917a7622c19886401d594029b5892 (diff)
downloadmxe-061d064c47a0a04b8b989cc6271e7de9b85f2ed1.zip
mxe-061d064c47a0a04b8b989cc6271e7de9b85f2ed1.tar.gz
mxe-061d064c47a0a04b8b989cc6271e7de9b85f2ed1.tar.bz2
Merge pull request #65 from residuum/master
Test case for json-c
Diffstat (limited to 'src')
-rw-r--r--src/json-c-test.c23
-rw-r--r--src/json-c.mk5
2 files changed, 28 insertions, 0 deletions
diff --git a/src/json-c-test.c b/src/json-c-test.c
new file mode 100644
index 0000000..676d6be
--- /dev/null
+++ b/src/json-c-test.c
@@ -0,0 +1,23 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <json/json.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ json_object *jobj;
+
+ (void)argc;
+ (void)argv;
+
+ jobj = json_object_new_object();
+ if (!jobj) {
+ return 1;
+ }
+ json_object_object_add(jobj, "key", json_object_new_string("value"));
+ printf("%s", json_object_to_json_string(jobj));
+ return 0;
+}
diff --git a/src/json-c.mk b/src/json-c.mk
index 9533971..e722213 100644
--- a/src/json-c.mk
+++ b/src/json-c.mk
@@ -25,4 +25,9 @@ define $(PKG)_BUILD
--disable-shared
CFLAGS=-Wno-error
$(MAKE) -C '$(1)' -j '$(JOBS)' install
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-json-c.exe' \
+ `'$(TARGET)-pkg-config' json --cflags --libs`
endef