mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
configure: Fix detection of libdir in ldconfig configuration
Ever since commit b4b5e9ce4d
the
detection of libdir in the ldconfig configuration has been broken,
resulting in RPATH being set when not needed and not wanted.
The cause was a change from an IFS setting of:
IFS="$(printf '\n\t')"
to a new setting of:
IFS="$(printf '\n')"
That looks desirable since we want to split the output of ldconfig
based on newlines, (and not split on any filename that might have an
embedded tab in it). The subtle bug in the above is that the shell
trims any trailing newlines when performing command substitution so
the final statement above was equivalent to:
IFS=''
which prevented any splitting of the ldconfig output at all.
Fix this by avoiding command substitution and just using a literal
newline in the source file for setting this variable.
This commit is contained in:
parent
e96741388a
commit
574f408816
1 changed files with 15 additions and 2 deletions
17
configure
vendored
17
configure
vendored
|
@ -355,17 +355,30 @@ elif [ $uname = "Linux" ] ; then
|
|||
printf "Linux\n"
|
||||
platform=LINUX
|
||||
linker_resolves_library_dependencies=1
|
||||
|
||||
printf "Checking for $libdir_expanded in ldconfig... "
|
||||
ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 's,^\(/.*\):\( (.*)\)\?$,\1,p')
|
||||
# Separate ldconfig_paths only on newline (not on any potential
|
||||
# embedded space characters in any filenames).
|
||||
# embedded space characters in any filenames). Note, we use a
|
||||
# literal newline in the source here rather than something like:
|
||||
#
|
||||
# IFS=$(printf '\n')
|
||||
#
|
||||
# because the shell's command substitution deletes any trailing newlines.
|
||||
OLD_IFS=$IFS
|
||||
IFS="$(printf '\n')"
|
||||
IFS="
|
||||
"
|
||||
for path in $ldconfig_paths; do
|
||||
if [ "$path" = "$libdir_expanded" ]; then
|
||||
libdir_in_ldconfig=1
|
||||
fi
|
||||
done
|
||||
IFS=$OLD_IFS
|
||||
if [ "$libdir_in_ldconfig" = '0' ]; then
|
||||
printf "No (will set RPATH)\n"
|
||||
else
|
||||
printf "Yes\n"
|
||||
fi
|
||||
else
|
||||
printf "Unknown.\n"
|
||||
cat <<EOF
|
||||
|
|
Loading…
Reference in a new issue