Title: [161328] trunk/Tools
Revision
161328
Author
[email protected]
Date
2014-01-05 20:09:02 -0800 (Sun, 05 Jan 2014)

Log Message

[GTK][CMake] Add support for building the GTK+ port with cmake to build-webkit
https://bugs.webkit.org/show_bug.cgi?id=126212

Reviewed by Daniel Bates.

Allow building the GTK+ cmake port with --gtkcmake.

* Scripts/build-webkit: Use the new isGtkCMake function to head down the CMake path
when appropriate. Skip the autotoos path when isGtkAutotools is false.
* Scripts/webkitdirs.pm: Add an isGtkCMake path in addition to the newly renamed isGtkAutotools.
Add isGtk which checks isGtkCMake || isGtkAutotools
(determineArchitecture): Use the CMake path for GTK+ when appropriate.
(argumentsForConfiguration): use --gtkcmake when appropriate.
(jscProductDir): Look in the CMake directory when appropriate.
(builtDylibPathForName): CMake builds the library into a different directory, so handle that.
(determineIsGtkCMake): Added.
(isGtkCMake): Added.
(isGtkAutotools): Renamed from isGtk.
(isGtk): New function which returns isGtkAutotools || isGtkCMake.
(determineIsGtkAutotools): Renamed from determineIsGtk.
(cmakeBasedPortName): Added a GTK+ path.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (161327 => 161328)


--- trunk/Tools/ChangeLog	2014-01-06 04:08:30 UTC (rev 161327)
+++ trunk/Tools/ChangeLog	2014-01-06 04:09:02 UTC (rev 161328)
@@ -1,3 +1,27 @@
+2014-01-05  Martin Robinson  <[email protected]>
+
+        [GTK][CMake] Add support for building the GTK+ port with cmake to build-webkit
+        https://bugs.webkit.org/show_bug.cgi?id=126212
+
+        Reviewed by Daniel Bates.
+
+        Allow building the GTK+ cmake port with --gtkcmake.
+
+        * Scripts/build-webkit: Use the new isGtkCMake function to head down the CMake path
+        when appropriate. Skip the autotoos path when isGtkAutotools is false.
+        * Scripts/webkitdirs.pm: Add an isGtkCMake path in addition to the newly renamed isGtkAutotools.
+        Add isGtk which checks isGtkCMake || isGtkAutotools
+        (determineArchitecture): Use the CMake path for GTK+ when appropriate.
+        (argumentsForConfiguration): use --gtkcmake when appropriate.
+        (jscProductDir): Look in the CMake directory when appropriate.
+        (builtDylibPathForName): CMake builds the library into a different directory, so handle that.
+        (determineIsGtkCMake): Added.
+        (isGtkCMake): Added.
+        (isGtkAutotools): Renamed from isGtk.
+        (isGtk): New function which returns isGtkAutotools || isGtkCMake.
+        (determineIsGtkAutotools): Renamed from determineIsGtk.
+        (cmakeBasedPortName): Added a GTK+ path.
+
 2014-01-04  Martin Robinson  <[email protected]>
 
         [GTK] [CMake] Fix the video and audio build

Modified: trunk/Tools/Scripts/build-webkit (161327 => 161328)


--- trunk/Tools/Scripts/build-webkit	2014-01-06 04:08:30 UTC (rev 161327)
+++ trunk/Tools/Scripts/build-webkit	2014-01-06 04:09:02 UTC (rev 161328)
@@ -290,7 +290,7 @@
     buildCMakeProjectOrExit($clean, "Nix", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
 }
 
-if (isEfl()) {
+if (isEfl() || isGtkCMake()) {
     # By default we build using all of the available CPUs.
     $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/;
     $cmakeArgs = "-DENABLE_WEBKIT=OFF "  . $cmakeArgs if $noWebKit1;
@@ -300,7 +300,8 @@
     # we enable new features. This forces a reconfiguration.
     removeCMakeCache();
 
-    buildCMakeProjectOrExit($clean, "Efl", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
+    my $portName = (isEfl() ? "Efl" : "GTK");
+    buildCMakeProjectOrExit($clean, $portName, $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs);
 }
 
 if (isWinCE()) {
@@ -325,14 +326,14 @@
     $result = 0;
 
     # For Gtk the WebKit project builds all others
-    if (isGtk() && $dir ne "Source/WebKit") {
+    if (isGtkAutotools() && $dir ne "Source/WebKit") {
         chdirWebKit();
         next;
     }
 
     my $project = basename($dir);
     my $baseProductDir = baseProductDir();
-    if (isGtk()) {
+    if (isGtkAutotools()) {
         $result = buildGtkProject($project, $clean, $prefixPath, $makeArgs, $noWebKit1, $noWebKit2, @features);
     } elsif (isAppleMacWebKit()) {
         my @local_options = @options;

Modified: trunk/Tools/Scripts/webkitdirs.pm (161327 => 161328)


--- trunk/Tools/Scripts/webkitdirs.pm	2014-01-06 04:08:30 UTC (rev 161327)
+++ trunk/Tools/Scripts/webkitdirs.pm	2014-01-06 04:09:02 UTC (rev 161328)
@@ -90,7 +90,8 @@
 my $nmPath;
 my $osXVersion;
 my $generateDsym;
-my $isGtk;
+my $isGtkAutotools;
+my $isGtkCMake;
 my $isWinCE;
 my $isWinCairo;
 my $isWin64;
@@ -291,7 +292,7 @@
     determineBaseProductDir();
     determineXcodeSDK();
 
-    if (isGtk()) {
+    if (isGtkAutotools()) {
         determineConfigurationProductDir();
         my $host_triple = `grep -E '^host = ' $configurationProductDir/GNUmakefile 2> /dev/null`;
         if ($host_triple =~ m/^host = ([^-]+)-/) {
@@ -316,7 +317,7 @@
                 $architecture = 'armv7';
             }
         }
-    } elsif (isEfl() || isNix()) {
+    } elsif (isEfl() || isNix() || isGtkCMake()) {
         my $host_processor = "";
         $host_processor = `cmake --system-information | grep CMAKE_SYSTEM_PROCESSOR`;
         if ($host_processor =~ m/^CMAKE_SYSTEM_PROCESSOR \"([^"]+)\"/) {
@@ -379,7 +380,8 @@
     push(@args, '--release') if ($configuration =~ "^Release");
     push(@args, '--32-bit') if ($architecture ne "x86_64" and !isWin64());
     push(@args, '--64-bit') if (isWin64());
-    push(@args, '--gtk') if isGtk();
+    push(@args, '--gtk') if isGtkAutotools();
+    push(@args, '--gtkcmake') if isGtkCMake();
     push(@args, '--efl') if isEfl();
     push(@args, '--nix') if isNix();
     push(@args, '--wincairo') if isWinCairo();
@@ -532,8 +534,8 @@
 sub jscProductDir
 {
     my $productDir = productDir();
-    $productDir .= "/bin" if (isEfl() || isNix());
-    $productDir .= "/Programs" if isGtk();
+    $productDir .= "/bin" if (isEfl() || isNix() || isGtkCMake());
+    $productDir .= "/Programs" if isGtkAutotools();
 
     return $productDir;
 }
@@ -777,8 +779,13 @@
         my @libraries = ("libwebkitgtk-1.0", "libwebkitgtk-3.0", "libwebkit2gtk-3.0");
         my $extension = isDarwin() ? ".dylib" : ".so";
 
+        my $builtLibraryPath = "$configurationProductDir/.libs/";
+        if (isGtkCMake()) {
+            $builtLibraryPath = "$configurationProductDir/lib/";
+        }
+
         foreach $libraryName (@libraries) {
-            my $libraryPath = "$configurationProductDir/.libs/" . $libraryName . $extension;
+            my $libraryPath = "$builtLibraryPath" . $libraryName . $extension;
             return $libraryPath if -e $libraryPath;
         }
         return "NotFound";
@@ -1045,6 +1052,18 @@
     return $isEfl;
 }
 
+sub determineIsGtkCMake()
+{
+    return if defined($isGtkCMake);
+    $isGtkCMake = checkForArgumentAndRemoveFromARGV("--gtkcmake");
+}
+
+sub isGtkCMake()
+{
+    determineIsGtkCMake();
+    return $isGtkCMake;
+}
+
 sub determineIsNix()
 {
     return if defined($isNix);
@@ -1056,16 +1075,22 @@
     determineIsNix();
     return $isNix;
 }
+
+sub isGtkAutotools()
+{
+    determineIsGtkAutotools();
+    return $isGtkAutotools;
+}
+
 sub isGtk()
 {
-    determineIsGtk();
-    return $isGtk;
+    return isGtkCMake() || isGtkAutotools();
 }
 
-sub determineIsGtk()
+sub determineIsGtkAutotools()
 {
-    return if defined($isGtk);
-    $isGtk = checkForArgumentAndRemoveFromARGV("--gtk");
+    return if defined($isGtkAutotools);
+    $isGtkAutotools = checkForArgumentAndRemoveFromARGV("--gtk");
 }
 
 sub isWinCE()
@@ -2096,6 +2121,7 @@
     return "Efl" if isEfl();
     return "WinCE" if isWinCE();
     return "Nix" if isNix();
+    return "GTK" if isGtk();
     return "";
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to