Changeset 121766 in webkit


Ignore:
Timestamp:
Jul 3, 2012 8:23:20 AM (12 years ago)
Author:
vestbo@webkit.org
Message:

[Qt] Make use of .qmake.cache for caching features

Instead of loading() features from the files that need them (and re-running
a bunch of checks), we now run feature detection as part of configure.pro,
and have build-webkit write the computed feature-defines and CONFIG to
.qmake.cache, which is then loaded by qmake _before_ even defaults_pre
when building WebKit.pro.

At some point we'll be able to selectivly prevent running of config tests
in configure.pro, which means we don't need a separate code-path for
the build-webkit --help case.

We should also move the code in build-webkit that now uses .webkit.config
to detect clean builds, to use .qmake.cache, since we now store the same
thing there.

Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

https://bugs.webkit.org/show_bug.cgi?id=90461

Reviewed by Tor Arne Vestbø.

Location:
trunk
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r121734 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        Reviewed by Tor Arne Vestbø.
     22
     23        * Source/QtWebKit.pro:
     24        * Source/api.pri:
     25        * Source/tests.pri:
     26        * WebKit.pro:
     27
    1282012-07-03  Christophe Dumez  <christophe.dumez@intel.com>
    229
  • trunk/Source/QtWebKit.pro

    r121228 r121766  
    44# See 'Tools/qmake/README' for an overview of the build system
    55# -------------------------------------------------------------------
    6 
    7 load(features)
    86
    97TEMPLATE = subdirs
  • trunk/Source/WTF/ChangeLog

    r121762 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        Reviewed by Tor Arne Vestbø.
     22
     23        * WTF.pri:
     24
    1252012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
    226
  • trunk/Source/WTF/WTF.pri

    r120076 r121766  
    55# See 'Tools/qmake/README' for an overview of the build system
    66# -------------------------------------------------------------------
    7 
    8 load(features)
    97
    108# All external modules should include WTF headers by prefixing with "wtf" (#include <wtf/some/thing.h>).
  • trunk/Source/WebCore/ChangeLog

    r121765 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        https://bugs.webkit.org/show_bug.cgi?id=90461
     22
     23        Reviewed by Tor Arne Vestbø.
     24
     25        * DerivedSources.pri:
     26        * WebCore.pri:
     27
    1282012-07-03  Vsevolod Vlasov  <vsevik@chromium.org>
    229
  • trunk/Source/WebCore/DerivedSources.pri

    r120962 r121766  
    1111sanitizedFile = $$toSanitizedPath($$_FILE_)
    1212equals(sanitizedFile, $$toSanitizedPath($$_PRO_FILE_)):TEMPLATE = derived
    13 
    14 load(features)
    1513
    1614mac {
  • trunk/Source/WebCore/WebCore.pri

    r121543 r121766  
    55# See 'Tools/qmake/README' for an overview of the build system
    66# -------------------------------------------------------------------
    7 
    8 load(features)
    97
    108SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore
  • trunk/Source/WebKit/qt/ChangeLog

    r121710 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        Reviewed by Tor Arne Vestbø.
     22
     23        * declarative/declarative.pro:
     24        * declarative/public.pri:
     25        * tests/qgraphicswebview/qgraphicswebview.pro:
     26
    1272012-07-02  No'am Rosenthal  <noam.rosenthal@nokia.com>
    228
  • trunk/Source/WebKit/qt/declarative/declarative.pro

    r114042 r121766  
    77TEMPLATE = subdirs
    88CONFIG += ordered
    9 
    10 load(features)
    119
    1210public_api.file = public.pri
  • trunk/Source/WebKit/qt/declarative/public.pri

    r118762 r121766  
    1111
    1212CONFIG += qt plugin
    13 
    14 load(features)
    1513
    1614QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
  • trunk/Source/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro

    r104034 r121766  
    22exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
    33
    4 load(features)
    54contains(DEFINES, ENABLE_WEBGL=1) {
    65    QT += opengl
  • trunk/Source/WebKit2/ChangeLog

    r121761 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        Reviewed by Tor Arne Vestbø.
     22
     23        * DerivedSources.pri:
     24        * Target.pri:
     25
    1262012-07-03  Alexis Menard  <alexis.menard@openbossa.org>
    227
  • trunk/Source/WebKit2/DerivedSources.pri

    r121221 r121766  
    1111sanitizedFile = $$toSanitizedPath($$_FILE_)
    1212equals(sanitizedFile, $$toSanitizedPath($$_PRO_FILE_)):TEMPLATE = derived
    13 
    14 load(features)
    1513
    1614WEBCORE_GENERATED_SOURCES_DIR = ../WebCore/$${GENERATED_SOURCES_DESTDIR}
  • trunk/Source/WebKit2/Target.pri

    r121686 r121766  
    77TEMPLATE = lib
    88TARGET = WebKit2
    9 
    10 load(features)
    119
    1210include(WebKit2.pri)
  • trunk/Source/api.pri

    r121261 r121766  
    125125runSyncQt() # Generate forwarding headers for the QtWebKit API
    126126
    127 load(features)
    128 
    129127WEBKIT += wtf
    130128
  • trunk/Source/tests.pri

    r121620 r121766  
    77TEMPLATE = subdirs
    88CONFIG += ordered
    9 
    10 load(features)
    119
    1210WEBKIT_TESTS_DIR = $$PWD/WebKit/qt/tests
  • trunk/Tools/ChangeLog

    r121762 r121766  
     12012-07-03  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
     2
     3        [Qt] Make use of .qmake.cache for caching features
     4
     5        Instead of loading() features from the files that need them (and re-running
     6        a bunch of checks), we now run feature detection as part of configure.pro,
     7        and have build-webkit write the computed feature-defines and CONFIG to
     8        .qmake.cache, which is then loaded by qmake _before_ even defaults_pre
     9        when building WebKit.pro.
     10
     11        At some point we'll be able to selectivly prevent running of config tests
     12        in configure.pro, which means we don't need a separate code-path for
     13        the build-webkit --help case.
     14
     15        We should also move the code in build-webkit that now uses .webkit.config
     16        to detect clean builds, to use .qmake.cache, since we now store the same
     17        thing there.
     18
     19        Original patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
     20
     21        Reviewed by Tor Arne Vestbø.
     22
     23        * DumpRenderTree/qt/DumpRenderTree.pro:
     24        * QtTestBrowser/QtTestBrowser.pro:
     25        * Scripts/webkitdirs.pm:
     26        (qtFeatureDefaults):
     27        (buildQMakeProjects):
     28        * Tools.pro:
     29        * WebKitTestRunner/InjectedBundle/DerivedSources.pri:
     30        * WebKitTestRunner/InjectedBundle/Target.pri:
     31        * WebKitTestRunner/Target.pri:
     32        * qmake/.qmake.conf: Added.
     33        * qmake/configure.pro:
     34        * qmake/mkspecs/features/default_post.prf:
     35        * qmake/mkspecs/features/default_pre.prf:
     36        * qmake/mkspecs/features/features.prf:
     37
    1382012-07-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>  Joel Dillon <joel.dillon@codethink.co.uk>
    239
  • trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro

    r121762 r121766  
    99TARGET = DumpRenderTree
    1010DESTDIR = $$ROOT_BUILD_DIR/bin
    11 
    12 load(features)
    1311
    1412WEBKIT += wtf webcore
  • trunk/Tools/QtTestBrowser/QtTestBrowser.pro

    r120166 r121766  
    1111    $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/ \
    1212    $${ROOT_WEBKIT_DIR}/Source/WTF
    13 
    14 load(features)
    1513
    1614SOURCES += \
  • trunk/Tools/Scripts/webkitdirs.pm

    r121725 r121766  
    825825    my $file;
    826826    my @buildArgs;
     827    my $qconfigs;
    827828
    828829    if (@_) {
    829830        @buildArgs = (@buildArgs, @{$_[0]});
     831        $qconfigs = $_[1];
    830832        my $dir = File::Spec->catfile(productDir(), "Tools", "qmake");
    831833        File::Path::mkpath($dir);
     
    834836    } else {
    835837        # Do a quick check of the features without running the config tests
     838        # FIXME: When Qt supports it, go through configure.pro but without config tests
    836839        $file = File::Spec->catfile($qmakepath, "mkspecs", "features", "features.prf");
    837840        push @buildArgs, "CONFIG+=compute_defaults";
    838841    }
    839842
    840     my $defaults = `$qmakecommand @buildArgs $file 2>&1`;
     843    my @defaults = `$qmakecommand @buildArgs $file 2>&1`;
    841844
    842845    my %qtFeatureDefaults;
    843     while ($defaults =~ m/(\S+?)=(\S+?)/gi) {
    844         $qtFeatureDefaults{$1}=$2;
     846    for (@defaults) {
     847        if (/ DEFINES: /) {
     848            while (/(\S+?)=(\S+?)/gi) {
     849                $qtFeatureDefaults{$1}=$2;
     850            }
     851        } elsif (/ CONFIG:(.*)$/) {
     852            if (@_) {
     853                $$qconfigs = $1;
     854            }
     855        } elsif (/Done computing defaults/) {
     856            print "\n";
     857            last;
     858        } elsif (@_) {
     859            print $_;
     860        }
    845861    }
    846862
     
    22312247
    22322248    my @buildArgs = ();
     2249    my $qconfigs = "";
    22332250
    22342251    my $make = qtMakeCommand($qmakebin);
     
    22872304    chdir $dir or die "Failed to cd into " . $dir . "\n";
    22882305
    2289     my %defines = qtFeatureDefaults(\@buildArgs);
     2306    my %defines = qtFeatureDefaults(\@buildArgs, \$qconfigs);
    22902307
    22912308    my $svnRevision = currentSVNRevision();
     
    22952312    my $pathToDefinesCache = File::Spec->catfile($dir, ".webkit.config");
    22962313    my $pathToOldDefinesFile = File::Spec->catfile($dir, "defaults.txt");
     2314
     2315    # FIXME: Get rid of .webkit.config and defaults.txt and move all the logic to .qmake.cache
    22972316
    22982317    # Ease transition to new build layout
     
    23582377            # After removing WebKitBuild directory, we have to call qtFeatureDefaults()
    23592378            # to run config tests and generate the removed Tools/qmake/.qmake.cache again.
    2360             qtFeatureDefaults(\@buildArgs);
     2379            qtFeatureDefaults(\@buildArgs, \$qconfigs);
    23612380        #}
    23622381
    23632382        # Still trigger an incremental build
    23642383        $buildHint = "incremental";
     2384    }
     2385
     2386    if ($buildHint eq "incremental") {
     2387        my $qmakeDefines = "DEFINES +=";
     2388        foreach my $key (sort keys %defines) {
     2389            $qmakeDefines .= " \\\n    $key=$defines{$key}";
     2390        }
     2391        open(QMAKE_CACHE, ">.qmake.cache") or die "Cannot create .qmake.cache!\n";
     2392        print QMAKE_CACHE "CONFIG += webkit_configured $qconfigs\n";
     2393        print QMAKE_CACHE $qmakeDefines."\n";
     2394        close(QMAKE_CACHE);
    23652395    }
    23662396
  • trunk/Tools/Tools.pro

    r121620 r121766  
    77TEMPLATE = subdirs
    88CONFIG += ordered
    9 
    10 load(features)
    119
    1210!no_webkit1 {
  • trunk/Tools/WebKitTestRunner/InjectedBundle/DerivedSources.pri

    r101133 r121766  
    1111sanitizedFile = $$toSanitizedPath($$_FILE_)
    1212equals(sanitizedFile, $$toSanitizedPath($$_PRO_FILE_)):TEMPLATE = derived
    13 
    14 load(features)
    1513
    1614IDL_BINDINGS += \
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Target.pri

    r110272 r121766  
    5353QT += declarative widgets webkit
    5454
    55 load(features)
    56 
    5755WEBKIT += wtf javascriptcore webcore
    5856
  • trunk/Tools/WebKitTestRunner/Target.pri

    r116304 r121766  
    2828QT = core gui widgets network declarative testlib quick quick-private webkit
    2929
    30 load(features)
    31 
    3230WEBKIT += wtf javascriptcore webkit2
    3331
  • trunk/Tools/qmake/configure.pro

    r100130 r121766  
     1# -------------------------------------------------------------------
     2# This file is used by build-webkit to compute the various feature
     3# defines, which are then cached in .qmake.cache.
     4#
     5# See 'Tools/qmake/README' for an overview of the build system
     6# -------------------------------------------------------------------
     7
     8# Will compute features based on command line arguments, config tests,
     9# dependency availability, and defaults.
    110load(features)
    2 message($$DEFINES)
     11
     12# Compute delta
     13CONFIG -= $$BASE_CONFIG
     14DEFINES -= $$BASE_DEFINES
     15
     16message(CONFIG: $$CONFIG)
     17message(DEFINES: $$DEFINES)
    318error("Done computing defaults")
  • trunk/Tools/qmake/mkspecs/features/default_post.prf

    r121762 r121766  
    55# See 'Tools/qmake/README' for an overview of the build system
    66# -------------------------------------------------------------------
    7 
    8 load(features)
    97
    108# Flag that we're now done processing the project file. This allows
  • trunk/Tools/qmake/mkspecs/features/default_pre.prf

    r121228 r121766  
    2828ROOT_BUILD_DIR = $$replace(OUT_PWD, $${WEBKIT_SUBDIR}$,)
    2929
     30# Detect if we're running the initial configure step
     31pro_file_name = $$basename(_PRO_FILE_)
     32equals(pro_file_name, configure.pro): CONFIG += configure_pass
     33
    3034# We want the QtWebKit API forwarding includes to live in the root build dir,
    3135# except when we are running the config.tests in Tools/qmake.
    32 pro_file_name = $$basename(_PRO_FILE_)
    33 !equals(pro_file_name, configure.pro): QMAKE_SYNCQT_OUTDIR = $$ROOT_BUILD_DIR
     36!configure_pass: QMAKE_SYNCQT_OUTDIR = $$ROOT_BUILD_DIR
    3437
    3538# Load Qt's defaults after we've resolved the build directory. This will also
     
    124127# Set some defaults for specific platforms
    125128CONFIG += include_webinspector
     129
     130# Try to locate sqlite3 source (for WebCore)
     131SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
     132isEmpty(SQLITE3SRCDIR) {
     133    haveQt(5): SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
     134    else: SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
     135}
     136
     137# --------- Make features available to JSC ------------
     138
     139## Forward enabled feature macros to JavaScript enabled features macros
     140FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
     141v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
     142
     143for(define, DEFINES) {
     144    enabled_feature_define = $$find(define, ^ENABLE_.+=1$)
     145    isEmpty(enabled_feature_define): next()
     146
     147    FEATURE_DEFINES_JAVASCRIPT += $$enabled_feature_define
     148}
     149
     150configure_pass {
     151    # Save the base config and defines so we can compute the delta between
     152    # what features.prf introduced and what was already there.
     153    BASE_CONFIG = $$CONFIG
     154    BASE_DEFINES = $$DEFINES
     155}
  • trunk/Tools/qmake/mkspecs/features/features.prf

    r121543 r121766  
    2020## load mobilityconfig if mobility is available
    2121load(mobilityconfig, true)
    22 
    23 # Try to locate sqlite3 source
    24 SQLITE3SRCDIR = $$(SQLITE3SRCDIR)
    25 isEmpty(SQLITE3SRCDIR) {
    26     haveQt(5):SQLITE3SRCDIR = $$QT.core.sources/../3rdparty/sqlite/
    27     else:SQLITE3SRCDIR = $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
    28 }
    2922
    3023# ---------- Dynamically detect optional features -------------
     
    221214}
    222215
    223 # --------- Make features available to JSC ------------
    224 
    225 ## Forward enabled feature macros to JavaScript enabled features macros
    226 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
    227 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1
    228 
    229 for(define, DEFINES) {
    230     enabled_feature_define = $$find(define, ^ENABLE_.+=1$)
    231     isEmpty(enabled_feature_define): next()
    232 
    233     FEATURE_DEFINES_JAVASCRIPT += $$enabled_feature_define
    234 }
    235 
    236216# ---------------------- The end ----------------------
    237217
     
    239219# Don't place anything after this!
    240220CONFIG(compute_defaults) {
    241     message($$DEFINES)
     221    # FIXME: We should have configure.pro do this when the config tests
     222    # can be selectivly run.
     223    message(DEFINES: $$DEFINES)
    242224    error("Done computing defaults")
    243225}
  • trunk/WebKit.pro

    r121228 r121766  
    88TEMPLATE = subdirs
    99CONFIG += ordered
    10 
    11 load(features)
    1210
    1311QMAKEPATH = $$(QMAKEPATH)
Note: See TracChangeset for help on using the changeset viewer.