diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-11-23 21:35:41 +0100 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-11-23 21:35:41 +0100 |
commit | 6960ddb3762639b2f95eb0d502ace12be8dffd73 (patch) | |
tree | f32cc16d84ef563d8dc99334085482b9fba473af /scripts/xldd.in | |
parent | 2e1dcdf8d499e857647a74e26cf07c312bb03649 (diff) | |
download | crosstool-ng-6960ddb3762639b2f95eb0d502ace12be8dffd73.tar.gz crosstool-ng-6960ddb3762639b2f95eb0d502ace12be8dffd73.tar.bz2 crosstool-ng-6960ddb3762639b2f95eb0d502ace12be8dffd73.zip |
scripts/xldd: parse /etc/ld.so.conf
Scan /etc/ld.so.conf for paths to search for libraries.
Also follow include directives in there.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/xldd.in')
-rwxr-xr-x | scripts/xldd.in | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/scripts/xldd.in b/scripts/xldd.in index 9c8ffbcd..50fc9e1a 100755 --- a/scripts/xldd.in +++ b/scripts/xldd.in @@ -55,7 +55,6 @@ guessed except at runtime, and we can't run. ${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 @@ do_process_file() { 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 @@ while [ -n "${ld_library_path}" ]; do [ -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}" |