[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keep variable un-expanded in configure script
From: |
Andres Perera |
Subject: |
Re: Keep variable un-expanded in configure script |
Date: |
Fri, 11 Mar 2011 17:12:04 -0430 |
On Fri, Mar 11, 2011 at 2:12 PM, Too, Justin A. <address@hidden> wrote:
> Thanks for the quick reply,
>
> ${#} solves the problem -- would this be the best practice?
why are you defining a function inside of a macro?
>
>
> Justin
>
> On 3/11/11 10:37 AM, "Eric Blake" <address@hidden> wrote:
>
>>On 03/11/2011 11:32 AM, Eric Blake wrote:
>>> On 03/11/2011 11:17 AM, Too, Justin A. wrote:
>>>> Hi,
>>>>
>>>> I have a simple function in an m4 file that is a convenience to output
>>>>information. The function takes two parameters
>>>>
>>>> function foo () {
>>>> If test $# != 2 ; then
>>>> exit 1
>>>> fi
>>>> }
>>>>
>>>> However, Autoconf expands $#. How can I escape $#, so that it will
>>>>remain as-is in the configure script? I just can't figure this one out
>>>>:)
>>>
>>> Several options, but I'd need to see more context to make sure of which
>>> one is right for your scenario.
>>>
>>> Have you tried $][# (that is, using the proper m4 quoting to break the
>>> m4 macro definition into two concatenated strings) or $[]# (that is,
>>> inject an extra m4 quoted empty string)? (Which one to use depends on
>>> what level of nesting the $# appears in your macro, and whether it is
>>> likely to go through another round of m4 expansion).
>>>
>>> And if all else fails - use quadrigraphs: @S|@#
>>
>>For shell, you can also use ${#} instead of trying to get autoconf to
>>output literal $#.
>>
>>--
>>Eric Blake address@hidden +1-801-349-2682
>>Libvirt virtualization library http://libvirt.org
>>
>
>
> _______________________________________________
> Autoconf mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/autoconf
>
>
- Keep variable un-expanded in configure script, Too, Justin A., 2011/03/11
- Re: Keep variable un-expanded in configure script, Eric Blake, 2011/03/11
- Re: Keep variable un-expanded in configure script, Eric Blake, 2011/03/11
- Re: Keep variable un-expanded in configure script, Too, Justin A., 2011/03/11
- Re: Keep variable un-expanded in configure script,
Andres Perera <=
- Re: Keep variable un-expanded in configure script, Ralf Wildenhues, 2011/03/12
- Re: Keep variable un-expanded in configure script, Andres Perera, 2011/03/12
- Re: Keep variable un-expanded in configure script, Too, Justin A., 2011/03/12