Hello!

Automake has one "smart" feature that I don't know how to override.

If ACLOCAL_AMFLAGS is present in Makefile.am automake scans for the
include directories (those appearing after -I) and includes every *.m4
file it finds to the dependencies of aclocal.m4:

$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4 \
                macros/aclocal-include.m4 macros/compiler-flags.m4 \
                macros/curses.m4 macros/gnome-bonobo-check.m4 \
and so on.

The problem is that not all of those macros are actually used, and
therefore are not distributed. However, they are very likely to be present
on the system where "make dist" is run because they are on CVS. Those
files cannot be removed from CVS because the "macros" directory is shared
between several projects.

AM_MAINTAINER_MODE is the workaround that is used now, but I'd like to see
Automake doing something about this problem as well.

I cannot even suppress that rule - explicit rules for aclocal.m4 and
$(ACLOCAL_M4) don't help - all those extra files still appear in
Makefile.in.

Proposed is a very simple solution - if ACLOCAL_M4_SOURCES is defined use
it as the list of M4 files aclocal.m4 depends on.

I'm not sure if ACLOCAL_M4_SOURCES should be distributed automatically - I
personally don't mind adding $(ACLOCAL_M4_SOURCES) to EXTRA_DIST by hand.

If ACLOCAL_M4_SOURCES sound bad better names are welcome. Tests are
available on request :-)

ChangeLog:
        * automake.in (handle_aclocal_m4): If ACLOCAL_M4_SOURCES is
        defined use it as the list of M4 files aclocal.m4 depends on.

Regards,
Pavel Roskin

==========================
Index: automake.in
--- automake.in Wed Aug 30 14:56:24 2000
+++ automake.in Wed Sep 13 20:18:03 2000
@@ -3174,7 +3174,11 @@
 
        # Scan all -I directories for m4 files.  These are our
        # dependencies.
-       if (&variable_defined ('ACLOCAL_AMFLAGS'))
+       if (&variable_defined ('ACLOCAL_M4_SOURCES'))
+       {
+           push (@ac_deps, "\$(ACLOCAL_M4_SOURCES)");
+       }
+       elsif (&variable_defined ('ACLOCAL_AMFLAGS'))
        {
            local ($examine_next, $amdir) = 0;
            foreach $amdir (&variable_value_as_list ('ACLOCAL_AMFLAGS', ''))
==========================


Reply via email to