<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[197946] branches/safari-601-branch/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/197946">197946</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 11:26:32 -0800 (Thu, 10 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre><rdar://problem/25074204>
Unreviewed build fix attempt.
* Scripts/webkitdirs.pm:
(determineBaseProductDir):
(determineConfiguration):
(determineArchitecture):
(determineNumberOfCPUs):
(jscPath):
(visualStudioInstallDir):
(msBuildInstallDir):
(visualStudioVersion):
(determineConfigurationProductDir):
(productDir):
(executableProductDir):
(jscProductDir):
(configuration):
(determineGenerateDsym):
(hasIOSDevelopmentCertificate):
(argumentsForXcode):
(XcodeOptions):
(XcodeOptionString):
(determinePassedConfiguration):
(passedConfiguration):
(checkFrameworks):
(checkForArgumentAndRemoveFromArrayRef):
(prohibitUnknownPort):
(determinePortName):
(portName):
(isEfl):
(isGtk):
(isWinCairo):
(isWin64):
(determineIsWin64):
(determineIsWin64FromArchitecture):
(isCygwin):
(isARM):
(isX86_64):
(isCrossCompilation):
(isAppleMacWebKit):
(isAppleWinWebKit):
(iOSSimulatorDevicesPath):
(createiOSSimulatorDevice):
(willUseIOSDeviceSDK):
(willUseIOSSimulatorSDK):
(isIOSWebKit):
(determineNmPath):
(nmPath):
(splitVersionString):
(determineOSXVersion):
(osXVersion):
(determineIOSVersion):
(iosVersion):
(isWindowsNT):
(debugger):
(determineDebugger):
(appendToEnvironmentVariableList):
(prependToEnvironmentVariableList):
(setUpGuardMallocIfNeeded):
(launcherName):
(checkRequiredSystemConfig):
(determineWindowsSourceDir):
(setupAppleWinEnv):
(setupCygwinEnv):
(buildXCodeProject):
(buildVisualStudioProject):
(isCachedArgumentfileOutOfDate):
(wrapperPrefixIfNeeded):
(canUseNinja):
(canUseNinjaGenerator):
(canUseEclipseNinjaGenerator):
(cmakeGeneratedBuildfile):
(generateBuildSystemFromCMakeProject):
(buildCMakeGeneratedProject):
(cleanCMakeGeneratedProject):
(buildCMakeProjectOrExit):
(cmakeBasedPortName):
(determineIsCMakeBuild):
(isCMakeBuild):
(promptUser):
(setPathForRunningWebKitApp):
(printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
(argumentsForRunAndDebugMacWebKitApp):
(setupMacWebKitEnvironment):
(setupIOSWebKitEnvironment):
(waitUntilIOSSimulatorDeviceIsInState):
(shutDownIOSSimulatorDevice):
(restartIOSSimulatorDevice):
(relaunchIOSSimulator):
(runIOSWebKitAppInSimulator):
(runIOSWebKitApp):
(execMacWebKitAppForDebugging):
(debugSafari):
(runSafari):
(runMiniBrowser):
(determineIsEfl): Deleted.
(determineIsGtk): Deleted.
(determineIsWinCairo): Deleted.
(willUseIOSDeviceSDKWhenBuilding): Deleted.
(willUseIOSSimulatorSDKWhenBuilding): Deleted.
(shouldTargetWebProcess): Deleted.
(determineShouldTargetWebProcess): Deleted.
(shouldUseXPCServiceForWebProcess): Deleted.
(determineShouldUseXPCServiceForWebProcess): Deleted.
(jhbuildWrapperPrefixIfNeeded): Deleted.
(canUseEclipse): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchToolsChangeLog">branches/safari-601-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari601branchToolsScriptswebkitdirspm">branches/safari-601-branch/Tools/Scripts/webkitdirs.pm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/ChangeLog (197945 => 197946)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/ChangeLog        2016-03-10 18:39:46 UTC (rev 197945)
+++ branches/safari-601-branch/Tools/ChangeLog        2016-03-10 19:26:32 UTC (rev 197946)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2016-03-10 Lucas Forschler <lforschler@apple.com>
+
+ <rdar://problem/25074204>
+ Unreviewed build fix attempt.
+
+ * Scripts/webkitdirs.pm:
+ (determineBaseProductDir):
+ (determineConfiguration):
+ (determineArchitecture):
+ (determineNumberOfCPUs):
+ (jscPath):
+ (visualStudioInstallDir):
+ (msBuildInstallDir):
+ (visualStudioVersion):
+ (determineConfigurationProductDir):
+ (productDir):
+ (executableProductDir):
+ (jscProductDir):
+ (configuration):
+ (determineGenerateDsym):
+ (hasIOSDevelopmentCertificate):
+ (argumentsForXcode):
+ (XcodeOptions):
+ (XcodeOptionString):
+ (determinePassedConfiguration):
+ (passedConfiguration):
+ (checkFrameworks):
+ (checkForArgumentAndRemoveFromArrayRef):
+ (prohibitUnknownPort):
+ (determinePortName):
+ (portName):
+ (isEfl):
+ (isGtk):
+ (isWinCairo):
+ (isWin64):
+ (determineIsWin64):
+ (determineIsWin64FromArchitecture):
+ (isCygwin):
+ (isARM):
+ (isX86_64):
+ (isCrossCompilation):
+ (isAppleMacWebKit):
+ (isAppleWinWebKit):
+ (iOSSimulatorDevicesPath):
+ (createiOSSimulatorDevice):
+ (willUseIOSDeviceSDK):
+ (willUseIOSSimulatorSDK):
+ (isIOSWebKit):
+ (determineNmPath):
+ (nmPath):
+ (splitVersionString):
+ (determineOSXVersion):
+ (osXVersion):
+ (determineIOSVersion):
+ (iosVersion):
+ (isWindowsNT):
+ (debugger):
+ (determineDebugger):
+ (appendToEnvironmentVariableList):
+ (prependToEnvironmentVariableList):
+ (setUpGuardMallocIfNeeded):
+ (launcherName):
+ (checkRequiredSystemConfig):
+ (determineWindowsSourceDir):
+ (setupAppleWinEnv):
+ (setupCygwinEnv):
+ (buildXCodeProject):
+ (buildVisualStudioProject):
+ (isCachedArgumentfileOutOfDate):
+ (wrapperPrefixIfNeeded):
+ (canUseNinja):
+ (canUseNinjaGenerator):
+ (canUseEclipseNinjaGenerator):
+ (cmakeGeneratedBuildfile):
+ (generateBuildSystemFromCMakeProject):
+ (buildCMakeGeneratedProject):
+ (cleanCMakeGeneratedProject):
+ (buildCMakeProjectOrExit):
+ (cmakeBasedPortName):
+ (determineIsCMakeBuild):
+ (isCMakeBuild):
+ (promptUser):
+ (setPathForRunningWebKitApp):
+ (printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
+ (argumentsForRunAndDebugMacWebKitApp):
+ (setupMacWebKitEnvironment):
+ (setupIOSWebKitEnvironment):
+ (waitUntilIOSSimulatorDeviceIsInState):
+ (shutDownIOSSimulatorDevice):
+ (restartIOSSimulatorDevice):
+ (relaunchIOSSimulator):
+ (runIOSWebKitAppInSimulator):
+ (runIOSWebKitApp):
+ (execMacWebKitAppForDebugging):
+ (debugSafari):
+ (runSafari):
+ (runMiniBrowser):
+ (determineIsEfl): Deleted.
+ (determineIsGtk): Deleted.
+ (determineIsWinCairo): Deleted.
+ (willUseIOSDeviceSDKWhenBuilding): Deleted.
+ (willUseIOSSimulatorSDKWhenBuilding): Deleted.
+ (shouldTargetWebProcess): Deleted.
+ (determineShouldTargetWebProcess): Deleted.
+ (shouldUseXPCServiceForWebProcess): Deleted.
+ (determineShouldUseXPCServiceForWebProcess): Deleted.
+ (jhbuildWrapperPrefixIfNeeded): Deleted.
+ (canUseEclipse): Deleted.
+
</ins><span class="cx"> 2016-03-03 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r188607. rdar://problem/24937998
</span></span></pre></div>
<a id="branchessafari601branchToolsScriptswebkitdirspm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Tools/Scripts/webkitdirs.pm (197945 => 197946)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Tools/Scripts/webkitdirs.pm        2016-03-10 18:39:46 UTC (rev 197945)
+++ branches/safari-601-branch/Tools/Scripts/webkitdirs.pm        2016-03-10 19:26:32 UTC (rev 197946)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-# Copyright (C) 2005-2007, 2010-2014 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2005-2007, 2010-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> # Copyright (C) 2009 Google Inc. All rights reserved.
</span><span class="cx"> # Copyright (C) 2011 Research In Motion Limited. All rights reserved.
</span><span class="cx"> # Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="lines">@@ -58,39 +58,62 @@
</span><span class="cx"> &XcodeOptions
</span><span class="cx"> &XcodeStaticAnalyzerOption
</span><span class="cx"> &appDisplayNameFromBundle
</span><ins>+ &appendToEnvironmentVariableList
</ins><span class="cx"> &baseProductDir
</span><span class="cx"> &chdirWebKit
</span><span class="cx"> &checkFrameworks
</span><span class="cx"> &cmakeBasedPortArguments
</span><del>- &cmakeBasedPortName
</del><span class="cx"> &currentSVNRevision
</span><span class="cx"> &debugSafari
</span><ins>+ &executableProductDir
</ins><span class="cx"> &findOrCreateSimulatorForIOSDevice
</span><span class="cx"> &iosSimulatorDeviceByName
</span><span class="cx"> &nmPath
</span><span class="cx"> &passedConfiguration
</span><ins>+ &prependToEnvironmentVariableList
</ins><span class="cx"> &printHelpAndExitForRunAndDebugWebKitAppIfNeeded
</span><span class="cx"> &productDir
</span><span class="cx"> &quitIOSSimulator
</span><span class="cx"> &relaunchIOSSimulator
</span><ins>+ &restartIOSSimulatorDevice
</ins><span class="cx"> &runIOSWebKitApp
</span><span class="cx"> &runMacWebKitApp
</span><span class="cx"> &safariPath
</span><ins>+ &iosVersion
</ins><span class="cx"> &setConfiguration
</span><span class="cx"> &setupMacWebKitEnvironment
</span><span class="cx"> &sharedCommandLineOptions
</span><span class="cx"> &sharedCommandLineOptionsUsage
</span><ins>+ &shutDownIOSSimulatorDevice
+ &willUseIOSDeviceSDK
+ &willUseIOSSimulatorSDK
+ SIMULATOR_DEVICE_SUFFIX_FOR_WEBKIT_DEVELOPMENT
</ins><span class="cx"> USE_OPEN_COMMAND
</span><span class="cx"> );
</span><span class="cx"> %EXPORT_TAGS = ( );
</span><span class="cx"> @EXPORT_OK = ();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+# Ports
+use constant {
+ AppleWin => "AppleWin",
+ GTK => "GTK",
+ Efl => "Efl",
+ iOS => "iOS",
+ Mac => "Mac",
+ WinCairo => "WinCairo",
+ Unknown => "Unknown"
+};
+
</ins><span class="cx"> use constant USE_OPEN_COMMAND => 1; # Used in runMacWebKitApp().
</span><span class="cx"> use constant INCLUDE_OPTIONS_FOR_DEBUGGING => 1;
</span><span class="cx"> use constant SIMULATOR_DEVICE_STATE_SHUTDOWN => "1";
</span><span class="cx"> use constant SIMULATOR_DEVICE_STATE_BOOTED => "3";
</span><ins>+use constant SIMULATOR_DEVICE_SUFFIX_FOR_WEBKIT_DEVELOPMENT => "For WebKit Development";
</ins><span class="cx">
</span><ins>+# See table "Certificate types and names" on <https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW41>.
+use constant IOS_DEVELOPMENT_CERTIFICATE_NAME_PREFIX => "iPhone Developer: ";
+
</ins><span class="cx"> our @EXPORT_OK;
</span><span class="cx">
</span><span class="cx"> my $architecture;
</span><span class="lines">@@ -109,17 +132,18 @@
</span><span class="cx"> my $didLoadIPhoneSimulatorNotification;
</span><span class="cx"> my $nmPath;
</span><span class="cx"> my $osXVersion;
</span><ins>+my $iosVersion;
</ins><span class="cx"> my $generateDsym;
</span><del>-my $isGtk;
-my $isWinCairo;
</del><ins>+my $isCMakeBuild;
</ins><span class="cx"> my $isWin64;
</span><del>-my $isEfl;
</del><span class="cx"> my $isInspectorFrontend;
</span><del>-my $shouldTargetWebProcess;
-my $shouldUseXPCServiceForWebProcess;
</del><ins>+my $portName;
</ins><span class="cx"> my $shouldUseGuardMalloc;
</span><ins>+my $shouldNotUseNinja;
</ins><span class="cx"> my $xcodeVersion;
</span><span class="cx">
</span><ins>+my $unknownPortProhibited = 0;
+
</ins><span class="cx"> # Variables for Win32 support
</span><span class="cx"> my $programFilesPath;
</span><span class="cx"> my $vcBuildPath;
</span><span class="lines">@@ -243,7 +267,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!defined($baseProductDir)) { # Port-specific checks failed, use default
</span><del>- $baseProductDir = "$sourceDir/WebKitBuild";
</del><ins>+ $baseProductDir = File::Spec->catdir($sourceDir, "WebKitBuild");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (isGit() && isGitBranchBuild()) {
</span><span class="lines">@@ -267,7 +291,7 @@
</span><span class="cx"> $ENV{"WEBKIT_OUTPUTDIR"} = $dosBuildPath;
</span><span class="cx"> my $unixBuildPath = `cygpath --unix \"$baseProductDir\"`;
</span><span class="cx"> chomp $unixBuildPath;
</span><del>- $baseProductDir = $unixBuildPath;
</del><ins>+ $baseProductDir = $dosBuildPath;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -292,12 +316,6 @@
</span><span class="cx"> } else {
</span><span class="cx"> $configuration = "Release";
</span><span class="cx"> }
</span><del>-
- if ($configuration && isWinCairo()) {
- unless ($configuration =~ /_WinCairo$/) {
- $configuration .= "_WinCairo";
- }
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub determineArchitecture
</span><span class="lines">@@ -324,29 +342,36 @@
</span><span class="cx"> } elsif ($xcodeSDK =~ /^iphonesimulator/) {
</span><span class="cx"> $architecture = 'x86_64';
</span><span class="cx"> } elsif ($xcodeSDK =~ /^iphoneos/) {
</span><del>- $architecture = 'armv7';
</del><ins>+ $architecture = 'arm64';
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>- } elsif (isEfl() || isGtk()) {
</del><ins>+ } elsif (isCMakeBuild()) {
</ins><span class="cx"> my $host_processor = "";
</span><del>- $host_processor = `cmake --system-information | grep CMAKE_SYSTEM_PROCESSOR`;
- if ($host_processor =~ m/^CMAKE_SYSTEM_PROCESSOR \"([^"]+)\"/) {
- # We have a configured build tree; use it.
- $architecture = $1;
- $architecture = 'x86_64' if $architecture eq 'amd64';
</del><ins>+ if (open my $cmake_sysinfo, "cmake --system-information |") {
+ while (<$cmake_sysinfo>) {
+ next unless index($_, 'CMAKE_SYSTEM_PROCESSOR') == 0;
+ if (/^CMAKE_SYSTEM_PROCESSOR \"([^"]+)\"/) {
+ $architecture = $1;
+ $architecture = 'x86_64' if $architecture eq 'amd64';
+ last;
+ }
+ }
+ close $cmake_sysinfo;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) {
- # Fall back to output of `arch', if it is present.
- $architecture = `arch`;
- chomp $architecture;
- }
</del><ins>+ if (!isAnyWindows()) {
+ if (!$architecture) {
+ # Fall back to output of `arch', if it is present.
+ $architecture = `arch`;
+ chomp $architecture;
+ }
</ins><span class="cx">
</span><del>- if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) {
- # Fall back to output of `uname -m', if it is present.
- $architecture = `uname -m`;
- chomp $architecture;
</del><ins>+ if (!$architecture) {
+ # Fall back to output of `uname -m', if it is present.
+ $architecture = `uname -m`;
+ chomp $architecture;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $architecture = 'x86_64' if ($architecture =~ /amd64/ && isBSD());
</span><span class="lines">@@ -380,7 +405,7 @@
</span><span class="cx"> if ($numberOfCPUs eq "") {
</span><span class="cx"> $numberOfCPUs = (grep /processor/, `cat /proc/cpuinfo`);
</span><span class="cx"> }
</span><del>- } elsif (isWindows() || isCygwin()) {
</del><ins>+ } elsif (isAnyWindows()) {
</ins><span class="cx"> # Assumes cygwin
</span><span class="cx"> $numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`;
</span><span class="cx"> } elsif (isDarwin() || isBSD()) {
</span><span class="lines">@@ -401,7 +426,7 @@
</span><span class="cx"> my ($productDir) = @_;
</span><span class="cx"> my $jscName = "jsc";
</span><span class="cx"> $jscName .= "_debug" if configuration() eq "Debug_All";
</span><del>- $jscName .= ".exe" if (isWindows() || isCygwin());
</del><ins>+ $jscName .= ".exe" if (isAnyWindows());
</ins><span class="cx"> return "$productDir/$jscName" if -e "$productDir/$jscName";
</span><span class="cx"> return "$productDir/JavaScriptCore.framework/Resources/$jscName";
</span><span class="cx"> }
</span><span class="lines">@@ -508,10 +533,11 @@
</span><span class="cx"> $vsInstallDir = $ENV{'VSINSTALLDIR'};
</span><span class="cx"> $vsInstallDir =~ s|[\\/]$||;
</span><span class="cx"> } else {
</span><del>- $vsInstallDir = File::Spec->catdir(programFilesPath(), "Microsoft Visual Studio 12.0");
</del><ins>+ $vsInstallDir = File::Spec->catdir(programFilesPath(), "Microsoft Visual Studio 14.0");
</ins><span class="cx"> }
</span><span class="cx"> chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin();
</span><span class="cx">
</span><ins>+ print "Using Visual Studio: $vsInstallDir\n";
</ins><span class="cx"> return $vsInstallDir;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -519,9 +545,11 @@
</span><span class="cx"> {
</span><span class="cx"> return $msBuildInstallDir if defined $msBuildInstallDir;
</span><span class="cx">
</span><del>- $msBuildInstallDir = File::Spec->catdir(programFilesPath(), "MSBuild", "12.0", "Bin");
</del><ins>+ $msBuildInstallDir = File::Spec->catdir(programFilesPath(), "MSBuild", "14.0", "Bin");
+
</ins><span class="cx"> chomp($msBuildInstallDir = `cygpath "$msBuildInstallDir"`) if isCygwin();
</span><span class="cx">
</span><ins>+ print "Using MSBuild: $msBuildInstallDir\n";
</ins><span class="cx"> return $msBuildInstallDir;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -531,8 +559,9 @@
</span><span class="cx">
</span><span class="cx"> my $installDir = visualStudioInstallDir();
</span><span class="cx">
</span><del>- $vsVersion = ($installDir =~ /Microsoft Visual Studio ([0-9]+\.[0-9]*)/) ? $1 : "12";
</del><ins>+ $vsVersion = ($installDir =~ /Microsoft Visual Studio ([0-9]+\.[0-9]*)/) ? $1 : "14";
</ins><span class="cx">
</span><ins>+ print "Using Visual Studio $vsVersion\n";
</ins><span class="cx"> return $vsVersion;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -559,8 +588,7 @@
</span><span class="cx"> determineBaseProductDir();
</span><span class="cx"> determineConfiguration();
</span><span class="cx"> if (isAppleWinWebKit() || isWinCairo()) {
</span><del>- my $binDir = isWin64() ? "bin64" : "bin32";
- $configurationProductDir = File::Spec->catdir($baseProductDir, $configuration, $binDir);
</del><ins>+ $configurationProductDir = File::Spec->catdir($baseProductDir, $configuration);
</ins><span class="cx"> } else {
</span><span class="cx"> if (usesPerConfigurationBuildDirectory()) {
</span><span class="cx"> $configurationProductDir = "$baseProductDir";
</span><span class="lines">@@ -611,14 +639,27 @@
</span><span class="cx"> return $configurationProductDir;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub jscProductDir
</del><ins>+sub executableProductDir
</ins><span class="cx"> {
</span><del>- my $productDir = productDir();
- $productDir .= "/bin" if (isEfl() || isGtk());
</del><ins>+ my $productDirectory = productDir();
</ins><span class="cx">
</span><del>- return $productDir;
</del><ins>+ my $binaryDirectory;
+ if (isEfl() || isGtk()) {
+ $binaryDirectory = "bin";
+ } elsif (isAnyWindows()) {
+ $binaryDirectory = isWin64() ? "bin64" : "bin32";
+ } else {
+ return $productDirectory;
+ }
+
+ return File::Spec->catdir($productDirectory, $binaryDirectory);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+sub jscProductDir
+{
+ return executableProductDir();
+}
+
</ins><span class="cx"> sub configuration()
</span><span class="cx"> {
</span><span class="cx"> determineConfiguration();
</span><span class="lines">@@ -655,6 +696,11 @@
</span><span class="cx"> $generateDsym = checkForArgumentAndRemoveFromARGV("--dsym");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub hasIOSDevelopmentCertificate()
+{
+ return !exitStatus(system("security find-identity -p codesigning | grep '" . IOS_DEVELOPMENT_CERTIFICATE_NAME_PREFIX . "' > /dev/null 2>&1"));
+}
+
</ins><span class="cx"> sub argumentsForXcode()
</span><span class="cx"> {
</span><span class="cx"> my @args = ();
</span><span class="lines">@@ -670,11 +716,25 @@
</span><span class="cx"> determineASanIsEnabled();
</span><span class="cx"> determineXcodeSDK();
</span><span class="cx">
</span><del>- my @sdkOption = ($xcodeSDK ? "SDKROOT=$xcodeSDK" : ());
- my @architectureOption = ($architecture ? "ARCHS=$architecture" : ());
- my @asanOption = ($asanIsEnabled ? ("-xcconfig", sourceDir() . "/Tools/asan/asan.xcconfig", "ASAN_IGNORE=" . sourceDir() . "/Tools/asan/webkit-asan-ignore.txt") : ());
-
- return ("-UseSanitizedBuildSystemEnvironment=YES", @baseProductDirOption, "-configuration", $configuration, @architectureOption, @sdkOption, @asanOption, argumentsForXcode());
</del><ins>+ my @options;
+ push @options, "-UseSanitizedBuildSystemEnvironment=YES";
+ push @options, ("-configuration", $configuration);
+ push @options, ("-xcconfig", sourceDir() . "/Tools/asan/asan.xcconfig", "ASAN_IGNORE=" . sourceDir() . "/Tools/asan/webkit-asan-ignore.txt") if $asanIsEnabled;
+ push @options, @baseProductDirOption;
+ push @options, "ARCHS=$architecture" if $architecture;
+ push @options, "SDKROOT=$xcodeSDK" if $xcodeSDK;
+ if (willUseIOSDeviceSDK()) {
+ push @options, "ENABLE_BITCODE=NO";
+ if (hasIOSDevelopmentCertificate()) {
+ # FIXME: May match more than one installed development certificate.
+ push @options, "CODE_SIGN_IDENTITY=" . IOS_DEVELOPMENT_CERTIFICATE_NAME_PREFIX;
+ } else {
+ push @options, "CODE_SIGN_IDENTITY="; # No identity
+ push @options, "CODE_SIGNING_REQUIRED=NO";
+ }
+ }
+ push @options, argumentsForXcode();
+ return @options;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub XcodeOptionString
</span><span class="lines">@@ -715,8 +775,6 @@
</span><span class="cx"> } elsif (checkForArgumentAndRemoveFromARGV("--profile") || checkForArgumentAndRemoveFromARGV("--profiling")) {
</span><span class="cx"> $passedConfiguration = "Profiling";
</span><span class="cx"> }
</span><del>-
- $passedConfiguration .= "_WinCairo" if (defined($passedConfiguration) && isWinCairo());
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub passedConfiguration
</span><span class="lines">@@ -880,7 +938,7 @@
</span><span class="cx"> # Check to see that all the frameworks are built.
</span><span class="cx"> sub checkFrameworks # FIXME: This is a poor name since only the Mac calls built WebCore a Framework.
</span><span class="cx"> {
</span><del>- return if isCygwin() || isWindows();
</del><ins>+ return if isAnyWindows();
</ins><span class="cx"> my @frameworks = ("JavaScriptCore", "WebCore");
</span><span class="cx"> push(@frameworks, "WebKit") if isAppleMacWebKit(); # FIXME: This seems wrong, all ports should have a WebKit these days.
</span><span class="cx"> for my $framework (@frameworks) {
</span><span class="lines">@@ -975,28 +1033,73 @@
</span><span class="cx"> return scalar @indicesToRemove > 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub determineIsEfl()
</del><ins>+sub prohibitUnknownPort()
</ins><span class="cx"> {
</span><del>- return if defined($isEfl);
- $isEfl = checkForArgumentAndRemoveFromARGV("--efl");
</del><ins>+ $unknownPortProhibited = 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub isEfl()
</del><ins>+sub determinePortName()
</ins><span class="cx"> {
</span><del>- determineIsEfl();
- return $isEfl;
</del><ins>+ return if defined $portName;
+
+ my %argToPortName = (
+ efl => Efl,
+ gtk => GTK,
+ wincairo => WinCairo
+ );
+
+ for my $arg (sort keys %argToPortName) {
+ if (checkForArgumentAndRemoveFromARGV("--$arg")) {
+ die "Argument '--$arg' conflicts with selected port '$portName'\n"
+ if defined $portName;
+
+ $portName = $argToPortName{$arg};
+ }
+ }
+
+ return if defined $portName;
+
+ # Port was not selected via command line, use appropriate default value
+
+ if (isAnyWindows()) {
+ $portName = AppleWin;
+ } elsif (isDarwin()) {
+ determineXcodeSDK();
+ if (willUseIOSDeviceSDK() || willUseIOSSimulatorSDK()) {
+ $portName = iOS;
+ } else {
+ $portName = Mac;
+ }
+ } else {
+ if ($unknownPortProhibited) {
+ my $portsChoice = join "\n\t", qw(
+ --efl
+ --gtk
+ );
+ die "Please specify which WebKit port to build using one of the following options:"
+ . "\n\t$portsChoice\n";
+ }
+
+ # If script is run without arguments we cannot determine port
+ # TODO: This state should be outlawed
+ $portName = Unknown;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub determineIsGtk()
</del><ins>+sub portName()
</ins><span class="cx"> {
</span><del>- return if defined($isGtk);
- $isGtk = checkForArgumentAndRemoveFromARGV("--gtk");
</del><ins>+ determinePortName();
+ return $portName;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+sub isEfl()
+{
+ return portName() eq Efl;
+}
+
</ins><span class="cx"> sub isGtk()
</span><span class="cx"> {
</span><del>- determineIsGtk();
- return $isGtk;
</del><ins>+ return portName() eq GTK;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Determine if this is debian, ubuntu, linspire, or something similar.
</span><span class="lines">@@ -1012,16 +1115,9 @@
</span><span class="cx">
</span><span class="cx"> sub isWinCairo()
</span><span class="cx"> {
</span><del>- determineIsWinCairo();
- return $isWinCairo;
</del><ins>+ return portName() eq WinCairo;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub determineIsWinCairo()
-{
- return if defined($isWinCairo);
- $isWinCairo = checkForArgumentAndRemoveFromARGV("--wincairo");
-}
-
</del><span class="cx"> sub isWin64()
</span><span class="cx"> {
</span><span class="cx"> determineIsWin64();
</span><span class="lines">@@ -1034,6 +1130,13 @@
</span><span class="cx"> $isWin64 = checkForArgumentAndRemoveFromARGV("--64-bit");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub determineIsWin64FromArchitecture($)
+{
+ my $arch = shift;
+ $isWin64 = ($arch eq "x86_64");
+ return $isWin64;
+}
+
</ins><span class="cx"> sub isCygwin()
</span><span class="cx"> {
</span><span class="cx"> return ($^O eq "cygwin") || 0;
</span><span class="lines">@@ -1109,6 +1212,11 @@
</span><span class="cx"> return ($Config{archname} =~ /^arm[v\-]/) || ($Config{archname} =~ /^aarch64[v\-]/);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub isX86_64()
+{
+ return (architecture() eq "x86_64") || 0;
+}
+
</ins><span class="cx"> sub isCrossCompilation()
</span><span class="cx"> {
</span><span class="cx"> my $compiler = "";
</span><span class="lines">@@ -1130,12 +1238,12 @@
</span><span class="cx">
</span><span class="cx"> sub isAppleMacWebKit()
</span><span class="cx"> {
</span><del>- return isDarwin() && !isGtk();
</del><ins>+ return (portName() eq Mac) || isIOSWebKit();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub isAppleWinWebKit()
</span><span class="cx"> {
</span><del>- return (isCygwin() || isWindows()) && !isWinCairo() && !isGtk();
</del><ins>+ return portName() eq AppleWin;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub iOSSimulatorDevicesPath
</span><span class="lines">@@ -1186,20 +1294,19 @@
</span><span class="cx"> die "Device $name $deviceTypeId $runtimeId wasn't found in " . iOSSimulatorDevicesPath();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub willUseIOSDeviceSDKWhenBuilding()
</del><ins>+sub willUseIOSDeviceSDK()
</ins><span class="cx"> {
</span><span class="cx"> return xcodeSDKPlatformName() eq "iphoneos";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub willUseIOSSimulatorSDKWhenBuilding()
</del><ins>+sub willUseIOSSimulatorSDK()
</ins><span class="cx"> {
</span><span class="cx"> return xcodeSDKPlatformName() eq "iphonesimulator";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub isIOSWebKit()
</span><span class="cx"> {
</span><del>- determineXcodeSDK();
- return isAppleMacWebKit() && (willUseIOSDeviceSDKWhenBuilding() || willUseIOSSimulatorSDKWhenBuilding());
</del><ins>+ return portName() eq iOS;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub determineNmPath()
</span><span class="lines">@@ -1219,6 +1326,18 @@
</span><span class="cx"> return $nmPath;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub splitVersionString
+{
+ my $versionString = shift;
+ my @splitVersion = split(/\./, $versionString);
+ @splitVersion >= 2 or die "Invalid version $versionString";
+ $osXVersion = {
+ "major" => $splitVersion[0],
+ "minor" => $splitVersion[1],
+ "subminor" => (defined($splitVersion[2]) ? $splitVersion[2] : 0),
+ };
+}
+
</ins><span class="cx"> sub determineOSXVersion()
</span><span class="cx"> {
</span><span class="cx"> return if $osXVersion;
</span><span class="lines">@@ -1228,14 +1347,8 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $version = `sw_vers -productVersion`;
- my @splitVersion = split(/\./, $version);
- @splitVersion >= 2 or die "Invalid version $version";
- $osXVersion = {
- "major" => $splitVersion[0],
- "minor" => $splitVersion[1],
- "subminor" => (defined($splitVersion[2]) ? $splitVersion[2] : 0),
- };
</del><ins>+ my $versionString = `sw_vers -productVersion`;
+ $osXVersion = splitVersionString($versionString);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub osXVersion()
</span><span class="lines">@@ -1244,33 +1357,28 @@
</span><span class="cx"> return $osXVersion;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub isWindowsNT()
</del><ins>+sub determineIOSVersion()
</ins><span class="cx"> {
</span><del>- return $ENV{'OS'} eq 'Windows_NT';
-}
</del><ins>+ return if $iosVersion;
</ins><span class="cx">
</span><del>-sub shouldTargetWebProcess
-{
- determineShouldTargetWebProcess();
- return $shouldTargetWebProcess;
-}
</del><ins>+ if (!isIOSWebKit()) {
+ $iosVersion = -1;
+ return;
+ }
</ins><span class="cx">
</span><del>-sub determineShouldTargetWebProcess
-{
- return if defined($shouldTargetWebProcess);
- $shouldTargetWebProcess = checkForArgumentAndRemoveFromARGV("--target-web-process");
</del><ins>+ my $versionString = xcodeSDKVersion();
+ $iosVersion = splitVersionString($versionString);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub shouldUseXPCServiceForWebProcess
</del><ins>+sub iosVersion()
</ins><span class="cx"> {
</span><del>- determineShouldUseXPCServiceForWebProcess();
- return $shouldUseXPCServiceForWebProcess;
</del><ins>+ determineIOSVersion();
+ return $iosVersion;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-sub determineShouldUseXPCServiceForWebProcess
</del><ins>+sub isWindowsNT()
</ins><span class="cx"> {
</span><del>- return if defined($shouldUseXPCServiceForWebProcess);
- $shouldUseXPCServiceForWebProcess = checkForArgumentAndRemoveFromARGV("--use-web-process-xpc-service");
</del><ins>+ return $ENV{'OS'} eq 'Windows_NT';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub debugger
</span><span class="lines">@@ -1299,17 +1407,28 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub appendToEnvironmentVariableList
</del><ins>+sub appendToEnvironmentVariableList($$)
</ins><span class="cx"> {
</span><del>- my ($environmentVariableName, $value) = @_;
</del><ins>+ my ($name, $value) = @_;
</ins><span class="cx">
</span><del>- if (defined($ENV{$environmentVariableName})) {
- $ENV{$environmentVariableName} .= ":" . $value;
</del><ins>+ if (defined($ENV{$name})) {
+ $ENV{$name} .= $Config{path_sep} . $value;
</ins><span class="cx"> } else {
</span><del>- $ENV{$environmentVariableName} = $value;
</del><ins>+ $ENV{$name} = $value;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub prependToEnvironmentVariableList($$)
+{
+ my ($name, $value) = @_;
+
+ if (defined($ENV{$name})) {
+ $ENV{$name} = $value . $Config{path_sep} . $ENV{$name};
+ } else {
+ $ENV{$name} = $value;
+ }
+}
+
</ins><span class="cx"> sub sharedCommandLineOptions()
</span><span class="cx"> {
</span><span class="cx"> return (
</span><span class="lines">@@ -1350,6 +1469,7 @@
</span><span class="cx">
</span><span class="cx"> if ($shouldUseGuardMalloc) {
</span><span class="cx"> appendToEnvironmentVariableList("DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib");
</span><ins>+ appendToEnvironmentVariableList("__XPC_DYLD_INSERT_LIBRARIES", "/usr/lib/libgmalloc.dylib");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1379,7 +1499,7 @@
</span><span class="cx"> } elsif (isAppleMacWebKit()) {
</span><span class="cx"> return "Safari";
</span><span class="cx"> } elsif (isAppleWinWebKit()) {
</span><del>- return "WinLauncher";
</del><ins>+ return "MiniBrowser";
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1402,20 +1522,7 @@
</span><span class="cx"> print "most likely fail. The latest Xcode is available from the App Store.\n";
</span><span class="cx"> print "*************************************************************\n";
</span><span class="cx"> }
</span><del>- } elsif (isGtk() or isEfl() or isWindows()) {
- my @cmds = qw(bison gperf flex);
- my @missing = ();
- my $oldPath = $ENV{PATH};
- foreach my $cmd (@cmds) {
- push @missing, $cmd if not commandExists($cmd);
- }
-
- if (@missing) {
- my $list = join ", ", @missing;
- die "ERROR: $list missing but required to build WebKit.\n";
- }
</del><span class="cx"> }
</span><del>- # Win32 and other platforms may want to check for minimum config
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub determineWindowsSourceDir()
</span><span class="lines">@@ -1517,6 +1624,8 @@
</span><span class="cx"> $variablesToSet{WEBKIT_LIBRARIES} = windowsLibrariesDir() unless $ENV{WEBKIT_LIBRARIES};
</span><span class="cx"> $variablesToSet{WEBKIT_OUTPUTDIR} = windowsOutputDir() unless $ENV{WEBKIT_OUTPUTDIR};
</span><span class="cx"> $variablesToSet{MSBUILDDISABLENODEREUSE} = "1" unless $ENV{MSBUILDDISABLENODEREUSE};
</span><ins>+ $variablesToSet{_IsNativeEnvironment} = "true" unless $ENV{_IsNativeEnvironment};
+ $variablesToSet{PreferredToolArchitecture} = "x64" unless $ENV{PreferredToolArchitecture};
</ins><span class="cx">
</span><span class="cx"> foreach my $variable (keys %variablesToSet) {
</span><span class="cx"> print "Setting the Environment Variable '" . $variable . "' to '" . $variablesToSet{$variable} . "'\n\n";
</span><span class="lines">@@ -1555,7 +1664,7 @@
</span><span class="cx">
</span><span class="cx"> sub setupCygwinEnv()
</span><span class="cx"> {
</span><del>- return if !isCygwin() && !isWindows();
</del><ins>+ return if !isAnyWindows();
</ins><span class="cx"> return if $vcBuildPath;
</span><span class="cx">
</span><span class="cx"> my $programFilesPath = programFilesPath();
</span><span class="lines">@@ -1572,7 +1681,7 @@
</span><span class="cx"> print "*************************************************************\n";
</span><span class="cx"> print "Cannot find '$visualStudioPath'\n";
</span><span class="cx"> print "Please execute the file 'vcvars32.bat' from\n";
</span><del>- print "'$programFilesPath\\Microsoft Visual Studio 12.0\\VC\\bin\\'\n";
</del><ins>+ print "'$programFilesPath\\Microsoft Visual Studio 14.0\\VC\\bin\\'\n";
</ins><span class="cx"> print "to setup the necessary environment variables.\n";
</span><span class="cx"> print "*************************************************************\n";
</span><span class="cx"> die;
</span><span class="lines">@@ -1639,8 +1748,6 @@
</span><span class="cx"> push(@extraOptions, "clean");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- push(@extraOptions, ("-sdk", xcodeSDK())) if isIOSWebKit();
-
</del><span class="cx"> chomp($ENV{DSYMUTIL_NUM_THREADS} = `sysctl -n hw.activecpu`);
</span><span class="cx"> return system "xcodebuild", "-project", "$project.xcodeproj", @extraOptions;
</span><span class="cx"> }
</span><span class="lines">@@ -1680,7 +1787,6 @@
</span><span class="cx"> my $warningLogging = "/flp1:LogFile=" . $warningLogFile . ";WarningsOnly";
</span><span class="cx">
</span><span class="cx"> my @command = ($vcBuildPath, "/verbosity:minimal", $project, $action, $config, $platform, "/fl", $errorLogging, "/fl1", $warningLogging);
</span><del>-
</del><span class="cx"> print join(" ", @command), "\n";
</span><span class="cx"> return system @command;
</span><span class="cx"> }
</span><span class="lines">@@ -1723,8 +1829,14 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub jhbuildWrapperPrefixIfNeeded()
</del><ins>+sub wrapperPrefixIfNeeded()
</ins><span class="cx"> {
</span><ins>+ if (isAnyWindows()) {
+ return ();
+ }
+ if (isAppleMacWebKit()) {
+ return ("xcrun");
+ }
</ins><span class="cx"> if (-e getJhbuildPath()) {
</span><span class="cx"> my @prefix = (File::Spec->catfile(sourceDir(), "Tools", "jhbuild", "jhbuild-wrapper"));
</span><span class="cx"> if (isEfl()) {
</span><span class="lines">@@ -1797,20 +1909,39 @@
</span><span class="cx">
</span><span class="cx"> sub canUseNinja(@)
</span><span class="cx"> {
</span><ins>+ if (!defined($shouldNotUseNinja)) {
+ $shouldNotUseNinja = checkForArgumentAndRemoveFromARGV("--no-ninja");
+ }
+
+ if ($shouldNotUseNinja) {
+ return 0;
+ }
+
</ins><span class="cx"> # Test both ninja and ninja-build. Fedora uses ninja-build and has patched CMake to also call ninja-build.
</span><span class="cx"> return commandExists("ninja") || commandExists("ninja-build");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub canUseEclipse(@)
</del><ins>+sub canUseNinjaGenerator(@)
</ins><span class="cx"> {
</span><del>- return commandExists("eclipse");
</del><ins>+ # Check that a Ninja generator is installed
+ my $devnull = File::Spec->devnull();
+ return exitStatus(system("cmake -N -G Ninja >$devnull 2>&1")) == 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+sub canUseEclipseNinjaGenerator(@)
+{
+ # Check that eclipse and eclipse Ninja generator is installed
+ my $devnull = File::Spec->devnull();
+ return commandExists("eclipse") && exitStatus(system("cmake -N -G 'Eclipse CDT4 - Ninja' >$devnull 2>&1")) == 0;
+}
+
</ins><span class="cx"> sub cmakeGeneratedBuildfile(@)
</span><span class="cx"> {
</span><span class="cx"> my ($willUseNinja) = @_;
</span><span class="cx"> if ($willUseNinja) {
</span><span class="cx"> return File::Spec->catfile(baseProductDir(), configuration(), "build.ninja")
</span><ins>+ } elsif (isAnyWindows()) {
+ return File::Spec->catfile(baseProductDir(), configuration(), "WebKit.sln")
</ins><span class="cx"> } else {
</span><span class="cx"> return File::Spec->catfile(baseProductDir(), configuration(), "Makefile")
</span><span class="cx"> }
</span><span class="lines">@@ -1818,15 +1949,16 @@
</span><span class="cx">
</span><span class="cx"> sub generateBuildSystemFromCMakeProject
</span><span class="cx"> {
</span><del>- my ($port, $prefixPath, @cmakeArgs, $additionalCMakeArgs) = @_;
</del><ins>+ my ($prefixPath, @cmakeArgs) = @_;
</ins><span class="cx"> my $config = configuration();
</span><ins>+ my $port = cmakeBasedPortName();
</ins><span class="cx"> my $buildPath = File::Spec->catdir(baseProductDir(), $config);
</span><span class="cx"> File::Path::mkpath($buildPath) unless -d $buildPath;
</span><span class="cx"> my $originalWorkingDirectory = getcwd();
</span><span class="cx"> chdir($buildPath) or die;
</span><span class="cx">
</span><span class="cx"> # We try to be smart about when to rerun cmake, so that we can have faster incremental builds.
</span><del>- my $willUseNinja = canUseNinja();
</del><ins>+ my $willUseNinja = canUseNinja() && canUseNinjaGenerator();
</ins><span class="cx"> if (-e cmakeCachePath() && -e cmakeGeneratedBuildfile($willUseNinja)) {
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -1843,11 +1975,13 @@
</span><span class="cx">
</span><span class="cx"> if ($willUseNinja) {
</span><span class="cx"> push @args, "-G";
</span><del>- if (canUseEclipse()) {
</del><ins>+ if (canUseEclipseNinjaGenerator()) {
</ins><span class="cx"> push @args, "'Eclipse CDT4 - Ninja'";
</span><span class="cx"> } else {
</span><span class="cx"> push @args, "Ninja";
</span><span class="cx"> }
</span><ins>+ } elsif (isAnyWindows() && isWin64()) {
+ push @args, '-G "Visual Studio 14 2015 Win64"';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # GTK+ has a production mode, but build-webkit should always use developer mode.
</span><span class="lines">@@ -1856,20 +1990,20 @@
</span><span class="cx"> # Don't warn variables which aren't used by cmake ports.
</span><span class="cx"> push @args, "--no-warn-unused-cli";
</span><span class="cx"> push @args, @cmakeArgs if @cmakeArgs;
</span><del>- push @args, $additionalCMakeArgs if $additionalCMakeArgs;
</del><span class="cx">
</span><del>- push @args, '"' . sourceDir() . '"';
</del><ins>+ my $cmakeSourceDir = isCygwin() ? windowsSourceDir() : sourceDir();
+ push @args, '"' . $cmakeSourceDir . '"';
</ins><span class="cx">
</span><span class="cx"> # Compiler options to keep floating point values consistent
</span><span class="cx"> # between 32-bit and 64-bit architectures.
</span><span class="cx"> determineArchitecture();
</span><del>- if ($architecture ne "x86_64" && !isARM() && !isCrossCompilation()) {
</del><ins>+ if ($architecture ne "x86_64" && !isARM() && !isCrossCompilation() && !isAnyWindows()) {
</ins><span class="cx"> $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse " . ($ENV{'CXXFLAGS'} || "");
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # We call system("cmake @args") instead of system("cmake", @args) so that @args is
</span><span class="cx"> # parsed for shell metacharacters.
</span><del>- my $wrapper = join(" ", jhbuildWrapperPrefixIfNeeded()) . " ";
</del><ins>+ my $wrapper = join(" ", wrapperPrefixIfNeeded()) . " ";
</ins><span class="cx"> my $returnCode = system($wrapper . "cmake @args");
</span><span class="cx">
</span><span class="cx"> chdir($originalWorkingDirectory);
</span><span class="lines">@@ -1903,9 +2037,8 @@
</span><span class="cx">
</span><span class="cx"> # We call system("cmake @args") instead of system("cmake", @args) so that @args is
</span><span class="cx"> # parsed for shell metacharacters. In particular, $makeArgs may contain such metacharacters.
</span><del>- my $wrapper = join(" ", jhbuildWrapperPrefixIfNeeded()) . " ";
</del><ins>+ my $wrapper = join(" ", wrapperPrefixIfNeeded()) . " ";
</ins><span class="cx"> return system($wrapper . "$command @args");
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub cleanCMakeGeneratedProject()
</span><span class="lines">@@ -1918,9 +2051,9 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-sub buildCMakeProjectOrExit($$$$@)
</del><ins>+sub buildCMakeProjectOrExit($$$@)
</ins><span class="cx"> {
</span><del>- my ($clean, $port, $prefixPath, $makeArgs, @cmakeArgs) = @_;
</del><ins>+ my ($clean, $prefixPath, $makeArgs, @cmakeArgs) = @_;
</ins><span class="cx"> my $returnCode;
</span><span class="cx">
</span><span class="cx"> exit(exitStatus(cleanCMakeGeneratedProject())) if $clean;
</span><span class="lines">@@ -1933,7 +2066,7 @@
</span><span class="cx"> system("perl", "$sourceDir/Tools/Scripts/update-webkitgtk-libs") == 0 or die $!;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- $returnCode = exitStatus(generateBuildSystemFromCMakeProject($port, $prefixPath, @cmakeArgs));
</del><ins>+ $returnCode = exitStatus(generateBuildSystemFromCMakeProject($prefixPath, @cmakeArgs));
</ins><span class="cx"> exit($returnCode) if $returnCode;
</span><span class="cx">
</span><span class="cx"> $returnCode = exitStatus(buildCMakeGeneratedProject($makeArgs));
</span><span class="lines">@@ -1948,14 +2081,20 @@
</span><span class="cx">
</span><span class="cx"> sub cmakeBasedPortName()
</span><span class="cx"> {
</span><del>- return "Efl" if isEfl();
- return "GTK" if isGtk();
- return "";
</del><ins>+ return ucfirst portName();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+sub determineIsCMakeBuild()
+{
+ return if defined($isCMakeBuild);
+ $isCMakeBuild = checkForArgumentAndRemoveFromARGV("--cmake");
+}
+
</ins><span class="cx"> sub isCMakeBuild()
</span><span class="cx"> {
</span><del>- return isEfl() || isGtk();
</del><ins>+ return 1 unless isAppleMacWebKit();
+ determineIsCMakeBuild();
+ return $isCMakeBuild;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub promptUser
</span><span class="lines">@@ -1983,12 +2122,15 @@
</span><span class="cx"> {
</span><span class="cx"> my ($env) = @_;
</span><span class="cx">
</span><del>- if (isAppleWinWebKit()) {
- $env->{PATH} = join(':', productDir(), appleApplicationSupportPath(), $env->{PATH} || "");
- } elsif (isWinCairo()) {
- my $winCairoBin = sourceDir() . "/WebKitLibraries/win/" . (isWin64() ? "bin64/" : "bin32/");
- my $gstreamerBin = isWin64() ? $ENV{"GSTREAMER_1_0_ROOT_X86_64"} . "bin" : $ENV{"GSTREAMER_1_0_ROOT_X86"} . "bin";
- $env->{PATH} = join(':', productDir(), $winCairoBin, $gstreamerBin, $env->{PATH} || "");
</del><ins>+ if (isAnyWindows()) {
+ my $productBinaryDir = executableProductDir();
+ if (isAppleWinWebKit()) {
+ $env->{PATH} = join(':', $productBinaryDir, appleApplicationSupportPath(), $env->{PATH} || "");
+ } elsif (isWinCairo()) {
+ my $winCairoBin = sourceDir() . "/WebKitLibraries/win/" . (isWin64() ? "bin64/" : "bin32/");
+ my $gstreamerBin = isWin64() ? $ENV{"GSTREAMER_1_0_ROOT_X86_64"} . "bin" : $ENV{"GSTREAMER_1_0_ROOT_X86"} . "bin";
+ $env->{PATH} = join(':', $productBinaryDir, $winCairoBin, $gstreamerBin, $env->{PATH} || "");
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2003,12 +2145,10 @@
</span><span class="cx"> --help Show this help message
</span><span class="cx"> --no-saved-state Launch the application without state restoration (OS X 10.7 and later)
</span><span class="cx"> -g|--guard-malloc Enable Guard Malloc (OS X only)
</span><del>- --use-web-process-xpc-service Launch the Web Process as an XPC Service (OS X only)
</del><span class="cx"> EOF
</span><span class="cx">
</span><span class="cx"> if ($includeOptionsForDebugging) {
</span><span class="cx"> print STDERR <<EOF;
</span><del>- --target-web-process Debug the web process
</del><span class="cx"> --use-gdb Use GDB (this is the default when using Xcode 4.4 or earlier)
</span><span class="cx"> --use-lldb Use LLDB (this is the default when using Xcode 4.5 or later)
</span><span class="cx"> EOF
</span><span class="lines">@@ -2025,7 +2165,6 @@
</span><span class="cx"> # FIXME: Don't set ApplePersistenceIgnoreState once all supported OS versions respect ApplePersistenceIgnoreStateQuietly (rdar://15032886).
</span><span class="cx"> push @args, ("-ApplePersistenceIgnoreState", "YES");
</span><span class="cx"> }
</span><del>- push @args, ("-WebKit2UseXPCServiceForWebProcess", "YES") if shouldUseXPCServiceForWebProcess();
</del><span class="cx"> unshift @args, @ARGV;
</span><span class="cx">
</span><span class="cx"> return @args;
</span><span class="lines">@@ -2037,8 +2176,8 @@
</span><span class="cx">
</span><span class="cx"> $dyldFrameworkPath = File::Spec->rel2abs($dyldFrameworkPath);
</span><span class="cx">
</span><del>- $ENV{DYLD_FRAMEWORK_PATH} = $ENV{DYLD_FRAMEWORK_PATH} ? join(":", $dyldFrameworkPath, $ENV{DYLD_FRAMEWORK_PATH}) : $dyldFrameworkPath;
- $ENV{__XPC_DYLD_FRAMEWORK_PATH} = $dyldFrameworkPath;
</del><ins>+ prependToEnvironmentVariableList("DYLD_FRAMEWORK_PATH", $dyldFrameworkPath);
+ prependToEnvironmentVariableList("__XPC_DYLD_FRAMEWORK_PATH", $dyldFrameworkPath);
</ins><span class="cx"> $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
</span><span class="cx">
</span><span class="cx"> setUpGuardMallocIfNeeded();
</span><span class="lines">@@ -2049,8 +2188,8 @@
</span><span class="cx"> my ($dyldFrameworkPath) = @_;
</span><span class="cx"> $dyldFrameworkPath = File::Spec->rel2abs($dyldFrameworkPath);
</span><span class="cx">
</span><del>- $ENV{DYLD_FRAMEWORK_PATH} = $dyldFrameworkPath;
- $ENV{DYLD_LIBRARY_PATH} = $dyldFrameworkPath;
</del><ins>+ prependToEnvironmentVariableList("DYLD_FRAMEWORK_PATH", $dyldFrameworkPath);
+ prependToEnvironmentVariableList("DYLD_LIBRARY_PATH", $dyldFrameworkPath);
</ins><span class="cx">
</span><span class="cx"> setUpGuardMallocIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -2110,6 +2249,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub shutDownIOSSimulatorDevice($)
+{
+ my ($simulatorDevice) = @_;
+ system("xcrun --sdk iphonesimulator simctl shutdown $simulatorDevice->{UDID} > /dev/null 2>&1");
+}
+
+sub restartIOSSimulatorDevice($)
+{
+ my ($simulatorDevice) = @_;
+ shutDownIOSSimulatorDevice($simulatorDevice);
+
+ exitStatus(system("xcrun", "--sdk", "iphonesimulator", "simctl", "boot", $simulatorDevice->{UDID})) == 0 or die "Failed to boot simulator device $simulatorDevice->{UDID}";
+}
+
</ins><span class="cx"> sub relaunchIOSSimulator($)
</span><span class="cx"> {
</span><span class="cx"> my ($simulatedDevice) = @_;
</span><span class="lines">@@ -2238,7 +2391,7 @@
</span><span class="cx"> my $productDir = productDir();
</span><span class="cx"> my $appDisplayName = appDisplayNameFromBundle($appBundle);
</span><span class="cx"> my $appIdentifier = appIdentifierFromBundle($appBundle);
</span><del>- my $simulatedDevice = findOrCreateSimulatorForIOSDevice("For WebKit Development");
</del><ins>+ my $simulatedDevice = findOrCreateSimulatorForIOSDevice(SIMULATOR_DEVICE_SUFFIX_FOR_WEBKIT_DEVELOPMENT);
</ins><span class="cx"> my $simulatedDeviceUDID = $simulatedDevice->{UDID};
</span><span class="cx">
</span><span class="cx"> my $willUseSystemInstalledApp = isIOSSimulatorSystemInstalledApp($appBundle);
</span><span class="lines">@@ -2296,10 +2449,10 @@
</span><span class="cx"> sub runIOSWebKitApp($)
</span><span class="cx"> {
</span><span class="cx"> my ($appBundle) = @_;
</span><del>- if (willUseIOSDeviceSDKWhenBuilding()) {
</del><ins>+ if (willUseIOSDeviceSDK()) {
</ins><span class="cx"> die "Only running Safari in iOS Simulator is supported now.";
</span><span class="cx"> }
</span><del>- if (willUseIOSSimulatorSDKWhenBuilding()) {
</del><ins>+ if (willUseIOSSimulatorSDK()) {
</ins><span class="cx"> return runIOSWebKitAppInSimulator($appBundle);
</span><span class="cx"> }
</span><span class="cx"> die "Not using an iOS SDK."
</span><span class="lines">@@ -2347,23 +2500,8 @@
</span><span class="cx"> setupMacWebKitEnvironment($productDir);
</span><span class="cx">
</span><span class="cx"> my @architectureFlags = ($architectureSwitch, architecture());
</span><del>- if (!shouldTargetWebProcess()) {
- print "Starting @{[basename($appPath)]} under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
- exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $appPath, argumentsForRunAndDebugMacWebKitApp() or die;
- } else {
- if (shouldUseXPCServiceForWebProcess()) {
- die "Targeting the Web Process is not compatible with using an XPC Service for the Web Process at this time.";
- }
-
- my $webProcessShimPath = File::Spec->catfile($productDir, "SecItemShim.dylib");
- my $webProcessPath = File::Spec->catdir($productDir, "WebProcess.app");
- my $webKit2ExecutablePath = File::Spec->catfile($productDir, "WebKit2.framework", "WebKit2");
-
- appendToEnvironmentVariableList("DYLD_INSERT_LIBRARIES", $webProcessShimPath);
-
- print "Starting WebProcess under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
- exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $webProcessPath, $webKit2ExecutablePath, "-type", "webprocess", "-client-executable", $appPath or die;
- }
</del><ins>+ print "Starting @{[basename($appPath)]} under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
+ exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $appPath, argumentsForRunAndDebugMacWebKitApp() or die;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub debugSafari
</span><span class="lines">@@ -2388,8 +2526,7 @@
</span><span class="cx">
</span><span class="cx"> if (isAppleWinWebKit()) {
</span><span class="cx"> my $result;
</span><del>- my $productDir = productDir();
- my $webKitLauncherPath = File::Spec->catfile(productDir(), "WinLauncher.exe");
</del><ins>+ my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
</ins><span class="cx"> return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2400,6 +2537,10 @@
</span><span class="cx"> {
</span><span class="cx"> if (isAppleMacWebKit()) {
</span><span class="cx"> return runMacWebKitApp(File::Spec->catfile(productDir(), "MiniBrowser.app", "Contents", "MacOS", "MiniBrowser"));
</span><ins>+ } elsif (isAppleWinWebKit()) {
+ my $result;
+ my $webKitLauncherPath = File::Spec->catfile(executableProductDir(), "MiniBrowser.exe");
+ return system { $webKitLauncherPath } $webKitLauncherPath, @ARGV;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return 1;
</span></span></pre>
</div>
</div>
</body>
</html>