|
|
Author: paultcochrane
Date: Fri Sep 21 02:29:23 2007
New Revision: 21448
Modified:
trunk/config/auto/attributes.pm
trunk/config/auto/backtrace.pm
trunk/config/auto/gcc.pm
trunk/config/auto/jit.pm
trunk/config/gen/config_pm.pm
trunk/config/gen/languages.pm
trunk/config/gen/makefiles.pm
trunk/config/gen/parrot_include.pm
trunk/config/gen/revision.pm
trunk/config/init/hints/darwin.pm
trunk/config/init/hints/dragonflybsd.pm
trunk/config/init/hints/linux.pm
trunk/config/init/hints/mswin32.pm
trunk/config/init/hints/solaris.pm
trunk/config/init/hints/vms.pm
trunk/config/init/install.pm
trunk/config/inter/lex.pm
trunk/config/inter/pmc.pm
trunk/config/inter/progs.pm
trunk/config/inter/yacc.pm
Log:
[config] Tidied code with perltidy
Modified: trunk/config/auto/attributes.pm
==============================================================================
--- trunk/config/auto/attributes.pm (original)
+++ trunk/config/auto/attributes.pm Fri Sep 21 02:29:23 2007
@@ -42,14 +42,13 @@
our $verbose;
-
sub runstep {
my ( $self, $conf ) = @_;
- $verbose = $conf->options->get( 'verbose' );
+ $verbose = $conf->options->get('verbose');
print $/ if $verbose;
- for my $maybe_attr ( @potential_attributes ) {
+ for my $maybe_attr (@potential_attributes) {
$self->try_attr( $conf, $maybe_attr );
}
return $self;
@@ -62,36 +61,37 @@
$verbose and print "trying attribute '$attr'$/";
- my $cc = $conf->option_or_data( 'cc' );
+ my $cc = $conf->option_or_data('cc');
cc_gen('config/auto/attributes/test_c.in');
my $disable_warnings = '';
+
# work around msvc warning for unused variable
- if ( defined $conf->option_or_data( 'msvcversion' ) ) {
+ if ( defined $conf->option_or_data('msvcversion') ) {
$disable_warnings = '-wd4101';
}
- my $ccflags = $conf->data->get( 'ccflags' );
+ my $ccflags = $conf->data->get('ccflags');
my $tryflags = "$ccflags -D$attr $disable_warnings";
my $command_line = Parrot::Configure::Step::_build_compile_command( $cc,
$tryflags );
$verbose and print " ", $command_line, $/;
# Don't use cc_build, because failure is expected.
- my $exit_code = Parrot::Configure::Step::_run_command(
- $command_line, $output_file, $output_file );
+ my $exit_code =
+ Parrot::Configure::Step::_run_command( $command_line, $output_file,
$output_file );
$verbose and print " exit code: $exit_code$/";
$conf->data->set( $attr => !$exit_code | 0 );
return if $exit_code;
- my $output = Parrot::BuildUtil::slurp_file( $output_file );
+ my $output = Parrot::BuildUtil::slurp_file($output_file);
$verbose and print " output: $output$/";
if ( $output !~ /error|warning/i ) {
$conf->data->set( ccflags => $tryflags );
- my $ccflags = $conf->data->get( "ccflags" );
+ my $ccflags = $conf->data->get("ccflags");
$verbose and print " ccflags: $ccflags$/";
}
Modified: trunk/config/auto/backtrace.pm
==============================================================================
--- trunk/config/auto/backtrace.pm (original)
+++ trunk/config/auto/backtrace.pm Fri Sep 21 02:29:23 2007
@@ -32,26 +32,23 @@
cc_gen("config/auto/backtrace/test_c.in");
-# If the program builds (e.g. the linker found backtrace* in libc) then we have
-# the glibc backtrace symbols. If the program fails to build for whatever
-# reason we're just going to assume that the build failure is because these
-# symbols are missing.
+ # If the program builds (e.g. the linker found backtrace* in libc) then we
have
+ # the glibc backtrace symbols. If the program fails to build for whatever
+ # reason we're just going to assume that the build failure is because these
+ # symbols are missing.
my $glibc_backtrace;
- eval {
- cc_build();
- };
- if (not $@) {
+ eval { cc_build(); };
+ if ( not $@ ) {
$glibc_backtrace = 1;
}
cc_clean();
- $conf->data->set(
- glibc_backtrace => $glibc_backtrace,
- );
+ $conf->data->set( glibc_backtrace => $glibc_backtrace, );
if ($glibc_backtrace) {
$self->set_result("yes");
- } else {
+ }
+ else {
$self->set_result("no");
}
Modified: trunk/config/auto/gcc.pm
==============================================================================
--- trunk/config/auto/gcc.pm (original)
+++ trunk/config/auto/gcc.pm Fri Sep 21 02:29:23 2007
@@ -90,7 +90,7 @@
# determined in a non-strict environment. An example is Solaris 8.
my @opt_and_vers = (
- 0 => " -W"
+ 0 => " -W"
. " -Wall"
. " -Wundef"
. " -Wmissing-declarations"
@@ -153,12 +153,13 @@
# us -Wpadded may prove interesting, or even noisy.
# -Wunreachable-code might be useful in a non debugging version
4.0 => "-fvisibility=hidden",
+
# Needed to prevent C++ compatibility issues
4.1 => " -Wc++-compat",
);
my @cage_opt_and_vers = (
- 0 => " -std=c89"
+ 0 => " -std=c89"
. " -Wall"
. " -Wextra"
. " -Wundef"
@@ -185,6 +186,7 @@
. " -Wno-div-by-zero"
. " -Wno-endif-labels"
. " -Werror-implicit-function-declaration"
+
#. " -Wfloat-equal"
. " -Wformat"
. " -Wformat=2"
@@ -237,9 +239,7 @@
#."-Wmost (APPLE ONLY)"
#C-only Warning Options
- . " -Wmissing-prototypes"
- . " -Wold-style-definition"
- . " -Wstrict-prototypes"
+ . " -Wmissing-prototypes" . " -Wold-style-definition" . "
-Wstrict-prototypes"
#. " -Wtraditional "
. " -Wdeclaration-after-statement",
@@ -281,10 +281,10 @@
# . "-Wdisabled-optimization -mno-accumulate-outgoing-args "
# . "-Wno-shadow -falign-functions=16 ",
4.0 => ""
+
#. " -Wfatal-errors"
- . " -Wmissing-field-initializers"
- . " -Wmissing-include-dirs"
- . " -Wvariadic-macros"
+ . " -Wmissing-field-initializers" . " -Wmissing-include-dirs"
. " -Wvariadic-macros"
+
#. " -Wno-discard-qual"
. " -Wno-pointer-sign",
4.1 => " -Wc++-compat",
Modified: trunk/config/auto/jit.pm
==============================================================================
--- trunk/config/auto/jit.pm (original)
+++ trunk/config/auto/jit.pm Fri Sep 21 02:29:23 2007
@@ -42,7 +42,7 @@
my $archname = $conf->data->get('archname');
my ( $cpuarch, $osname ) = split( /-/, $archname );
- if ( $verbose ) {
+ if ($verbose) {
print "determining operating system and cpu architecture$/";
print "archname: <$archname>$/";
}
@@ -65,10 +65,11 @@
$cpuarch = 'ppc';
}
}
+
# cpuarch and osname are reversed in archname on windows
elsif ( $cpuarch =~ /MSWin32/ ) {
$cpuarch = ( $osname =~ /x64/ ) ? 'amd64' : 'i386';
- $osname = 'MSWin32';
+ $osname = 'MSWin32';
}
elsif ( $osname =~ /cygwin/i || $cpuarch =~ /cygwin/i ) {
$cpuarch = 'i386';
@@ -99,6 +100,7 @@
if $verbose;
if ( -e "$jitbase/$cpuarch/core.jit" ) {
+
# Just because there is a "$jitbase/$cpuarch/core.jit" file,
# doesn't mean the JIT is working on that platform.
# So build JIT per default only on platforms where JIT in known
Modified: trunk/config/gen/config_pm.pm
==============================================================================
--- trunk/config/gen/config_pm.pm (original)
+++ trunk/config/gen/config_pm.pm Fri Sep 21 02:29:23 2007
@@ -25,10 +25,8 @@
use Cwd qw(cwd);
use File::Spec::Functions qw(catdir);
-
$description = "Recording configuration data for later retrieval";
-@args = ();
-
+@args = ();
sub runstep {
my ( $self, $conf ) = @_;
Modified: trunk/config/gen/languages.pm
==============================================================================
--- trunk/config/gen/languages.pm (original)
+++ trunk/config/gen/languages.pm Fri Sep 21 02:29:23 2007
@@ -35,7 +35,7 @@
pugs punie pynie regex scheme tap urm WMLScript Zcode
} unless defined $languages;
- foreach my $language (split ' ', $languages) {
+ foreach my $language ( split ' ', $languages ) {
genfile( "languages/$language/config/makefiles/root.in" =>
"languages/$language/Makefile" );
}
Modified: trunk/config/gen/makefiles.pm
==============================================================================
--- trunk/config/gen/makefiles.pm (original)
+++ trunk/config/gen/makefiles.pm Fri Sep 21 02:29:23 2007
@@ -23,50 +23,48 @@
our $description = 'Generating makefiles and other build files';
our @args = qw(target);
-
my %makefiles = (
- 'Makefile' => { SOURCE => 'config/gen/makefiles/root.in' },
+ 'Makefile' => { SOURCE => 'config/gen/makefiles/root.in' },
'ext/Makefile' => {
- SOURCE => 'config/gen/makefiles/ext.in',
- commentType => '#',
- replace_slashes => 1,
- conditioned_lines => 1,
+ SOURCE => 'config/gen/makefiles/ext.in',
+ commentType => '#',
+ replace_slashes => 1,
+ conditioned_lines => 1,
},
'ext/Parrot-Embed/Makefile.PL' => {
- SOURCE => 'config/gen/makefiles/parrot_embed.in',
- replace_slashes => 0,
- conditioned_lines => 1,
+ SOURCE => 'config/gen/makefiles/parrot_embed.in',
+ replace_slashes => 0,
+ conditioned_lines => 1,
},
- 'compilers/past-pm/Makefile' => { SOURCE =>
'config/gen/makefiles/past-pm.in' },
- 'compilers/pct/Makefile' => { SOURCE => 'config/gen/makefiles/pct.in'
},
- 'compilers/pge/Makefile' => { SOURCE => 'config/gen/makefiles/pge.in'
},
- 'compilers/tge/Makefile' => { SOURCE => 'config/gen/makefiles/tge.in'
},
- 'compilers/bcg/Makefile' => { SOURCE => 'config/gen/makefiles/bcg.in'
},
- 'compilers/json/Makefile' => { SOURCE =>
'config/gen/makefiles/json.in' },
- 'compilers/pirc/Makefile' => { SOURCE =>
'config/gen/makefiles/pirc.in' },
- 'src/dynpmc/Makefile' => { SOURCE =>
'config/gen/makefiles/dynpmc.in' },
- 'src/dynoplibs/Makefile' => { SOURCE =>
'config/gen/makefiles/dynoplibs.in' },
- 'editor/Makefile' => { SOURCE =>
'config/gen/makefiles/editor.in' },
-
- 'tools/build/dynpmc.pl' => {
- SOURCE => 'config/gen/makefiles/dynpmc_pl.in',
- comment_type => '#',
- replace_slashes => 0,
- conditioned_lines => 1,
+ 'compilers/past-pm/Makefile' => { SOURCE =>
'config/gen/makefiles/past-pm.in' },
+ 'compilers/pct/Makefile' => { SOURCE => 'config/gen/makefiles/pct.in'
},
+ 'compilers/pge/Makefile' => { SOURCE => 'config/gen/makefiles/pge.in'
},
+ 'compilers/tge/Makefile' => { SOURCE => 'config/gen/makefiles/tge.in'
},
+ 'compilers/bcg/Makefile' => { SOURCE => 'config/gen/makefiles/bcg.in'
},
+ 'compilers/json/Makefile' => { SOURCE => 'config/gen/makefiles/json.in'
},
+ 'compilers/pirc/Makefile' => { SOURCE => 'config/gen/makefiles/pirc.in'
},
+ 'src/dynpmc/Makefile' => { SOURCE =>
'config/gen/makefiles/dynpmc.in' },
+ 'src/dynoplibs/Makefile' => { SOURCE =>
'config/gen/makefiles/dynoplibs.in' },
+ 'editor/Makefile' => { SOURCE =>
'config/gen/makefiles/editor.in' },
+
+ 'tools/build/dynpmc.pl' => {
+ SOURCE => 'config/gen/makefiles/dynpmc_pl.in',
+ comment_type => '#',
+ replace_slashes => 0,
+ conditioned_lines => 1,
},
'tools/build/dynoplibs.pl' => {
- SOURCE => 'config/gen/makefiles/dynoplibs_pl.in',
- comment_type => '#',
- replace_slashes => 0,
- conditioned_lines => 1,
+ SOURCE => 'config/gen/makefiles/dynoplibs_pl.in',
+ comment_type => '#',
+ replace_slashes => 0,
+ conditioned_lines => 1,
},
- 'parrot.pc' => { SOURCE =>
'config/gen/makefiles/parrot.pc.in' },
- 'docs/Makefile' => { SOURCE => 'config/gen/makefiles/docs.in'
},
+ 'parrot.pc' => { SOURCE => 'config/gen/makefiles/parrot.pc.in' },
+ 'docs/Makefile' => { SOURCE => 'config/gen/makefiles/docs.in' },
);
-
sub runstep {
my ( $self, $conf ) = @_;
@@ -76,7 +74,6 @@
return $self;
}
-
sub cflags {
my ( $self, $conf ) = @_;
@@ -103,12 +100,12 @@
return;
}
-
sub makefiles {
my ( $self, $conf ) = @_;
my $targets = $conf->options->get('targets');
- my @targets = defined $targets
+ my @targets =
+ defined $targets
? split ' ', $targets
: keys %makefiles;
Modified: trunk/config/gen/parrot_include.pm
==============================================================================
--- trunk/config/gen/parrot_include.pm (original)
+++ trunk/config/gen/parrot_include.pm Fri Sep 21 02:29:23 2007
@@ -23,59 +23,62 @@
use vars qw($description @args);
$description = 'Generating runtime/parrot/include';
-@args = qw(verbose);
+@args = qw(verbose);
sub const_to_parrot {
- map ".constant $_->[0]\t$_->[1]", @_
+ map ".constant $_->[0]\t$_->[1]", @_;
}
# TODO: refactor to generate 'use constant' statements, RT#42286
sub const_to_perl {
- map "$_->[0] => $_->[1],", @_
+ map "$_->[0] => $_->[1],", @_;
}
sub transform_name {
my $action = shift;
- map [$action->($_->[0]), $_->[1]], @_
+ map [ $action->( $_->[0] ), $_->[1] ], @_;
}
sub prepend_prefix {
my $prefix = shift;
- transform_name sub { $prefix . $_[0] }, @_
+ transform_name sub { $prefix . $_[0] }, @_;
}
sub perform_directive {
my ($d) = @_;
- my @defs = prepend_prefix $d->{prefix}, @{$d->{defs}};
- if (my $subst = $d->{subst}) {
+ my @defs = prepend_prefix $d->{prefix}, @{ $d->{defs} };
+ if ( my $subst = $d->{subst} ) {
@defs = transform_name sub { local $_ = shift; eval $subst; $_ },
@defs;
}
- @defs
+ @defs;
}
sub parse_file {
- my ($file, $fh) = @_;
+ my ( $file, $fh ) = @_;
my @d;
my %values;
my $last_val;
my $cur;
- while (my $line = <$fh>) {
- if ($line =~ m!
+ while ( my $line = <$fh> ) {
+ if (
+ $line =~ m!
&gen_from_(enum|def) \( ( [^)]* ) \)
(?: \s+ prefix \( (\w+) \) )?
(?: \s+ subst \( (s/.*?/.*?/[eig]?) \) )?
- !x) {
+ !x
+ )
+ {
$cur and die "Missing '&end_gen' in $file\n";
$cur = {
- type => $1,
- files => [split ' ', $2],
+ type => $1,
+ files => [ split ' ', $2 ],
prefix => defined $3 ? $3 : '',
- defined $4 ? (subst => $4) : (),
+ defined $4 ? ( subst => $4 ) : (),
};
$last_val = -1;
}
- elsif ($line =~ /&end_gen\b/) {
+ elsif ( $line =~ /&end_gen\b/ ) {
$cur or die "Missing &gen_from_(enum|def) in $file\n";
push @d, $cur;
$cur = undef;
@@ -83,29 +86,31 @@
$cur or next;
- if ($cur->{type} eq 'def' && $line =~
/^\s*#define\s+(\w+)\s+(-?\w+|"[^"]*")/) {
- push @{$cur->{defs}}, [$1, $2];
+ if ( $cur->{type} eq 'def' && $line =~
/^\s*#define\s+(\w+)\s+(-?\w+|"[^"]*")/ ) {
+ push @{ $cur->{defs} }, [ $1, $2 ];
}
- elsif ($cur->{type} eq 'enum') {
- if ($line =~ /^\s*(\w+)\s*=\s*(-?\w+)/) {
- my ($k, $v) = ($1, $2);
- if (defined $values{$v}) {
+ elsif ( $cur->{type} eq 'enum' ) {
+ if ( $line =~ /^\s*(\w+)\s*=\s*(-?\w+)/ ) {
+ my ( $k, $v ) = ( $1, $2 );
+ if ( defined $values{$v} ) {
$v = $values{$v};
- } elsif ($v =~ /^0/) {
+ }
+ elsif ( $v =~ /^0/ ) {
$v = oct $v;
}
$values{$k} = $last_val = $v;
- push @{$cur->{defs}}, [$k, $v];
- } elsif ($line =~ m!^\s*(\w+)\s*(?:,\s*)?(?:/\*|$)!) {
+ push @{ $cur->{defs} }, [ $k, $v ];
+ }
+ elsif ( $line =~ m!^\s*(\w+)\s*(?:,\s*)?(?:/\*|$)! ) {
my $k = $1;
my $v = $values{$k} = ++$last_val;
- push @{$cur->{defs}}, [$k, $v];
+ push @{ $cur->{defs} }, [ $k, $v ];
}
}
}
$cur and die "Missing '&end_gen' in $file\n";
- return @d
+ return @d;
}
my @files = qw(
@@ -131,7 +136,7 @@
my $destdir = 'runtime/parrot/include';
sub runstep {
- my ($self, $conf) = @_;
+ my ( $self, $conf ) = @_;
# need vtable.h now
system( $^X, "tools/build/vtable_h.pl" );
@@ -143,11 +148,13 @@
close $fh;
for my $d (@directives) {
my @defs = perform_directive $d;
- for my $target (@{$d->{files}}) {
+ for my $target ( @{ $d->{files} } ) {
$conf->options->get('verbose') and print "$target ";
- my $gen = join "\n", ($target =~ /\.pl$/ ? \&const_to_perl :
\&const_to_parrot)->(@defs);
+ my $gen = join "\n",
+ ( $target =~ /\.pl$/ ? \&const_to_perl : \&const_to_parrot
)->(@defs);
my $target_tmp = "$target.tmp";
open my $out, '>', $target_tmp or die "Can't open $target_tmp:
$!\n";
+
# TODO: refactor to include package declarations and Export
# declarations for generated Perl constant modules, RT#42286
print $out <<"EOF";
@@ -162,14 +169,14 @@
EOF
close $out or die "Can't write $target_tmp: $!\n";
$target =~ m[/] or $target = "$destdir/$target";
- move_if_diff($target_tmp, $target);
+ move_if_diff( $target_tmp, $target );
push @generated, $target;
}
}
}
- $conf->data->set(TEMP_gen_pasm_includes => join("\t\\\n\t", @generated));
+ $conf->data->set( TEMP_gen_pasm_includes => join( "\t\\\n\t", @generated )
);
- return $self
+ return $self;
}
1;
Modified: trunk/config/gen/revision.pm
==============================================================================
--- trunk/config/gen/revision.pm (original)
+++ trunk/config/gen/revision.pm Fri Sep 21 02:29:23 2007
@@ -29,9 +29,7 @@
my $revision = $Parrot::Revision::current;
- $conf->data->set(
- revision => $revision,
- );
+ $conf->data->set( revision => $revision, );
if ( $revision >= 1 ) {
$self->set_result("r$revision");
Modified: trunk/config/init/hints/darwin.pm
==============================================================================
--- trunk/config/init/hints/darwin.pm (original)
+++ trunk/config/init/hints/darwin.pm Fri Sep 21 02:29:23 2007
@@ -47,8 +47,8 @@
parrot_is_shared => 0,
libparrot_shared => 'libparrot.$(SOVERSION)$(SHARE_EXT)',
libparrot_shared_alias => 'libparrot$(SHARE_EXT)',
- rpath => "-L",
- libparrot_soname => "-install_name "
+ rpath => "-L",
+ libparrot_soname => "-install_name "
. $conf->data->get('lib_dir')
. $conf->data->get('slash')
. "libparrot"
Modified: trunk/config/init/hints/dragonflybsd.pm
==============================================================================
--- trunk/config/init/hints/dragonflybsd.pm (original)
+++ trunk/config/init/hints/dragonflybsd.pm Fri Sep 21 02:29:23 2007
@@ -6,24 +6,23 @@
use strict;
use warnings;
-sub runstep
-{
- my ($self, $conf) = @_;
+sub runstep {
+ my ( $self, $conf ) = @_;
my $libs = $conf->data->get('libs');
$libs .= ' -pthread' unless $libs =~ /pthread/;
$conf->data->set(
- libs => $libs,
- link => 'g++',
- rpath => '-Wl,-R',
-
- has_dynamic_linking => 1,
- parrot_is_shared => 1,
- libparrot_shared => 'libparrot$(SHARE_EXT).$(SOVERSION)',
- libparrot_shared_alias => 'libparrot$(SHARE_EXT)',
- libparrot_soname =>
'-Wl,-soname=libparrot$(SHARE_EXT).$(SOVERSION)',
+ libs => $libs,
+ link => 'g++',
+ rpath => '-Wl,-R',
+
+ has_dynamic_linking => 1,
+ parrot_is_shared => 1,
+ libparrot_shared => 'libparrot$(SHARE_EXT).$(SOVERSION)',
+ libparrot_shared_alias => 'libparrot$(SHARE_EXT)',
+ libparrot_soname =>
'-Wl,-soname=libparrot$(SHARE_EXT).$(SOVERSION)',
);
}
Modified: trunk/config/init/hints/linux.pm
==============================================================================
--- trunk/config/init/hints/linux.pm (original)
+++ trunk/config/init/hints/linux.pm Fri Sep 21 02:29:23 2007
@@ -13,12 +13,12 @@
sub runstep {
my ( $self, $conf ) = @_;
- my $libs = $conf->option_or_data('libs');
- my $ccflags = $conf->option_or_data('ccflags');
- my $cc = $conf->option_or_data('cc');
- my $linkflags = $conf->option_or_data('linkflags');
+ my $libs = $conf->option_or_data('libs');
+ my $ccflags = $conf->option_or_data('ccflags');
+ my $cc = $conf->option_or_data('cc');
+ my $linkflags = $conf->option_or_data('linkflags');
- $verbose = $conf->options->get( 'verbose' );
+ $verbose = $conf->options->get('verbose');
print $/ if $verbose;
# should find g++ in most cases
@@ -31,6 +31,7 @@
my $cc_shared = $conf->data->get('cc_shared');
if ( $cc =~ /icc/ ) {
+
# Intel C++ compiler has the same name as its C compiler
$link = $cc;
Modified: trunk/config/init/hints/mswin32.pm
==============================================================================
--- trunk/config/init/hints/mswin32.pm (original)
+++ trunk/config/init/hints/mswin32.pm Fri Sep 21 02:29:23 2007
@@ -50,6 +50,7 @@
$ccflags =~ s/-W\d/-W4/;
my $ccwarn = '';
+
# disable certain very noisy warnings
$ccwarn .= "-wd4127 "; # conditional expression is constant
$ccwarn .= "-wd4054 "; # type cast from function ptr to data ptr
Modified: trunk/config/init/hints/solaris.pm
==============================================================================
--- trunk/config/init/hints/solaris.pm (original)
+++ trunk/config/init/hints/solaris.pm Fri Sep 21 02:29:23 2007
@@ -36,7 +36,8 @@
# Can't call cc_build since we haven't set all the flags yet.
# This should suffice for this test.
my $cc_inc = $conf->data->get('cc_inc');
- Parrot::Configure::Step::_run_command( "$cc -o test test.c $cc_inc",
'test.cco', 'test.cco' )
+ Parrot::Configure::Step::_run_command( "$cc -o test test.c $cc_inc",
+ 'test.cco', 'test.cco' )
and confess "C compiler failed (see test.cco)";
%gnuc = eval cc_run() or die "Can't run the test program: $!";
if ( defined $gnuc{__GNUC__} ) {
Modified: trunk/config/init/hints/vms.pm
==============================================================================
--- trunk/config/init/hints/vms.pm (original)
+++ trunk/config/init/hints/vms.pm Fri Sep 21 02:29:23 2007
@@ -10,10 +10,9 @@
my ( $self, $conf ) = @_;
$conf->data->set(
- ccflags =>
- qq{/Prefix=All/Obj=.obj/NoList/include="./include"/nowarn},
- perl => "MCR $^X",
- exe => ".exe"
+ ccflags => qq{/Prefix=All/Obj=.obj/NoList/include="./include"/nowarn},
+ perl => "MCR $^X",
+ exe => ".exe"
);
{
Modified: trunk/config/init/install.pm
==============================================================================
--- trunk/config/init/install.pm (original)
+++ trunk/config/init/install.pm Fri Sep 21 02:29:23 2007
@@ -65,47 +65,47 @@
sub runstep {
my ( $self, $conf ) = @_;
- my $prefix = $conf->options->get('prefix') || "/usr/local";
+ my $prefix = $conf->options->get('prefix') || "/usr/local";
$prefix =~ s{/\z}{};
my $ep = $conf->options->get('exec-prefix');
$ep =~ s{/\z}{} if defined $ep;
my $eprefix = $ep ? $ep : $prefix;
# --bindir=DIR user executables [EPREFIX/bin]
- my $bindir = assign_dir($conf, 'bindir', $eprefix, '/bin');
+ my $bindir = assign_dir( $conf, 'bindir', $eprefix, '/bin' );
# --sbindir=DIR system admin executables [EPREFIX/sbin]
- my $sbindir = assign_dir($conf, 'sbindir', $eprefix, '/sbin');
+ my $sbindir = assign_dir( $conf, 'sbindir', $eprefix, '/sbin' );
# --libexecdir=DIR program executables [EPREFIX/libexec]
- my $libexecdir = assign_dir($conf, 'libexecdir', $eprefix, '/libexec');
+ my $libexecdir = assign_dir( $conf, 'libexecdir', $eprefix, '/libexec' );
# --datadir=DIR read-only architecture-independent data
[PREFIX/share]
- my $datadir = assign_dir($conf, 'datadir', $prefix, '/share');
+ my $datadir = assign_dir( $conf, 'datadir', $prefix, '/share' );
# --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- my $sysconfdir = assign_dir($conf, 'sysconfdir', $prefix, '/etc');
+ my $sysconfdir = assign_dir( $conf, 'sysconfdir', $prefix, '/etc' );
# --sharedstatedir=DIR modifiable architecture-independent data
[PREFIX/com]
- my $sharedstatedir = assign_dir($conf, 'sharedstatedir', $prefix, '/com');
+ my $sharedstatedir = assign_dir( $conf, 'sharedstatedir', $prefix, '/com'
);
# --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- my $localstatedir = assign_dir($conf, 'localstatedir', $prefix, '/var');
+ my $localstatedir = assign_dir( $conf, 'localstatedir', $prefix, '/var' );
# --libdir=DIR object code libraries [EPREFIX/lib]
- my $libdir = assign_dir($conf, 'libdir', $eprefix, '/lib');
+ my $libdir = assign_dir( $conf, 'libdir', $eprefix, '/lib' );
# --includedir=DIR C header files [PREFIX/include]
- my $includedir = assign_dir($conf, 'includedir', $prefix, '/include');
+ my $includedir = assign_dir( $conf, 'includedir', $prefix, '/include' );
# --oldincludedir=DIR C header files f|| non-gcc [/usr/include]
- my $oldincludedir = assign_dir($conf, 'oldincludedir', q{},
'/usr/include');
+ my $oldincludedir = assign_dir( $conf, 'oldincludedir', q{},
'/usr/include' );
# --infodir=DIR info documentation [PREFIX/info]
- my $infodir = assign_dir($conf, 'infodir', $prefix, '/info');
+ my $infodir = assign_dir( $conf, 'infodir', $prefix, '/info' );
# --mandir=DIR man documentation [PREFIX/man]
- my $mandir = assign_dir($conf, 'mandir', $prefix, '/man');
+ my $mandir = assign_dir( $conf, 'mandir', $prefix, '/man' );
$conf->data->set(
prefix => $prefix,
@@ -134,9 +134,9 @@
}
sub assign_dir {
- my ($conf, $dir_str, $fix, $ext) = @_;
- my $d = $conf->options->get($dir_str);
- return $d ? $d : $fix . $ext;
+ my ( $conf, $dir_str, $fix, $ext ) = @_;
+ my $d = $conf->options->get($dir_str);
+ return $d ? $d : $fix . $ext;
}
1;
Modified: trunk/config/inter/lex.pm
==============================================================================
--- trunk/config/inter/lex.pm (original)
+++ trunk/config/inter/lex.pm Fri Sep 21 02:29:23 2007
@@ -28,7 +28,8 @@
$prompt = "Do you have a lexical analyzer generator like flex or lex?";
@args = qw( lex ask maintainer );
-my @lex_defaults = defined($ENV{TEST_LEX})
+my @lex_defaults =
+ defined( $ENV{TEST_LEX} )
? $ENV{TEST_LEX}
: qw( flex lex );
@@ -61,28 +62,32 @@
$conf->data->set( $util => $prog );
$self->set_result('user defined');
return $self;
- } else {
- $prog = check_progs( [ @lex_defaults ], $verbose );
- if (! $prog) {
+ }
+ else {
+ $prog = check_progs( [@lex_defaults], $verbose );
+ if ( !$prog ) {
$self->set_result('no lex program was found');
return;
- } else {
+ }
+ else {
+
# RT#43170 should --ask be handled like the other user defines or
# checked for version requirements?
if ( $conf->options->get('ask') ) {
- $prog = prompt(
- $prompt, $prog ? $prog : $conf->data->get($util)
- );
+ $prog = prompt( $prompt, $prog ? $prog :
$conf->data->get($util) );
}
- my ( $stdout, $stderr, $ret ) =
- capture_output( $prog, '--version' );
+ my ( $stdout, $stderr, $ret ) = capture_output( $prog, '--version'
);
+
# don't override the user even if the program they provided
# appears to be broken
if ( $ret == -1 and !$conf->options->get('ask') ) {
+
# fall back to default
$self->set_result('lex program does not exist or does not
understand --version');
return;
- } elsif ( $stdout =~ /f?lex .*? (\d+) \. (\d+) \. (\d+)/x ) {
+ }
+ elsif ( $stdout =~ /f?lex .*? (\d+) \. (\d+) \. (\d+)/x ) {
+
# if '--version' returns a string assume that this is flex.
# flex calls it self by $0 so it will claim to be lex
# if invoked as `lex`
@@ -95,32 +100,34 @@
$req = $default_required;
}
if ($req) {
- my ( $rmajor, $rminor, $rpatch ) =
- ( $req =~ / ^ (\d+) \. (\d+) \. (\d+) $ /x );
- if (! defined $rmajor ) {
- $self->set_result(
- "could not understand flex version requirement");
+ my ( $rmajor, $rminor, $rpatch ) = ( $req =~ / ^ (\d+) \.
(\d+) \. (\d+) $ /x );
+ if ( !defined $rmajor ) {
+ $self->set_result("could not understand flex version
requirement");
return;
- } elsif (
+ }
+ elsif (
$prog_major < $rmajor
or ( $prog_major == $rmajor
and $prog_minor < $rminor )
or ( $prog_major == $rmajor
and $prog_minor == $rminor
and $prog_patch < $rpatch )
- ) {
+ )
+ {
$self->set_result( "found flex version $prog_version"
. " but at least $rmajor.$rminor.$rpatch is
required" );
return;
- } else {
- 1; # lack an explicit 'else' here
+ }
+ else {
+ 1; # lack an explicit 'else' here
}
}
$conf->data->set( flex_version => $prog_version );
$self->set_result("flex $prog_version");
$conf->data->set( $util => $prog );
return $self;
- } else {
+ }
+ else {
$self->set_result('lex program does not exist or does not
understand --version');
return;
}
Modified: trunk/config/inter/pmc.pm
==============================================================================
--- trunk/config/inter/pmc.pm (original)
+++ trunk/config/inter/pmc.pm Fri Sep 21 02:29:23 2007
@@ -134,7 +134,7 @@
E_NOTE
- $TEMP_pmc_build .= <<END;
+ $TEMP_pmc_build .= <<END;
PMC2C_FILES = \\
\t\tlib/Parrot/Pmc2c/Pmc2cMain.pm \\
\t\tlib/Parrot/Pmc2c/Parser.pm \\
Modified: trunk/config/inter/progs.pm
==============================================================================
--- trunk/config/inter/progs.pm (original)
+++ trunk/config/inter/progs.pm Fri Sep 21 02:29:23 2007
@@ -33,7 +33,7 @@
sub runstep {
my ( $self, $conf ) = @_;
- $verbose = $conf->options->get( 'verbose' );
+ $verbose = $conf->options->get('verbose');
print $/ if $verbose;
my ( $cc, $cxx, $link, $ld, $ccflags, $ccwarn, $linkflags, $ldflags,
$libs, $lex, $yacc );
@@ -108,7 +108,7 @@
$debug = 'y' if $conf->options->get('debugging');
$debug = prompt( "Do you want a debugging build of Parrot?", $debug )
if $ask;
- unless ($debug =~ /^[yn]$/i) {
+ unless ( $debug =~ /^[yn]$/i ) {
return;
}
@@ -124,13 +124,12 @@
$ccwarn = integrate( $conf->data->get('ccwarn'),
$conf->options->get('ccwarn') );
$conf->data->set( ccwarn => $ccwarn );
- test_compiler( $cc );
+ test_compiler($cc);
return $self;
}
-sub test_compiler
-{
+sub test_compiler {
my $cc = shift;
open( my $out_fh, '>', 'test.c' ) or die "Unable to open 'test.c': $@\n";
Modified: trunk/config/inter/yacc.pm
==============================================================================
--- trunk/config/inter/yacc.pm (original)
+++ trunk/config/inter/yacc.pm Fri Sep 21 02:29:23 2007
@@ -28,9 +28,10 @@
$prompt = "Do you have a parser generator, like bison or yacc?";
@args = qw( yacc ask maintainer );
-my @yacc_defaults = defined($ENV{TEST_YACC})
+my @yacc_defaults =
+ defined( $ENV{TEST_YACC} )
? $ENV{TEST_YACC}
- : ('bison -v -y', 'yacc', 'byacc');
+ : ( 'bison -v -y', 'yacc', 'byacc' );
my $default_required = '2.1';
@@ -61,28 +62,34 @@
$conf->data->set( $util => $prog );
$self->set_result('user defined');
return $self;
- } else {
- # $prog = check_progs( [ 'bison -v -y', 'yacc', 'byacc' ], $verbose );
- $prog = check_progs( [ @yacc_defaults ], $verbose );
- if (! $prog) {
+ }
+ else {
+
+ # $prog = check_progs( [ 'bison -v -y', 'yacc', 'byacc' ], $verbose
);
+ $prog = check_progs( [@yacc_defaults], $verbose );
+ if ( !$prog ) {
$self->set_result('no yacc program was found');
return;
- } else {
+ }
+ else {
+
# RT#43170 should --ask be handled like the other user defines or
# checked for version requirements?
if ( $conf->options->get('ask') ) {
- $prog = prompt(
- $prompt, $prog ? $prog : $conf->data->get($util) );
+ $prog = prompt( $prompt, $prog ? $prog :
$conf->data->get($util) );
}
- my ( $stdout, $stderr, $ret ) =
- capture_output( $prog, '--version' );
+ my ( $stdout, $stderr, $ret ) = capture_output( $prog, '--version'
);
+
# don't override the user even if the program they provided
# appears to be broken
if ( $ret == -1 and !$conf->options->get('ask') ) {
+
# fall back to default
$self->set_result('yacc program does not exist or does not
understand --version');
return;
- } elsif ( $stdout =~ /Bison .*? (\d+) \. (\d+) (\w)?/x ) {
+ }
+ elsif ( $stdout =~ /Bison .*? (\d+) \. (\d+) (\w)?/x ) {
+
# if '--version' returns a string assume that this is bison.
# if this is bison pretending to be yacc
# '--version' doesn't work
@@ -97,31 +104,33 @@
$req = $default_required;
}
if ($req) {
- my ( $rmajor, $rminor ) =
- ( $req =~ / ^ (\d+) \. (\d+) (\w)? $ /x );
- if (! defined $rmajor ) {
- $self->set_result(
- "could not understand bison version requirement");
+ my ( $rmajor, $rminor ) = ( $req =~ / ^ (\d+) \. (\d+)
(\w)? $ /x );
+ if ( !defined $rmajor ) {
+ $self->set_result("could not understand bison version
requirement");
return;
- } elsif (
-# $prog_major >= $rmajor
+ }
+ elsif (
+
+ # $prog_major >= $rmajor
$prog_major < $rmajor
or ( $prog_major == $rmajor
and $prog_minor < $rminor )
- ) {
- $self->set_result(
- "found bison version $prog_version"
- . " but at least $rmajor.$rminor is required" );
+ )
+ {
+ $self->set_result( "found bison version $prog_version"
+ . " but at least $rmajor.$rminor is required"
);
return;
- } else {
- 1; # lack an explicit 'else' here
+ }
+ else {
+ 1; # lack an explicit 'else' here
}
}
$conf->data->set( bison_version => $prog_version );
$self->set_result("bison $prog_version");
$conf->data->set( $util => $prog );
return $self;
- } else {
+ }
+ else {
$self->set_result('yacc program does not exist or does not
understand --version');
return;
}
|
|