automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {maint} Document in detail some limitations of aclocal.


From: Nick Bowler
Subject: Re: [PATCH] {maint} Document in detail some limitations of aclocal.
Date: Thu, 4 Nov 2010 17:47:42 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

On 2010-11-04 22:28 +0100, Stefano Lattarini wrote:
> On Thursday 04 November 2010, Nick Bowler wrote:
> > On 2010-11-04 20:47 +0100, Stefano Lattarini wrote:
> > > +AC_DEFUN([MY_DEFUN], [m4_apply([AC_DEFUN], [$1], [$2])])
> > 
> > This is insufficiently quoted, it should be:
> >                         [m4_apply([AC_DEFUN], [[$1], [$2]])]
> I'm not an m4 quoting guru, but I think that one single level of quotes
> is sufficient to avoid *spurious* expansions.  Do you have any reason or
> example showing that two levels of quotes are indeed needed?

"Insufficient quoting" was probably the wrong term to use here -- you
are right that spurious expansion is avoided.   The problem is the use
of m4_apply, which takes two arguments: the first is the (quoted) name
of the macro, and the second is the (quoted) list of arguments.  So in
effect, this MY_DEFUN macro will only ever call AC_DEFUN with one
argument (because the third argument to m4_apply is discarded).

For a specific example, try running the configure script generated by
the following configure.ac:

  AC_INIT([test], [1.0])
  
  AC_DEFUN([DEFONE], [m4_apply([AC_DEFUN], [$1], [$2])])
  AC_DEFUN([DEFTWO], [m4_apply([AC_DEFUN], [[$1], [$2]])])
  
  DEFONE([HELLO], [echo "Hello, World"])
  DEFTWO([GOODBYE], [echo "Goodbye, World"])
  
  HELLO
  GOODBYE

  AC_OUTPUT

-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)



reply via email to

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