summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/libjson/libjson.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/package/libjson/libjson.mk b/package/libjson/libjson.mk
index deca0f845..9b1aca3bf 100644
--- a/package/libjson/libjson.mk
+++ b/package/libjson/libjson.mk
@@ -11,8 +11,16 @@ LIBJSON_INSTALL_STAGING = YES
LIBJSON_LICENSE = BSD-2c
LIBJSON_LICENSE_FILES = License.txt
-LIBJSON_MAKE_OPT = BUILD_TYPE= SHARED=$(if $(BR2_PREFER_STATIC_LIB),0,1) \
- CXXFLAGS="$(TARGET_CXXFLAGS) -DNDEBUG"
+LIBJSON_CXXFLAGS = $(TARGET_CFLAGS) -DNDEBUG
+
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LIBJSON_MAKE_OPT += SHARED=0
+else
+LIBJSON_MAKE_OPT += SHARED=1
+LIBJSON_CXXFLAGS += -fPIC
+endif
+
+LIBJSON_MAKE_OPT += BUILD_TYPE= CXXFLAGS="$(LIBJSON_CXXFLAGS)"
define LIBJSON_EXTRACT_CMDS
unzip -d $(@D) $(DL_DIR)/$(LIBJSON_SOURCE)