Hi Eric,

> > In Makefile.am add:
> > 
> >   localedir = @localedir@

This is probably not needed at all; the AC_SUBST invocation causes this line
to be added to every Makefile.in generated from a Makefile.am automatically.

> > 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.

> 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.

>  # 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.

>  configmake.h: Makefile
>       $(AM_V_GEN)rm -f $...@-t && \
>       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
> @@ -35,6 +36,9 @@ configmake.h: Makefile
>         echo '#define LIBEXECDIR "$(libexecdir)"'; \
>         echo '#define DATAROOTDIR "$(datarootdir)"'; \
>         echo '#define DATADIR "$(datadir)"'; \
> +       echo '#ifndef DATAROOTDIR'; \
> +       echo '# define DATAROOTDIR DATADIR'; \
> +       echo '#endif; \
>         echo '#define SYSCONFDIR "$(sysconfdir)"'; \
>         echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
>         echo '#define LOCALSTATEDIR "$(localstatedir)"'; \

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.

Bruno

Reply via email to