libtool-patches
[Top][All Lists]
Advanced

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

Re: FYI: function definitions


From: Gary V. Vaughan
Subject: Re: FYI: function definitions
Date: Tue, 01 Feb 2005 11:49:29 +0000
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Hallo Ralf!

Ralf Wildenhues wrote:
> * Gary V. Vaughan wrote on Mon, Jan 10, 2005 at 12:27:44PM CET:
> 
>>Pending the status of $as_cr_alnum, please go ahead.
> 
> I just realized that, if I first need Autoconf to have a macro that
> guarantees to provide as_cr_alnum, then we can't use it anyway until
> the next stable Autoconf is released.

Not so.

> --- tests/sh.test     28 Dec 2004 13:50:23 -0000      1.21
> +++ tests/sh.test     4 Jan 2005 15:00:58 -0000
> @@ -81,4 +81,18 @@
>    status=$EXIT_FAILURE
>  fi
>
> +# Check for opening brace on next line in shell function definition
> +for s in $scripts
> +do
> +  if $SED -n '/^func_/{N;/^func_['"$as_cr_alnum"'_]* ()\n{$/d;p;}' $s |
> +     $EGREP .; then
> +    echo "Function definitions should look like this in $s:
> +func_foo ()
> +{
> +  # ...
> +}"
> +    status=$EXIT_FAILURE
> +  fi
> +done
> +

The old style test scripts don't get an m4sh expansion pass, so _AS_CR_PREPARE
has no bearing on the contents of test.sh.  Rewriting it on HEAD as a new
style test might involve adding this somewhere (since we know that either
Autoconf is new enough and provides a good value for as_cr_alnum, or Autoconf
is so old that it doesn't provide a value at all):

AC_PROVIDE_IFELSE([_AR_CR_PREPARE], [], [
as_cr_alnum='abcdef...XYZ0123456789'
])

On branch-2-0, I think the following is fairly future proof:

test -n "$as_cr_alnum" || as_cr_alnum='abcdef...XYZ0123456789'

In both cases, I think the slight untidiness is worth the extra safety added
to sh.test...  what do you think?

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]