Re: [perl #58034] [TODO] save config_args for make reconfig

[email protected] (Reini Urban) Fri, 6 Feb 2009 14:01:28 +0100
Newsgroups perl.perl6.internals
Message-ID <[email protected]>
2009/2/6 Reini Urban <[email protected]>:
> 2009/2/6 James Keenan via RT <[email protected]>:
>> If so, then I wonder why you are using 'make clean' instead of 'make
>> realclean'.  We've always said that 'make clean' undoes the effect of
>> 'make', whereas 'make realclean' undoes the effect of both 'perl
>> Configure.pl' and 'make'.  So I don't know why you aren't using 'make
>> realclean' here.
>
> I've changed it to make realclean as discussed on irc.

This time with attachment, sorry.
-- 
Reini Urban
http://phpwiki.org/              http://murbreak.at/
58034-config_args.patch (application/octet-stream, 1.9 KB)
2008-08-17 [email protected]

make reconfig ignores the given Configure.pl command-line args.
We need to save the config_args somewhere to be able to do 
make reconfig like 

CONFIG_ARGS = @config_args@

reconfig : realclean
	$(PERL) Configure.pl $(CONFIG_ARGS)

The CONFIG_ARGS should be stored in Makefile.
config_args should be stored in config_lib.pasm as in perl5 also.

We must ensure that the args are properly quoted, so that
  perl Configure.pl --debugging --ccflags="-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -g3" 
will not loose the " for ccflags

BTW: We really should track all dependencies and do a make reconfig automatically.

Index: parrot-svn/Configure.pl
===================================================================
--- parrot-svn.orig/Configure.pl
+++ parrot-svn/Configure.pl
@@ -63,6 +63,8 @@ $conf->add_steps( @{ $steps_list_ref } )
 
 # from Parrot::Configure::Data
 $conf->options->set( %{$args} );
+# save the command-line for make reconfig
+$conf->data->set(configure_args => '"'.join("\" \"", map {qq($_)} @ARGV).'"');
 
 # Log files created by Configure.pl in MANIFEST.configure.generated
 $conf->{active_configuration} = 1;
Index: parrot-svn/config/gen/makefiles/root.in
===================================================================
--- parrot-svn.orig/config/gen/makefiles/root.in
+++ parrot-svn/config/gen/makefiles/root.in
@@ -20,6 +20,8 @@ DEVEL           = @DEVEL@
 VERSION         = @VERSION@$(DEVEL)
 SOVERSION       = @VERSION@
 
+CONFIG_ARGS     = @configure_args@
+
 # Override at least PREFIX with the install location if you're going
 # to be using this outside of your build area.
 BUILDPREFIX     =
@@ -1766,8 +1768,8 @@ distclean : realclean
 svnclobber : .svn
 	$(PERL) tools/dev/svnclobber.pl
 
-reconfig : clean
-	$(PERL) Configure.pl
+reconfig : realclean
+	$(PERL) Configure.pl $(CONFIG_ARGS)
 
 manitest :
 	$(PERL) tools/dev/manicheck.pl