<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164632] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164632">164632</a></dd>
<dt>Author</dt> <dd>mrobinson@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-24 23:30:21 -0800 (Mon, 24 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
https://bugs.webkit.org/show_bug.cgi?id=128417

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: Define the paths to the pkgconfig files here, so that they
may one day be used in the webkitdom config file generation.

Source/WebCore:

* bindings/gobject/GNUmakefile.am: Generate a config file for webkitdom documentation generation.

Source/WebKit:

* PlatformGTK.cmake: Correct the definition of WebKitGTK_ENUM_GENERATION_HEADERS and generate
a gtkdoc-webkitgtk.cfg file to be used by generate-gtkdoc.

Source/WebKit/gtk:

* GNUmakefile.am: Generate a config file for generate-gtkdoc.

Source/WebKit2:

* GNUmakefile.am: Generate a config file for generate-gtkdoc.
* PlatformGTK.cmake: Ditto.

Tools:

* gtk/GNUmakefile.am: Make the documentation process depend on the configuration files.
* gtk/generate-gtkdoc: Switch from using hard-coded configurations to reading them from
a makefile. This allows accepting a header list from the build system, which can be used
to dynamically build a list of ignored files. We can ignore any source file that doesn't
have a corresponding header file on the header list.
* gtk/gtkdoc.py: Now accept a headers parameter, which can be used instead of passing just
source directories to gtkdoc-scan.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkGNUmakefileam">trunk/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsgobjectGNUmakefileam">trunk/Source/WebCore/bindings/gobject/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformGTKcmake">trunk/Source/WebKit/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKitgtkChangeLog">trunk/Source/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitgtkGNUmakefileam">trunk/Source/WebKit/gtk/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2GNUmakefileam">trunk/Source/WebKit2/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkGNUmakefileam">trunk/Tools/gtk/GNUmakefile.am</a></li>
<li><a href="#trunkToolsgtkgenerategtkdoc">trunk/Tools/gtk/generate-gtkdoc</a></li>
<li><a href="#trunkToolsgtkgtkdocpy">trunk/Tools/gtk/gtkdoc.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/OptionsGTK.cmake: Define the paths to the pkgconfig files here, so that they
+        may one day be used in the webkitdom config file generation.
+
</ins><span class="cx"> 2014-02-18  Gyuyoung Kim  &lt;gyuyoung.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][CMake] Fix javascriptcore test failings by the jsCStack branch merge
</span></span></pre></div>
<a id="trunkGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/GNUmakefile.am (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/GNUmakefile.am        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/GNUmakefile.am        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -133,6 +133,15 @@
</span><span class="cx"> typelibsdir := $(libdir)/girepository-1.0
</span><span class="cx"> endif
</span><span class="cx"> 
</span><ins>+webkit1_pkg_config_file = Source/WebKit/gtk/webkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.pc
+webkit2_pkg_config_file = Source/WebKit2/webkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.pc
+
+if ENABLE_WEBKIT2
+webkitdom_pkgconfig_file = $(webkit2_pkg_config_file)
+else
+webkitdom_pkgconfig_file = $(webkit1_pkg_config_file)
+endif
+
</ins><span class="cx"> # We do not care at all about this implicit built-in make rules,
</span><span class="cx"> # disable them to save some build time
</span><span class="cx"> %: %.c
</span><span class="lines">@@ -291,4 +300,4 @@
</span><span class="cx">         @mkdir -p $(distdir)/Documentation/webkitdomgtk/html
</span><span class="cx">         @mkdir -p $(distdir)/Documentation/webkitdomgtk/tmpl
</span><span class="cx">         @-cp ./Documentation/webkitdomgtk/tmpl/*.sgml $(distdir)/Documentation/webkitdomgtk/tmpl
</span><del>-        @cp ./Documentation/webkitdomgtk/html/* $(distdir)/Documentation/webkitdomgtk/html
</del><span class="cx">\ No newline at end of file
</span><ins>+        @cp ./Documentation/webkitdomgtk/html/* $(distdir)/Documentation/webkitdomgtk/html
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebCore/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * bindings/gobject/GNUmakefile.am: Generate a config file for webkitdom documentation generation.
+
</ins><span class="cx"> 2014-02-24  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Need to initialize VM stack data even when the VM is on an exclusive thread.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgobjectGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/gobject/GNUmakefile.am (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/gobject/GNUmakefile.am        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebCore/bindings/gobject/GNUmakefile.am        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -575,12 +575,15 @@
</span><span class="cx">         -fvisibility=hidden \
</span><span class="cx">         $(global_cflags)
</span><span class="cx"> 
</span><ins>+webkitgtk_gdom_include_dirs = \
+        -I$(WebCore)/bindings \
+        -I$(WebCore)/bindings/gobject \
+        -I$(GENSOURCES_WEBKITDOM)
+
</ins><span class="cx"> libGObjectDOMBindings_la_CPPFLAGS = \
</span><span class="cx">         -DBUILDING_WebCore \
</span><span class="cx">         -DBUILDING_WEBKIT \
</span><del>-        -I$(WebCore)/bindings \
-        -I$(WebCore)/bindings/gobject \
-        -I$(GENSOURCES_WEBKITDOM) \
</del><ins>+        $(webkitgtk_gdom_include_dirs) \
</ins><span class="cx">         $(global_cppflags) \
</span><span class="cx">         $(platform_cppflags) \
</span><span class="cx">         $(platformgtk_cppflags) \
</span><span class="lines">@@ -591,3 +594,13 @@
</span><span class="cx">         $(FREETYPE_CFLAGS) \
</span><span class="cx">         $(GLIB_CFLAGS) \
</span><span class="cx">         $(LIBSOUP_CFLAGS)
</span><ins>+
+gtkdoc-webkitdom.cfg: $(WebCore)/bindings/gobject/GNUmakefile.am $(srcdir)/Tools/gtk/GNUmakefile.am
+        $(AM_V_GEN)echo &quot;[webkitdomgtk]&quot; &gt; $@ &amp;&amp; \
+        echo &quot;pkgconfig_file=$(webkitdom_pkgconfig_file)&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;namespace=webkit_dom&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;doc_dir=DerivedSources/webkitdom/docs&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;cflags=-I$(srcdir)/Source $(webkitgtk_gdom_include_dirs)&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;source_dirs=$(top_builddir)/DerivedSources/webkitdom $(srcdir)/Source/WebCore/bindings/gobject&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;headers=$(webkitgtk_gdom_built_h_api) DerivedSources/webkitdom/WebKitDOMDeprecated.h&quot; &gt;&gt; $@
+BUILT_SOURCES += gtkdoc-webkitdom.cfg
</ins></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * PlatformGTK.cmake: Correct the definition of WebKitGTK_ENUM_GENERATION_HEADERS and generate
+        a gtkdoc-webkitgtk.cfg file to be used by generate-gtkdoc.
+
</ins><span class="cx"> 2014-02-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add WebViewGroup
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformGTK.cmake (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformGTK.cmake        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit/PlatformGTK.cmake        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKITGTK_DIR})
</span><span class="cx"> file(MAKE_DIRECTORY ${DERIVED_SOURCES_WEBKITGTK_API_DIR})
</span><span class="cx"> configure_file(gtk/webkit/webkitversion.h.in ${DERIVED_SOURCES_WEBKITGTK_API_DIR}/webkitversion.h)
</span><del>-configure_file(gtk/webkit.pc.in ${CMAKE_BINARY_DIR}/Source/WebKit/gtk/webkitgtk-${WEBKITGTK_API_VERSION}.pc @ONLY)
</del><ins>+configure_file(gtk/webkit.pc.in ${WebKit_PKGCONFIG_FILE} @ONLY)
</ins><span class="cx"> 
</span><span class="cx"> add_definitions(-DPACKAGE_LOCALE_DIR=&quot;${CMAKE_INSTALL_FULL_LOCALEDIR}&quot;)
</span><span class="cx"> 
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> 
</span><span class="cx"> # To generate webkitenumtypes.h we want to use all installed headers, except webkitenumtypes.h itself.
</span><span class="cx"> set(WebKitGTK_ENUM_GENERATION_HEADERS ${WebKitGTK_INSTALLED_HEADERS})
</span><del>-list(REMOVE_ITEM WebKitGTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/webkitenumtypes.h)
</del><ins>+list(REMOVE_ITEM WebKitGTK_ENUM_GENERATION_HEADERS ${DERIVED_SOURCES_WEBKITGTK_API_DIR}/webkitenumtypes.h)
</ins><span class="cx"> add_custom_command(
</span><span class="cx">     OUTPUT ${DERIVED_SOURCES_WEBKITGTK_API_DIR}/webkitenumtypes.h
</span><span class="cx">            ${DERIVED_SOURCES_WEBKITGTK_API_DIR}/webkitenumtypes.cpp
</span><span class="lines">@@ -228,3 +228,17 @@
</span><span class="cx"> install(FILES ${CMAKE_BINARY_DIR}/WebKit-${WEBKITGTK_API_VERSION}.typelib
</span><span class="cx">         DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
</span><span class="cx"> )
</span><ins>+
+file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkitgtk.cfg
+    &quot;[webkitgtk]\n&quot;
+    &quot;pkgconfig_file=${WebKit_PKGCONFIG_FILE}\n&quot;
+    &quot;namespace=webkit\n&quot;
+    &quot;cflags=-I${DERIVED_SOURCES_DIR}\n&quot;
+    &quot;       -I${CMAKE_SOURCE_DIR}\n&quot;
+    &quot;       -I${CMAKE_SOURCE_DIR}/Source\n&quot;
+    &quot;       -I${CMAKE_SOURCE_DIR}/JavaScriptCore/ForwardingHeaders\n&quot;
+    &quot;doc_dir=${WEBKIT_DIR}/gtk/docs\n&quot;
+    &quot;source_dirs=${WEBKIT_DIR}/gtk/webkit\n&quot;
+    &quot;            ${DERIVED_SOURCES_WEBKITGTK_API_DIR}\n&quot;
+    &quot;headers=${WebKitGTK_ENUM_GENERATION_HEADERS}\n&quot;
+)
</ins></span></pre></div>
<a id="trunkSourceWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit/gtk/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * GNUmakefile.am: Generate a config file for generate-gtkdoc.
+
</ins><span class="cx"> 2014-02-24  Enrique Ocaña González  &lt;eocanha@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r164438): [GTK] Tests /WebKitGtk/testcontextmenu, /WebKitGtk/testmimehandling, /WebKitGtk/testloading assert in Debug build
</span></span></pre></div>
<a id="trunkSourceWebKitgtkGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/GNUmakefile.am (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/GNUmakefile.am        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit/gtk/GNUmakefile.am        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -376,6 +376,17 @@
</span><span class="cx">         &amp;&amp; cp xgen-gtc $@ \
</span><span class="cx">         &amp;&amp; rm -f xgen-gtc
</span><span class="cx"> 
</span><ins>+gtkdoc-webkitgtk.cfg: $(WebKit)/GNUmakefile.am $(srcdir)/Tools/gtk/GNUmakefile.am
+        $(AM_V_GEN)echo &quot;[webkitgtk]&quot; &gt; $@ &amp;&amp; \
+        echo &quot;pkgconfig_file=$(webkit1_pkg_config_file)&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;namespace=webkit&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;cflags=$(libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS)&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;doc_dir=$(srcdir)/Source/WebKit/gtk/docs&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;source_dirs=$(srcdir)/Source/WebKit/gtk/webkit\n \
+           Source/WebKit/gtk/webkit&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;headers=$(webkitgtk_static_h_api) Source/WebKit/gtk/webkit/webkitversion.h&quot; &gt;&gt; $@
+BUILT_SOURCES += gtkdoc-webkitgtk.cfg
+
</ins><span class="cx"> EXTRA_DIST += \
</span><span class="cx">         $(WebKit)/ChangeLog \
</span><span class="cx">         $(WebKit)/NEWS \
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * GNUmakefile.am: Generate a config file for generate-gtkdoc.
+        * PlatformGTK.cmake: Ditto.
+
</ins><span class="cx"> 2014-02-24  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         32-bit build fix.
</span></span></pre></div>
<a id="trunkSourceWebKit2GNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/GNUmakefile.am (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/GNUmakefile.am        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit2/GNUmakefile.am        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -803,6 +803,25 @@
</span><span class="cx">         -fvisibility-inlines-hidden \
</span><span class="cx">         $(global_cxxflags)
</span><span class="cx"> 
</span><ins>+# It would be nice to use the CPPFLAGS from the WebKit2 library here, but the prefix
+# header doesn't seem to play nicely with the gtkdoc tools.
+gtkdoc-webkit2gtk.cfg: $(WebKit2)/GNUmakefile.am $(WebKit2)/GNUmakefile.list.am
+        $(AM_V_GEN)echo &quot;[webkit2gtk]&quot; &gt; $@ &amp;&amp; \
+        echo &quot;pkgconfig_file=$(webkit2_pkg_config_file)&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;namespace=webkit&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;cflags=-I$(srcdir)/Source\n \
+       -I$(WebKit2)/UIProcess/API/gtk\n \
+       -IDerivedSources/webkit2gtk/include\n \
+       -IDerivedSources/WebKit2/webkit2gtk\n&quot; &gt;&gt; $@ &amp;&amp; \
+        echo &quot;doc_dir=$(WebKit2)/UIProcess/API/gtk/docs&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;source_dirs=$(WebKit2)/UIProcess/API/gtk\n \
+           $(WebKit2)/WebProcess/InjectedBundle/API/gtk\n \
+           DerivedSources/WebKit2/webkit2gtk/webkit2\n&quot; &gt;&gt; $@ &amp;&amp; \
+        echo -e &quot;headers=$(webkit2gtk_ui_h_api)\n \
+         $(webkit2gtk_web_extension_h_api)\n \
+         DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitVersion.h&quot; &gt;&gt; $@
+BUILT_SOURCES += gtkdoc-webkit2gtk.cfg
+
</ins><span class="cx"> EXTRA_DIST += \
</span><span class="cx">         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
</span><span class="cx">         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR})
</span><span class="cx"> 
</span><span class="cx"> configure_file(UIProcess/API/gtk/WebKitVersion.h.in ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h)
</span><del>-configure_file(webkit2gtk.pc.in ${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc @ONLY)
</del><ins>+configure_file(webkit2gtk.pc.in ${WebKit2_PKGCONFIG_FILE} @ONLY)
</ins><span class="cx"> 
</span><span class="cx"> add_definitions(-DWEBKIT2_COMPILATION)
</span><span class="cx"> add_definitions(-DLIBEXECDIR=&quot;${CMAKE_INSTALL_FULL_LIBEXECDIR}&quot;)
</span><span class="lines">@@ -790,3 +790,18 @@
</span><span class="cx">               ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.typelib
</span><span class="cx">         DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
</span><span class="cx"> )
</span><ins>+
+file(WRITE ${CMAKE_BINARY_DIR}/gtkdoc-webkit2gtk.cfg
+    &quot;[webkit2gtk]\n&quot;
+    &quot;pkgconfig_file=${WebKit2_PKGCONFIG_FILE}\n&quot;
+    &quot;namespace=webkit\n&quot;
+    &quot;cflags=-I${CMAKE_SOURCE_DIR}/Source\n&quot;
+    &quot;       -I${WEBKIT2_DIR}/UIProcess/API/gtk\n&quot;
+    &quot;       -I${DERIVED_SOURCES_WEBKIT2GTK_DIR}\n&quot;
+    &quot;       -I${FORWARDING_HEADERS_WEBKIT2GTK_DIR}\n&quot;
+    &quot;doc_dir=${WEBKIT2_DIR}/UIProcess/API/gtk/docs\n&quot;
+    &quot;source_dirs=${WEBKIT2_DIR}/UIProcess/API/gtk\n&quot;
+    &quot;            ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk\n&quot;
+    &quot;            ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}\n&quot;
+    &quot;headers=${WebKit2GTK_ENUM_GENERATION_HEADERS} ${WebKit2WebExtension_INSTALLED_HEADERS}\n&quot;
+)
</ins></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Source/cmake/OptionsGTK.cmake        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -264,6 +264,10 @@
</span><span class="cx"> set(FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders)
</span><span class="cx"> set(FORWARDING_HEADERS_WEBKIT2GTK_DIR ${FORWARDING_HEADERS_DIR}/webkit2gtk)
</span><span class="cx"> set(FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR ${FORWARDING_HEADERS_DIR}/webkit2gtk-webextension)
</span><ins>+
+set(WebKit_PKGCONFIG_FILE ${CMAKE_BINARY_DIR}/Source/WebKit/gtk/webkitgtk-${WEBKITGTK_API_VERSION}.pc)
+set(WebKit2_PKGCONFIG_FILE ${CMAKE_BINARY_DIR}/Source/WebKit2/webkit2gtk-${WEBKITGTK_API_VERSION}.pc)
+
</ins><span class="cx"> set(SHOULD_INSTALL_JS_SHELL ON)
</span><span class="cx"> 
</span><span class="cx"> # Push of rbp is needed after JSC JIT uses CStack. See http://wkbug.com/127777.
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Tools/ChangeLog        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-02-24  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
+        https://bugs.webkit.org/show_bug.cgi?id=128417
+
+        Reviewed by Carlos Garcia Campos.
+
+        * gtk/GNUmakefile.am: Make the documentation process depend on the configuration files.
+        * gtk/generate-gtkdoc: Switch from using hard-coded configurations to reading them from
+        a makefile. This allows accepting a header list from the build system, which can be used
+        to dynamically build a list of ignored files. We can ignore any source file that doesn't
+        have a corresponding header file on the header list. 
+        * gtk/gtkdoc.py: Now accept a headers parameter, which can be used instead of passing just
+        source directories to gtkdoc-scan.
+
</ins><span class="cx"> 2014-02-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a DefaultVisitedLinkProvider and route visited link actions through it
</span></span></pre></div>
<a id="trunkToolsgtkGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/GNUmakefile.am (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/GNUmakefile.am        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Tools/gtk/GNUmakefile.am        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -10,21 +10,23 @@
</span><span class="cx"> .PHONY : docs
</span><span class="cx"> DISTCLEANFILES += docs-build.stamp
</span><span class="cx"> 
</span><del>-docs_build_stamp_list = \
</del><ins>+docs_build_dependencies = \
</ins><span class="cx">         Source/WebKit/gtk/docs/webkitenvironment.xml
</span><span class="cx"> 
</span><span class="cx"> if ENABLE_WEBKIT1
</span><del>-docs_build_stamp_list += \
</del><ins>+docs_build_dependencies += \
</ins><span class="cx">         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
</span><span class="cx">         Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
</span><del>-        Source/WebKit/gtk/docs/webkitgtk-sections.txt
</del><ins>+        Source/WebKit/gtk/docs/webkitgtk-sections.txt \
+        gtkdoc-webkitgtk.cfg
</ins><span class="cx"> endif
</span><span class="cx"> 
</span><span class="cx"> if ENABLE_WEBKIT2
</span><del>-docs_build_stamp_list += \
</del><ins>+docs_build_dependencies += \
</ins><span class="cx">         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
</span><span class="cx">         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
</span><del>-        Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
</del><ins>+        Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
+        gtkdoc-webkit2gtk.cfg
</ins><span class="cx"> endif
</span><span class="cx"> 
</span><span class="cx"> $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-docs.sgml: $(gdom_symbol_files) $(srcdir)/Tools/gtk/generate-webkitdom-doc-files
</span><span class="lines">@@ -39,12 +41,13 @@
</span><span class="cx">         $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-docs.sgml \
</span><span class="cx">         $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-sections.txt
</span><span class="cx"> 
</span><del>-docs_build_stamp_list += \
</del><ins>+docs_build_dependencies += \
</ins><span class="cx">         libGObjectDOMBindings.la \
</span><span class="cx">         $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-docs.sgml \
</span><del>-        $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-sections.txt
</del><ins>+        $(top_builddir)/DerivedSources/webkitdom/docs/webkitdomgtk-sections.txt \
+        gtkdoc-webkitdom.cfg
</ins><span class="cx"> 
</span><del>-docs-build.stamp: $(docs_build_stamp_list)
</del><ins>+docs-build.stamp: $(docs_build_dependencies)
</ins><span class="cx">         CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
</span><span class="cx">         @touch docs-build.stamp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsgtkgenerategtkdoc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/generate-gtkdoc (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/generate-gtkdoc        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Tools/gtk/generate-gtkdoc        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -15,6 +15,9 @@
</span><span class="cx"> # License along with this library; if not, write to the Free Software
</span><span class="cx"> # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
</span><span class="cx"> 
</span><ins>+from __future__ import print_function
+from ConfigParser import SafeConfigParser
+
</ins><span class="cx"> import argparse
</span><span class="cx"> import common
</span><span class="cx"> import glob
</span><span class="lines">@@ -23,9 +26,6 @@
</span><span class="cx"> import os.path
</span><span class="cx"> import sys
</span><span class="cx"> 
</span><del>-sys.path.insert(0, os.path.join(os.path.dirname(__file__), &quot;../jhbuild&quot;))
-import jhbuildrc_common
-
</del><span class="cx"> def configure_logging(verbose):
</span><span class="cx">     level = logging.DEBUG if verbose else logging.INFO
</span><span class="cx">     logger = logging.getLogger('gtkdoc')
</span><span class="lines">@@ -38,183 +38,119 @@
</span><span class="cx">     else:
</span><span class="cx">         handler.setFormatter(logging.Formatter('%(message)s'))
</span><span class="cx"> 
</span><del>-
-def get_gtkdoc_module_paths(xref_dep_packages):
-    deps = []
-    html_dir = os.path.join('share', 'gtk-doc', 'html')
-
-    for package in xref_dep_packages:
-        prefix = common.prefix_of_pkg_config_file(package)
-        if prefix is None:
-            continue
-        for module in xref_dep_packages[package]:
-            deps.append(os.path.join(prefix, html_dir, module))
-
-    return deps
-
-
-def get_common_xref_deps():
-    return {
</del><ins>+def get_gtkdoc_module_paths(gtk_version):
+    dependent_packages = {
</ins><span class="cx">         'glib-2.0' : ['glib', 'gobject', 'gio'],
</span><span class="cx">         'libsoup-2.4' : ['libsoup-2.4'],
</span><span class="cx">         'gdk-pixbuf-2.0': ['gdk-pixbuf']
</span><span class="cx">     }
</span><del>-
-def webkitdom_docs_html_path():
-    return common.build_path('Documentation', 'webkitdomgtk', 'html')
-
-def get_webkit2_options(virtual_root):
-    api_path = jhbuildrc_common.top_level_path('Source', 'WebKit2', 'UIProcess', 'API', 'gtk')
-    injected_bundle_api_path = jhbuildrc_common.top_level_path('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk')
-
-    if common.is_cmake_build():
-        generated_api_path = common.build_path('DerivedSources', 'webkit2gtk', 'webkit2')
</del><ins>+    if gtk_version == 3:
+        dependent_packages.update({'gtk+-3.0' : ['gtk3', 'gdk3']})
</ins><span class="cx">     else:
</span><del>-        generated_api_path = common.build_path('DerivedSources', 'WebKit2', 'webkit2gtk', 'webkit2')
</del><ins>+        dependent_packages.update({'gtk+-2.0' : ['gtk', 'gdk']})
</ins><span class="cx"> 
</span><del>-    xref_deps = get_common_xref_deps().copy()
-    xref_deps.update({
-        'gtk+-3.0' : ['gtk3', 'gdk3']
-    })
</del><ins>+    paths = []
+    html_dir = os.path.join('share', 'gtk-doc', 'html')
+    for package, modules in dependent_packages.iteritems():
+        prefix = common.prefix_of_pkg_config_file(package)
+        if prefix is None:
+            continue
+        for module in modules:
+            paths.append(os.path.join(prefix, html_dir, module))
+    # This technically is not needed for the GObject DOM bindings documentation itself,
+    # but adding it doesn't hurt and allows us to avoid a check here.
+    paths.append(common.build_path('Documentation', 'webkitdomgtk', 'html'))
+    return paths
</ins><span class="cx"> 
</span><del>-    def src_path(*args):
-        return os.path.join(api_path, *args)
</del><ins>+def print_missing_api(generator):
+    missing_api = generator.api_missing_documentation()
+    if not missing_api:
+        return
+    print(&quot;\nThe following API are missing documentation:&quot;)
+    for api in missing_api:
+        print(&quot;\t{0}&quot;.format(api))
</ins><span class="cx"> 
</span><del>-    options = {
-        'decorator': 'WEBKIT_API|WEBKIT_DEPRECATED|WEBKIT_DEPRECATED_FOR\(.+\)',
-        'deprecation_guard': 'WEBKIT_DISABLE_DEPRECATED',
-        'library_path' : common.library_build_path(),
-        'virtual_root' : virtual_root,
-        'module_name' : 'webkit2gtk',
-        'namespace' : 'webkit',
-        'doc_dir' : src_path('docs'),
-        'output_dir' : common.build_path('Documentation', 'webkit2gtk'),
-        'source_dirs' : [src_path(), generated_api_path, injected_bundle_api_path],
-        'cflags' :
-            # Common paths
-            ' -I' + jhbuildrc_common.top_level_path('Source') + \
-            ' -I' + api_path + \
-            # Autotools paths
-            ' -I' + common.build_path('DerivedSources', 'webkit2gtk', 'include') + \
-            ' -I' + common.build_path('DerivedSources', 'WebKit2', 'webkit2gtk') + \
-            # CMake paths
-            ' -I' + common.build_path('DerivedSources', 'ForwardingHeaders', 'webkit2gtk') + \
-            ' -I' + common.build_path('DerivedSources', 'webkit2gtk'),
-        'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps) + [webkitdom_docs_html_path()],
-        'ignored_files': glob.glob(src_path('*Private.h')) + \
-                         glob.glob(os.path.join(injected_bundle_api_path, '*Private.h')) + \
-                         glob.glob(src_path('*Client*')) + \
-                         glob.glob(src_path('WebKitAuthenticationDialog.*')) + \
-                         glob.glob(src_path('WebKitBatteryProvider.*')) + \
-                         glob.glob(src_path('WebKitGeolocationProvider.*')) + \
-                         glob.glob(src_path('WebKitTextChecker.*')) + \
-                         glob.glob(src_path('WebKitWebViewBaseAccessible.*')) + \
-                         glob.glob(src_path('WebViewBaseInputMethodFilter.*')) + \
-                         glob.glob(os.path.join(generated_api_path, 'WebKitMarshal.*')) + \
-                         glob.glob(os.path.join(generated_api_path, 'WebKitEnumTypes.*')) + \
-                         glob.glob(src_path('tests/*.h'))
-    }
-    return options
</del><ins>+def files_to_ignore(source_dirs, headers_with_gtkdoc):
+    &quot;&quot;&quot;
+    Find files to ignore during documentation generation. We assume that if an
+    implementation file exists for a header with gtkdoc (say webkitfoo.cpp for
+    webkitfoo.h) we shouldn't ignore that file. Currently this holds true for all
+    of the WebKit project.
+    &quot;&quot;&quot;
+    implementation_files = list(headers_with_gtkdoc)
+    for header in headers_with_gtkdoc:
+        def add_file_if_exists(file):
+            if os.path.isfile(file):
+                implementation_files.append(os.path.abspath(file))
+        header_name_without_extension = os.path.splitext(header)[0]
+        add_file_if_exists(header_name_without_extension + &quot;.cpp&quot;)
+        add_file_if_exists(header_name_without_extension + &quot;.c&quot;)
</ins><span class="cx"> 
</span><del>-def get_webkit1_options(gtk_version, virtual_root):
-    def src_path(*args):
-        return jhbuildrc_common.top_level_path(*(('Source', 'WebKit', 'gtk') + args))
</del><ins>+    def file_should_be_ignored(file):
+        if os.path.splitext(file)[1] not in ['.h', '.c', '.cpp', '.cc']:
+            return False # These files are ignored anyway.
+        if not os.path.isfile(file):
+            return False
+        return os.path.abspath(file) not in implementation_files
</ins><span class="cx"> 
</span><del>-    def webkitversionh_path():
-        if common.is_cmake_build():
-            return common.build_path('DerivedSources', 'webkitgtk')
-        else:
-            return common.build_path('Source', 'WebKit', 'gtk', 'webkit')
</del><ins>+    all_files = sum([[os.path.join(dir, file) for file in os.listdir(dir)] for dir in source_dirs], [])
+    return filter(file_should_be_ignored, all_files)
</ins><span class="cx"> 
</span><del>-    xref_deps = get_common_xref_deps().copy()
-    if gtk_version == 3:
-        xref_deps.update({
-                'gtk+-3.0' : ['gtk3', 'gdk3']
-        })
-    else:
-        xref_deps.update({
-                'gtk+-2.0' : ['gtk', 'gdk']
-        })
</del><ins>+def get_generator_for_config(config_file, virtual_root):
+    if not os.path.isfile(config_file):
+        return None
</ins><span class="cx"> 
</span><del>-    options = {
-        'decorator': 'WEBKIT_API|WEBKIT_DEPRECATED|WEBKIT_DEPRECATED_FOR\(.+\)',
-        'deprecation_guard': 'WEBKIT_DISABLE_DEPRECATED',
-        'library_path' : common.library_build_path(),
-        'virtual_root' : virtual_root,
-        'module_name' : 'webkitgtk',
-        'namespace' : 'webkit',
-        'doc_dir' : src_path('docs'),
-        'output_dir' : common.build_path('Documentation', 'webkitgtk'),
-        'source_dirs' : [src_path('webkit'), webkitversionh_path()],
-        'cflags' : ' -I' + common.build_path('WebKit', 'gtk') + \
-                   ' -I' + common.build_path('DerivedSources') + \
-                   ' -I' + src_path() + \
-                   ' -I' + jhbuildrc_common.top_level_path('Source') + \
-                   ' -I' + jhbuildrc_common.top_level_path('Source', 'JavaScriptCore', 'ForwardingHeaders'),
-        'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps) + [webkitdom_docs_html_path()],
-        'ignored_files': glob.glob(src_path('webkit', '*private.*')) + \
-                         glob.glob(src_path('webkit', 'webkitauthenticationdialog.*')) + \
-                         glob.glob(src_path('webkit', 'webkitspellcheckerenchant.*'))
-    }
-    return options
</del><ins>+    config = SafeConfigParser()
+    config.read(config_file)
+    module_name = config.sections()[0]
+    pkgconfig_file = config.get(module_name, 'pkgconfig_file')
+    gtk_version = common.gtk_version_of_pkg_config_file(pkgconfig_file)
</ins><span class="cx"> 
</span><del>-def get_webkitdom_options(virtual_root):
-    def derived_sources_path(*args):
-        return common.build_path(*(('DerivedSources', 'webkitdom') + args))
-    def src_path(*args):
-        return jhbuildrc_common.top_level_path(*(('Source', 'WebCore', 'bindings', 'gobject') + args))
-
-    xref_deps = { 'glib-2.0' : ['glib', 'gobject', 'gio'] }
-
-    options = {
</del><ins>+    source_dirs = config.get(module_name, 'source_dirs').replace(';', ' ').split()
+    headers = [os.path.abspath(f) for f in config.get(module_name, 'headers').replace(';', ' ').split()]
+    return gtkdoc.PkgConfigGTKDoc(pkgconfig_file, {
</ins><span class="cx">         'decorator': 'WEBKIT_API|WEBKIT_DEPRECATED|WEBKIT_DEPRECATED_FOR\(.+\)',
</span><span class="cx">         'deprecation_guard': 'WEBKIT_DISABLE_DEPRECATED',
</span><del>-        'library_path' : common.library_build_path(),
-        'virtual_root' : virtual_root,
-        'module_name' : 'webkitdomgtk',
-        'namespace' : 'webkit_dom',
-        'doc_dir' : derived_sources_path('docs'),
-        'output_dir' : common.build_path('Documentation', 'webkitdomgtk'),
-        'source_dirs' : [derived_sources_path()],
-        'cflags' : ' -I' + derived_sources_path() + \
-                   ' -I' + src_path() + \
-                   ' -I' + jhbuildrc_common.top_level_path('Source'),
-        'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps),
-        'ignored_files': glob.glob(derived_sources_path('*Private.h'))
-    }
-    return options
</del><ins>+        'library_path': common.library_build_path(),
+        'virtual_root': virtual_root,
+        'module_name': module_name,
+        'namespace': config.get(module_name, 'namespace'),
+        'doc_dir': config.get(module_name, 'doc_dir'),
+        'output_dir': common.build_path('Documentation', module_name),
+        'source_dirs': source_dirs,
+        'headers': headers,
+        'cflags': &quot; &quot;.join(config.get(module_name, 'cflags').split()),
+        'cross_reference_deps': get_gtkdoc_module_paths(gtk_version),
+        'ignored_files': files_to_ignore(source_dirs, headers),
+    })
</ins><span class="cx"> 
</span><del>-def print_missing_api(generator):
-    missing_api = generator.api_missing_documentation()
-    if not missing_api:
-        return
-    print(&quot;\nThe following API are missing documentation:&quot;)
-    for api in missing_api:
-        print(&quot;\t%s&quot; % api)
-
</del><span class="cx"> def generate_doc(generator, skip_html):
</span><ins>+    print(&quot;\nGenerating {0} documentation...&quot;.format(generator.module_name))
</ins><span class="cx">     generator.generate(not skip_html)
</span><span class="cx">     if generator.saw_warnings:
</span><span class="cx">         print_missing_api(generator)
</span><span class="cx">     return generator.saw_warnings
</span><span class="cx"> 
</span><del>-if __name__ == &quot;__main__&quot;:
-    parser = argparse.ArgumentParser(description='Generate gtkdoc for WebKit.')
-    parser.add_argument('-v', '--verbose', action='store_true',
-                        help='Whether or not to run in verbose mode.')
-    parser.add_argument('--rebase', action='store_true',
-                        help='When specified, run the tool in rebase mode.')
-    parser.add_argument('--skip-html', action='store_true',
-                        help='Whether or not to skip HTML generation, which can be slow.')
-    parser.add_argument('--virtual-root', type=str, default='',
-                        help='A temporary installation directory which is used as the root ' + \
-                             'where the actual installation prefix lives; this is mostly ' + \
-                             'useful for packagers, and should be set to what is given to ' + \
-                             'make install as DESTDIR.')
</del><ins>+def rebase_doc(generator):
+    print(&quot;\nRebasing {0} documentation...&quot;.format(generator.module_name))
+    try:
+        generator.rebase_installed_docs()
+    except Exception:
+        print(&quot;Rebase did not happen, likely no documentation is present.&quot;)
</ins><span class="cx"> 
</span><del>-    arguments = parser.parse_args()
-    configure_logging(arguments.verbose)
</del><ins>+def generate_documentation_for_config(config_file):
+    generator = get_generator_for_config(config_file, arguments.virtual_root)
+    if not generator:
+        print(&quot;{0} does not exist! Skipping that documentation.&quot;.format(os.path.basename(config_file)))
+        return
</ins><span class="cx"> 
</span><ins>+    if not arguments.rebase:
+        generate_doc(generator, arguments.skip_html)
+    else:
+        rebase_doc(generator)
+    return generator.saw_warnings
+
+def prepare_environment_for_gtkdoc_generation():
</ins><span class="cx">     # We need to add the JavaScriptCore build directory to the PKG_CONFIG_PATH
</span><span class="cx">     # so that pkgconfig can properly resolve the libjavascriptcore dependency.
</span><span class="cx">     pkg_config_path = os.environ.get(&quot;PKG_CONFIG_PATH&quot;)
</span><span class="lines">@@ -233,59 +169,31 @@
</span><span class="cx">     if os.environ.get('CC') == &quot;clang&quot;:
</span><span class="cx">         os.environ['CFLAGS'] += ' -Qunused-arguments'
</span><span class="cx"> 
</span><del>-    saw_webkit1_warnings = saw_webkit2_warnings = False
-    wk2_pkg_config_path = common.build_path('Source', 'WebKit2', 'webkit2gtk-3.0.pc')
-    wk1_pkg_config_path = common.build_path('Source', 'WebKit', 'gtk', 'webkitgtk-3.0.pc')
-    if not os.path.exists(wk1_pkg_config_path):
-        wk1_pkg_config_path = common.build_path('Source', 'WebKit', 'gtk', 'webkit-1.0.pc')
</del><ins>+    # Paths from the GNUmakefile generated configuration files are relative to the build directory.
+    os.chdir(common.build_path())
</ins><span class="cx"> 
</span><del>-    if os.path.exists(wk2_pkg_config_path):
-        pkg_config_path = wk2_pkg_config_path
-    elif os.path.exists(wk1_pkg_config_path):
-        pkg_config_path = wk1_pkg_config_path
</del><ins>+if __name__ == &quot;__main__&quot;:
+    parser = argparse.ArgumentParser(description='Generate gtkdoc for WebKit.')
+    parser.add_argument('-v', '--verbose', action='store_true',
+                        help='Whether or not to run in verbose mode.')
+    parser.add_argument('--rebase', action='store_true',
+                        help='When specified, run the tool in rebase mode.')
+    parser.add_argument('--skip-html', action='store_true',
+                        help='Whether or not to skip HTML generation, which can be slow.')
+    parser.add_argument('--virtual-root', type=str, default='',
+                        help='A temporary installation directory which is used as the root ' + \
+                             'where the actual installation prefix lives; this is mostly ' + \
+                             'useful for packagers, and should be set to what is given to ' + \
+                             'make install as DESTDIR.')
</ins><span class="cx"> 
</span><del>-    webkitdom_docs_path = common.build_path('DerivedSources', 'webkitdom', 'docs')
-    if not common.is_cmake_build():
-        generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, get_webkitdom_options(arguments.virtual_root))
-        if not arguments.rebase:
-            print(&quot;\nGenerating WebKitDOM documentation...&quot;)
-            saw_webkitdom_warnings = generate_doc(generator, arguments.skip_html)
-        else:
-            print(&quot;\nRebasing WebKitDOM documentation...&quot;)
-            try:
-                generator.rebase_installed_docs()
-            except Exception:
-                print(&quot;Rebase did not happen, likely no documentation is present.&quot;)
</del><ins>+    arguments = parser.parse_args()
+    configure_logging(arguments.verbose)
</ins><span class="cx"> 
</span><del>-    pkg_config_path = wk1_pkg_config_path
-    if os.path.exists(pkg_config_path):
-        options = get_webkit1_options(common.gtk_version_of_pkg_config_file(pkg_config_path), arguments.virtual_root)
-        generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, options)
-        if not arguments.rebase:
-            print(&quot;Generating WebKit1 documentation...&quot;)
-            saw_webkit1_warnings = generate_doc(generator, arguments.skip_html)
-        else:
-            print(&quot;Rebasing WebKit1 documentation...&quot;)
-            try:
-                generator.rebase_installed_docs()
-            except Exception:
-                print(&quot;Rebase did not happen, likely no documentation is present.&quot;)
</del><ins>+    prepare_environment_for_gtkdoc_generation()
</ins><span class="cx"> 
</span><del>-    # WebKit2 might not be enabled, so check for the pkg-config file before building documentation.
-    pkg_config_path = wk2_pkg_config_path
-    if os.path.exists(pkg_config_path):
-        generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, get_webkit2_options(arguments.virtual_root))
-        if not arguments.rebase:
-            print(&quot;\nGenerating WebKit2 documentation...&quot;)
-            saw_webkit2_warnings = generate_doc(generator, arguments.skip_html)
-        else:
-            print(&quot;\nRebasing WebKit2 documentation...&quot;)
-            try:
-                generator.rebase_installed_docs()
-            except Exception:
-                print(&quot;Rebase did not happen, likely no documentation is present.&quot;)
-
-    # For CMake we are still generating warnings because we lack DOM bindings docs,
-    # so do not cause the build to fail for now.
</del><ins>+    saw_webkit1_warnings = generate_documentation_for_config(common.build_path('gtkdoc-webkitgtk.cfg'))
+    saw_webkit2_warnings = generate_documentation_for_config(common.build_path('gtkdoc-webkit2gtk.cfg'))
</ins><span class="cx">     if not common.is_cmake_build():
</span><del>-        sys.exit(saw_webkit1_warnings or saw_webkit2_warnings)
</del><ins>+        generate_documentation_for_config(common.build_path('gtkdoc-webkitdom.cfg'))
+
+    sys.exit(saw_webkit1_warnings or saw_webkit2_warnings)
</ins></span></pre></div>
<a id="trunkToolsgtkgtkdocpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/gtkdoc.py (164631 => 164632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/gtkdoc.py        2014-02-25 07:13:23 UTC (rev 164631)
+++ trunk/Tools/gtk/gtkdoc.py        2014-02-25 07:30:21 UTC (rev 164632)
</span><span class="lines">@@ -38,11 +38,14 @@
</span><span class="cx">     module_name        -- The name of the documentation module. For libraries this
</span><span class="cx">                           is typically the library name. Required if not library path
</span><span class="cx">                           is given.
</span><del>-    source_dirs        -- A list of paths to the source code to be scanned. Required.
</del><ins>+    source_dirs        -- A list of paths to directories of source code to be scanned.
+                          Required if headers is not specified.
</ins><span class="cx">     ignored_files      -- A list of filenames to ignore in the source directory. It is
</span><span class="cx">                           only necessary to provide the basenames of these files.
</span><span class="cx">                           Typically it is important to provide an updated list of
</span><span class="cx">                           ignored files to prevent warnings about undocumented symbols.
</span><ins>+    headers            -- A list of paths to headers to be scanned. Required if source_dirs
+                          is not specified.
</ins><span class="cx">     namespace          -- The library namespace.
</span><span class="cx">     decorator          -- If a decorator is used to unhide certain symbols in header
</span><span class="cx">                           files this parameter is required for successful scanning.
</span><span class="lines">@@ -87,6 +90,7 @@
</span><span class="cx">         # Parameters specific to scanning.
</span><span class="cx">         self.module_name = ''
</span><span class="cx">         self.source_dirs = []
</span><ins>+        self.headers = []
</ins><span class="cx">         self.ignored_files = []
</span><span class="cx">         self.namespace = ''
</span><span class="cx">         self.decorator = ''
</span><span class="lines">@@ -112,18 +116,18 @@
</span><span class="cx">         for key, value in iter(args.items()):
</span><span class="cx">             setattr(self, key, value)
</span><span class="cx"> 
</span><del>-        def raise_error_if_not_specified(key):
-            if not getattr(self, key):
-                raise Exception('%s not specified.' % key)
</del><ins>+        if not getattr(self, 'output_dir'):
+            raise Exception('output_dir not specified.')
+        if not getattr(self, 'module_name'):
+            raise Exception('module_name not specified.')
+        if not getattr(self, 'source_dirs') and not getattr(self, 'headers'):
+            raise Exception('Neither source_dirs nor headers specified.' % key)
</ins><span class="cx"> 
</span><del>-        raise_error_if_not_specified('output_dir')
-        raise_error_if_not_specified('source_dirs')
-        raise_error_if_not_specified('module_name')
-
</del><span class="cx">         # Make all paths absolute in case we were passed relative paths, since
</span><span class="cx">         # we change the current working directory when executing subcommands.
</span><span class="cx">         self.output_dir = os.path.abspath(self.output_dir)
</span><span class="cx">         self.source_dirs = [os.path.abspath(x) for x in self.source_dirs]
</span><ins>+        self.headers = [os.path.abspath(x) for x in self.headers]
</ins><span class="cx">         if self.library_path:
</span><span class="cx">             self.library_path = os.path.abspath(self.library_path)
</span><span class="cx"> 
</span><span class="lines">@@ -274,8 +278,9 @@
</span><span class="cx">                 '--module=%s' % self.module_name,
</span><span class="cx">                 '--rebuild-types']
</span><span class="cx"> 
</span><del>-        # Each source directory should be have its own &quot;--source-dir=&quot; prefix.
-        args.extend(['--source-dir=%s' % path for path in self.source_dirs])
</del><ins>+        if not self.headers:
+            # Each source directory should be have its own &quot;--source-dir=&quot; prefix.
+            args.extend(['--source-dir=%s' % path for path in self.source_dirs])
</ins><span class="cx"> 
</span><span class="cx">         if self.decorator:
</span><span class="cx">             args.append('--ignore-decorators=%s' % self.decorator)
</span><span class="lines">@@ -284,13 +289,18 @@
</span><span class="cx">         if self.output_dir:
</span><span class="cx">             args.append('--output-dir=%s' % self.output_dir)
</span><span class="cx"> 
</span><del>-        # gtkdoc-scan wants the basenames of ignored headers, so strip the
-        # dirname. Different from &quot;--source-dir&quot;, the headers should be
-        # specified as one long string.
-        ignored_files_basenames = self._ignored_files_basenames()
-        if ignored_files_basenames:
-            args.append('--ignore-headers=%s' % ignored_files_basenames)
</del><ins>+        # We only need to pass the list of ignored files if the we are not using an explicit list of headers.
+        if not self.headers:
+            # gtkdoc-scan wants the basenames of ignored headers, so strip the
+            # dirname. Different from &quot;--source-dir&quot;, the headers should be
+            # specified as one long string.
+            ignored_files_basenames = self._ignored_files_basenames()
+            if ignored_files_basenames:
+                args.append('--ignore-headers=%s' % ignored_files_basenames)
</ins><span class="cx"> 
</span><ins>+        if self.headers:
+            args.extend(self.headers)
+
</ins><span class="cx">         self._run_command(args)
</span><span class="cx"> 
</span><span class="cx">     def _run_gtkdoc_scangobj(self):
</span></span></pre>
</div>
</div>

</body>
</html>