]> git.notmuchmail.org Git - notmuch/commitdiff
configure: really expand libdir_expanded
authorDavid Bremner <bremner@debian.org>
Wed, 28 Nov 2012 12:25:52 +0000 (08:25 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 1 Dec 2012 12:04:30 +0000 (08:04 -0400)
It turns out that if people really use configure in autotools style and pass
libdir containing '${prefix}/foo' then the ldconfig previously failed.

This uses sed for portability (versus bash parameter expansion with
substitution) and hopefully a bit more robustness than blindly
parameter expanding the string.

configure

index ea8a1ad5d996cecff184d449318c46ea9a01feea..460fcfcf31178ea4b1ecdf9fc506e692b064747a 100755 (executable)
--- a/configure
+++ b/configure
@@ -236,7 +236,12 @@ done
 # Makefile.config file later like most values), because we need to
 # actually investigate this value compared to the ldconfig_paths value
 # below.
-libdir_expanded=${LIBDIR:-${PREFIX}/lib}
+if [ -z "$LIBDIR" ] ; then
+    libdir_expanded="${PREFIX}/lib"
+else
+    # very non-general variable expansion
+    libdir_expanded=`echo "$LIBDIR" | sed "s|\\${prefix}|${PREFIX}|g; s|\\$prefix/|${PREFIX}/|; s|//*|/|g"`
+fi
 
 cat <<EOF
 Welcome to Notmuch, a system for indexing, searching and tagging your email.