Title: [100461] trunk/Tools
Revision
100461
Author
ves...@webkit.org
Date
2011-11-16 09:27:43 -0800 (Wed, 16 Nov 2011)

Log Message

[Qt] Fix use of config.tests

We were checking @buildArgs to determine if the optional argument was
passed or not, but this is not the right way to do that in Perl. The
right way is to not use a prototype for the function, and to pass
the list as a reference (to avoid list expansion). That way we can
check the number of arguments, and choose the right code path based
on that.

We were also missing a default-value of 0 for any feature that's not
set in features.prf.

Reviewed by Kenneth Rohde Christiansen.

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(qtFeatureDefaults):
(buildQMakeProject):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (100460 => 100461)


--- trunk/Tools/ChangeLog	2011-11-16 17:20:25 UTC (rev 100460)
+++ trunk/Tools/ChangeLog	2011-11-16 17:27:43 UTC (rev 100461)
@@ -1,5 +1,26 @@
 2011-11-16  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
 
+        [Qt] Fix use of config.tests
+
+        We were checking @buildArgs to determine if the optional argument was
+        passed or not, but this is not the right way to do that in Perl. The
+        right way is to not use a prototype for the function, and to pass
+        the list as a reference (to avoid list expansion). That way we can
+        check the number of arguments, and choose the right code path based
+        on that.
+
+        We were also missing a default-value of 0 for any feature that's not
+        set in features.prf.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * Scripts/build-webkit:
+        * Scripts/webkitdirs.pm:
+        (qtFeatureDefaults):
+        (buildQMakeProject):
+
+2011-11-16  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
+
         [Qt] Prospective fix for broken plugin tests
 
         Don't hide symbols for the NPAPI test plugin

Modified: trunk/Tools/Scripts/build-webkit (100460 => 100461)


--- trunk/Tools/Scripts/build-webkit	2011-11-16 17:20:25 UTC (rev 100460)
+++ trunk/Tools/Scripts/build-webkit	2011-11-16 17:27:43 UTC (rev 100461)
@@ -348,7 +348,7 @@
     }
 
     foreach (@features) {
-        $_->{default} = (%qtDefaults ? $qtDefaults{$_->{define}} : -1);
+        $_->{default} = (%qtDefaults ? $qtDefaults{$_->{define}} || 0 : -1);
     }
 }
 

Modified: trunk/Tools/Scripts/webkitdirs.pm (100460 => 100461)


--- trunk/Tools/Scripts/webkitdirs.pm	2011-11-16 17:20:25 UTC (rev 100460)
+++ trunk/Tools/Scripts/webkitdirs.pm	2011-11-16 17:27:43 UTC (rev 100461)
@@ -731,11 +731,8 @@
     return $qtVersion;
 }
 
-sub qtFeatureDefaults(;@)
+sub qtFeatureDefaults
 {
-    my @buildArgs = @_;
-    my %qtFeatureDefaults;
-
     die "ERROR: qmake missing but required to build WebKit.\n" if not commandExists($qmakebin);
 
     my $qmakepath = File::Spec->catfile(sourceDir(), "Tools", "qmake");
@@ -749,19 +746,23 @@
     my $originalCwd = getcwd();
 
     my $file;
-    if (!@buildArgs) {
-        # Do a quick check of the features without running the config tests
-        $file = File::Spec->catfile($qmakepath, "mkspecs", "features", "features.prf");
-        push @buildArgs, "CONFIG+=compute_defaults";
-    } else {
+    my @buildArgs;
+
+    if (@_) {
+        @buildArgs = (@buildArgs, @{$_[0]});
         my $dir = File::Spec->catfile(productDir(), "Tools", "qmake");
         File::Path::mkpath($dir);
         chdir $dir or die "Failed to cd into " . $dir . "\n";
         $file = File::Spec->catfile($qmakepath, "configure.pro");
+    } else {
+        # Do a quick check of the features without running the config tests
+        $file = File::Spec->catfile($qmakepath, "mkspecs", "features", "features.prf");
+        push @buildArgs, "CONFIG+=compute_defaults";
     }
 
     my $defaults = `$qmakecommand @buildArgs $file 2>&1`;
 
+    my %qtFeatureDefaults;
     while ($defaults =~ m/(\S+?)=(\S+?)/gi) {
         $qtFeatureDefaults{$1}=$2;
     }
@@ -1769,7 +1770,7 @@
     File::Path::mkpath($dir);
     chdir $dir or die "Failed to cd into " . $dir . "\n";
 
-    my %defines = qtFeatureDefaults(@buildArgs);
+    my %defines = qtFeatureDefaults(\@buildArgs);
 
     my $needsCleanBuild = 0;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to