[GTK] Detect cross-compilation in webkitdirs.pm to not generate gtkdoc
authorrgabor@webkit.org <rgabor@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 09:01:21 +0000 (09:01 +0000)
committerrgabor@webkit.org <rgabor@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 09:01:21 +0000 (09:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76138

Reviewed by Martin Robinson.

* Scripts/webkitdirs.pm:
(isCrossCompilation):
(buildAutotoolsProject):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105974 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index fa3081b..44e2f7f 100644 (file)
@@ -1,3 +1,14 @@
+2012-01-26  Gabor Rapcsanyi  <rgabor@webkit.org>
+
+        [GTK] Detect cross-compilation in webkitdirs.pm to not generate gtkdoc
+        https://bugs.webkit.org/show_bug.cgi?id=76138
+
+        Reviewed by Martin Robinson.
+
+        * Scripts/webkitdirs.pm:
+        (isCrossCompilation):
+        (buildAutotoolsProject):
+
 2012-01-25  Adam Barth  <abarth@webkit.org>
 
         Kentaro is a reviewer now.  Yay!
index 8ab60d9..431baaf 100755 (executable)
@@ -1232,6 +1232,19 @@ sub isARM()
     return $Config{archname} =~ /^arm-/;
 }
 
+sub isCrossCompilation()
+{
+  my $compiler = $ENV{'CC'};
+  if ($compiler =~ /gcc/) {
+      my $compiler_options = `$compiler -v 2>&1`;
+      my @host = $compiler_options =~ m/--host=(.*?)\s/;
+      my @target = $compiler_options =~ m/--target=(.*?)\s/;
+
+      return ($host[0] ne "" && $target[0] ne "" && $host[0] ne $target[0]);
+  }
+  return 0;
+}
+
 sub isAppleWebKit()
 {
     return !(isQt() or isGtk() or isWx() or isChromium() or isEfl() or isWinCE() or isBlackBerry());
@@ -1907,7 +1920,7 @@ sub buildAutotoolsProject($@)
 
     chdir ".." or die;
 
-    if ($project eq 'WebKit') {
+    if ($project eq 'WebKit' && !isCrossCompilation()) {
         my @docGenerationOptions = ($runWithJhbuild, "$gtkScriptsPath/generate-gtkdoc", "--skip-html");
         if ($debug) {
             push(@docGenerationOptions, "--debug");