[Top][All Lists]

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

Re: Keep variable un-expanded in configure script

From: Too, Justin A.
Subject: Re: Keep variable un-expanded in configure script
Date: Fri, 11 Mar 2011 10:42:28 -0800
User-agent: Microsoft-MacOutlook/

Thanks for the quick reply,

${#} solves the problem -- would this be the best practice?


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

reply via email to

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