Bug 110293 - [GTK] Move feature overriding to the configure phase
Summary: [GTK] Move feature overriding to the configure phase
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Martin Robinson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-19 19:23 PST by Martin Robinson
Modified: 2013-03-26 12:29 PDT (History)
9 users (show)

See Also:


Attachments
Patch (28.44 KB, patch)
2013-02-19 22:55 PST, Martin Robinson
gns: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Robinson 2013-02-19 19:23:39 PST
Currently feature overriding happens while autogen.sh is called. This bug tracks moving it to the configure phase, so that it can be shared more easily with the gyp build.
Comment 1 Martin Robinson 2013-02-19 22:55:00 PST
Created attachment 189251 [details]
Patch
Comment 2 Martin Robinson 2013-02-19 23:09:28 PST
For the sake of reviewers, here is a high-level overview of how the new feature overriding system works:

1. The feature profile for releases is defined in SetupWebKitFeatures.m4. This is what you get when you run configure from the tarball.

2. build-webkit writes WebKitFeatureOverrides.txt in the build directory. This is the developer feature profile (modified by any command-line arguments passed to build-webkit) described as a simple list of key value pairs like:
ENABLE_3D_RENDERING=0 ENABLE_ACCELERATED_2D_CANVAS=0 ENABLE_BATTERY_STATUS=0...

3. configure takes the features defined in SetupWebKitFeatures.m4 and command-line arguments and passes that as an argument to generate-feature-defines-files.

4. generate-feature-defines-files overrides its command-line arguments (the defaults from step 3) with the contents of WebKitFeatureOverrides.txt, if it exists. It writes two files: 

  * WebKitFeatures.h: A header that has all the features as compiler defines. Before these were passed as command-line arguments to the compiler. This header is included in the autotoolconfig.h header. If it changes, it will trigger a full rebuild.

  * WebKitFeatures.txt: A key-value pair list of the resolved features that are passed to code generators. This used to be generated by the WebCore GNUmakefile.am.

5. GNUmakefile.am reads WebKitFeatures.txt and passes the contents to all code generators.
Comment 3 Gustavo Noronha (kov) 2013-02-21 04:25:59 PST
Comment on attachment 189251 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=189251&action=review

LGTM!

> Source/autotools/SetupWebKitFeatures.m4:189
> +  dnl Grep the generated GNUmakefile.features.am

s/GNUmakefile.features.am/WebKitFeatures.txt/, but I'd just remove the comment, the code is pretty self-explanatory.
Comment 4 Martin Robinson 2013-02-21 08:22:33 PST
Committed r143604: <http://trac.webkit.org/changeset/143604>
Comment 5 Laszlo Gombos 2013-02-24 10:37:05 PST
Martin, can you also update http://trac.webkit.org/wiki/AddingFeatures to reflect this commit ?
Comment 6 Landry Breuil 2013-03-26 06:47:55 PDT
This commit uses read -d which is a bashism for the read builtin. Configure bails out with ksh here.

checking for pthread_rwlock_init in -lpthread... yes
./configure[21434]: read: -d: unknown option
env: python: No such file or directory
Comment 7 Landry Breuil 2013-03-26 07:19:23 PDT
A more sh-portable option is to use a backslash between each value:

read FOO << "EOF"
a \
b \
c
EOF
Comment 8 Martin Robinson 2013-03-26 12:29:00 PDT
(In reply to comment #7)
> A more sh-portable option is to use a backslash between each value:
> 
> read FOO << "EOF"
> a \
> b \
> c
> EOF

Makes sense. Do you mind opening a bug for this and CCing me?