Recursively determine DLL dependencies.

This commit is contained in:
klayoutmatthias 2017-08-08 00:39:51 +02:00
parent 0ae9c9c9e1
commit fe6b0d307c
1 changed files with 17 additions and 7 deletions

View File

@ -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
# ----------------------------------------------------------