summaryrefslogtreecommitdiff
path: root/scripts/xldd.in
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-02-13 02:53:23 (GMT)
committerAlexey Neyman <stilor@att.net>2017-02-14 06:47:40 (GMT)
commit7bcf18bfab84374d3305c7a088f95ac1219ddf93 (patch)
tree49c67ed5fb9729ef554c3a07a916612af5139e24 /scripts/xldd.in
parentfbc69323085e2370faeb8b46291cd66cbf9ef649 (diff)
Determine whether -E/-r option selects extended regexp
... and then use the right option. See the note in scripts/functions on where we should use ${foo} and where just 'foo'; this boils down to whether we can expect the build tools override to be in effect (e.g. in the actual build scripts) or not (i.e. outside of scripts/build). While running in scripts/functions, or in scripts/crosstool-NG.sh the build tools override directory (.build/tools/bin) may have not been set up (yet, or at all). Also, modify the installed scripts (populate, xldd) accordingly. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/xldd.in')
-rw-r--r--scripts/xldd.in7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/xldd.in b/scripts/xldd.in
index 0e8c0d0..9aa8b61 100644
--- a/scripts/xldd.in
+++ b/scripts/xldd.in
@@ -5,6 +5,7 @@ export LC_ALL=C
version="@@CT_VERSION@@"
bits="@@CT_BITS@@"
sed="${SED:-@@CT_sed@@}"
+sed_r="${SED_R:-@@CT_sed_r@@}"
grep="${GREP:-@@CT_grep@@}"
my_name="$( basename "${0}" )"
@@ -159,7 +160,7 @@ fi
sysroot="$( "${gcc}" -print-sysroot 2>/dev/null )"
if [ -z "${sysroot}" ]; then
sysroot="$( "${gcc}" -print-file-name=libc.so 2>/dev/null \
- |${sed} -r -e 's:/usr/lib/libc.so$::;' \
+ |${sed_r} -e 's:/usr/lib/libc.so$::;' \
)"
fi
if [ -z "${sysroot}" ]; then
@@ -259,7 +260,7 @@ do_process_file() {
save_search_rpath=( "${search_rpath[@]}" )
for n in $( "${readelf}" -d "${file}" \
|"${grep}" -E '\((RPATH|RUNPATH)\)' \
- |"${sed}" -r -e 's/^.*Library r(|un)path:[[:space:]]+\[(.*)\]$/\2/;'\
+ |"${sed_r}" -e 's/^.*Library r(|un)path:[[:space:]]+\[(.*)\]$/\2/;'\
); do
do_trace "-> adding rpath '%s'\n" "${n}"
search_rpath+=( "${n}" )
@@ -272,7 +273,7 @@ do_process_file() {
for n in $( "${readelf}" -d "${file}" \
|"${grep}" -E '\(NEEDED\)' \
- |"${sed}" -r -e 's/^.*Shared library:[[:space:]]+\[([^]]+)\].*/\1/;' \
+ |"${sed_r}" -e 's/^.*Shared library:[[:space:]]+\[([^]]+)\].*/\1/;' \
); do
found=0
for m in "${needed_list[@]}"; do