diff -r aa2305c5b2a5 -r 52e1698ac243 scripts/xldd.in --- a/scripts/xldd.in Tue Nov 23 21:35:28 2010 +0100 +++ b/scripts/xldd.in Tue Nov 23 21:35:41 2010 +0100 @@ -55,7 +55,6 @@ ${my_name} does not scan /etc/ld.so.cache, but instead uses /etc/ld.so.conf (it understands the include directives therein for libces that have that). -[Note: this is missing for now...] ${my_name} will search the directory specified with --root for libraries to resolve the NEEDED tags. If --root is not set, then ${my_name} will @@ -214,6 +213,31 @@ done } +# Recursively scan a /etc/ld.so.conf file +do_scan_etc_ldsoconf() { + local ldsoconf="${1}" + local g + local f + + [ -f "${ldsoconf}" ] || return 0 + + while read line; do + case "${line}" in + include\ *) + g="${root}${line#include }" + for f in ${g}; do + do_scan_etc_ldsoconf "${f}" + done + ;; + \#*|"") + ;; + *) + needed_search_path+=( "${line}" ) + ;; + esac + done <"${ldsoconf}" +} + # Build up the full list of search directories declare -a needed_search_path ld_library_path="${ld_library_path}:" @@ -222,5 +246,6 @@ [ -n "${d}" ] && needed_search_path+=( "${d}" ) ld_library_path="${ld_library_path#*:}" done +do_scan_etc_ldsoconf "${root}/etc/ld.so.conf" do_process_file "${1}"