[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-devel] problems with sed test
From: |
Rocky Bernstein |
Subject: |
Re: [Libcdio-devel] problems with sed test |
Date: |
Sat, 27 Oct 2012 10:43:52 -0400 |
I think you are correct, and this is now in git commit 8992c19 with one
addition: set SED if it is not previously set. In other words, this line:
test -n "$SED" || SED=$ac_path_SED
On Fri, Oct 26, 2012 at 12:34 PM, Robert William Fuller <
address@hidden> wrote:
> Consider the following code in configure.ac:
>
> SED_EXTENDED_RE_FLAG='-r'
> result=$(echo 'define' | $ac_path_SED -r -e 's/^define/foo/' 2>/dev/null)
> if [[ $? -ne 0 ]] ; then
> result=$(echo 'define' | $ac_path_SED -r -E 's/^define/foo/'
> 2>/dev/null)
> if [[ $? -ne 0 ]] ; then
> SED_EXTENDED_RE_FLAG='-E'
> else
> AC_MSG_WARN([Don't have SED that understand extended RE's. Some minor
> compilation issues may fail.])
> SED_EXTENDED_RE_FLAG=''
> fi
> fi
>
> Now consider that the second test ought to be [[ $? -eq 0 ]] because we're
> checking to see if the -E flag works. BUT, the second invocation of sed
> will never succeed because the -r and the -E flag are mutually exclusive.
> One exists on one platform and not the other. So the second run of sed
> really ought to be "-E -e" not "-r -E". (I suspect that someone
> accidentally changed the wrong option during a copy and paste of the prior
> invocation when they wrote this code originally.)
>
> Supposing we make all these changes, this still won't work on MacOS
> because it has ac_path_SED set to /usr/X11/bin/gsed which does not exist.
> We should use the SED variable rather than ac_path_SED. So when all is
> sed and done, it should look like this:
>
> SED_EXTENDED_RE_FLAG='-r'
> result=$(echo 'define' | $SED -r -e 's/^define/foo/' 2>/dev/null)
> if [[ $? -ne 0 ]] ; then
> result=$(echo 'define' | $SED -E -e 's/^define/foo/' 2>/dev/null)
> if [[ $? -eq 0 ]] ; then
> SED_EXTENDED_RE_FLAG='-E'
> else
> AC_MSG_WARN([Don't have SED that understand extended RE's. Some
> minor compilation issues may fail.])
> SED_EXTENDED_RE_FLAG=''
> fi
> fi
>
> Thoughts?
>
> Rob
>
>