DLL dependency listing utility for MinGW applications
修订版 | 4438871e1cde53355d45df7eb771cfc57aa10a35 (tree) |
---|---|
时间 | 2019-10-12 20:36:38 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Use mingw32-specific objdump command, if available.
* mingw32-ldd.sh (objdump): New script variable; define, and...
(list_depends): ...use it.
@@ -8,8 +8,8 @@ | ||
8 | 8 | # |
9 | 9 | # $Id$ |
10 | 10 | # |
11 | -# Written by Keith Marshall <keithmarshall@users.sourceforge.net> | |
12 | -# Copyright (C) 2016, 2017, MinGW.org Project | |
11 | +# Written by Keith Marshall <keith@users.osdn.me> | |
12 | +# Copyright (C) 2016, 2017, 2019, MinGW.org Project | |
13 | 13 | # |
14 | 14 | # |
15 | 15 | # Permission is hereby granted, free of charge, to any person obtaining a |
@@ -65,13 +65,19 @@ | ||
65 | 65 | ) |
66 | 66 | } |
67 | 67 | # |
68 | +# The list_depends() function uses the objdump command to identify the | |
69 | +# DLL references, but for cross-hosted use, prefer the mingw32-objdump | |
70 | +# variant, if it is present in $PATH. | |
71 | +# | |
72 | + objdump=`type -p mingw32-objdump || type -p objdump || echo objdump` | |
73 | +# | |
68 | 74 | list_depends(){ |
69 | 75 | # Usage: list_depends {EXENAME | DLLNAME} |
70 | 76 | # |
71 | 77 | # Helper function, called by depends(), to perform dependency list |
72 | 78 | # extraction from the file explicitly named by EXENAME or DLLNAME. |
73 | 79 | # |
74 | - objdump -x "$1" | awk 'BEGIN{IGNORECASE=1}/dll name/{print $NF}' | |
80 | + $objdump -x "$1" | awk 'BEGIN{IGNORECASE=1}/dll name/{print $NF}' | |
75 | 81 | } |
76 | 82 | # |
77 | 83 | plot_depends(){ |