Changeset 128308 in webkit


Ignore:
Timestamp:
Sep 12, 2012 7:35:03 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Build on Windows requires bison/flex in PATH
https://bugs.webkit.org/show_bug.cgi?id=96358

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-09-12
Reviewed by Tor Arne Vestbø.

Source/ThirdParty/ANGLE:

Use MAKEFILE_NOOP_COMMAND instead of the \n\t trick to generate a dummy command. Otherwise
the PATH prepend trick will break because it generates a command line along the lines of
(set PATH="...") && with just that trailing ampersand pair.

  • DerivedSources.pri:

Tools:

The build requires flex, bison, etc. and they need to be in the PATH when building. On Mac OS X
and Linux that is rarely a problem given how easily available the tools are. On Windows however
a separate installation of various GNU tools is required as the operating system doesn't come with
them. To make the development more convenient, Qt 5 provides a copy of the most essential tools in
the gnuwin32 directory of the qt5.git top-level repository.

This patch tries to detect the presence of those tools and prepends them to the PATH if found.

This is required in preparation for the elimination of qt5/qtwebkit.pri, which currently expands
PATH before calling build-webkit. It it also required for the upcoming introduction of win_flex
as dependency over flex, which can be done with less hassle when qt5's gnuwin32 directory has been
updated with the new tool.

  • Scripts/webkitdirs.pm:

(checkRequiredSystemConfig):

  • qmake/mkspecs/features/default_post.prf:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r128209 r128308  
     12012-09-12  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Build on Windows requires bison/flex in PATH
     4        https://bugs.webkit.org/show_bug.cgi?id=96358
     5
     6        Reviewed by Tor Arne Vestbø.
     7
     8        Use MAKEFILE_NOOP_COMMAND instead of the \n\t trick to generate a dummy command. Otherwise
     9        the PATH prepend trick will break because it generates a command line along the lines of
     10        (set PATH="...") && with just that trailing ampersand pair.
     11
     12        * DerivedSources.pri:
     13
    1142012-09-10  Dean Jackson  <dino@apple.com>
    215
  • trunk/Source/ThirdParty/ANGLE/DerivedSources.pri

    r127724 r128308  
    3232
    3333anglebison_impl.input = ANGLE_BISON_SOURCES
    34 anglebison_impl.commands = $$escape_expand(\\n)
     34anglebison_impl.commands = $$MAKEFILE_NOOP_COMMAND
    3535anglebison_impl.depends = $$GENERATED_SOURCES_DESTDIR/${QMAKE_FILE_BASE}_tab.h
    3636anglebison_impl.output = ${QMAKE_FILE_BASE}_tab.cpp
  • trunk/Tools/ChangeLog

    r128305 r128308  
     12012-09-12  Simon Hausmann  <simon.hausmann@nokia.com>
     2
     3        [Qt] Build on Windows requires bison/flex in PATH
     4        https://bugs.webkit.org/show_bug.cgi?id=96358
     5
     6        Reviewed by Tor Arne Vestbø.
     7
     8        The build requires flex, bison, etc. and they need to be in the PATH when building. On Mac OS X
     9        and Linux that is rarely a problem given how easily available the tools are. On Windows however
     10        a separate installation of various GNU tools is required as the operating system doesn't come with
     11        them. To make the development more convenient, Qt 5 provides a copy of the most essential tools in
     12        the gnuwin32 directory of the qt5.git top-level repository.
     13
     14        This patch tries to detect the presence of those tools and prepends them to the PATH if found.
     15
     16        This is required in preparation for the elimination of qt5/qtwebkit.pri, which currently expands
     17        PATH before calling build-webkit. It it also required for the upcoming introduction of win_flex
     18        as dependency over flex, which can be done with less hassle when qt5's gnuwin32 directory has been
     19        updated with the new tool.
     20
     21        * Scripts/webkitdirs.pm:
     22        (checkRequiredSystemConfig):
     23        * qmake/mkspecs/features/default_post.prf:
     24
    1252012-09-12  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    226
  • trunk/Tools/Scripts/webkitdirs.pm

    r128176 r128308  
    15451545        my @cmds = qw(flex bison gperf);
    15461546        my @missing = ();
     1547        my $oldPath = $ENV{PATH};
     1548        if (isQt() and isWindows()) {
     1549            chomp(my $gnuWin32Dir = `$qmakebin -query QT_HOST_DATA`);
     1550            $gnuWin32Dir = File::Spec->catfile($gnuWin32Dir, "..", "gnuwin32", "bin");
     1551            if (-d "$gnuWin32Dir") {
     1552                $ENV{PATH} = $gnuWin32Dir . ";" . $ENV{PATH};
     1553            }
     1554        }
    15471555        foreach my $cmd (@cmds) {
    15481556            push @missing, $cmd if not commandExists($cmd);
     
    15521560            my $list = join ", ", @missing;
    15531561            die "ERROR: $list missing but required to build WebKit.\n";
     1562        }
     1563        if (isQt() and isWindows()) {
     1564            $ENV{PATH} = $oldPath;
    15541565        }
    15551566    }
  • trunk/Tools/qmake/mkspecs/features/default_post.prf

    r128295 r128308  
    7676    QMAKE_EXTRA_TARGETS += fake_release
    7777
     78    # A lot of our code generators require GNU tools, readily available
     79    # on Linux and Mac OS X. On Windows we do have a convenience copy in
     80    # Qt5's top-level repository, so let's add that to the PATH if we can
     81    # find it.
     82    win32 {
     83        GNUTOOLS=$$[QT_HOST_DATA]/../gnuwin32/bin
     84        exists($$GNUTOOLS/gperf.exe) {
     85            GNUTOOLS = "(set $$escape_expand(\\\")PATH=$$toSystemPath($$GNUTOOLS);%PATH%$$escape_expand(\\\"))"
     86        }
     87    }
     88
    7889    for(generator, GENERATORS) {
    7990        eval($${generator}.CONFIG = target_predeps no_link)
     
    8697        script = $$eval($${generator}.script)
    8798        eval($${generator}.depends += $$script)
     99
     100        commands = $$eval($${generator}.commands)
     101        !isEmpty(commands):!isEmpty(GNUTOOLS) {
     102            eval($${generator}.commands = $${GNUTOOLS} && $$val_escape($${generator}.commands))
     103        }
    88104
    89105        !isEmpty($${generator}.input) {
Note: See TracChangeset for help on using the changeset viewer.