DLL dependency listing utility for MinGW applications
ldd { exename | dllname } ...
mingw32-ldd { exename | dllname } ...
mingw-ldd is a Bourne shell utility script, which may be used to display the DLL dependencies of one or more MS-Windows executable programs, or other MS-Windows DLLs. Suitable for use on MS-Windows itself, (running within MinGW.org's MSYS environment), or as a component of a cross-compiler tool suite, running on a non-Windows platform, it utilizes the objdump -x utility, in conjunction with awk, to extract any DLL Name headers from the named executables, or DLLs, then recursively processes each DLL, identified as a dependency by such headers, presenting all recursively identified DLLs in the form of a dependency tree.
Typically, when deployed on MS-Windows, in the MSYS environment, this utility is simply called ldd, and is invoked using the first form of the command, as shown in the synopsis; when deployed on any non-Windows platform, to avoid conflict with the native utility of the same name, this utility is called mingw32-ldd, (possibly with the "mingw32" prefix adjusted to match that of the mingw32-objdump command, within the associated cross-compiler suite), and is invoked using the second form of the command.
To install mingw-ldd, for use in MinGW.org's MSYS environment, simply copy the mingw32-ldd.sh file, saving it to the MSYS /bin directory, as /bin/ldd; it may then be invoked, (provided that the MinGW.org binutils tools, and the MSYS awk package, are also installed), using the first form shown in the synopsis.
To install on a non-Windows platform, to accompany a cross-compiler tool suite, copy the mingw32-ldd.sh file to any convenient directory in $PATH, (typically the same directory as the mingw32-objdump program), saving it without the .sh suffix, and make it executable, (e.g. by running chmod a+x mingw32-ldd in the appropriate directory); it may then be invoked using the second form of the command, as shown in the synopsis.
Note that, regardless of the platform on which mingw-ldd is installed, it requires both a POSIX.1 conforming awk utility, and an objdump utility which supports the MS-Windows PE-coff object format. It is assumed that any modern awk will satisfy the POSIX.1 requirement, and no provision is made, to accommodate a non-conforming implementation. On the other hand, on non-Windows platforms, the host's native objdump utility may, or may not, support the PE-coff object format; in case it does not, then a cross-objdump utility must be installed, and the "mingw32" host prefix part of the installed "mingw32-ldd" name should be adjusted to match the actual host prefix of the cross-objdump utility.
mingw-ldd uses a small number of shell variables, to influence its configuration; these may be defined as environment variables, and passed through the shell environment when invoking mingw32-ldd; alternatively, they may be defined as script variables, in the user-specific $HOME/.mingw32rt configuration file, which will be sourced by mingw32-ldd, on start-up.
The influential variables are:—
Note that the directories within "$PATH" are not automatically included within "$DLLPATH", but may be explicitly added to either PROGRAM_FILES, or SYSTEM_DLLPATH, (or to an explicit definition of DLLPATH itself), if desired.
Rev. | Time | Author | Message RSS |
2b4c7d12 | 2020-09-10 04:37:28 | Keith Marshall | Avoid the use of GNU-specific awk extensions. * mingw32-... |
66b69666 | 2020-09-08 19:08:30 | Keith Marshall | Support a configurable command name host prefix. * mingw... |
a9475f38 | 2020-09-08 03:13:38 | Keith Marshall | Adopt a consistent style for shell function definitions. ... |
6c62748f | 2020-09-07 02:38:10 | Keith Marshall | Support persistent user-specific run-time initialization.... |
4438871e | 2019-10-12 20:36:38 | Keith Marshall | Use mingw32-specific objdump command, if available. * mi... |
a80f93b3 | 2020-09-06 18:43:32 | Keith Marshall | Diagnose missing files at top level. * mingw32-ldd.sh (s... |
61e5b061 | 2017-07-22 06:14:52 | Keith Marshall | New repository; initial commit. * mingw32-ldd.sh: New fi... |