Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add --optimize Configure option

git-svn-id: https://svn.parrot.org/parrot/trunk@2918 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit ad4983ce827605ca6ed334eb12be0f3a3bcdadc6 1 parent a1a6a39
Leopold Toetsch authored
Showing with 19 additions and 17 deletions.
  1. +12 −11 Configure.pl
  2. +3 −2 config/init/data.pl
  3. +4 −4 config/init/debug.pl
23 Configure.pl
View
@@ -26,7 +26,7 @@
for(@ARGV) {
my($key, $value)=/--(\w+)(?:=(.*))?/;
$value = 1 unless defined $value;
-
+
for($key) {
/version/ && do {
my $cvsid='$Id$';
@@ -43,7 +43,7 @@ END
Options:
--help Show this text
--version Show version information
-
+
Steps may take additional options of the form --name or --name=value.
Popular ones include:
@@ -53,6 +53,7 @@ END
:rem{-g} :add{-O2}
--nomanicheck Don't check the MANIFEST
--debugging Enable debugging
+ --optimize Optimized compile
--cc=(compiler) Use the given compiler
--ld=(linker) Use the given linker
--intval=(type) Use the given type for INTVAL
@@ -72,12 +73,12 @@ END
Parrot Version $parrot_version Configure 2.0
Copyright (C) 2001-2002 Yet Another Society
-Hello, I'm Configure. My job is to poke and prod your system to figure out
+Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you passed in
the `--ask' flag on the command line, in which case it'll prompt you for a few
pieces of info.
-Since you're running this script, you obviously have Perl 5--I'll be pulling
+Since you're running this script, you obviously have Perl 5--I'll be pulling
some defaults from its configuration.
END
@@ -115,7 +116,7 @@ =head1 DESCRIPTION
B<I<U<THIS NEEDS TO BE UPDATED!!!>>>
-Configure is broken up into I<steps>. Each step contains several related I<prompts>,
+Configure is broken up into I<steps>. Each step contains several related I<prompts>,
I<probes>, or I<generations>. Steps should be mostly of a single type, though some overlap
is allowed (for example, allowing a probe to ask the user what to do in an exceptional
situation).
@@ -135,15 +136,15 @@ =head2 Initialization Steps
I<Initialization steps> are run before any other steps. They do tasks such as preparing
Configure's data structures and checking the MANIFEST. These will rarely be added; when
-they are, it usually means that Configure is getting significant new capabilities.
+they are, it usually means that Configure is getting significant new capabilities.
They're kept in the directory F<config/init>.
Initialization steps usually do not output anything under normal circumstances.
=head2 Prompts
-Prompts ask the user for some information. These should be used sparingly. A step
-containing prompts is an I<interactive step>. Interactive steps should be in the
+Prompts ask the user for some information. These should be used sparingly. A step
+containing prompts is an I<interactive step>. Interactive steps should be in the
F<config/inter> folder.
Interactive steps often include simple probes to determine good guesses of what the user
@@ -177,7 +178,7 @@ =head2 Prompt or Probe?
=head2 Adding Steps
-New steps should be added in one of the three folders mentioned above. They should include the
+New steps should be added in one of the three folders mentioned above. They should include the
C<Parrot::Configure::Step> module, described below.
All steps are really modules; they should start with a declaration setting the current package
@@ -259,7 +260,7 @@ =head2 Command-line Arguments
=head2 Building Up Configuration Data
-The second step is F<config/init/data.pl>, which sets up a C<Configure::Data> package. You get and set
+The second step is F<config/init/data.pl>, which sets up a C<Configure::Data> package. You get and set
Configure's data by calling methods on this package. The methods are listed below.
=over 4
@@ -311,7 +312,7 @@ =head2 C<Parrot::Configure::Step>
=item C<genfile(infile, outfile)>
-Takes the given I<infile>, substitutes any sequences matching C</\$\{\w+\}/> for the given key's value in
+Takes the given I<infile>, substitutes any sequences matching C</\$\{\w+\}/> for the given key's value in
Configure's data, and writes the results to I<outfile>.
=back
5 config/init/data.pl
View
@@ -6,10 +6,10 @@ package Configure::Step;
$description="Setting up Configure's data structures...";
-@args=('debugging');
+@args=('debugging', 'optimize');
sub runstep {
- my ($debugging) = @_;
+ my ($debugging, $optimize) = @_;
package Configure::Data;
use Config;
@@ -19,6 +19,7 @@ sub runstep {
my(%c)=(
debugging => $debugging ? 1 : 0,
+ optimize => $optimize ? $Config{optimize} : '',
# Compiler -- used to turn .c files into object files.
# (Usually cc or cl, or something like that.)
8 config/init/debug.pl
View
@@ -10,11 +10,11 @@ package Configure::Step;
sub runstep {
if (Configure::Data->get('debugging')) {
- my($ccflags, $linkflags, $ldflags) =
- Configure::Data->get(qw(ccflags linkflags ldflags));
- my($cc_debug, $link_debug, $ld_debug) =
+ my($ccflags, $linkflags, $ldflags, $optimize) =
+ Configure::Data->get(qw(ccflags linkflags ldflags optimize));
+ my($cc_debug, $link_debug, $ld_debug) =
Configure::Data->get(qw(cc_debug link_debug ld_debug));
- $ccflags .= " $cc_debug";
+ $ccflags .= " $cc_debug $optimize";
$linkflags .= " $link_debug";
$ldflags .= " $ld_debug";
Please sign in to comment.
Something went wrong with that request. Please try again.