• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

DLL dependency listing utility for MinGW applications


Commit MetaInfo

Revisiona80f93b3ab073007b892bb0bda22695031a3ab49 (tree)
Time2020-09-06 18:43:32
AuthorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Diagnose missing files at top level.

* mingw32-ldd.sh (show_depends): Rename original function...
(plot_depends): ...as this; use it in reimplementation, as new, of...
(show_depends): ...this; add diagnostics to report missing files.
(CMD): New script variable; define, and use it in diagnostics...
(usage, show_depends): ...in each of these.
(STATUS): New variable.

Change Summary

Incremental Difference

--- a/mingw32-ldd.sh
+++ b/mingw32-ldd.sh
@@ -32,11 +32,12 @@
3232 # DEALINGS IN THE SOFTWARE.
3333 #
3434 #
35- usage(){ echo >&2 "Usage: `basename $0` {EXENAME | DLLNAME} ..."; echo; }
35+ CMD=`basename $0`
36+ usage(){ echo >&2 "Usage: $CMD {EXENAME | DLLNAME} ..."; STATUS=2; echo; }
3637 #
3738 PROGRAM_FILES="$SYSTEM_DRIVE/program files"
3839 SYSTEM_DLLPATH="$SYSTEM_DRIVE/windows/system32"
39- EXEPATH=`dirname "$1"`
40+ EXEPATH=`dirname "$1"` STATUS=0
4041 #
4142 set_dllpath(){
4243 # Usage: set_dllpath "colon:separated:path:list"
@@ -73,8 +74,8 @@
7374 objdump -x "$1" | awk 'BEGIN{IGNORECASE=1}/dll name/{print $NF}'
7475 }
7576 #
76- show_depends(){
77- # Usage: show_depends {EXENAME | DLLNAME} [count] [prefix]
77+ plot_depends(){
78+ # Usage: plot_depends {EXENAME | DLLNAME} [count] [prefix]
7879 #
7980 # Recursively plot the DLL dependency graph for the executable or
8081 # dynamic link library file named by EXENAME or DLLNAME; the count
@@ -88,11 +89,11 @@
8889 local ref count references="`depends $1`"
8990 for ref in $references
9091 do references=`ref_shift $references` count=`ref_count $references`
91- show_depends $ref $count ${2+"$3 `plot_linkage $2` "}
92+ plot_depends $ref $count ${2+"$3 `plot_linkage $2` "}
9293 done
9394 }
9495 #
95-# Helper functions, called by show_depends(), to assist in formatting
96+# Helper functions, called by plot_depends(), to assist in formatting
9697 # the plot of the DLL dependency graph; ref_count() simply reports the
9798 # number of entries in the reference list, (passed as an argument list),
9899 # while ref_shift() removes the first such reference from the same list,
@@ -114,6 +115,18 @@
114115 test $1 -gt 0 && echo "|" || echo " "
115116 }
116117 #
118+ show_depends(){
119+ # Usage: show_depends {EXENAME | DLLNAME}
120+ #
121+ # Wrapper to invoke plot_depends() for EXENAME or DLLNAME, provided
122+ # it exists, otherwise display a diagnostic message
123+ #
124+ test -f "$1" && plot_depends "$1" || {
125+ echo >&2 "$CMD: ***ERROR*** $1: file not found"
126+ STATUS=2
127+ }
128+ }
129+#
117130 # Effective program entry point: set up the DLLPATH (in space separated,
118131 # quoted path list format), then plot the DLL dependency graph for each
119132 # EXENAME or DLLNAME specified on the command line.
@@ -121,5 +134,6 @@
121134 test $# -gt 0 || { usage; exit 2; }
122135 set_dllpath "${DLLPATH-$PROGRAM_FILES:/mingw/bin:$SYSTEM_DLLPATH}"
123136 while test $# -gt 0; do show_depends "$1"; shift; test $# -gt 0 && echo; done
137+ exit $STATUS
124138 #
125139 # $RCSfile$: end of file