From fe6b0d307cbb512dce79c8281f991ee92a87af17 Mon Sep 17 00:00:00 2001 From: klayoutmatthias Date: Tue, 8 Aug 2017 00:39:51 +0200 Subject: [PATCH] Recursively determine DLL dependencies. --- scripts/deploy-win-mingw.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/deploy-win-mingw.sh b/scripts/deploy-win-mingw.sh index 11485367a..bb225b05a 100644 --- a/scripts/deploy-win-mingw.sh +++ b/scripts/deploy-win-mingw.sh @@ -170,14 +170,24 @@ echo ']' >>$target/.python-paths.txt # ---------------------------------------------------------- # Binary dependencies -# Analyze the dependencies of our components and add the corresponding libraries from $mingw_inst/bin -libs=$(find $target \( -name "*.dll" -or -name "*.so" \) -exec objdump -p "{}" ";" | grep "DLL Name:" | sort -u | sed 's/.*DLL Name: *//') +new_libs=$(find $target -name "*.dll" -or -name "*.so") + +while [ "$new_libs" != "" ]; do + + echo "Analyzing dependencies of $new_libs .." + + # Analyze the dependencies of our components and add the corresponding libraries from $mingw_inst/bin + libs=$(objdump -p $new_libs | grep "DLL Name:" | sort -u | sed 's/.*DLL Name: *//') + new_libs="" + + for l in $libs; do + if [ -e $mingw_inst/bin/$l ] && ! [ -e $target/$l ]; then + echo "Copying binary installation partial $mingw_inst/bin/$l -> $target/$l .." + cp $mingw_inst/bin/$l $target/$l + new_libs="$new_libs $target/$l" + fi + done -for l in $libs; do - if [ -e $mingw_inst/bin/$l ]; then - echo "Copying binary installation partial $mingw_inst/bin/$l -> $target/$l .." - cp $mingw_inst/bin/$l $target/$l - fi done # ----------------------------------------------------------