Skip to content

Instantly share code, notes, and snippets.

@jpcima
Created March 26, 2018 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpcima/e5b2915a9a79b451e3799d14e5cfd7ec to your computer and use it in GitHub Desktop.
Save jpcima/e5b2915a9a79b451e3799d14e5cfd7ec to your computer and use it in GitHub Desktop.
make-blacklist.sh
#!/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