autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Support AC_CONFIG_LIBOBJ_DIR


From: Gary V. Vaughan
Subject: Re: [PATCH] Support AC_CONFIG_LIBOBJ_DIR
Date: Wed, 20 Apr 2005 11:00:57 +0100
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Hi Paul,

Paul Eggert wrote:
> "Gary V. Vaughan" <address@hidden> writes:
> 
> 
>>>ac_libobj_dir=
>>>test "X${ac_config_libobj_dir-.}" != X. &&
>>>  ac_libobj_dir=`expr "X$ac_config_libobj_dir/" : 'X\(.*[^/]\)' '|' 'X/' : 
>>> 'X\(/\)'`
>>
>>I think that does something different.  The idea of my sed expression is
>>just to avoid adding a trailing slash if configure.ac contains, say,
>>AC_CONFIG_LIBOBJ_DIR([lib/]).
> 
> 
> But that's what this patch does.  For example:

You misunderstood; my intent was to ensure exactly one trailing slash for easy
concatenation further down in the code.

> $ expr 'Xlib/' : 'X\(.*[^/]\)' '|' 'X/' : 'X\(/\)'
> lib

$ echo 'lib/' | sed 's,/*$,/,'
lib/

> $ expr 'Xlib//' : 'X\(.*[^/]\)' '|' 'X/' : 'X\(/\)'
> lib

$ echo 'lib//' | sed 's,/*$,/,'
lib/

> $ expr 'Xlib///' : 'X\(.*[^/]\)' '|' 'X/' : 'X\(/\)'
> lib

$ echo 'lib///' | sed 's,/*$,/,'
lib/

> $ expr 'Xabc\def/' : 'X\(.*[^/]\)' '|' 'X/' : 'X\(/\)'
> abc\def

$ echo 'abc\def' | sed 's,/*$,/,'
abc\def

Although the latter is certainly subject to the vagiaries of the local echo
implementation.

> The advantage of expr is that it does the right thing even if
> $ac_config_libobj_dir contains a backslash or other weird character.

Agreed.

$ expr 'Xlib/sub///' : 'X\(.*[^/]/\)'
lib/sub/

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]