Title: [128308] trunk
Revision
128308
Author
commit-qu...@webkit.org
Date
2012-09-12 07:35:03 -0700 (Wed, 12 Sep 2012)

Log Message

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

Patch by Simon Hausmann <simon.hausm...@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:

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/ANGLE/ChangeLog (128307 => 128308)


--- trunk/Source/ThirdParty/ANGLE/ChangeLog	2012-09-12 14:26:31 UTC (rev 128307)
+++ trunk/Source/ThirdParty/ANGLE/ChangeLog	2012-09-12 14:35:03 UTC (rev 128308)
@@ -1,3 +1,16 @@
+2012-09-12  Simon Hausmann  <simon.hausm...@nokia.com>
+
+        [Qt] Build on Windows requires bison/flex in PATH
+        https://bugs.webkit.org/show_bug.cgi?id=96358
+
+        Reviewed by Tor Arne Vestbø.
+
+        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:
+
 2012-09-10  Dean Jackson  <d...@apple.com>
 
         [Apple] Install plist for Apple Open Source build system

Modified: trunk/Source/ThirdParty/ANGLE/DerivedSources.pri (128307 => 128308)


--- trunk/Source/ThirdParty/ANGLE/DerivedSources.pri	2012-09-12 14:26:31 UTC (rev 128307)
+++ trunk/Source/ThirdParty/ANGLE/DerivedSources.pri	2012-09-12 14:35:03 UTC (rev 128308)
@@ -31,7 +31,7 @@
 GENERATORS += anglebison_decl
 
 anglebison_impl.input = ANGLE_BISON_SOURCES
-anglebison_impl.commands = $$escape_expand(\\n)
+anglebison_impl.commands = $$MAKEFILE_NOOP_COMMAND
 anglebison_impl.depends = $$GENERATED_SOURCES_DESTDIR/${QMAKE_FILE_BASE}_tab.h
 anglebison_impl.output = ${QMAKE_FILE_BASE}_tab.cpp
 GENERATORS += anglebison_impl

Modified: trunk/Tools/ChangeLog (128307 => 128308)


--- trunk/Tools/ChangeLog	2012-09-12 14:26:31 UTC (rev 128307)
+++ trunk/Tools/ChangeLog	2012-09-12 14:35:03 UTC (rev 128308)
@@ -1,3 +1,27 @@
+2012-09-12  Simon Hausmann  <simon.hausm...@nokia.com>
+
+        [Qt] Build on Windows requires bison/flex in PATH
+        https://bugs.webkit.org/show_bug.cgi?id=96358
+
+        Reviewed by Tor Arne Vestbø.
+
+        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:
+
 2012-09-12  Tor Arne Vestbø  <tor.arne.ves...@nokia.com>
 
         [Qt] Update build-jsc after r128174

Modified: trunk/Tools/Scripts/webkitdirs.pm (128307 => 128308)


--- trunk/Tools/Scripts/webkitdirs.pm	2012-09-12 14:26:31 UTC (rev 128307)
+++ trunk/Tools/Scripts/webkitdirs.pm	2012-09-12 14:35:03 UTC (rev 128308)
@@ -1544,6 +1544,14 @@
     } elsif (isGtk() or isQt() or isWx() or isEfl()) {
         my @cmds = qw(flex bison gperf);
         my @missing = ();
+        my $oldPath = $ENV{PATH};
+        if (isQt() and isWindows()) {
+            chomp(my $gnuWin32Dir = `$qmakebin -query QT_HOST_DATA`);
+            $gnuWin32Dir = File::Spec->catfile($gnuWin32Dir, "..", "gnuwin32", "bin");
+            if (-d "$gnuWin32Dir") {
+                $ENV{PATH} = $gnuWin32Dir . ";" . $ENV{PATH};
+            }
+        }
         foreach my $cmd (@cmds) {
             push @missing, $cmd if not commandExists($cmd);
         }
@@ -1552,6 +1560,9 @@
             my $list = join ", ", @missing;
             die "ERROR: $list missing but required to build WebKit.\n";
         }
+        if (isQt() and isWindows()) {
+            $ENV{PATH} = $oldPath;
+        }
     }
     # Win32 and other platforms may want to check for minimum config
 }

Modified: trunk/Tools/qmake/mkspecs/features/default_post.prf (128307 => 128308)


--- trunk/Tools/qmake/mkspecs/features/default_post.prf	2012-09-12 14:26:31 UTC (rev 128307)
+++ trunk/Tools/qmake/mkspecs/features/default_post.prf	2012-09-12 14:35:03 UTC (rev 128308)
@@ -75,6 +75,17 @@
     fake_release.depends = first
     QMAKE_EXTRA_TARGETS += fake_release
 
+    # A lot of our code generators require GNU tools, readily available
+    # on Linux and Mac OS X. On Windows we do have a convenience copy in
+    # Qt5's top-level repository, so let's add that to the PATH if we can
+    # find it.
+    win32 {
+        GNUTOOLS=$$[QT_HOST_DATA]/../gnuwin32/bin
+        exists($$GNUTOOLS/gperf.exe) {
+            GNUTOOLS = "(set $$escape_expand(\\\")PATH=$$toSystemPath($$GNUTOOLS);%PATH%$$escape_expand(\\\"))"
+        }
+    }
+
     for(generator, GENERATORS) {
         eval($${generator}.CONFIG = target_predeps no_link)
         eval($${generator}.dependency_type = TYPE_C)
@@ -86,6 +97,11 @@
         script = $$eval($${generator}.script)
         eval($${generator}.depends += $$script)
 
+        commands = $$eval($${generator}.commands)
+        !isEmpty(commands):!isEmpty(GNUTOOLS) {
+            eval($${generator}.commands = $${GNUTOOLS} && $$val_escape($${generator}.commands))
+        }
+
         !isEmpty($${generator}.input) {
             # Compiler-style generator
             QMAKE_EXTRA_COMPILERS += $$generator
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to