automake
[Top][All Lists]
Advanced

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

PATCH: subdirs and conditionals


From: Richard Boulton
Subject: PATCH: subdirs and conditionals
Date: Mon, 30 Apr 2001 21:49:48 +0100
User-agent: Mutt/1.2.5i

Resubmitting this patch, since there was no reply.

This problem is causing significant difficulty for the gstreamer project:
we're being asked several times a day why automake goes to in excess of
150Mb when building the makefile.ins for our project.

I also attach a patch against automake version 1.4, in case that is of any
use.

===

In current automake, if a variable is defined in terms of N conditionally
defined variables, an array of possible combinations of conditional values
is generated.  This array is, of course, of size 2^N, which implies that
only small numbers of conditionals can effectively be used together.

The gstreamer project, however, has a Makefile.am with conditionals for
each of a set of conditions dictating which SUBDIRS are to be built.  The
file currently has 16 separate conditionally defined variables (and will
have more soon), used only in the SUBDIRS variable.

The attached patch avoids computing the list of conditionals for the SUBDIRS
variable, where it is not actually needed, if the DIST_SUBDIRS variable is
defined.  This enables automake to generate the Makefile.in for gstreamer
within a memory footprint of about 4Mb.  Without the patch, automake grows
to around 160Mb, (and causes my home computer to run out of space and
crash).

A better solution may be to make variable_conditionally_defined() not call
variable_conditions(), determining whether a variable is conditionally
defined in a more efficient way.  However, this patch helps a great deal.

It may also be worth giving a warning if more than, say, 8 conditionals are
used together, to avoid this situation occurring unexpectedly.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1046
diff -u -r1.1046 automake.in
--- automake.in 2001/04/24 18:00:14     1.1046
+++ automake.in 2001/04/24 19:35:56
@@ -3071,8 +3071,8 @@
        # to all possible directories, and use it.  If DIST_SUBDIRS is
        # defined, just use it.
        my $dist_subdir_name;
-       if (variable_conditionally_defined ('SUBDIRS')
-           || &variable_defined ('DIST_SUBDIRS'))
+       if (&variable_defined ('DIST_SUBDIRS')
+           || variable_conditionally_defined ('SUBDIRS'))
        {
            $dist_subdir_name = 'DIST_SUBDIRS';
            if (! &variable_defined ('DIST_SUBDIRS'))



Patch against automake version 1.4
@@ -2383,8 +2383,8 @@
        # to all possible directories, and use it.  If DIST_SUBDIRS is
        # defined, just use it.
        local ($dist_subdir_name);
-       if (&variable_conditions ('SUBDIRS')
-           || &variable_defined ('DIST_SUBDIRS'))
+       if (&variable_defined ('DIST_SUBDIRS')
+           || &variable_conditions ('SUBDIRS'))
        {
            $dist_subdir_name = 'DIST_SUBDIRS';
            if (! &variable_defined ('DIST_SUBDIRS'))

-- 
Richard



reply via email to

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