summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2012-04-06 22:20:13 -0500
committerQt by Nokia <qt-info@nokia.com>2012-04-20 18:51:30 +0200
commit3dffd4e71035fc9a8433045a1dcfd1b9425793e7 (patch)
tree07220ed99d4381b19cdb1ef777ea364d0109f568 /build
parent1e103533a0770ef3fa73c47c0b5a9bb7a8d866cf (diff)
Just move functions closer to their logical place in the code
Makes it easier to read the code Change-Id: I71ed3affa3d3fe4e2b782898c78f1c1a97371d26 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'build')
-rwxr-xr-xbuild112
1 files changed, 56 insertions, 56 deletions
diff --git a/build b/build
index 61c333c7..07f60fd3 100755
--- a/build
+++ b/build
@@ -54,6 +54,31 @@ use Cwd qw( getcwd );
use File::Spec qw( path catfile );
use Config;
+sub parse_arguments
+{
+ my ($self, @args) = @_;
+
+ %{$self} = (%{$self},
+ 'verbose' => 0,
+ 'continue' => 0,
+ 'jobs' => -1,
+ 'force_qmake' => 0,
+ 'build-submodules' => [],
+ );
+
+ GetOptionsFromArray(\@args,
+ 'verbose|v:1' => \$self->{'verbose'},
+ 'continue' => \$self->{'continue'},
+ 'jobs|j:1' => \$self->{'jobs'},
+ 'force-qmake' => \$self->{'force_qmake'},
+ 'help|?' => sub { pod2usage(1); },
+ ) || pod2usage(2);
+
+ push(@{$self->{'build-submodules'}}, @args) if (@args);
+
+ return;
+}
+
# Like `system', but possibly log the command, and die on non-zero exit code
sub exe
{
@@ -120,62 +145,6 @@ sub exeLowPriv()
}
}
-sub new
-{
- my ($class, @arguments) = @_;
-
- my $self = {};
- bless $self, $class;
-
- $self->parse_arguments(@arguments);
- $self->detect_configuration;
-
- my $depfile = "build.dependencies";
- my $result;
- our (%build_dependencies, %build_commands, %install_commands, @nondefault_modules);
-
- # following variables may be expanded in the evaluation below
- my $MAKEOPTS = $self->{'MAKEOPTS'};
- my $MAKE = $self->{'MAKE'};
-
- unless ($result = do $depfile) {
- die "build couldn't parse $depfile: $@" if $@;
- die "build couldn't execute $depfile: $!" unless defined $result;
- }
-
- $self->{'deps'} = \%build_dependencies;
- $self->{'buildcmds'} = \%build_commands;
- $self->{'instcmds'} = \%install_commands;
- $self->{'nondefault'} = \@nondefault_modules;
-
- return $self;
-}
-
-sub parse_arguments
-{
- my ($self, @args) = @_;
-
- %{$self} = (%{$self},
- 'verbose' => 0,
- 'continue' => 0,
- 'jobs' => -1,
- 'force_qmake' => 0,
- 'build-submodules' => [],
- );
-
- GetOptionsFromArray(\@args,
- 'verbose|v:1' => \$self->{'verbose'},
- 'continue' => \$self->{'continue'},
- 'jobs|j:1' => \$self->{'jobs'},
- 'force-qmake' => \$self->{'force_qmake'},
- 'help|?' => sub { pod2usage(1); },
- ) || pod2usage(2);
-
- push(@{$self->{'build-submodules'}}, @args) if (@args);
-
- return;
-}
-
sub which {
my ($self, $exe) = @_;
@@ -419,6 +388,37 @@ sub build_qt
return 0;
}
+sub new
+{
+ my ($class, @arguments) = @_;
+
+ my $self = {};
+ bless $self, $class;
+
+ $self->parse_arguments(@arguments);
+ $self->detect_configuration;
+
+ my $depfile = "build.dependencies";
+ my $result;
+ our (%build_dependencies, %build_commands, %install_commands, @nondefault_modules);
+
+ # following variables may be expanded in the evaluation below
+ my $MAKEOPTS = $self->{'MAKEOPTS'};
+ my $MAKE = $self->{'MAKE'};
+
+ unless ($result = do $depfile) {
+ die "build couldn't parse $depfile: $@" if $@;
+ die "build couldn't execute $depfile: $!" unless defined $result;
+ }
+
+ $self->{'deps'} = \%build_dependencies;
+ $self->{'buildcmds'} = \%build_commands;
+ $self->{'instcmds'} = \%install_commands;
+ $self->{'nondefault'} = \@nondefault_modules;
+
+ return $self;
+}
+
sub run
{
my ($self) = @_;