From: David Bremner <david@tethera.net>
Date: Wed, 30 May 2018 02:03:17 +0000 (-0700)
Subject: configure: check for links to/from libdir in ldconfig output
X-Git-Tag: 0.27_rc1~2
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b71fa262b54398399821e89d01d984f46e24d2e8;p=notmuch

configure: check for links to/from libdir in ldconfig output

If e.g. /lib is a link to /usr/lib, then the latter may not show up in
the way we expect in the output of ldconfig. 'test foo -ef bar' checks
if foo and bar have the same device and inode numbers. Since (at least
in bash, dash, ksh, and zsh) the shell dereferences symlinks before
applying the test, this includes both the case where file1 is equal to
file2 and the case where one is a symlink to the other.
---

diff --git a/configure b/configure
index 3cefdcc6..ab7e1610 100755
--- a/configure
+++ b/configure
@@ -715,7 +715,7 @@ elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
     IFS="
 "
     for path in $ldconfig_paths; do
-	if [ "$path" = "$libdir_expanded" ]; then
+	if [ "$path" -ef "$libdir_expanded" ]; then
 	    libdir_in_ldconfig=1
 	fi
     done