diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-07-09 16:51:56 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-07-09 16:54:10 +0200 |
commit | fd1cc6ce5b91c8baf6ad66763bebb788cfc14995 (patch) | |
tree | 611964383bf46425ee119312197c4318ec1615e3 | |
parent | 2abc9ee32365d7943ca8626d11710dd643436fa1 (diff) |
qt5_tool: Improve make handling
- Windows: Autodetect jom
- Execute make install if required, deduced only from
configure arguments.
Change-Id: I59806a2c1c7c8e1bbd12fa667885a835365edd32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rwxr-xr-x | bin/qt5_tool | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/bin/qt5_tool b/bin/qt5_tool index 4934de0..a9bcb41 100755 --- a/bin/qt5_tool +++ b/bin/qt5_tool @@ -156,26 +156,37 @@ sub msysGitUtility } my $qmakeSpec = $ENV{'QMAKESPEC'}; -my $minGW = $os == $OS_WINDOWS && defined($qmakeSpec) && index($qmakeSpec,'g++') > 0; my $make = 'make'; -$make = $minGW ? 'mingw32-make' : 'nmake' if ($os == $OS_WINDOWS); +my @makeArgs = ('-s'); +my $makeForceArg = '-k'; +my $minGW = 0; -my @makeArgs = $os == $OS_WINDOWS && !$minGW ? ('/s', '/l') : ('-s'); - -if ($os == $OS_WINDOWS) { # Switch cl compiler to multicore - my $oldCL = $ENV{'CL'}; - if (defined $oldCL) { - $ENV{'CL'} = $oldCL . ' /MP' +if ($os == $OS_WINDOWS) { + $minGW = defined($qmakeSpec) && index($qmakeSpec,'g++') > 0; + if ($minGW) { + $make = 'mingw32-make'; } else { - $ENV{'CL'} = '/MP' - } + @makeArgs = ('/s', '/l'); + $makeForceArg = '/k'; + my $jom = which('jom'); + if (defined $jom) { + $make = $jom; + } else { + $make = 'nmake'; + # Switch cl compiler to multicore + my $oldCL = $ENV{'CL'}; + if (defined $oldCL) { + $ENV{'CL'} = $oldCL . ' /MP' + } else { + $ENV{'CL'} = '/MP' + } + } # jom + } # !MinGW } my $git = which('git'); # TODO: Mac, Windows special cases? die ('Unable to locate git') unless defined $git; -my $makeForceArg = $os == $OS_WINDOWS && !$minGW ? '/k' : '-k'; - my $rootDir = ''; my $baseDir = ''; my $home = $os == $OS_WINDOWS ? ($ENV{'HOMEDRIVE'} . $ENV{'HOMEPATH'}) : $ENV{'HOME'}; @@ -856,14 +867,15 @@ if ( $UPDATE != 0 ) { # ---- Configure and build +my $makeInstallRequired = 0; + if ( $BUILD != 0 ) { print 'Building Qt 5 in ',$rootDir,"\n"; winRemoveGitFromPath() if $minGW; - my $developerBuild = readQt5ToolConfigBool($developerBuildConfigKey); my @configureArguments; - push(@configureArguments, '-prefix', File::Spec->catfile($rootDir, 'qtbase')) unless $developerBuild; my $configureArgumentsFromConfig = readQt5ToolConfig('configureArguments'); push(@configureArguments, split(/ /, $configureArgumentsFromConfig)) unless $configureArgumentsFromConfig eq ''; + $makeInstallRequired = grep(/^-prefix$/, @configureArguments); # --- Shadow builds: Remove and re-create directory my $shadowBuildDir = shadowBuildFolder(); if ($shadowBuildDir ne '') { @@ -895,6 +907,11 @@ if ( $BUILD_WEBKIT != 0) { buildWebKit(); } +if ( $BUILD && $makeInstallRequired ) { + print 'Installing Qt 5 from ',$rootDir,"\n"; + executeCheck($make, (@makeArgs, 'install')); +} + # ---- Build documentation. Note: qch_docs may fail on Windows. if ($DOC != 0 ) { |