Front page | perl.perl5.build |
Postings from March 2004
Re: runmakedepend patch
From: H.Merijn Brand
March 29, 2004 14:14
Re: runmakedepend patch
Message ID: 20040330001018.3C2B.H.M.BRAND@hccnet.nl
On Mon 29 Mar 2004 19:02, Andrew Dougherty <firstname.lastname@example.org> wrote:
> On Sat, 20 Mar 2004, H.Merijn Brand wrote:
Thanks for the long answer. Learned some more again. But since the right
options already made Nick Happy, we dropped this idea altogether.
With some other open ends to be tied and 5.8.4 comming 'round the corner, I'd
like to commit my time to keeping Configure backward compatible to at least
5.6.x, which still is the case, and I even hope to go further and get 5.5.x
Next step is to regenerate config_h,SH, which is hopelessly outdated, and
looking at what the metaconfig would build has been patched manually for a
looooong time now. I want to see if a fresh generated version still works
> > --8<--- This patch
> > p4 -dpu diff
> > ==== //depot/metaconfig/U/modified/Finish.U#5 - /pro/3gl/CPAN/metaconfig/U/modified/Finish.U ====
> > 38c38
> > < ?MAKE:Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \
> > ---
> > > ?MAKE:runmakedepend Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \
> > 40a41,43
> > > ?S:runmakedepend:
> > > ?S: This variable defines if Configure runs 'make depend'
> > > ?S:.
> > yields:
> > :
> > Looking for dependency cycles...
> > Cycle found for:
> > (#1) Oldsym
> > (#1) runmakedepend
> > (#1) Config_h
> > (#1) Magic_h
> > Cycle involves:
> > (?) End: runmakedepend
> > (?) Config_h: End Config_sh
> > (?) Config_sh: End
> > (?) Oldsym: Config_sh
> > (Finish) runmakedepend: Oldsym Magic_h
> > (?) Magic_h: Config_h
> > Done.
> Ah, yes, I see. As the very last unit, Finish.U is special. In
> particular, what's happening is that 'runmakedepend' is now one of the
> symbols made by Configure, and hence it is in the $W list of "Wanted"
> symbols. The End.U unit depends on $W (and hence on Finish.U), but the
> End.U unit is supposed to come just before the Finish.U unit. Hence you
> get the circular dependency.
> One solution (the direction you were headed previously, I think) might be
> to try to put in enough metalint directives to allow you to declare (and
> describe) the new runmakedepend variable without actually declaring it
> 'made' anywhere. You end up fighting metalint a lot, and I'm unsure if
> you can ever win :-).
> Another solution is to make up a new unit, runmakedepend.U, and declare
> the new variable in that unit in the usual way. (There's a catch, of
> course, in that you can't tell if the generated Makefile will have a
> 'depend:' target until after it's extracted, and that won't have happened
> yet when the runmakedepend unit is called.)
> Here's a sample runmakedepend.U unit:
> ?RCS: $Id: runmakedepend.U,v $
> ?RCS: Copyright (c) 2004 The Perl Foundation
> ?RCS: You may distribute under the terms of either the GNU General Public
> ?RCS: License or the Artistic License, as specified in the README file.
> ?RCS: $Log: runmakedepend.U,v $
> ?MAKE: -pick add $@ %<
> ?S: This variable designates whether Configure is to run
> ?S: 'make depend'. This unit exists only to define the variable.
> ?S: (Presumably it is set by a Configure command-line option.) The actual
> ?S: code to ask the question and to run 'make depend' is in the Finish.U
> ?S: unit, since the question only gets asked if the extracted Makefile has
> ?S: a depend: rule, and the extraced Makefile doesn't yet exist. We can't
> ?S: put the definition of runmakedepend into the Finish.U unit, however,
> ?S: since it's the very last unit and it can't define any new variables.
> ?S: (Such variables would be listed as "Wanted" and End.U would end up
> ?S: depending on them, leading to a circular dependency.)
> ?X: Actually, we don't set it or do anything here -- that all happens
> ?X: in Finish.U.
> ?LINT:set runmakedepend
> Using it will require patching Finish.U on top of what you have done so
> far to tell it that 'runmakedepend' is an external dependency now, and to
> tell metalint that we're going to change it (assuming you want to record
> the actual value in config.sh, which I would assume you do).
> --- U/modified/Finish.U.mb 2004-03-29 08:55:06.000000000 -0500
> +++ U/modified/Finish.U 2004-03-29 11:33:28.000000000 -0500
> @@ -35,14 +35,12 @@
> ?X: SH files, which among other things produce config.h and (usually) Makefile.
> ?X: It offers to do a make depend if the Makefile contains that target.
> -?MAKE:runmakedepend Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \
> - test package make
> +?MAKE:Finish: Chk_MANI Extract Myread Oldsym Magic_h cat rm contains \
> + test package make runmakedepend
> ?MAKE: -pick add $@ %<
> -?S: This variable defines if Configure runs 'make depend'
> +?LINT:change runmakedepend
> : Finish up by extracting the .SH files
> case "$alldone" in
> @@ -108,9 +106,11 @@
> . UU/myread
> case "$ans" in
> + runmakedepend='y'
> $make depend && echo "Now you must run '$make'."
> + runmakedepend='n'
> echo "You must run '$make depend' then '$make'."
> Andy Dougherty email@example.com
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.3, & 5.9.x, and 806 on HP-UX 10.20 & 11.00, 11i,
AIX 4.3, SuSE 9.0, and Win2k. http://www.cmve.net/~merijn/
send smoke reports to: firstname.lastname@example.org, QA: http://qa.perl.org