On 12/14/2010 02:33 PM, Bruno Haible wrote: >>> In configure.ac add: >>> >>> dnl Installation directories. >>> dnl Remove this when you can assume autoconf >= 2.60. >>> AC_SUBST([localedir], ['${datadir}/locale']) > > This is the essential change.
It's also the change that is most likely to cause conflicts if done incorrectly - that is, we don't want to do this if autoconf and/or automake is new enough to already cover it. > >> But the Makefile.am in question is generated by gnulib. Adding it to >> the top level won't affect the generation of configmake.h. > > Then you could use gnulib-tool's option --makefile-name and include the > gnulib-generated Makefile.am fragment from your real Makefile.am. But the whole point of the configmake module is that it should just work without the user having to specify --makefile-name. At least we can inject both configure.ac and Makefile.am snippets into the configmake module. However, it appears you are right; after testing, I confirmed that the AC_SUBST edit to configure.ac plus a single mention of $(localedir) in the gnulib-level Makefile.am (already present, thanks to the configmake substitutions) is sufficient to get even automake 1.9.6 to automatically populate $(localedir) = @localedir@, without me having to edit any Makefile.am. > >> # Listed in the same order as the GNU makefile conventions. >> # The Automake-defined pkg* macros are appended, in the order >> # listed in the Automake 1.10a+ documentation. >> +# Support newer definitions even when using older automake 1.9.6 > > The Automake version is probably irrelevant here. It's the Autoconf > version that matters. Oh; it's a mix of both autoconf and automake macros (autoconf AC_SUBST's localedir, but only automake 1.11 AC_SUBST's pkglibexecdir); the comment in modules/configmake only mentioned automake, but both tools have a hand in feeding configmake.h. >> echo '#define DATAROOTDIR "$(datarootdir)"'; \ >> echo '#define DATADIR "$(datadir)"'; \ >> + echo '#ifndef DATAROOTDIR'; \ >> + echo '# define DATAROOTDIR DATADIR'; \ >> + echo '#endif; \ > > I would prefer to do this at configure.ac level. Because if a package has > C code which accesses DATAROOTDIR or LOCALEDIR, chances are high that it > also has Makefile rules that install files into $(datarootdir) or > $(localedir). > The change that you propose handles the C code but not the Makefile.am rules. Okay, then, I'm back to trying to modify the configmake module's configure.ac section, in a way that is friendly to the autotools already providing a definition, and which allows use of these variables throughout makefiles in addition to C files. -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature