aboutsummaryrefslogtreecommitdiffstats
path: root/patches/qtwebkit/0014-QtWebKit-Windows-Use-jom-instead-of-nmake-if-present.patch
blob: 91727468431ad1ab66f64eef87199cf9a4a89456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 845b4a908ee0c3f2467b797046bfcc3f834641b8 Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Date: Tue, 22 Mar 2011 16:17:10 -0500
Subject: [PATCH] QtWebKit/Windows: Use jom instead of nmake, if present

Detect if jom.exe is in the PATH. If so, use Jom instead of
nmake to compile, since Jom supports building on several cores.

Had to roll out own find_exe function, since File::Which doesn't
seem to be installed by default on certain Linux systems.
---
 Tools/Scripts/webkitdirs.pm |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm
index 1820f1e..8a5a03e 100644
--- a/Tools/Scripts/webkitdirs.pm
+++ b/Tools/Scripts/webkitdirs.pm
@@ -1345,6 +1345,18 @@ sub retrieveQMakespecVar
     return $varvalue;
 }
 
+sub find_exe {
+    my ($exe) = @_;
+    return if (!defined($exe));
+    my @paths = split(/;/, $ENV{"PATH"});
+    foreach my $path (@paths) {
+        $path =~ s/\\$//g;
+        $path =~ s/\\/\//g;
+        my $file = $path . '/' . $exe;
+        return $file if ((-e $file) && (-f $file));
+    }
+}
+
 sub qtMakeCommand($)
 {
     my ($qmakebin) = @_;
@@ -1356,6 +1368,7 @@ sub qtMakeCommand($)
     #print "compiler found: " . $compiler . "\n";
 
     if ($compiler && $compiler eq "cl") {
+        return "jom" if(find_exe('jom.exe'));
         return "nmake";
     }
 
@@ -1640,7 +1653,7 @@ sub buildQMakeProject($@)
     for my $subdir (@subdirs) {
         my $dsMakefile = "Makefile.DerivedSources";
         print "Calling '$make $makeargs -C $subdir -f $dsMakefile generated_files' in " . $dir . "/$subdir\n\n";
-        if ($make eq "nmake") {
+        if ($make eq "nmake" || $make eq "jom") {
             my $subdirWindows = $subdir;
             $subdirWindows =~ s:/:\\:g;
             $result = system "pushd $subdirWindows && $make $makeargs -f $dsMakefile generated_files && popd";
-- 
1.7.2.3.msysgit.0.311.gb27be