summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2013-05-03 11:10:23 (GMT)
committer Peter Korsgaard <jacmet@sunsite.dk>2013-05-03 11:10:23 (GMT)
commit80e7419680d5eb57da0b0b34248e49dcd81619a8 (patch)
treeedae295ad23216015ce1decbf97b7a59ce9146c4
parent97387cda09e234c6584f7edfd9ae4c504a0304b5 (diff)
downloadbuildroot-80e7419680d5eb57da0b0b34248e49dcd81619a8.tar.gz
buildroot-80e7419680d5eb57da0b0b34248e49dcd81619a8.tar.bz2
libjson: ensure shared lib is built with -fPIC
Fixes http://autobuild.buildroot.net/results/72e6c260c9028dd636965b8bf76bb7ba216aa1a4/build-end.log Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-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 deca0f8..9b1aca3 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)