1 ################################################################################
5 ################################################################################
7 BENEJSON_VERSION
= 0.9.7
8 BENEJSON_SITE
= $(call github
,codehero
,benejson
,$(BENEJSON_VERSION
))
10 BENEJSON_LICENSE_FILES
= LICENSE
11 BENEJSON_INSTALL_STAGING
= YES
12 BENEJSON_DEPENDENCIES
= host-scons
14 # wchar support needs to be manually disabled
15 ifeq ($(BR2_USE_WCHAR
),)
16 define BENEJSON_DISABLE_WCHAR
17 $(SED
) 's,^#define BNJ_WCHAR_SUPPORT,#undef BNJ_WCHAR_SUPPORT,' \
18 $(@D
)/benejson
/benejson.h
20 BENEJSON_POST_PATCH_HOOKS
+= BENEJSON_DISABLE_WCHAR
23 BENEJSON_SCONS_TARGETS
= include
25 ifeq ($(BR2_STATIC_LIBS
)$(BR2_SHARED_STATIC_LIBS
),y
)
26 BENEJSON_SCONS_TARGETS
+= lib
/libbenejson.a
27 define BENEJSON_INSTALL_STATIC_LIB
28 $(INSTALL
) -D
-m
0644 $(@D
)/lib
/libbenejson.a \
29 $(1)/usr
/lib
/libbenejson.a
31 endif # Static enabled
33 ifeq ($(BR2_SHARED_LIBS
)$(BR2_SHARED_STATIC_LIBS
),y
)
34 BENEJSON_SCONS_TARGETS
+= lib
/libbenejson.so
35 define BENEJSON_INSTALL_SHARED_LIB
36 $(INSTALL
) -D
-m
0644 $(@D
)/lib
/libbenejson.so \
37 $(1)/usr
/lib
/libbenejson.so
39 endif # Shared enabled
41 define BENEJSON_BUILD_CMDS
43 $(TARGET_CONFIGURE_OPTS
) CROSS
=$(TARGET_CROSS
) \
44 $(SCONS
) $(BENEJSON_SCONS_TARGETS
))
47 define BENEJSON_INSTALL_STAGING_CMDS
48 $(INSTALL
) -D
-m
0644 $(@D
)/include/benejson
/benejson.h \
49 $(STAGING_DIR
)/usr
/include/benejson
/benejson.h
; \
50 $(INSTALL
) -D
-m
0644 $(@D
)/include/benejson
/pull.hh \
51 $(STAGING_DIR
)/usr
/include/benejson
/pull.hh
52 $(call BENEJSON_INSTALL_STATIC_LIB
,$(STAGING_DIR
))
53 $(call BENEJSON_INSTALL_SHARED_LIB
,$(STAGING_DIR
))
56 define BENEJSON_INSTALL_TARGET_CMDS
57 $(call BENEJSON_INSTALL_SHARED_LIB
,$(TARGET_DIR
))
60 $(eval
$(generic-package
))