From 5197a0034973649e19216429ef5e921dbbb7d943 Mon Sep 17 00:00:00 2001
From: Andras Becsi <andras.becsi@digia.com>
Date: Wed, 8 May 2013 17:55:06 +0200
Subject: [PATCH] Remove obsolete build configuration for QtWebKit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Building the qtwebkit module works the same way as any other module
these days (i.e. qmake && make), thus using the build-webkit script
for this purpose is obsolete.
In particular when using the qt5_tool the module is actually built
twice: first time with the top-level Makefile, and for the second
time in a final step with build-webkit which fails because the other
build is present. Since the build-webkit script is meant for upstream
developer builds the option can be removed from qt5_tool.
Configure with '-skip qtwebkit' when a webkit build was not requested.

Task-number: QTBUG-30858
Change-Id: Ib6b51b188c9f97064efb834da46de4d03e2a72b7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
---
 bin/qt5_tool | 31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/bin/qt5_tool b/bin/qt5_tool
index 205abb1..72996b7 100755
--- a/bin/qt5_tool
+++ b/bin/qt5_tool
@@ -522,32 +522,6 @@ sub checkoutBranch
     return 1;
 }
 
-sub buildWebKit
-{
-    my $webkit = 'qtwebkit';
-    chdir($webkit) or die ('Failed to chdir from' . $rootDir . ' to "' . $webkit . '":' . $!);
-    my $webOutDir = File::Spec->catfile($rootDir, $webkit, 'WebKitBuild');
-    print 'Setting WEBKITOUTPUTDIR: ', $webOutDir, "\n";
-    $ENV{'WEBKITOUTPUTDIR'} = $webOutDir;
-    if ($os == $OS_WINDOWS) { # get bison from mother repository
-        my $toolsPath = File::Spec->catfile($rootDir, 'gnuwin32', 'bin');
-        my $path = $ENV{'PATH'};
-        $path .= ';' unless $path =~ /;$/; # SDKs create trailing semicolons
-        $path .= $toolsPath;
-        print 'Adding tools to path: ', $toolsPath, "\n";
-        $ENV{'PATH'} = $path;
-    }
-    my $script = File::Spec->catfile($rootDir, $webkit, 'Tools', 'Scripts', 'build-webkit');
-    my $qmake = File::Spec->catfile($rootDir, 'qtbase', 'bin', 'qmake');
-    $qmake .= '.exe' if ($os == $OS_WINDOWS);
-    my @args = ($script, '--qt', '--no-netscape-plugin');
-    push (@args, '--no-webkit2') if $os == $OS_WINDOWS;
-    push (@args, '--qmake=' . $qmake, '--makeargs=' . join(' ', @makeArgs));
-    push (@args, '--release') unless grep('-debug', split(' ', readQt5ToolConfig('configureArguments')));
-    executeCheck('perl', @args);
-    chdir($rootDir);
-}
-
 # --------------- MAIN: Parse arguments
 
 $Getopt::ignoreCase = 0;
@@ -864,6 +838,7 @@ if ( $BUILD !=  0 ) {
     my @configureArguments;
     my $configureArgumentsFromConfig = readQt5ToolConfig('configureArguments');
     push(@configureArguments, split(/ /, $configureArgumentsFromConfig)) unless $configureArgumentsFromConfig eq '';
+    push(@configureArguments, "-skip qtwebkit") if not $BUILD_WEBKIT;
     $makeInstallRequired = grep(/^-prefix$/, @configureArguments);
 #   --- Shadow builds: Remove and re-create directory
     my $shadowBuildDir = shadowBuildFolder();
@@ -892,10 +867,6 @@ if ( $BUILD + $MAKE !=  0) {
     executeCheck($make, @makeArgs);
 } # MAKE
 
-if ( $BUILD_WEBKIT !=  0) {
-    buildWebKit();
-}
-
 if ( $BUILD && $makeInstallRequired ) {
     print 'Installing Qt 5 from ',$rootDir,"\n";
     my @installArgs = @makeArgs;
-- 
GitLab