diff options
Diffstat (limited to 'Tools/Scripts/build-webkit')
| -rwxr-xr-x | Tools/Scripts/build-webkit | 379 |
1 files changed, 22 insertions, 357 deletions
diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit index 7c8cac8e6..cba264b83 100755 --- a/Tools/Scripts/build-webkit +++ b/Tools/Scripts/build-webkit @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. # Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2010 moiji-mobile.com All rights reserved. # Copyright (C) 2011 Research In Motion Limited. All rights reserved. @@ -39,7 +39,7 @@ use FindBin; use Getopt::Long qw(:config pass_through); use lib $FindBin::Bin; use webkitdirs; -use webkitperl::features; +use webkitperl::FeatureList qw(getFeatureOptionList); use POSIX; sub cMakeArgsFromFeatures(); @@ -62,309 +62,10 @@ my $makeArgs = ""; my $cmakeArgs; my $onlyWebKitProject = 0; my $noWebKit2 = 0; +my $coverageSupport = 0; my $startTime = time(); -my ( - $requestAnimationFrameSupport, - $threeDCanvasSupport, - $threeDRenderingSupport, - $accelerated2dCanvasSupport, - $animationAPISupport, - $blobSupport, - $channelMessagingSupport, - $clientBasedGeolocationSupport, - $coverageSupport, - $cssFiltersSupport, - $cssGridLayoutSupport, - $cssShadersSupport, - $sqlDatabaseSupport, - $datalistSupport, - $dataTransferItemsSupport, - $detailsSupport, - $deviceOrientationSupport, - $directoryUploadSupport, - $downloadAttributeSupport, - $fileSystemSupport, - $filtersSupport, - $ftpDirSupport, - $fullscreenAPISupport, - $gamepadSupport, - $geolocationSupport, - $iconDatabaseSupport, - $imageResizerSupport, - $indexedDatabaseSupport, - $inputColorSupport, - $inputSpeechSupport, - $scriptedSpeechSupport, - $inputTypeDateSupport, - $inputTypeDatetimeSupport, - $inputTypeDatetimelocalSupport, - $inputTypeMonthSupport, - $inputTypeTimeSupport, - $inputTypeWeekSupport, - $javaScriptDebuggerSupport, - $legacyNotificationsSupport, - $linkPrefetchSupport, - $mathmlSupport, - $mediaSourceSupport, - $mediaStatisticsSupport, - $mediaStreamSupport, - $meterTagSupport, - $mhtmlSupport, - $microdataSupport, - $mutationObserversSupport, - $netscapePluginSupport, - $notificationsSupport, - $orientationEventsSupport, - $pageVisibilityApiSupport, - $progressTagSupport, - $quotaSupport, - $registerProtocolHandlerSupport, - $shadowDomSupport, - $sharedWorkersSupport, - $styleScopedSupport, - $svgSupport, - $svgDOMObjCBindingsSupport, - $svgFontsSupport, - $systemMallocSupport, - $tiledBackingStoreSupport, - $touchEventsSupport, - $touchIconLoadingSupport, - $vibrationSupport, - $videoSupport, - $videoTrackSupport, - $webAudioSupport, - $webInspectorSupport, - $webSocketsSupport, - $webTimingSupport, - $workersSupport, - $xsltSupport, - $wtfURL, -); - -my @features = ( - { option => "request-animation-frame", desc => "Toggle requestAnimationFrame support", - define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isBlackBerry()), value => \$requestAnimationFrameSupport }, - - { option => "download-attribute", desc => "Toggle download attribute support", - define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isBlackBerry(), value =>\$downloadAttributeSupport }, - - { option => "3d-canvas", desc => "Toggle 3D canvas (WebGL) support", - define => "ENABLE_WEBGL", default => (isAppleMacWebKit() && !isLeopard()), value => \$threeDCanvasSupport }, - - { option => "3d-rendering", desc => "Toggle 3D rendering support", - define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() || isQt()), value => \$threeDRenderingSupport }, - - { option => "accelerated-2d-canvas", desc => "Toggle accelerated 2D canvas support", - define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2dCanvasSupport }, - - { option => "animation-api", desc => "Toggle animation API support", - define => "ENABLE_ANIMATION_API", default => isBlackBerry(), value => \$animationAPISupport }, - - { option => "blob", desc => "Toggle Blob support", - define => "ENABLE_BLOB", default => (isAppleMacWebKit() || isGtk() || isChromium() || isBlackBerry()), value => \$blobSupport }, - - { option => "channel-messaging", desc => "Toggle MessageChannel and MessagePort support", - define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport }, - - { option => "client-based-geolocation", desc => "Toggle client-based Geolocation support", - define => "ENABLE_CLIENT_BASED_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$clientBasedGeolocationSupport }, - - { option => "css-filters", desc => "Toggle CSS Filters support", - define => "ENABLE_CSS_FILTERS", default => isAppleWebKit(), value => \$cssFiltersSupport }, - - { option => "css-grid-layout", desc => "Toggle CSS Grid Layout support", - define => "ENABLE_CSS_GRID_LAYOUT", default => 0, value => \$cssGridLayoutSupport }, - - { option => "css-shaders", desc => "Toggle CSS Shaders (within CSS Filters) support", - define => "ENABLE_CSS_SHADERS", default => isAppleWebKit(), value => \$cssShadersSupport }, - - { option => "coverage", desc => "Toggle code coverage support", - define => "", default => 0, value => \$coverageSupport }, - - { option => "sql-database", desc => "Toggle SQL Database Support", - define => "ENABLE_SQL_DATABASE", default => 1, value => \$sqlDatabaseSupport }, - - { option => "datalist", desc => "Toggle HTML5 datalist support", - define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport }, - - { option => "data-transfer-items", desc => "Toggle HTML5 data transfer items support", - define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport }, - - { option => "details", desc => "Toggle HTML5 details support", - define => "ENABLE_DETAILS", default => 1, value => \$detailsSupport }, - - { option => "device-orientation", desc => "Toggle DeviceOrientation support", - define => "ENABLE_DEVICE_ORIENTATION", default => isBlackBerry(), value => \$deviceOrientationSupport }, - - { option => "directory-upload", desc => "Toogle Directory upload support", - define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport }, - - { option => "file-system", desc => "Toggle FileSystem support", - define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport }, - - { option => "filters", desc => "Toggle SVG Filters support", - define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl() || isBlackBerry()), value => \$filtersSupport }, - - { option => "ftpdir", desc => "Toggle FTP directory support", - define => "ENABLE_FTPDIR", default => !isWinCE(), value => \$ftpDirSupport }, - - { option => "fullscreen-api", desc => "Toggle Fullscreen API support", - define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isGtk()), value => \$fullscreenAPISupport }, - - { option => "gamepad", desc => "Toggle Gamepad support", - define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport }, - - { option => "geolocation", desc => "Toggle Geolocation support", - define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$geolocationSupport }, - - { option => "icon-database", desc => "Toggle Icon database support", - define => "ENABLE_ICONDATABASE", default => 1, value => \$iconDatabaseSupport }, - - { option => "indexed-database", desc => "Toggle Indexed Database API support", - define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport }, - - { option => "input-color", desc => "Color Input support", - define => "ENABLE_INPUT_COLOR", default => isBlackBerry(), value => \$inputColorSupport }, - - { option => "input-speech", desc => "Speech Input API support", - define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport }, - - { option => "scripted-speech", desc => "Scripted Speech API support", - define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport }, - - { option => "input-type-date", desc => "Toggle date type <input> support", - define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport }, - - { option => "input-type-datetime", desc => "Toggle datetime type <input> support", - define => "ENABLE_INPUT_TYPE_DATETIME", default => 0, value => \$inputTypeDatetimeSupport }, - - { option => "input-type-datetimelocal", desc => "Toggle datetime-local type <input> support", - define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport }, - - { option => "input-type-month", desc => "Toggle month type <input> support", - define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport }, - - { option => "input-type-time", desc => "Toggle time type <input> support", - define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport }, - - { option => "input-type-week", desc => "Toggle week type <input> support", - define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport }, - - { option => "inspector", desc => "Toggle Web Inspector support", - define => "ENABLE_INSPECTOR", default => !isWinCE(), value => \$webInspectorSupport }, - - { option => "javascript-debugger", desc => "Toggle JavaScript Debugger/Profiler support", - define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javaScriptDebuggerSupport }, - - { option => "legacy-notifications", desc => "Toggle Legacy Desktop Notifications Support", - define => "ENABLE_LEGACY_NOTIFICATIONS", default => isBlackBerry(), value => \$legacyNotificationsSupport }, - - { option => "link-prefetch", desc => "Toggle pre fetching support", - define => "ENABLE_LINK_PREFETCH", default => 0, value => \$linkPrefetchSupport }, - - { option => "mathml", desc => "Toggle MathML support", - define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport }, - - { option => "media-source", desc => "Toggle Media Source support", - define => "ENABLE_MEDIA_SOURCE", default => 0, value => \$mediaSourceSupport }, - - { option => "media-statistics", desc => "Toggle Media Statistics support", - define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport }, - - { option => "media-stream", desc => "Toggle Media Stream API support (implies Blob support, currently Chromium and GTK only)", - define => "ENABLE_MEDIA_STREAM", default => (isChromium() || isGtk()), value => \$mediaStreamSupport }, - - { option => "meter-tag", desc => "Meter Tag support", - define => "ENABLE_METER_TAG", default => !isAppleWinWebKit(), value => \$meterTagSupport }, - - { option => "mhtml", desc => "Toggle MHTML support", - define => "ENABLE_MHTML", default => 0, value => \$mhtmlSupport }, - - { option => "microdata", desc => "Toggle Microdata support", - define => "ENABLE_MICRODATA", default => 0, value => \$microdataSupport }, - - { option => "mutation-observers", desc => "Toggle DOM mutation observer support", - define => "ENABLE_MUTATION_OBSERVERS", default => 1, value => \$mutationObserversSupport }, - - { option => "netscape-plugin", desc => "Netscape Plugin support", - define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isEfl(), value => \$netscapePluginSupport }, - - { option => "notifications", desc => "Toggle Desktop Notifications Support", - define => "ENABLE_NOTIFICATIONS", default => isBlackBerry(), value => \$notificationsSupport }, - - { option => "orientation-events", desc => "Toggle Orientation Events support", - define => "ENABLE_ORIENTATION_EVENTS", default => isBlackBerry(), value => \$orientationEventsSupport }, - - { option => "page-visibility-api", desc => "Page Visibility API support", - define => "ENABLE_PAGE_VISIBILITY_API", default => isEfl(), value => \$pageVisibilityApiSupport }, - - { option => "progress-tag", desc => "Progress Tag support", - define => "ENABLE_PROGRESS_TAG", default => 1, value => \$progressTagSupport }, - - { option => "quota", desc => "Toggle Quota support", - define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport }, - - { option => "register-protocol-handler", desc => "Register Protocol Handler support", - define => "ENABLE_REGISTER_PROTOCOL_HANDLER", default => 0, value => \$registerProtocolHandlerSupport }, - - { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc", - define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport }, - - { option => "shadow-dom", desc => "Toggle Shadow DOM support", - define => "ENABLE_SHADOW_DOM", default => 0, value => \$shadowDomSupport }, - - { option => "shared-workers", desc => "Toggle SharedWorkers support", - define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$sharedWorkersSupport }, - - { option => "style-scoped", desc => "Toggle <style scoped> support", - define => "ENABLE_STYLE_SCOPED", default => 0, value => \$styleScopedSupport }, - - { option => "svg", desc => "Toggle SVG support", - define => "ENABLE_SVG", default => 1, value => \$svgSupport }, - - { option => "svg-dom-objc-bindings", desc => "Toggle SVG DOM Objective-C bindings support (implies SVG support)", - define => "ENABLE_SVG_DOM_OBJC_BINDINGS", default => isAppleMacWebKit(), value => \$svgDOMObjCBindingsSupport }, - - { option => "svg-fonts", desc => "Toggle SVG fonts support (imples SVG support)", - define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport }, - - { option => "tiled-backing-store", desc => "Toggle Tiled Backing Store support", - define => "WTF_USE_TILED_BACKING_STORE", default => isQt(), value => \$tiledBackingStoreSupport }, - - { option => "touch-events", desc => "Toggle Touch Events support", - define => "ENABLE_TOUCH_EVENTS", default => (isQt() || isBlackBerry()), value => \$touchEventsSupport }, - - { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support", - define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport }, - - { option => "vibration", desc => "Toggle Vibration API support", - define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport }, - - { option => "video", desc => "Toggle Video support", - define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$videoSupport }, - - { option => "video-track", desc => "Toggle Video Track support", - define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk()), value => \$videoTrackSupport }, - - { option => "web-audio", desc => "Toggle Web Audio support", - define => "ENABLE_WEB_AUDIO", default => 0, value=> \$webAudioSupport }, - - { option => "web-sockets", desc => "Toggle Web Sockets support", - define => "ENABLE_WEB_SOCKETS", default => 1, value=> \$webSocketsSupport }, - - { option => "web-timing", desc => "Toggle Web Timing support", - define => "ENABLE_WEB_TIMING", default => 0, value=> \$webTimingSupport }, - - { option => "workers", desc => "Toggle Web Workers support", - define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$workersSupport }, - - { option => "wtfurl", desc => "Toogle the use of WTFURL for URL parsing", - define => "WTF_USE_WTFURL", default => 0, value => \$wtfURL }, - - { option => "xslt", desc => "Toggle XSLT support", - define => "ENABLE_XSLT", default => 1, value => \$xsltSupport }, -); +my @features = getFeatureOptionList(); # Update defaults from Qt's project file if (isQt()) { @@ -405,10 +106,6 @@ foreach (@features) { ${$_->{value}} = ($minimal ? 0 : $_->{default}); } -$svgSupport = $svgSupport || $svgDOMObjCBindingsSupport || $svgFontsSupport; - -$blobSupport = $blobSupport || $mediaStreamSupport; - my $programName = basename($0); my $usage = <<EOF; Usage: $programName [options] [options to pass to build system] @@ -416,7 +113,7 @@ Usage: $programName [options] [options to pass to build system] --clean Cleanup the build directory --debug Compile in debug mode --gyp Use GYP-generated project files - --dsym Change debugging format to dwarf-with-dsym (Mac only) + --coverage Enable Code Coverage support (Mac only) --blackberry Build the BlackBerry port on Mac/Linux --chromium Build the Chromium port on Mac/Win/Linux @@ -458,6 +155,7 @@ my %options = ( 'v8' => \$v8, 'only-webkit' => \$onlyWebKitProject, 'no-webkit2' => \$noWebKit2, + 'coverage' => \$coverageSupport, ); # Build usage text and options list from features @@ -496,7 +194,7 @@ sub unlinkZeroFiles() my @projects = ("Source/JavaScriptCore", "Source/WebCore", "Source/WebKit"); # Build WTF as a separate static library on ports which support it. -splice @projects, 0, 0, "Source/WTF" if isAppleMacWebKit(); +splice @projects, 0, 0, "Source/WTF" if isAppleMacWebKit() or isAppleWinWebKit(); for my $dir (@projects) { if (! -d $dir) { @@ -536,10 +234,8 @@ if (isGtk()) { } foreach (@features) { - if ($_->{option} ne "coverage" && $_->{option} ne "wtfurl") { - my $option = option($_->{define}, ${$_->{value}}, $_->{default}); - push @options, $option unless $option eq ""; - } + my $option = option($_->{define}, ${$_->{value}}, $_->{default}); + push @options, $option unless $option eq ""; } # ANGLE must come before WebCore @@ -549,37 +245,7 @@ if (isGtk()) { push @projects, ("Source/WebKit2", "Tools/MiniBrowser") if osXVersion()->{"minor"} >= 6 and !$noWebKit2; # Copy library and header from WebKitLibraries to a findable place in the product directory. - my @librariesToCopy = ( - "libWebKitSystemInterfaceLeopard.a", - "libWebKitSystemInterfaceSnowLeopard.a", - "libWebKitSystemInterfaceLion.a", - "libWebCoreSQLite3.a", - ); - foreach my $libName (@librariesToCopy) { - my $srcLib = "WebKitLibraries/" . $libName; - my $lib = "$productDir/" . $libName; - if (!-e $lib || -M $lib > -M $srcLib) { - print "Updating $lib\n"; - system "ditto", $srcLib, $lib; - system "ranlib", $lib; - } - } - - # FIXME: This code should be abstracted to not be copy/paste. - my $srcHeader = "WebKitLibraries/WebKitSystemInterface.h"; - my $header = "$productDir/usr/local/include/WebKitSystemInterface.h"; - if (!-e $header || -M $header > -M $srcHeader) { - print "Updating $header\n"; - system "mkdir", "-p", "$productDir/usr/local/include"; - system "ditto", $srcHeader, $header; - } - - my $srcHeaderDir = "WebKitLibraries/WebCoreSQLite3"; - my $headerDir = "$productDir/WebCoreSQLite3"; - if (!-e $headerDir || -M $headerDir > -M $srcHeaderDir) { - print "Updating $headerDir\n"; - system "ditto", $srcHeaderDir, $headerDir; - } + (system("perl Tools/Scripts/copy-webkitlibraries-to-product-directory") == 0) or die; } elsif (isWinCairo()) { (system("perl Tools/Scripts/update-webkit-wincairo-libs") == 0) or die; } elsif (isAppleWinWebKit()) { @@ -593,7 +259,7 @@ if (isGtk()) { push @options, "--qmakearg=CONFIG+=no_webkit2" if $noWebKit2; if (checkForArgumentAndRemoveFromARGV("-2")) { - print "Note: WebKit2 is now built by default, you don't need to passs -2. Disable using --no-webkit2\n"; + print "Note: WebKit2 is now built by default, you don't need to pass -2. Disable using --no-webkit2\n"; } @options = (@ARGV, @options); @@ -602,12 +268,11 @@ if (isGtk()) { push @options, "DEFINES+=$_->{define}=${$_->{value}}" if $_->{define} && ${$_->{value}} != $_->{default}; } - if ($minimal) { - push @options, "CONFIG+=minimal"; - } - if ($v8) { - push @options, "CONFIG+=v8"; + print "Building WebKit2 with v8 is not supported currently. Disabling WebKit2.\n"; + # FIXME: Deal with this in defaults_pre, once Qt has support for getting at the + # command line arguments at that stage. + push @options, "CONFIG+=v8 CONFIG+=no_webkit2"; } } @@ -616,9 +281,6 @@ if (isGtk()) { # build options, etc. @projects = ("Source/WebKit") if $onlyWebKitProject; -# Force re-link of existing libraries if different than expected -removeLibraryDependingOnFeature("WebCore", "SVG", $svgSupport); - if (isInspectorFrontend()) { exit exitStatus(copyInspectorFrontendFiles()); } @@ -678,7 +340,7 @@ if (isBlackBerry()) { } $makeArgs .= ($makeArgs ? " " : "") . "-j" . $numberOfJobs if $makeArgs !~ /-j\s*\d+/; $prefixPath = $ENV{"STAGE_DIR"} unless $prefixPath; - buildCMakeProjectOrExit($clean, "BlackBerry", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures())); + buildCMakeProjectOrExit($clean, "BlackBerry", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs); } if (isQt()) { @@ -700,14 +362,13 @@ for my $dir (@projects) { my $project = basename($dir); if (isGtk()) { - if (!$noWebKit2) { - unshift(@options, "--enable-webkit2"); + if ($noWebKit2) { + unshift(@options, "--disable-webkit2"); } $result = buildGtkProject($project, $clean, @options); } elsif (isAppleMacWebKit()) { my @local_options = @options; push @local_options, XcodeCoverageSupportOptions() if $coverageSupport && $project ne "ANGLE"; - push @local_options, "OTHER_CFLAGS= \$(OTHER_CFLAGS) -DWTF_USE_WTFURL=1" if $wtfURL; my $useGYPProject = $useGYP && ($project =~ "WebCore|JavaScriptCore"); my $projectPath = $useGYPProject ? "gyp/$project" : $project; $result = buildXCodeProject($projectPath, $clean, @local_options, @ARGV); @@ -742,6 +403,10 @@ exit if $clean; # Don't report congrats message if build was interrupted by the user. exit if ($result & 127) == SIGINT; +# Explicitly chdir back to where exit will take us anyway, since the following "launcher" +# message is relative to that directory. +chdir $originalWorkingDirectory; + # Write out congratulations message. writeCongrats(); |
