On Tue, 18 Feb 2003 [EMAIL PROTECTED] wrote:
>
> I think --optimize alone is busted.
>
You'd be right: the code adding the optimization flags to the list of
compiler flags is only executed if 'debugging' is defined, which is
only the case when the --debugging flag has been used.
The patches below seem to fix this problem and get the --optimize
option working as intended.
One minor niggle that remains is that when I use the --debugging option,
I get two copies of '-g' appended to the ldflags, ie:
LINKFLAGS = -L/usr/local/lib
LDFLAGS = -L/usr/local/lib -g -g
I'm not sure what's happening here, but fortunately it seems to be
harmless.
Simon
--- config/init/debug.pl.old Thu Feb 20 21:56:31 2003
+++ config/init/debug.pl Thu Feb 20 22:01:42 2003
@@ -10,11 +10,11 @@ $description="Enabling debugging...";
sub runstep {
if (Configure::Data->get('debugging')) {
- my($ccflags, $linkflags, $ldflags, $optimize) =
- Configure::Data->get(qw(ccflags linkflags ldflags optimize));
+ my($ccflags, $linkflags, $ldflags) =
+ Configure::Data->get(qw(ccflags linkflags ldflags));
my($cc_debug, $link_debug, $ld_debug) =
Configure::Data->get(qw(cc_debug link_debug ld_debug));
- $ccflags .= " $cc_debug $optimize";
+ $ccflags .= " $cc_debug";
$linkflags .= " $link_debug";
$ldflags .= " $ld_debug";
--- /dev/null Thu Aug 30 16:30:55 2001
+++ config/init/optimize.pl Thu Feb 20 22:01:57 2003
@@ -0,0 +1,26 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step;
+
+$description="Enabling optimization...";
+
[EMAIL PROTECTED]();
+
+sub runstep {
+ if (Configure::Data->get('optimize')) {
+ my($ccflags, $optimize) =
+ Configure::Data->get(qw(ccflags optimize));
+ $ccflags .= " $optimize";
+
+ Configure::Data->set(
+ ccflags => $ccflags,
+ );
+ }
+ else {
+ print "(none requested) ";
+ }
+}
+
+1;
--- lib/Parrot/Configure/RunSteps.pm.old Thu Feb 20 21:59:48 2003
+++ lib/Parrot/Configure/RunSteps.pm Thu Feb 20 22:00:03 2003
@@ -10,6 +10,7 @@ use vars qw(@steps);
init/miniparrot.pl
init/hints.pl
init/debug.pl
+ init/optimize.pl
inter/progs.pl
inter/types.pl
inter/ops.pl
--- MANIFEST.old Thu Feb 20 22:13:05 2003
+++ MANIFEST Thu Feb 20 22:13:17 2003
@@ -112,6 +112,7 @@ config/init/hints/os2.pl
config/init/hints/vms.pl
config/init/manifest.pl
config/init/miniparrot.pl
+config/init/optimize.pl
config/inter/exp.pl
config/inter/ops.pl
config/inter/pmc.pl