Title: [137270] trunk
Revision
137270
Author
[email protected]
Date
2012-12-11 01:37:28 -0800 (Tue, 11 Dec 2012)

Log Message

[GTK] Feature enabling/disabling should be possible through build-webkit
https://bugs.webkit.org/show_bug.cgi?id=99271

Reviewed by Gustavo Noronha Silva.

.: 

The autogen.sh script now calls the Tools/gtk/override-feature-defines script
before calling autoreconf. This ensures that Source/WebCore/GNUmakefile.features.am
is present and properly modified if the build-webkit script intends to override
any feature.

The Source/WebCore/GNUmakefile.features.am file is added to the ignored files list
so it doesn't pop out as a new, untracked file.

* .gitignore:
* autogen.sh:

Source/WebCore: 

Move the contents of GNUmakefile.features.am into GNUmakefile.features.am.in.
The former is then copied from the latter but then appropriately modified if
the build-webkit script overrides any of the default feature defines.

No new tests - no new testable functionality.

* GNUmakefile.features.am.in: Renamed from Source/WebCore/GNUmakefile.features.am.

Tools: 

Refactor the code in webkitdirs.pm that builds an autotools project to generate
autogen.sh arguments, make arguments and installation prefix from the passed-in
parameters rather than generating all of that in build-webkit. The autogen.sh
arguments now contain only enable/disable flags for options that are actually
configurable in configure.ac, the flag value actually reflecting whether the feature
is enabled or disabled in the feature list.

Other features are overridable through modifying the GNUmakefile.features.am file.
All these features are now stored in the build directory and upon change trigger
a rerun of the autogen.sh script, pretty much like the autogen.sh arguments do.

The override-feature-defines script is called by autogen.sh, before GNUmakefile.in is
generated when calling autoreconf. Its task is to copy the GNUmakefile.features.am.in
into GNUmakefile.features.am and modify it if there's a text file in the build directory
that contains all the feature defines the build-webkit script has written. If the build
is not done through build-webkit (and there's no file in build directory listing all the
feature defines) the script does not advance further from copying.

This approach is taken to overcome the rigidness of the automake system as it's impossible
to effectively generate and use GNUmakefile.features.am or even GNUmakefile.features file
after the autoreconf command execution in autogen.sh.

* Scripts/build-jsc:
(buildMyProject):
* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(runAutogenForAutotoolsProjectIfNecessary):
(mustReRunAutogen):
(buildAutotoolsProject):
(buildGtkProject):
* Scripts/webkitperl/FeatureList.pm: Update the features that are currently enabled in
Source/WebCore/GNUmakefile.features.am.in but aren't in the feature list.
* Scripts/webkitpy/style/checker.py: Source/WebCore/GNUmakefile.features.am.in is recognized
as a text file and tabulation errors are reported. Skip the file to suppress them.
* gtk/override-feature-defines: Added.
(copy_feature_defines_makefile):
(adjust_feature_defines_makefile):
(adjust_feature_defines_makefile.override_feature_define):
(override_feature_defines):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/.gitignore (137269 => 137270)


--- trunk/.gitignore	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/.gitignore	2012-12-11 09:37:28 UTC (rev 137270)
@@ -47,6 +47,7 @@
 /Source/autotools/ltversion.m4
 /Source/autotools/lt~obsolete.m4
 /Source/autotools/missing
+/Source/WebCore/GNUmakefile.features.am
 /Source/WebKit/gtk/docs/GNUmakefile.in
 /Source/WebKit/gtk/po/*.pot
 /autotoolsconfig.h.in

Modified: trunk/ChangeLog (137269 => 137270)


--- trunk/ChangeLog	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/ChangeLog	2012-12-11 09:37:28 UTC (rev 137270)
@@ -1,3 +1,21 @@
+2012-12-11  Zan Dobersek  <[email protected]>
+
+        [GTK] Feature enabling/disabling should be possible through build-webkit
+        https://bugs.webkit.org/show_bug.cgi?id=99271
+
+        Reviewed by Gustavo Noronha Silva.
+
+        The autogen.sh script now calls the Tools/gtk/override-feature-defines script
+        before calling autoreconf. This ensures that Source/WebCore/GNUmakefile.features.am
+        is present and properly modified if the build-webkit script intends to override
+        any feature.
+
+        The Source/WebCore/GNUmakefile.features.am file is added to the ignored files list
+        so it doesn't pop out as a new, untracked file.
+
+        * .gitignore:
+        * autogen.sh:
+
 2012-12-10  Martin Robinson  <[email protected]>
 
         [GTK] Remove the Pango backend

Modified: trunk/Source/WebCore/ChangeLog (137269 => 137270)


--- trunk/Source/WebCore/ChangeLog	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Source/WebCore/ChangeLog	2012-12-11 09:37:28 UTC (rev 137270)
@@ -1,3 +1,18 @@
+2012-12-11  Zan Dobersek  <[email protected]>
+
+        [GTK] Feature enabling/disabling should be possible through build-webkit
+        https://bugs.webkit.org/show_bug.cgi?id=99271
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Move the contents of GNUmakefile.features.am into GNUmakefile.features.am.in.
+        The former is then copied from the latter but then appropriately modified if
+        the build-webkit script overrides any of the default feature defines.
+
+        No new tests - no new testable functionality.
+
+        * GNUmakefile.features.am.in: Renamed from Source/WebCore/GNUmakefile.features.am.
+
 2012-12-11  Jinwoo Song  <[email protected]>
 
         [QT][EFL][WK2] Move the GraphicsSurfaceGLX.cpp to common place

Deleted: trunk/Source/WebCore/GNUmakefile.features.am (137269 => 137270)


--- trunk/Source/WebCore/GNUmakefile.features.am	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Source/WebCore/GNUmakefile.features.am	2012-12-11 09:37:28 UTC (rev 137270)
@@ -1,102 +0,0 @@
-feature_defines_defaults += \
-	ENABLE_3D_RENDERING=0 \
-	ENABLE_ACCELERATED_2D_CANVAS=0 \
-	ENABLE_ANIMATION_API=0 \
-	ENABLE_BATTERY_STATUS=0 \
-	ENABLE_BLOB=1 \
-	ENABLE_CHANNEL_MESSAGING=1 \
-	ENABLE_CSP_NEXT=1 \
-	ENABLE_CSS3_TEXT=1 \
-	ENABLE_CSS_BOX_DECORATION_BREAK=1 \
-	ENABLE_CSS_COMPOSITING=0 \
-	ENABLE_CSS_DEVICE_ADAPTATION=0 \
-	ENABLE_CSS_EXCLUSIONS=1 \
-	ENABLE_CSS_FILTERS=0 \
-	ENABLE_CSS_IMAGE_ORIENTATION=0 \
-	ENABLE_CSS_IMAGE_RESOLUTION=0 \
-	ENABLE_CSS_REGIONS=1 \
-	ENABLE_CSS_SHADERS=0 \
-	ENABLE_CSS_STICKY_POSITION=1 \
-	ENABLE_CSS_VARIABLES=0 \
-	ENABLE_CSS3_CONDITIONAL_RULES=0 \
-	ENABLE_CUSTOM_SCHEME_HANDLER=0 \
-	ENABLE_DASHBOARD_SUPPORT=0 \
-	ENABLE_DATALIST_ELEMENT=0 \
-	ENABLE_DATA_TRANSFER_ITEMS=0 \
-	ENABLE_DETAILS_ELEMENT=1 \
-	ENABLE_DEVICE_ORIENTATION=0 \
-	ENABLE_DIALOG_ELEMENT=0 \
-	ENABLE_DIRECTORY_UPLOAD=0 \
-	ENABLE_DOWNLOAD_ATTRIBUTE=0 \
-	ENABLE_FILE_SYSTEM=0 \
-	ENABLE_FILTERS=1 \
-	ENABLE_FTPDIR=0 \
-	ENABLE_FULLSCREEN_API=1 \
-	ENABLE_GAMEPAD=1 \
-	ENABLE_GEOLOCATION=1 \
-	ENABLE_HIGH_DPI_CANVAS=0 \
-	ENABLE_ICONDATABASE=1 \
-	ENABLE_IFRAME_SEAMLESS=1 \
-	ENABLE_INDEXED_DATABASE=0 \
-	ENABLE_INPUT_SPEECH=0 \
-	ENABLE_INPUT_TYPE_COLOR=0 \
-	ENABLE_INPUT_TYPE_DATE=0 \
-	ENABLE_INPUT_TYPE_DATETIME=0 \
-	ENABLE_INPUT_TYPE_DATETIMELOCAL=0 \
-	ENABLE_INPUT_TYPE_MONTH=0 \
-	ENABLE_INPUT_TYPE_TIME=0 \
-	ENABLE_INPUT_TYPE_WEEK=0 \
-	ENABLE_INSPECTOR=1 \
-	ENABLE_JAVASCRIPT_DEBUGGER=1 \
-	ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0 \
-	ENABLE_LEGACY_NOTIFICATIONS=0 \
-	ENABLE_LEGACY_VENDOR_PREFIXES=1 \
-	ENABLE_LEGACY_WEB_AUDIO=1 \
-	ENABLE_LINK_PREFETCH=1 \
-	ENABLE_LINK_PRERENDER=0 \
-	ENABLE_MATHML=1 \
-	ENABLE_MEDIA_CAPTURE=0 \
-	ENABLE_MEDIA_SOURCE=0 \
-	ENABLE_MEDIA_STATISTICS=0 \
-	ENABLE_MEDIA_STREAM=1 \
-	ENABLE_METER_ELEMENT=1 \
-	ENABLE_MHTML=1 \
-	ENABLE_MICRODATA=1 \
-	ENABLE_MOUSE_CURSOR_SCALE=0 \
-	ENABLE_MUTATION_OBSERVERS=1 \
-	ENABLE_NAVIGATOR_CONTENT_UTILS=0 \
-	ENABLE_NETSCAPE_PLUGIN_API=1 \
-	ENABLE_NETWORK_INFO=0 \
-	ENABLE_NOTIFICATIONS=0 \
-	ENABLE_ORIENTATION_EVENTS=0 \
-	ENABLE_PAGE_VISIBILITY_API=0 \
-	ENABLE_PROGRESS_ELEMENT=1 \
-	ENABLE_PROXIMITY_EVENTS=0 \
-	ENABLE_QUOTA=0 \
-	ENABLE_REQUEST_ANIMATION_FRAME=1 \
-	ENABLE_SCRIPTED_SPEECH=0 \
-	ENABLE_SHADOW_DOM=1 \
-	ENABLE_SHARED_WORKERS=1 \
-	ENABLE_SMOOTH_SCROLLING=1 \
-	ENABLE_SPELLCHECK=1 \
-	ENABLE_SQL_DATABASE=1 \
-	ENABLE_STYLE_SCOPED=1 \
-	ENABLE_SVG=1 \
-	ENABLE_SVG_DOM_OBJC_BINDINGS=0 \
-	ENABLE_SVG_FONTS=1 \
-	ENABLE_TEMPLATE_ELEMENT=0 \
-	ENABLE_TEXT_AUTOSIZING=0 \
-	ENABLE_TOUCH_EVENTS=0 \
-	ENABLE_TOUCH_ICON_LOADING=0 \
-	ENABLE_VIBRATION=0 \
-	ENABLE_VIDEO=1 \
-	ENABLE_VIDEO_TRACK=1 \
-	ENABLE_WEBGL=1 \
-	ENABLE_WEB_AUDIO=0 \
-	ENABLE_WEB_INTENTS=0 \
-	ENABLE_WEB_INTENTS_TAG=0 \
-	ENABLE_WEB_SOCKETS=1 \
-	ENABLE_WEB_TIMING=1 \
-	ENABLE_WORKERS=1 \
-	ENABLE_XHR_TIMEOUT=1 \
-	ENABLE_XSLT=1

Added: trunk/Source/WebCore/GNUmakefile.features.am.in (0 => 137270)


--- trunk/Source/WebCore/GNUmakefile.features.am.in	                        (rev 0)
+++ trunk/Source/WebCore/GNUmakefile.features.am.in	2012-12-11 09:37:28 UTC (rev 137270)
@@ -0,0 +1,102 @@
+feature_defines_defaults += \
+	ENABLE_3D_RENDERING=0 \
+	ENABLE_ACCELERATED_2D_CANVAS=0 \
+	ENABLE_ANIMATION_API=0 \
+	ENABLE_BATTERY_STATUS=0 \
+	ENABLE_BLOB=1 \
+	ENABLE_CHANNEL_MESSAGING=1 \
+	ENABLE_CSP_NEXT=1 \
+	ENABLE_CSS3_TEXT=1 \
+	ENABLE_CSS_BOX_DECORATION_BREAK=1 \
+	ENABLE_CSS_COMPOSITING=0 \
+	ENABLE_CSS_DEVICE_ADAPTATION=0 \
+	ENABLE_CSS_EXCLUSIONS=1 \
+	ENABLE_CSS_FILTERS=0 \
+	ENABLE_CSS_IMAGE_ORIENTATION=0 \
+	ENABLE_CSS_IMAGE_RESOLUTION=0 \
+	ENABLE_CSS_REGIONS=1 \
+	ENABLE_CSS_SHADERS=0 \
+	ENABLE_CSS_STICKY_POSITION=1 \
+	ENABLE_CSS_VARIABLES=0 \
+	ENABLE_CSS3_CONDITIONAL_RULES=0 \
+	ENABLE_CUSTOM_SCHEME_HANDLER=0 \
+	ENABLE_DASHBOARD_SUPPORT=0 \
+	ENABLE_DATALIST_ELEMENT=0 \
+	ENABLE_DATA_TRANSFER_ITEMS=0 \
+	ENABLE_DETAILS_ELEMENT=1 \
+	ENABLE_DEVICE_ORIENTATION=0 \
+	ENABLE_DIALOG_ELEMENT=0 \
+	ENABLE_DIRECTORY_UPLOAD=0 \
+	ENABLE_DOWNLOAD_ATTRIBUTE=0 \
+	ENABLE_FILE_SYSTEM=0 \
+	ENABLE_FILTERS=1 \
+	ENABLE_FTPDIR=0 \
+	ENABLE_FULLSCREEN_API=1 \
+	ENABLE_GAMEPAD=1 \
+	ENABLE_GEOLOCATION=1 \
+	ENABLE_HIGH_DPI_CANVAS=0 \
+	ENABLE_ICONDATABASE=1 \
+	ENABLE_IFRAME_SEAMLESS=1 \
+	ENABLE_INDEXED_DATABASE=0 \
+	ENABLE_INPUT_SPEECH=0 \
+	ENABLE_INPUT_TYPE_COLOR=0 \
+	ENABLE_INPUT_TYPE_DATE=0 \
+	ENABLE_INPUT_TYPE_DATETIME=0 \
+	ENABLE_INPUT_TYPE_DATETIMELOCAL=0 \
+	ENABLE_INPUT_TYPE_MONTH=0 \
+	ENABLE_INPUT_TYPE_TIME=0 \
+	ENABLE_INPUT_TYPE_WEEK=0 \
+	ENABLE_INSPECTOR=1 \
+	ENABLE_JAVASCRIPT_DEBUGGER=1 \
+	ENABLE_LEGACY_CSS_VENDOR_PREFIXES=0 \
+	ENABLE_LEGACY_NOTIFICATIONS=0 \
+	ENABLE_LEGACY_VENDOR_PREFIXES=1 \
+	ENABLE_LEGACY_WEB_AUDIO=1 \
+	ENABLE_LINK_PREFETCH=1 \
+	ENABLE_LINK_PRERENDER=0 \
+	ENABLE_MATHML=1 \
+	ENABLE_MEDIA_CAPTURE=0 \
+	ENABLE_MEDIA_SOURCE=0 \
+	ENABLE_MEDIA_STATISTICS=0 \
+	ENABLE_MEDIA_STREAM=1 \
+	ENABLE_METER_ELEMENT=1 \
+	ENABLE_MHTML=1 \
+	ENABLE_MICRODATA=1 \
+	ENABLE_MOUSE_CURSOR_SCALE=0 \
+	ENABLE_MUTATION_OBSERVERS=1 \
+	ENABLE_NAVIGATOR_CONTENT_UTILS=0 \
+	ENABLE_NETSCAPE_PLUGIN_API=1 \
+	ENABLE_NETWORK_INFO=0 \
+	ENABLE_NOTIFICATIONS=0 \
+	ENABLE_ORIENTATION_EVENTS=0 \
+	ENABLE_PAGE_VISIBILITY_API=0 \
+	ENABLE_PROGRESS_ELEMENT=1 \
+	ENABLE_PROXIMITY_EVENTS=0 \
+	ENABLE_QUOTA=0 \
+	ENABLE_REQUEST_ANIMATION_FRAME=1 \
+	ENABLE_SCRIPTED_SPEECH=0 \
+	ENABLE_SHADOW_DOM=1 \
+	ENABLE_SHARED_WORKERS=1 \
+	ENABLE_SMOOTH_SCROLLING=1 \
+	ENABLE_SPELLCHECK=1 \
+	ENABLE_SQL_DATABASE=1 \
+	ENABLE_STYLE_SCOPED=1 \
+	ENABLE_SVG=1 \
+	ENABLE_SVG_DOM_OBJC_BINDINGS=0 \
+	ENABLE_SVG_FONTS=1 \
+	ENABLE_TEMPLATE_ELEMENT=0 \
+	ENABLE_TEXT_AUTOSIZING=0 \
+	ENABLE_TOUCH_EVENTS=0 \
+	ENABLE_TOUCH_ICON_LOADING=0 \
+	ENABLE_VIBRATION=0 \
+	ENABLE_VIDEO=1 \
+	ENABLE_VIDEO_TRACK=1 \
+	ENABLE_WEBGL=1 \
+	ENABLE_WEB_AUDIO=0 \
+	ENABLE_WEB_INTENTS=0 \
+	ENABLE_WEB_INTENTS_TAG=0 \
+	ENABLE_WEB_SOCKETS=1 \
+	ENABLE_WEB_TIMING=1 \
+	ENABLE_WORKERS=1 \
+	ENABLE_XHR_TIMEOUT=1 \
+	ENABLE_XSLT=1

Modified: trunk/Tools/ChangeLog (137269 => 137270)


--- trunk/Tools/ChangeLog	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/ChangeLog	2012-12-11 09:37:28 UTC (rev 137270)
@@ -1,3 +1,50 @@
+2012-12-11  Zan Dobersek  <[email protected]>
+
+        [GTK] Feature enabling/disabling should be possible through build-webkit
+        https://bugs.webkit.org/show_bug.cgi?id=99271
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Refactor the code in webkitdirs.pm that builds an autotools project to generate
+        autogen.sh arguments, make arguments and installation prefix from the passed-in
+        parameters rather than generating all of that in build-webkit. The autogen.sh
+        arguments now contain only enable/disable flags for options that are actually
+        configurable in configure.ac, the flag value actually reflecting whether the feature
+        is enabled or disabled in the feature list.
+
+        Other features are overridable through modifying the GNUmakefile.features.am file.
+        All these features are now stored in the build directory and upon change trigger
+        a rerun of the autogen.sh script, pretty much like the autogen.sh arguments do.
+
+        The override-feature-defines script is called by autogen.sh, before GNUmakefile.in is
+        generated when calling autoreconf. Its task is to copy the GNUmakefile.features.am.in
+        into GNUmakefile.features.am and modify it if there's a text file in the build directory
+        that contains all the feature defines the build-webkit script has written. If the build
+        is not done through build-webkit (and there's no file in build directory listing all the
+        feature defines) the script does not advance further from copying.
+
+        This approach is taken to overcome the rigidness of the automake system as it's impossible
+        to effectively generate and use GNUmakefile.features.am or even GNUmakefile.features file
+        after the autoreconf command execution in autogen.sh.
+
+        * Scripts/build-jsc:
+        (buildMyProject):
+        * Scripts/build-webkit:
+        * Scripts/webkitdirs.pm:
+        (runAutogenForAutotoolsProjectIfNecessary):
+        (mustReRunAutogen):
+        (buildAutotoolsProject):
+        (buildGtkProject):
+        * Scripts/webkitperl/FeatureList.pm: Update the features that are currently enabled in
+        Source/WebCore/GNUmakefile.features.am.in but aren't in the feature list.
+        * Scripts/webkitpy/style/checker.py: Source/WebCore/GNUmakefile.features.am.in is recognized
+        as a text file and tabulation errors are reported. Skip the file to suppress them.
+        * gtk/override-feature-defines: Added.
+        (copy_feature_defines_makefile):
+        (adjust_feature_defines_makefile):
+        (adjust_feature_defines_makefile.override_feature_define):
+        (override_feature_defines):
+
 2012-12-10  Yury Semikhatsky  <[email protected]>
 
         Memory instrumentation: make sure each edge is reported only once

Modified: trunk/Tools/Scripts/build-jsc (137269 => 137270)


--- trunk/Tools/Scripts/build-jsc	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/Scripts/build-jsc	2012-12-11 09:37:28 UTC (rev 137270)
@@ -85,7 +85,7 @@
         $result = buildVisualStudioProject("$projectName.vcproj/$projectName.sln");
     } elsif (isGtk()) {
         checkForArgumentAndRemoveFromARGV("--gtk");
-        $result = buildGtkProject($projectName, 0, @ARGV);
+        $result = buildGtkProject($projectName, 0);
     } elsif (isWx()) {
         # Builds everything in one-shot. No need to build anything here.
         $result = 0;

Modified: trunk/Tools/Scripts/build-webkit (137269 => 137270)


--- trunk/Tools/Scripts/build-webkit	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/Scripts/build-webkit	2012-12-11 09:37:28 UTC (rev 137270)
@@ -209,16 +209,7 @@
 
 my @options = ();
 
-# enable autotool options accordingly
-if (isGtk()) {
-    @options = @ARGV;
-    foreach (@features) {
-        push @options, autotoolsFlag(${$_->{value}}, $_->{option});
-    }
-
-    push @options, "--prefix=" . $prefixPath if defined($prefixPath);
-    push @options, "--makeargs=" . $makeArgs if $makeArgs;
-} elsif (isAppleMacWebKit()) {
+if (isAppleMacWebKit()) {
     push @options, XcodeOptions();
 
     sub option($$$)
@@ -363,10 +354,7 @@
 
     my $project = basename($dir);
     if (isGtk()) {
-        if ($noWebKit2) {
-            unshift(@options, "--disable-webkit2");
-        }
-        $result = buildGtkProject($project, $clean, @options);
+        $result = buildGtkProject($project, $clean, $prefixPath, $makeArgs, $noWebKit2, @features);
     } elsif (isAppleMacWebKit()) {
         my @local_options = @options;
         push @local_options, XcodeCoverageSupportOptions() if $coverageSupport && $project ne "ANGLE";

Modified: trunk/Tools/Scripts/webkitdirs.pm (137269 => 137270)


--- trunk/Tools/Scripts/webkitdirs.pm	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/Scripts/webkitdirs.pm	2012-12-11 09:37:28 UTC (rev 137270)
@@ -1906,9 +1906,10 @@
 
 sub runAutogenForAutotoolsProjectIfNecessary($@)
 {
-    my ($dir, $prefix, $sourceDir, $project, @buildArgs) = @_;
+    my ($dir, $prefix, $sourceDir, $project, $joinedOverridableFeatures, @buildArgs) = @_;
 
-    my $argumentsFile = "previous-autogen-arguments.txt";
+    my $joinedBuildArgs = join(" ", @buildArgs);
+
     if (-e "GNUmakefile") {
         # Just assume that build-jsc will never be used to reconfigure JSC. Later
         # we can go back and make this more complicated if the demand is there.
@@ -1916,8 +1917,9 @@
             return;
         }
 
-        # We only run autogen.sh again if the arguments passed have changed.
-        if (!mustReRunAutogen($sourceDir, $argumentsFile, @buildArgs)) {
+        # Run autogen.sh again if either the features overrided by build-webkit or build arguments have changed.
+        if (!mustReRunAutogen($sourceDir, "feature-defines-overriding.txt", $joinedOverridableFeatures)
+            && !mustReRunAutogen($sourceDir, "previous-autogen-arguments.txt", $joinedBuildArgs)) {
             return;
         }
     }
@@ -1928,8 +1930,12 @@
     # Only for WebKit, write the autogen.sh arguments to a file so that we can detect
     # when they change and automatically re-run it.
     if ($project eq 'WebKit') {
-        open(AUTOTOOLS_ARGUMENTS, ">$argumentsFile");
-        print AUTOTOOLS_ARGUMENTS join(" ", @buildArgs);
+        open(OVERRIDABLE_FEATURES, ">feature-defines-overriding.txt");
+        print OVERRIDABLE_FEATURES $joinedOverridableFeatures;
+        close(OVERRIDABLE_FEATURES);
+
+        open(AUTOTOOLS_ARGUMENTS, ">previous-autogen-arguments.txt");
+        print AUTOTOOLS_ARGUMENTS $joinedBuildArgs;
         close(AUTOTOOLS_ARGUMENTS);
     }
 
@@ -1963,24 +1969,24 @@
 
 sub mustReRunAutogen($@)
 {
-    my ($sourceDir, $filename, @currentArguments) = @_;
+    my ($sourceDir, $filename, $currentContents) = @_;
 
     if (! -e $filename) {
         return 1;
     }
 
-    open(AUTOTOOLS_ARGUMENTS, $filename);
-    chomp(my $previousArguments = <AUTOTOOLS_ARGUMENTS>);
-    close(AUTOTOOLS_ARGUMENTS);
+    open(CONTENTS_FILE, $filename);
+    chomp(my $previousContents = <CONTENTS_FILE>);
+    close(CONTENTS_FILE);
 
     # We only care about the WebKit2 argument when we are building WebKit itself.
     # build-jsc never passes --enable-webkit2, so if we didn't do this, autogen.sh
     # would run for every single build on the bots, since it runs both build-webkit
     # and build-jsc.
-    my $joinedCurrentArguments = join(" ", @currentArguments);
-    if ($previousArguments ne $joinedCurrentArguments) {
-        print "Previous autogen arguments were: $previousArguments\n\n";
-        print "New autogen arguments are: $joinedCurrentArguments\n";
+    if ($previousContents ne $currentContents) {
+        print "Contents for file $filename have changed.\n";
+        print "Previous contents were: $previousContents\n\n";
+        print "New contents are: $currentContents\n";
         return 1;
     }
 
@@ -1989,12 +1995,11 @@
 
 sub buildAutotoolsProject($@)
 {
-    my ($project, $clean, @buildParams) = @_;
+    my ($project, $clean, $prefix, $makeArgs, $noWebKit2, @features) = @_;
 
     my $make = 'make';
     my $dir = productDir();
     my $config = passedConfiguration() || configuration();
-    my $prefix;
 
     # Use rm to clean the build directory since distclean may miss files
     if ($clean && -d $dir) {
@@ -2010,19 +2015,38 @@
         return 0;
     }
 
-    my @buildArgs = ();
-    my $makeArgs = $ENV{"WebKitMakeArguments"} || "";
-    for my $i (0 .. $#buildParams) {
-        my $opt = $buildParams[$i];
-        if ($opt =~ /^--makeargs=(.*)/i ) {
-            $makeArgs = $makeArgs . " " . $1;
-        } elsif ($opt =~ /^--prefix=(.*)/i ) {
-            $prefix = $1;
+    my @buildArgs = @ARGV;
+    if ($noWebKit2) {
+        unshift(@buildArgs, "--disable-webkit2");
+    }
+
+    # Configurable features listed here should be kept in sync with the
+    # features for which there exists a configuration option in configure.ac.
+    my %configurableFeatures = (
+        "filters" => 1,
+        "gamepad" => 1,
+        "geolocation" => 1,
+        "indexed-database" => 1,
+        "media-stream" => 1,
+        "svg" => 1,
+        "svg-fonts" => 1,
+        "video" => 1,
+        "webgl" => 1,
+        "web-audio" => 1,
+        "xslt" => 1,
+    );
+    my @overridableFeatures = ();
+    foreach (@features) {
+        if ($configurableFeatures{$_->{option}}) {
+            push @buildArgs, autotoolsFlag(${$_->{value}}, $_->{option});;
         } else {
-            push @buildArgs, $opt;
+            push @overridableFeatures, $_->{define} . "=" . (${$_->{value}} ? "1" : "0");
         }
     }
 
+    $makeArgs = $makeArgs || "";
+    $makeArgs = $makeArgs . " " . $ENV{"WebKitMakeArguments"} if $ENV{"WebKitMakeArguments"};
+
     # Automatically determine the number of CPUs for make only
     # if make arguments haven't already been specified.
     if ($makeArgs eq "") {
@@ -2060,7 +2084,8 @@
     # If GNUmakefile exists, don't run autogen.sh unless its arguments
     # have changed. The makefile should be smart enough to track autotools
     # dependencies and re-run autogen.sh when build files change.
-    runAutogenForAutotoolsProjectIfNecessary($dir, $prefix, $sourceDir, $project, @buildArgs);
+    my $joinedOverridableFeatures = join(" ", @overridableFeatures);
+    runAutogenForAutotoolsProjectIfNecessary($dir, $prefix, $sourceDir, $project, $joinedOverridableFeatures, @buildArgs);
 
     my $runWithJhbuild = jhbuildWrapperPrefixIfNeeded();
     if (system("$runWithJhbuild $make $makeArgs") ne 0) {
@@ -2406,13 +2431,13 @@
 
 sub buildGtkProject
 {
-    my ($project, $clean, @buildArgs) = @_;
+    my ($project, $clean, $prefix, $makeArgs, $noWebKit2, @features) = @_;
 
     if ($project ne "WebKit" and $project ne "_javascript_Core" and $project ne "WTF") {
         die "Unsupported project: $project. Supported projects: WebKit, _javascript_Core, WTF\n";
     }
 
-    return buildAutotoolsProject($project, $clean, @buildArgs);
+    return buildAutotoolsProject($project, $clean, $prefix, $makeArgs, $noWebKit2, @features);
 }
 
 sub buildChromiumMakefile($$@)

Modified: trunk/Tools/Scripts/webkitperl/FeatureList.pm (137269 => 137270)


--- trunk/Tools/Scripts/webkitperl/FeatureList.pm	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/Scripts/webkitperl/FeatureList.pm	2012-12-11 09:37:28 UTC (rev 137270)
@@ -183,7 +183,7 @@
       define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 0, value => \$css3ConditionalRulesSupport },
 
     { option => "css3-text", desc => "Toggle CSS3 Text support",
-      define => "ENABLE_CSS3_TEXT", default => isEfl(), value => \$css3TextSupport },
+      define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
 
     { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
       define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
@@ -318,7 +318,7 @@
       define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
 
     { option => "media-stream", desc => "Toggle Media Stream support",
-      define => "ENABLE_MEDIA_STREAM", default => (isChromium() || isGtk() || isBlackBerry()), value => \$mediaStreamSupport },
+      define => "ENABLE_MEDIA_STREAM", default => (isChromium() || isBlackBerry()), value => \$mediaStreamSupport },
 
     { option => "meter-tag", desc => "Toggle Meter Tag support",
       define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterTagSupport },
@@ -381,7 +381,7 @@
       define => "ENABLE_SQL_DATABASE", default => 1, value => \$sqlDatabaseSupport },
 
     { option => "style-scoped", desc => "Toggle Style Scoped support",
-      define => "ENABLE_STYLE_SCOPED", default => isBlackBerry(), value => \$styleScopedSupport },
+      define => "ENABLE_STYLE_SCOPED", default => (isBlackBerry() || isGtk()), value => \$styleScopedSupport },
 
     { option => "svg", desc => "Toggle SVG support",
       define => "ENABLE_SVG", default => 1, value => \$svgSupport },

Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (137269 => 137270)


--- trunk/Tools/Scripts/webkitpy/style/checker.py	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py	2012-12-11 09:37:28 UTC (rev 137270)
@@ -328,6 +328,8 @@
 # with FileType.NONE are automatically skipped without warning.
 _SKIPPED_FILES_WITHOUT_WARNING = [
     "LayoutTests" + os.path.sep,
+    # Prevents this being recognized as a text file.
+    "Source/WebCore/GNUmakefile.features.am.in",
     ]
 
 # Extensions of files which are allowed to contain carriage returns.

Added: trunk/Tools/gtk/override-feature-defines (0 => 137270)


--- trunk/Tools/gtk/override-feature-defines	                        (rev 0)
+++ trunk/Tools/gtk/override-feature-defines	2012-12-11 09:37:28 UTC (rev 137270)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+
+import os
+import re
+import shutil
+import sys
+
+def copy_feature_defines_makefile():
+    src_path = os.path.join('Source', 'WebCore', 'GNUmakefile.features.am.in')
+    dest_path = os.path.join('Source', 'WebCore', 'GNUmakefile.features.am')
+    shutil.copy(src_path, dest_path)
+
+def adjust_feature_defines_makefile(build_dir, feature_defines_overriding):
+    feature_defines_makefile_file = os.path.join('Source', 'WebCore', 'GNUmakefile.features.am')
+    with open(feature_defines_makefile_file) as f:
+        feature_defines_makefile = f.read()
+
+    overriden_feature_defines = []
+    def override_feature_define(match):
+        matched_feature_define = match.group('feature')
+        if matched_feature_define not in feature_defines_overriding:
+            return match.string[match.start():match.end()]
+
+        if int(match.group('default_value')) is not feature_defines_overriding[matched_feature_define]:
+            overriden_feature_defines.append(matched_feature_define)
+        return "%s=%d" % (matched_feature_define, feature_defines_overriding[matched_feature_define])
+
+    feature_defines_makefile = re.sub(r"(?P<feature>(?:ENABLE_)\w+)=(?P<default_value>0|1)", override_feature_define, feature_defines_makefile)
+    with open(feature_defines_makefile_file, 'w') as f:
+        f.write(feature_defines_makefile)
+
+    if overriden_feature_defines:
+        print "The following feature defines were overriden:\n%s" % ', '.join(overriden_feature_defines)
+
+def override_feature_defines(build_dir):
+    copy_feature_defines_makefile()
+
+    feature_defines_overriding_file = os.path.join(build_dir, 'feature-defines-overriding.txt')
+    if not os.path.exists(feature_defines_overriding_file):
+        return
+
+    with open(feature_defines_overriding_file) as f:
+        match_iter = re.findall(r"((?:ENABLE_)\w+)=(0|1)", f.read())
+
+    feature_defines_overriding = {}
+    for match in match_iter:
+        feature_defines_overriding[match[0]] = int(match[1])
+
+    adjust_feature_defines_makefile(build_dir, feature_defines_overriding)
+
+if __name__=='__main__':
+    override_feature_defines(sys.argv[1])
Property changes on: trunk/Tools/gtk/override-feature-defines
___________________________________________________________________

Added: svn:executable

Modified: trunk/autogen.sh (137269 => 137270)


--- trunk/autogen.sh	2012-12-11 09:29:20 UTC (rev 137269)
+++ trunk/autogen.sh	2012-12-11 09:37:28 UTC (rev 137270)
@@ -12,6 +12,8 @@
 
 touch README INSTALL
 
+Tools/gtk/override-feature-defines $ORIGDIR
+
 if test -z `which autoreconf`; then
     echo "Error: autoreconf not found, please install it."
     exit 1
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to