From 6035c45b8550febd05eeba6ae2bb0b5e72d92bf6 Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Fri, 13 Jul 2012 11:48:46 +0300 Subject: [PATCH 2/9] Fallback to libpopt on shared object Use shared library if no static library is installed. Signed-off-by: Julian Anastasov Signed-off-by: Simon Horman --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 969bff9..930b29f 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,21 @@ POPT_LIB = $(shell for i in $(LIB_SEARCH); do \ fi; \ fi; \ done) +ifeq (,$(POPT_LIB)) +POPT_LIB = $(shell for i in $(LIB_SEARCH); do \ + f1=""; \ + for so in $$i/libpopt.so*; do \ + if [ -f $$so ]; then \ + if objdump -T $$so | fgrep -q poptGetContext; then \ + echo "-lpopt"; \ + f1=y; \ + break; \ + fi; \ + fi; \ + done; \ + [ "$$f1" != "" ] && break; \ +done) +endif endif ifneq (,$(POPT_LIB)) -- 1.8.1.4