Re: [PATCH] configure: really expand libdir_expanded

Subject: Re: [PATCH] configure: really expand libdir_expanded

Date: Wed, 28 Nov 2012 14:31:21 +0200

To: david@tethera.net, notmuch@notmuchmail.org

Cc: David Bremner

From: Tomi Ollila


On Wed, Nov 28 2012, david@tethera.net wrote:

> From: David Bremner <bremner@debian.org>
>
> 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.
> ---

For the record: +1

Tomi


>  configure |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index ea8a1ad..460fcfc 100755
> --- 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.
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

Thread: