Created
March 26, 2018 17:21
-
-
Save jpcima/e5b2915a9a79b451e3799d14e5cfd7ec to your computer and use it in GitHub Desktop.
make-blacklist.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
chost=i686-w64-mingw32 | |
prefix=/usr/"$chost" | |
mingw_crt_files() { | |
pacman -Ql mingw-w64-crt | cut -d ' ' -f 2- | |
} | |
mingw_find_libs() { | |
mingw_crt_files | while read f; do | |
case "$f" in "$prefix"/lib/*.a) echo "$f" ;; esac | |
done | |
} | |
mingw_find_dlls() { | |
mingw_crt_files | while read f; do | |
case "$f" in "$prefix"/bin/*.dll) echo "$f" ;; esac | |
done | |
} | |
compute_blacklist() { | |
mingw_find_libs | while read f; do | |
dllname=`"$chost-dlltool" -I "$f" 2>/dev/null` || continue | |
if ! [ -f "$prefix"/bin/"$dllname" ]; then | |
echo "$dllname" | tr A-Z a-z | |
fi | |
done | |
} | |
echo -n "[" | |
compute_blacklist | while read f; do | |
echo -n " \"$f\"," | |
done | |
echo " ]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment