benejson: fix for non-wchar toolchains
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Mon, 26 Jan 2015 14:17:38 +0000 (11:17 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 26 Jan 2015 16:16:03 +0000 (17:16 +0100)
wchar needs to be disabled in order for it to build on !wchar. Fixes:
http://autobuild.buildroot.net/results/71f/71f19d5056b56d40463b9fef7fa859e0025c4991/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/benejson/benejson.mk

index 75753d2da4d95e6a9ce3fd9a4f564166c5825576..2b8d09d3015c72d260b85ad9a59fab315793332f 100644 (file)
@@ -9,9 +9,17 @@ BENEJSON_SITE = $(call github,codehero,benejson,$(BENEJSON_VERSION))
 BENEJSON_LICENSE = MIT
 BENEJSON_LICENSE_FILES = LICENSE
 BENEJSON_INSTALL_STAGING = YES
-
 BENEJSON_DEPENDENCIES = host-scons
 
+# wchar support needs to be manually disabled
+ifeq ($(BR2_USE_WCHAR),)
+define BENEJSON_DISABLE_WCHAR
+       $(SED) 's,^#define BNJ_WCHAR_SUPPORT,#undef BNJ_WCHAR_SUPPORT,' \
+               $(@D)/benejson/benejson.h
+endef
+BENEJSON_POST_PATCH_HOOKS += BENEJSON_DISABLE_WCHAR
+endif
+
 define BENEJSON_BUILD_CMDS
        (cd $(@D); \
                $(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS) \