[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] AC_INIT: properly quote package name containing m4 macro
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH] AC_INIT: properly quote package name containing m4 macro |
Date: |
Thu, 17 Mar 2011 16:50:55 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
Hi Eric, and thanks for having solved this.
I have just a minor nit and a question below (sorry for not giving a
proper review, but I must admit some parts of your patch are way beyond
me ATM :-(, especially the new definition of AC_PACKAGE_TARNAME).
On Thursday 17 March 2011, Eric Blake wrote:
>
> [CUT]
>
> Note that this is a subtle semantic change. It used to be that you
> could do:
>
> m4_define([pkg_name], [foo])
> AC_INIT([pkg_name], [1.0])
>
> and that would result in AC_SUBST of PACKAGE_NAME=foo
>
> With this patch, it results in PACKAGE_NAME=pkg_name.
>
> [CUT]
>
> I don't see too much harm in making this change, and stating that the
> arguments to AC_INIT are never re-expanded for macros by autoconf
> itself. For most packages it won't matter - you don't define macros
> for your package name; for automake, it will avoid the testsuite
> failures encountered when the test name included an m4 builtin that
> later became an AC_INIT argument. And for computation purposes, you
> can _always_ do this, pre- and post-patch, to get PACKAGE_NAME=foo:
>
> m4_define([pkg_name], [foo])
> AC_INIT(pkg_name, [1.0])
>
Wouldn't
AC_INIT(m4_defn([pkg_name]), [1.0])
be even better? It should also allow for patological stuff like:
m4_define([pkg_name], [my-changequote])
Maybe the testsuite addition can be enhanced to ensure this works
too?
> I think that I need to also touch up docs/autoconf.texi and NEWS
> before pushing this, in case someone really was expecting macro
> invocation after the fact.
>
FWIW, I think that would be prudent.
>
> [CUT]
>
> diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
> index dd20e71..7b8c873 100644
> --- a/lib/autoconf/general.m4
> +++ b/lib/autoconf/general.m4
>
> [BIG CUT]
>
> @@ -588,9 +596,9 @@ AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
> AC_SUBST([localstatedir], ['${prefix}/var'])dnl
> AC_SUBST([includedir], ['${prefix}/include'])dnl
> AC_SUBST([oldincludedir], ['/usr/include'])dnl
> -AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
> +AC_SUBST([docdir], m4_ifset([AC_PACKAGE_TARNAME],
> ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
> - ['${datarootdir}/doc/${PACKAGE}'])])dnl
> + [['${datarootdir}/doc/${PACKAGE}']]))dnl
> AC_SUBST([infodir], ['${datarootdir}/info'])dnl
> AC_SUBST([htmldir], ['${docdir}'])dnl
> AC_SUBST([dvidir], ['${docdir}'])dnl
>
What is this hunk for exactly? (Sorry in advance if it's a stupid question)
Thanks,
Stefano
- [PATCH] AC_INIT: properly quote package name containing m4 macro, Eric Blake, 2011/03/17
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro,
Stefano Lattarini <=
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Ralf Corsepius, 2011/03/17
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Ralf Wildenhues, 2011/03/17
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Ralf Corsepius, 2011/03/19
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Dave Hart, 2011/03/20
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Ralf Corsepius, 2011/03/21
- Re: [PATCH] AC_INIT: properly quote package name containing m4 macro, Eric Blake, 2011/03/21