autoconf-archive-maintainers
[Top][All Lists]
Advanced

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

Re: AX_PROG_{PERL, ...} -> (AU) obsoletes both AX_WITH_{PERL, ...} and A


From: Ralf Wildenhues
Subject: Re: AX_PROG_{PERL, ...} -> (AU) obsoletes both AX_WITH_{PERL, ...} and AX_PROG_{PERL, ...}_VERSION
Date: Wed, 13 Oct 2010 20:18:51 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

* Peter Simons wrote on Wed, Oct 13, 2010 at 01:15:00PM CEST:
>  > --- a/m4/ax_with_perl.m4
>  > +++ b/m4/ax_with_perl.m4

>  > +AU_DEFUN([AX_WITH_PERL], [AX_PROG_PERL($2,,,[ PERL=$1 ])])
>  >  AC_DEFUN([AX_WITH_PERL],[
>  >      AX_WITH_PROG(PERL,perl,$1,$2)
>  >  ])
> 
> I am surprised that this code works. Is it possible to have both an
> AU_DEFUN and an AC_DEFUN for the same name?

Yes, it is.  I think that it doesn't make a lot of sense in this case
though, because the AC_DEFUN (which comes later here) will just
overwrite the definition from the AU_DEFUN.  It makes more sense to have
AU_DEFUN followed by m4_define which then means that the former is
active during autoupdate, but the latter during autoconf.

Please get in the habit of using proper m4 quoting though, at least the
macro arguments should be quoted:

    AU_DEFUN([AX_WITH_PERL], [AX_PROG_PERL([$2],,,[ PERL=$1 ])])

    AC_DEFUN([AX_WITH_PERL],[
        AX_WITH_PROG(PERL,perl,[$1],[$2])
    ])

so that, when they happen to contain a comma, don't mess up the number
of arguments to called macros.

Cheers,
Ralf



reply via email to

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