automake
[Top][All Lists]
Advanced

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

Re: removing $seen_canonical


From: Akim Demaille
Subject: Re: removing $seen_canonical
Date: 19 Feb 2001 11:06:20 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

"Derek R. Price" <address@hidden> writes:

> I've removed the references to $seen_canonical, re one of the FIXME
> comments on the way to enabling traces.  I know this patch is kinda
> largish, but even if it doesn't get checked in yet, I'd like some
> feedback.  This is somewhat integral to my work on traces.

I like your intentions, and as a matter of fact, I think we share the
same approach to hacking Automake.


> -
> -        # Extra stuff for AC_CANONICAL_*
> -        local (@whatlist) = ();
> -        if ($seen_canonical)
> -        {
> -            push (@whatlist, 'host');
> -        }
>  
> -        # Extra stuff only for AC_CANONICAL_SYSTEM.
> -        if ($seen_canonical == $AC_CANONICAL_SYSTEM)
> +     my $c;
> +     foreach $c ('build', 'host', 'target')
>          {
> -            push (@whatlist, 'target', 'build');
> +         # Maybe an error message if both of these are not set is a good
> +         # idea?  It might be overkill.
> +         $output_rules .= "address@hidden 'set ${c}_triplet \$(${c})' >> 
> address@hidden"
> +             if defined $configure_vars{$c};
> +         $output_rules .= "address@hidden 'set ${c}_alias \$(${c}_alias})' 
> >> address@hidden"
> +             if defined $configure_vars{"${c}_alias"};
>          }
>  
> -        local ($c1, $c2);
> -        foreach $c1 (@whatlist)
> -        {
> -            foreach $c2 ('alias', 'triplet')
> -            {
> -                $output_rules .= "address@hidden 'set ${c1}_${c2} 
> \$(${c1}_${c2})' >> address@hidden";
> -            }
> -        }
> -

I like the intention, but I personally don't like the implementation:
it is leaving ad-hoc code in automake.in, and there should be as
little as possible.

I have sent a patch which precisely addresses this issue by moving
most of this code into *.am files.  I think your patch would be an
excellent complement to it.

Maybe my patch will just make it more difficult for traces, no idea,
but in which case I would much prefer seeing a list of default
variables to AC_SUBST somewhere, and have the full list of build_alias
etc. defined there.  But in no way ad-hoc code to make that Cartesian
product in the output routines.

Ad-hoc should be limited to predefined lists and *.am files.  automake
should remain generic, and when it's not possible, it's usually
possible to make it more generic.



reply via email to

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