nls.mk: add -rpath-link when needed for NLS support
authorSteven Barth <cyrus@openwrt.org>
Mon, 7 Sep 2015 08:03:34 +0000 (08:03 +0000)
committerSteven Barth <cyrus@openwrt.org>
Mon, 7 Sep 2015 08:03:34 +0000 (08:03 +0000)
When a package links to a shared library that depends on libiconv or
libintl shared libraries, specifying directory pathes to them via -L
switches is not enough, see "man 1 ld" -rpath-link description.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
SVN-Revision: 46801

include/nls.mk

index 118000d3ee16e7363dcc4b518a1103ff9d396822..51463b9f122c6a2f2dc60b4dc0ecf17a74e110c0 100644 (file)
@@ -28,12 +28,12 @@ PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
 ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
 ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
 ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
-ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib
+ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib -Wl,-rpath-link=$(ICONV_PREFIX)/lib
 
 INTL_DEPENDS:=+BUILD_NLS:libintl-full
 INTL_CFLAGS:=-I$(INTL_PREFIX)/include
 INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
-INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib
+INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib -Wl,-rpath-link=$(INTL_PREFIX)/lib
 
 TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
 TARGET_CPPFLAGS += $(ICONV_CPPFLAGS) $(INTL_CPPFLAGS)