diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-08-26 17:31:27 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-08-26 17:31:27 +0000 |
commit | 5a6f44332310a6da18eec350f66011659ea1f58c (patch) | |
tree | 3fcd6e8a1ad204c360beb8c507a61824ec6af9ac /package/Makefile | |
parent | 936bb7554ea4fe6c9c18a11daa7868faf6db01c7 (diff) | |
download | upstream-5a6f44332310a6da18eec350f66011659ea1f58c.tar.gz upstream-5a6f44332310a6da18eec350f66011659ea1f58c.tar.bz2 upstream-5a6f44332310a6da18eec350f66011659ea1f58c.zip |
mklibs: Fix mklibs usage when *.so files reside in subdirs
Currently package/Makefile only passes /lib /usr/lib and /usr/lib/ebtables
to mklibs. However, other libs can also reside in different subdirectories
(in my case /usr/lib/ipsec). Hence, create the list of library directories
dynamically.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37841 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/Makefile')
-rw-r--r-- | package/Makefile | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/package/Makefile b/package/Makefile index f8002348b1..00ac773499 100644 --- a/package/Makefile +++ b/package/Makefile @@ -34,20 +34,18 @@ ifdef CONFIG_USE_MKLIBS # find all loadable objects that are not regular libraries and add them to the list as well find $(STAGING_DIR_ROOT) -type f -name \*.so\* -exec \ file -r -N -F '' {} + | \ - awk ' /shared object/ { print $$1 }' >> $(TMP_DIR)/mklibs-progs + awk ' /shared object/ { print $$1 }' > $(TMP_DIR)/mklibs-libs mkdir -p $(TMP_DIR)/mklibs-out $(STAGING_DIR_HOST)/bin/mklibs -D \ -d $(TMP_DIR)/mklibs-out \ --sysroot $(STAGING_DIR_ROOT) \ - -L /lib \ - -L /usr/lib \ - -L /usr/lib/ebtables \ + `cat $(TMP_DIR)/mklibs-libs | sed 's:/*[^/]\+/*$$::' | uniq | sed 's:^$(STAGING_DIR_ROOT):-L :'` \ --ldlib $(patsubst $(STAGING_DIR_ROOT)/%,/%,$(firstword $(wildcard \ $(foreach name,ld-uClibc.so.* ld-linux.so.* ld-*.so, \ $(STAGING_DIR_ROOT)/lib/$(name) \ )))) \ --target $(REAL_GNU_TARGET_NAME) \ - `cat $(TMP_DIR)/mklibs-progs` 2>&1 + `cat $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-libs` 2>&1 $(RSTRIP) $(TMP_DIR)/mklibs-out for lib in `ls $(TMP_DIR)/mklibs-out/*.so.* 2>/dev/null`; do \ LIB="$${lib##*/}"; \ |