scripts/xldd.in
changeset 2189 52e1698ac243
parent 2188 aa2305c5b2a5
child 2190 9b9a0bb51cfb
     1.1 --- a/scripts/xldd.in	Tue Nov 23 21:35:28 2010 +0100
     1.2 +++ b/scripts/xldd.in	Tue Nov 23 21:35:41 2010 +0100
     1.3 @@ -55,7 +55,6 @@
     1.4  
     1.5  ${my_name} does not scan /etc/ld.so.cache, but instead uses /etc/ld.so.conf
     1.6  (it understands the include directives therein for libces that have that).
     1.7 -[Note: this is missing for now...]
     1.8  
     1.9  ${my_name} will search the directory specified with --root for libraries
    1.10  to resolve the NEEDED tags. If --root is not set, then ${my_name} will
    1.11 @@ -214,6 +213,31 @@
    1.12       done
    1.13  }
    1.14  
    1.15 +# Recursively scan a /etc/ld.so.conf file
    1.16 +do_scan_etc_ldsoconf() {
    1.17 +    local ldsoconf="${1}"
    1.18 +    local g
    1.19 +    local f
    1.20 +
    1.21 +    [ -f "${ldsoconf}" ] || return 0
    1.22 +
    1.23 +    while read line; do
    1.24 +        case "${line}" in
    1.25 +            include\ *)
    1.26 +                g="${root}${line#include }"
    1.27 +                for f in ${g}; do
    1.28 +                    do_scan_etc_ldsoconf "${f}"
    1.29 +                done
    1.30 +                ;;
    1.31 +            \#*|"")
    1.32 +                ;;
    1.33 +            *)
    1.34 +                needed_search_path+=( "${line}" )
    1.35 +                ;;
    1.36 +        esac
    1.37 +    done <"${ldsoconf}"
    1.38 +}
    1.39 +
    1.40  # Build up the full list of search directories
    1.41  declare -a needed_search_path
    1.42  ld_library_path="${ld_library_path}:"
    1.43 @@ -222,5 +246,6 @@
    1.44      [ -n "${d}" ] && needed_search_path+=( "${d}" )
    1.45      ld_library_path="${ld_library_path#*:}"
    1.46  done
    1.47 +do_scan_etc_ldsoconf "${root}/etc/ld.so.conf"
    1.48  
    1.49  do_process_file "${1}"