Title: [160401] branches/safari-537.74-branch/Tools
Revision
160401
Author
lforsch...@apple.com
Date
2013-12-10 17:09:08 -0800 (Tue, 10 Dec 2013)

Log Message

Merged r156926.  <rdar://problem/15560412>

Modified Paths

Diff

Modified: branches/safari-537.74-branch/Tools/ChangeLog (160400 => 160401)


--- branches/safari-537.74-branch/Tools/ChangeLog	2013-12-11 01:08:11 UTC (rev 160400)
+++ branches/safari-537.74-branch/Tools/ChangeLog	2013-12-11 01:09:08 UTC (rev 160401)
@@ -1,3 +1,22 @@
+2013-12-10  Lucas Forschler  <lforsch...@apple.com>
+
+        Merge r156926
+
+    2013-10-04  Brent Fulgham  <bfulg...@apple.com>
+
+            Teach webkitdirs.pm to honor the --64-bit flag
+            https://bugs.webkit.org/show_bug.cgi?id=122357
+
+            Reviewed by David Kilzer.
+
+            * Scripts/webkitdirs.pm:
+            (argumentsForConfiguration): Modify to check if --64-bit is supplied
+            by the user.
+            (findMatchingArguments): Added.
+            (hasArgument): Added.
+            (checkForArgumentAndRemoveFromArrayRef): Refactor to use the new
+            findMatchingArguments subroutine.
+
 2013-12-10  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge 152921

Modified: branches/safari-537.74-branch/Tools/Scripts/webkitdirs.pm (160400 => 160401)


--- branches/safari-537.74-branch/Tools/Scripts/webkitdirs.pm	2013-12-11 01:08:11 UTC (rev 160400)
+++ branches/safari-537.74-branch/Tools/Scripts/webkitdirs.pm	2013-12-11 01:09:08 UTC (rev 160401)
@@ -115,6 +115,9 @@
 # Defined in VCSUtils.
 sub exitStatus($);
 
+sub findMatchingArguments($$);
+sub hasArgument($$);
+
 sub determineSourceDir
 {
     return if $sourceDir;
@@ -383,7 +386,7 @@
     my @args = ();
     push(@args, '--debug') if $configuration eq "Debug";
     push(@args, '--release') if $configuration eq "Release";
-    push(@args, '--32-bit') if $architecture ne "x86_64";
+    push(@args, '--32-bit') if ($architecture ne "x86_64" and !hasArgument('--64-bit', \@ARGV));
     push(@args, '--qt') if isQt();
     push(@args, '--gtk') if isGtk();
     push(@args, '--efl') if isEfl();
@@ -950,20 +953,35 @@
     return checkForArgumentAndRemoveFromArrayRef($argToCheck, \@ARGV);
 }
 
-sub checkForArgumentAndRemoveFromArrayRef
+sub findMatchingArguments($$)
 {
     my ($argToCheck, $arrayRef) = @_;
-    my @indicesToRemove;
+    my @matchingIndices;
     foreach my $index (0 .. $#$arrayRef) {
         my $opt = $$arrayRef[$index];
         if ($opt =~ /^$argToCheck$/i ) {
-            push(@indicesToRemove, $index);
+            push(@matchingIndices, $index);
         }
     }
+    return @matchingIndices; 
+}
+
+sub hasArgument($$)
+{
+    my ($argToCheck, $arrayRef) = @_;
+    my @matchingIndices = findMatchingArguments($argToCheck, $arrayRef);
+    my $far = scalar @matchingIndices;
+    return scalar @matchingIndices > 0;
+}
+
+sub checkForArgumentAndRemoveFromArrayRef
+{
+    my ($argToCheck, $arrayRef) = @_;
+    my @indicesToRemove = findMatchingArguments($argToCheck, $arrayRef);
     foreach my $index (@indicesToRemove) {
         splice(@$arrayRef, $index, 1);
     }
-    return $#indicesToRemove > -1;
+    return scalar @indicesToRemove > 0;
 }
 
 sub isWK2()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to