[GTK] Integrate build-gtkdoc into build-webkit and make
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Nov 2011 16:19:44 +0000 (16:19 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Nov 2011 16:19:44 +0000 (16:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72626

Reviewed by Philippe Normand.

.:

* GNUmakefile.am: Remove references to old gtkdoc files. Update
the dist-hook to include copying documentation into the distribution.
This also means that the build will fail if documentation hasn't been
generated before 'make dist.'
* configure.ac: Ditto.

Source/WebKit/gtk:

* docs/GNUmakefile.am: Removed.
* docs/version.xml.in: Removed.

Source/WebKit2:

* GNUmakefile.am: Removed references to build-gtkdoc and gtkdoc.py.
* UIProcess/API/gtk/docs/build-gtkdoc: Removed.

Tools:

* GNUmakefile.am: Added support for new scripts and "make docs".
* Scripts/webkitdirs.pm: Call generate-gtkdoc when building.
(buildAutotoolsProject):
* gtk/generate-gtkdoc: Added.
* gtk/gtkdoc.py: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/gtkdoc.py.

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

17 files changed:
ChangeLog
GNUmakefile.am
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/GNUmakefile.gtk-doc.am [deleted file]
Source/WebKit/gtk/docs/GNUmakefile.am [deleted file]
Source/WebKit/gtk/docs/version.xml.in [deleted file]
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/UIProcess/API/gtk/docs/build-gtkdoc [deleted file]
Tools/ChangeLog
Tools/GNUmakefile.am
Tools/Scripts/webkitdirs.pm
Tools/gtk/common.py [new file with mode: 0644]
Tools/gtk/generate-gtkdoc [new file with mode: 0755]
Tools/gtk/gtkdoc.py [moved from Source/WebKit2/UIProcess/API/gtk/docs/gtkdoc.py with 91% similarity]
configure.ac

index 13e5de9..ea17cc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Integrate build-gtkdoc into build-webkit and make
+        https://bugs.webkit.org/show_bug.cgi?id=72626
+
+        Reviewed by Philippe Normand.
+
+        * GNUmakefile.am: Remove references to old gtkdoc files. Update
+        the dist-hook to include copying documentation into the distribution.
+        This also means that the build will fail if documentation hasn't been
+        generated before 'make dist.'
+        * configure.ac: Ditto.
+
 2011-11-23  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Re-generate QtWebKit API forwarding headers when API changes
index f91e88d..4d2785f 100644 (file)
@@ -207,7 +207,6 @@ include Source/WebKit/gtk/GNUmakefile.am
 include Source/WebCore/bindings/gobject/GNUmakefile.am
 include Tools/GNUmakefile.am
 include Source/WebKit/gtk/po/GNUmakefile.am
-include Source/WebKit/gtk/docs/GNUmakefile.am
 include Tools/DumpRenderTree/gtk/GNUmakefile.ImageDiff.am
 
 if ENABLE_WEBKIT2
@@ -265,3 +264,17 @@ clean-local:
 maintainer-clean-local: distclean-local
 distclean-local:
        -rm -rf $(GENSOURCES) $(GENPROGRAMS)
+
+dist-hook: doc-dist-hook
+doc-dist-hook: docs-build.stamp
+       cp $(WebKit)/NEWS $(distdir)
+       @mkdir -p $(distdir)/Documentation/webkitgtk/html
+       @mkdir -p $(distdir)/Documentation/webkitgtk/tmpl
+       @-cp ./Documentation/webkitgtk/tmpl/*.sgml $(distdir)/Documentation/webkitgtk/tmpl
+       @cp ./Documentation/webkitgtk/html/* $(distdir)/Documentation/webkitgtk/html
+if ENABLE_WEBKIT2
+       @mkdir -p $(distdir)/Documentation/webkit2gtk/html
+       @mkdir -p $(distdir)/Documentation/webkit2gtk/tmpl
+       @-cp ./Documentation/webkit2gtk/tmpl/*.sgml $(distdir)/Documentation/webkit2gtk/tmpl
+       @cp ./Documentation/webkit2gtk/html/* $(distdir)/Documentation/webkit2gtk/html
+endif
index d9d28f8..4f7526a 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Integrate build-gtkdoc into build-webkit and make
+        https://bugs.webkit.org/show_bug.cgi?id=72626
+
+        Reviewed by Philippe Normand.
+
+        * docs/GNUmakefile.am: Removed.
+        * docs/version.xml.in: Removed.
+
 2011-11-23  Kaustubh Atrawalkar  <kaustubh@motorola.com>
 
         Documentation fix for load-committed in webkitwebframe
index 752c9e6..e34b442 100644 (file)
@@ -384,8 +384,12 @@ gsettings_SCHEMAS = $(top_builddir)/Source/WebKit/gtk/org.webkitgtk-@WEBKITGTK_A
 EXTRA_DIST += \
        $(WebKit)/ChangeLog \
        $(WebKit)/NEWS \
+       $(WebKit)/docs/webkitgtk-docs.sgml \
+       $(WebKit)/docs/webkitgtk-sections.txt \
+       $(WebKit)/docs/webkitgtk.types \
+       $(WebKit)/docs/webkitenvironment.xml \
+       $(WebKit)/docs/webkitgtk-overrides.txt \
        $(WebKit)/webkitmarshal.list \
-       $(WebKit)/GNUmakefile.gtk-doc.am \
        $(WebKit)/po/* \
        $(WebKit)/resources/* \
        $(WebKit)/tests/resources/* \
@@ -593,8 +597,6 @@ DISTCLEANFILES += \
        $(top_builddir)/Source/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml \
        $(top_builddir)/Source/WebKit/gtk/webkit/webkitversion.h
 
-dist-hook:
-       cp $(WebKit)/NEWS $(distdir)
 install-data-local: po-install-data-local
 installdirs-data-local: po-installdirs-data-local
 uninstall-local: po-uninstall-local
diff --git a/Source/WebKit/gtk/GNUmakefile.gtk-doc.am b/Source/WebKit/gtk/GNUmakefile.gtk-doc.am
deleted file mode 100644 (file)
index 052c788..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-# -*- mode: makefile -*-
-
-GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(GTKDOC_INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-GTKDOC_RUN = $(LIBTOOL) --mode=execute
-
-TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-
-SETUP_FILES = \
-       $(DOC_MAIN_SGML_FILE)           \
-       webkitenvironment.xml           \
-       $(DOC_MODULE)-sections.txt      \
-       $(DOC_MODULE)-overrides.txt
-
-EXTRA_DIST += \
-       $(HTML_IMAGES)                  \
-       $(SETUP_FILES)
-
-DOC_STAMPS=doc-setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
-       html-build.stamp pdf-build.stamp \
-       tmpl.stamp sgml.stamp html.stamp pdf.stamp
-
-SCANOBJ_FILES =                 \
-       $(DOC_MODULE).args       \
-       $(DOC_MODULE).hierarchy  \
-       $(DOC_MODULE).interfaces \
-       $(DOC_MODULE).prerequisites \
-       $(DOC_MODULE).signals
-
-REPORT_FILES = \
-       $(DOC_MODULE)-undocumented.txt \
-       $(DOC_MODULE)-undeclared.txt \
-       $(DOC_MODULE)-unused.txt
-
-CLEANFILES += $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
-
-if ENABLE_GTK_DOC
-HTML_BUILD_STAMP=html-build.stamp
-endif
-
-doc_srcdir := $(abs_srcdir)/Source/WebKit/gtk/docs
-
-docs: $(HTML_BUILD_STAMP)
-
-$(REPORT_FILES): sgml-build.stamp
-
-#### setup ####
-
-doc-setup-build.stamp: libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
-       -@mkdir -p Documentation
-       -@ln -fs ../doltlibtool Documentation/
-       -@ln -fs ../doltcompile Documentation/
-       -@ln -fs ../libtool Documentation/
-       -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
-           echo '  DOC   Preparing build'; \
-           files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
-           if test "x$$files" != "x" ; then \
-               for file in $$files ; do \
-                   test -f $(doc_srcdir)/$$file && \
-                       cp -pu $(doc_srcdir)/$$file $(abs_builddir)/Documentation/ || true; \
-               done; \
-           fi; \
-           test -d $(doc_srcdir)/tmpl && \
-               { cp -rp $(doc_srcdir)/tmpl $(abs_builddir)/Documentation/; \
-               chmod -R u+w $(abs_builddir)/Documentation/tmpl; } \
-       fi
-       @touch doc-setup-build.stamp
-
-#### scan ####
-
-scan-build.stamp: doc-setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
-       @echo '  DOC   Scanning header files'
-       @cd Documentation; _source_dir='' ; \
-       for i in $(DOC_SOURCE_DIR) ; do \
-           _source_dir="$${_source_dir} --source-dir=../$$i" ; \
-       done ; \
-       gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-       @cd Documentation; if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
-           echo "  DOC   Introspecting gobjects"; \
-           scanobj_options=""; \
-           gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
-           if test "$(?)" = "0"; then \
-               if test "x$(V)" = "x1"; then \
-                   scanobj_options="--verbose"; \
-               fi; \
-           fi; \
-           CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
-           gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
-       else \
-           for i in $(SCANOBJ_FILES) ; do \
-               test -f $$i || touch $$i ; \
-           done \
-       fi
-       @touch scan-build.stamp
-
-Documentation/$(DOC_MODULE)-decl.txt Documentation/$(SCANOBJ_FILES) Documentation/$(DOC_MODULE)-sections.txt Documentation/$(DOC_MODULE)-overrides.txt: scan-build.stamp
-       @true
-
-#### templates ####
-
-tmpl-build.stamp: doc-setup-build.stamp Documentation/$(DOC_MODULE)-decl.txt Documentation/$(SCANOBJ_FILES) Documentation/$(DOC_MODULE)-sections.txt Documentation/$(DOC_MODULE)-overrides.txt
-       @echo '  DOC   Rebuilding template files'
-       @cd Documentation; gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
-       @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
-         if test -w $(abs_srcdir) ; then \
-           cp -rp $(abs_builddir)/Documentation/tmpl $(doc_srcdir); \
-         fi \
-       fi
-       @touch tmpl-build.stamp
-
-tmpl.stamp: tmpl-build.stamp
-       @true
-
-$(srcdir)/tmpl/*.sgml:
-       @true
-
-#### xml ####
-
-sgml-build.stamp: doc-setup-build.stamp tmpl.stamp Documentation/$(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml
-       @echo '  DOC   Building XML'
-       @-chmod -R u+w $(srcdir)
-       @cd Documentation; _source_dir='' ; \
-       for i in $(DOC_SOURCE_DIR) ; do \
-           _source_dir="$${_source_dir} --source-dir=../$$i" ; \
-       done ; \
-       gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
-       @touch sgml-build.stamp
-
-sgml.stamp: sgml-build.stamp
-       @true
-
-#### html ####
-
-Documentation/$(DOC_MAIN_SGML_FILE): sgml.stamp
-Documentation/webkitenvironment.xml: doc-setup-build.stamp
-
-html-build.stamp: sgml.stamp Documentation/$(DOC_MAIN_SGML_FILE)
-       @echo '  DOC   Building HTML'
-       @rm -rf Documentation/html
-       @mkdir Documentation/html
-       @cd Documentation; mkhtml_options=""; \
-       gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
-       if test "$(?)" = "0"; then \
-         if test "x$(V)" = "x1"; then \
-           mkhtml_options="$$mkhtml_options --verbose"; \
-         fi; \
-       fi; \
-       gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-path"; \
-       if test "$(?)" = "0"; then \
-         mkhtml_options="$$mkhtml_options --path=\"$(doc_srcdir)\""; \
-       fi; \
-       cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
-       -@test "x$(HTML_IMAGES)" = "x" || \
-       for file in $(HTML_IMAGES) ; do \
-         if test -f $(abs_srcdir)/$$file ; then \
-           cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
-         fi; \
-         if test -f $(abs_builddir)/$$file ; then \
-           cp $(abs_builddir)/$$file $(abs_builddir)/html; \
-         fi; \
-       done;
-       @echo '  DOC   Fixing cross-references'
-       @cd Documentation; gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
-       @touch html-build.stamp
-
-clean-local: doc-clean-local
-
-doc-clean-local:
-       @rm -f Documentation/*~ Documentation/*.bak
-       @rm -rf Documentation/.libs
-
-distclean-local: doc-distclean-local
-
-doc-distclean-local:
-       @rm -rf Documentation
-
-maintainer-clean-local: doc-maintainer-clean-local
-
-doc-maintainer-clean-local: clean
-       @rm -rf Documentation/xml Documentation/html
-       -@rmdir Documentation
-
-#
-# Require gtk-doc when making dist
-#
-if ENABLE_GTK_DOC
-dist-check-gtkdoc:
-
-all: docs
-else
-dist-check-gtkdoc:
-       @echo "*** gtk-doc must be installed and enabled in order to make dist"
-       @false
-endif
-
-dist-hook: doc-dist-hook
-
-doc-dist-hook: dist-check-gtkdoc dist-hook-local
-       @mkdir -p $(distdir)/$(DOC_MODULE)/tmpl
-       @mkdir -p $(distdir)/$(DOC_MODULE)/html
-       @-cp ./Documentation/tmpl/*.sgml $(distdir)/$(DOC_MODULE)/tmpl
-       @cp ./Documentation/html/* $(distdir)/$(DOC_MODULE)/html
-       @-cp ./Documentation/$(DOC_MODULE).types $(distdir)/
-       @-cp ./Documentation/$(DOC_MODULE)-sections.txt $(distdir)/
-       @cd $(distdir) && rm -f $(DISTCLEANFILES)
-       @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/$(DOC_MODULE)/html
-
-.PHONY : dist-hook-local docs
diff --git a/Source/WebKit/gtk/docs/GNUmakefile.am b/Source/WebKit/gtk/docs/GNUmakefile.am
deleted file mode 100644 (file)
index c8c4b21..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-## Process this file with automake to produce GNUmakefile.in
-
-# This is a blank Makefile.am for using gtk-doc.
-# Copy this to your project's API docs directory and modify the variables to
-# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
-# of using the various options.
-
-# The name of the module, e.g. 'glib'.
-DOC_MODULE=webkitgtk
-
-# The top-level SGML file. You can change this if you want to.
-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
-
-# The directory containing the source code. Relative to $(srcdir).
-# gtk-doc will search all .c & .h files beneath here for inline comments
-# documenting the functions and macros.
-# e.g. DOC_SOURCE_DIR=../../../gtk
-DOC_SOURCE_DIR=$(top_srcdir)/Source/WebKit/gtk/webkit
-
-# Extra options to pass to gtkdoc-scangobj. Not normally needed.
-SCANGOBJ_OPTIONS="--type-init-func=g_type_init()"
-
-# Extra options to supply to gtkdoc-scan.
-# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
-SCAN_OPTIONS=--deprecated-guards="WEBKIT_DISABLE_DEPRECATED" --ignore-decorators="WEBKIT_API"
-
-# Extra options to supply to gtkdoc-mkdb.
-# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
-MKDB_OPTIONS=--sgml-mode --output-format=xml --source-suffixes=h,c,cpp
-
-# Extra options to supply to gtkdoc-mktmpl
-# e.g. MKTMPL_OPTIONS=--only-section-tmpl
-MKTMPL_OPTIONS=
-
-# Extra options to supply to gtkdoc-fixref. Not normally needed.
-# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
-FIXXREF_OPTIONS=
-
-# Used for dependencies. The docs will be rebuilt if any of these change.
-# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
-# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
-HFILE_GLOB=$(top_srcdir)/Source/WebKit/gtk/webkit/*.h
-CFILE_GLOB=$(top_srcdir)/Source/WebKit/gtk/webkit/*.cpp
-
-# Header files to ignore when scanning.
-# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
-IGNORE_HFILES = \
-   webkitdownloadprivate.h \
-   webkitgeolocationpolicydecisionprivate.h \
-   webkitglobalsprivate.h \
-   webkithittestresultprivate.h \
-   webkitnetworkrequestprivate.h \
-   webkitnetworkresponseprivate.h \
-   webkitsecurityoriginprivate.h \
-   webkitviewportattributesprivate.h \
-   webkitwebbackforwardlistprivate.h \
-   webkitwebdatasourceprivate.h \
-   webkitwebframeprivate.h \
-   webkitwebhistoryitemprivate.h \
-   webkitwebinspectorprivate.h \
-   webkitwebnavigationactionprivate.h \
-   webkitwebplugindatabaseprivate.h \
-   webkitwebpluginprivate.h \
-   webkitwebpolicydecisionprivate.h \
-   webkitwebresourceprivate.h \
-   webkitwebsettingsprivate.h \
-   webkitwebviewprivate.h \
-   webkitwebwindowfeaturesprivate.h
-
-# Images to copy into HTML directory.
-# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
-HTML_IMAGES=
-
-# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
-# Only needed if you are using gtkdoc-scangobj to dynamically query widget
-# signals and properties.
-# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
-# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
-GTKDOC_INCLUDES= \
-       -I$(abs_srcdir)/Source/WebKit/gtk \
-       -I$(abs_builddir)/Source/WebKit/gtk \
-       $(global_cppflags) \
-       $(global_cflags) \
-       -I$(abs_srcdir)/Source \
-       -I$(abs_srcdir)/Source/JavaScriptCore \
-       -I$(abs_srcdir)/Source/JavaScriptCore/ForwardingHeaders \
-       -I$(abs_srcdir)/Source/JavaScriptCore/parser \
-       -I$(abs_srcdir)/Source/JavaScriptCore/wtf \
-       -I$(abs_builddir)/DerivedSources \
-       -I$(abs_srcdir)/Source/WebCore/platform/network/soup/cache \
-       $(GLOBALDEPS_CFLAGS) \
-       $(CAIRO_CFLAGS) \
-       $(GLIB_CFLAGS) \
-       $(GTK_CFLAGS) \
-       $(LIBSOUP_CFLAGS)
-
-GTKDOC_LIBS= \
-       $(abs_builddir)/libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
-       $(abs_builddir)/libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
-       $(GLIB_LIBS) \
-       $(GTK_LIBS) \
-       $(LIBSOUP_LIBS)
-
-# This includes our custom gtk-doc make rules.
-include $(top_srcdir)/Source/WebKit/gtk/GNUmakefile.gtk-doc.am
-
-# Other files to distribute
-# e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST += \
-       $(WebKit)/docs/webkitenvironment.xml \
-       $(WebKit)/docs/webkitgtk-docs.sgml \
-       $(WebKit)/docs/webkitgtk-sections.txt \
-       $(WebKit)/docs/version.xml.in
-
-# Files not to distribute
-# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
-# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
-DISTCLEANFILES += \
-       $(top_builddir)/Source/WebKit/gtk/docs/version.xml \
-       $(top_builddir)/tmpl-build.stamp \
-       $(top_builddir)/doc-setup-build.stamp \
-       $(top_builddir)/html-build.stamp \
-       $(top_builddir)/scan-build.stamp \
-       $(top_builddir)/sgml-build.stamp
-
-# Comment this out if you want your docs-status tested during 'make check'
-#TESTS = $(GTKDOC_CHECK)
-
diff --git a/Source/WebKit/gtk/docs/version.xml.in b/Source/WebKit/gtk/docs/version.xml.in
deleted file mode 100644 (file)
index d78bda9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@VERSION@
index c09852c..e71e8e2 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Integrate build-gtkdoc into build-webkit and make
+        https://bugs.webkit.org/show_bug.cgi?id=72626
+
+        Reviewed by Philippe Normand.
+
+        * GNUmakefile.am: Removed references to build-gtkdoc and gtkdoc.py.
+        * UIProcess/API/gtk/docs/build-gtkdoc: Removed.
+
 2011-11-25  Kenneth Rohde Christiansen  <kenneth@webkit.org>
 
         Clean up code in WK2/ChromeClientClient related to viewport handling
index 75a0470..08cc2b2 100644 (file)
@@ -1403,8 +1403,6 @@ Programs_WebKitPluginProcess_CXXFLAGS = \
 endif
 
 EXTRA_DIST += \
-       $(WebKit2)/UIProcess/API/gtk/docs/build-gtkdoc \
-       $(WebKit2)/UIProcess/API/gtk/docs/gtkdoc.py \
        $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
        $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
        $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk.types \
diff --git a/Source/WebKit2/UIProcess/API/gtk/docs/build-gtkdoc b/Source/WebKit2/UIProcess/API/gtk/docs/build-gtkdoc
deleted file mode 100755 (executable)
index f304a7e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-#  Copyright (C) 2011 Igalia S.L.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-import glob
-import gtkdoc
-import logging
-import os.path
-import sys
-
-def configure_logging():
-    level = logging.DEBUG if '-v' in sys.argv else logging.INFO
-    logger = logging.getLogger("gtkdoc")
-    logger.setLevel(level)
-    handler = logging.StreamHandler()
-    handler.setLevel(level)
-    logger.addHandler(handler)
-    if level == logging.DEBUG:
-        handler.setFormatter(logging.Formatter('[%(asctime)s]  %(message)s'))
-    else:
-        handler.setFormatter(logging.Formatter('%(message)s'))
-
-def find_build_directory(top_level):
-    def is_valid_build_directory(build_dir):
-        return os.path.exists(os.path.join(build_dir, ".libs"))
-
-    if is_valid_build_directory(top_level):
-        return top_level
-
-    build_dir = os.path.join(top_level, 'WebKitBuild')
-    if is_valid_build_directory(build_dir):
-        return build_dir
-
-    build_dir = os.path.join(top_level, 'WebKitBuild', 'Release')
-    if is_valid_build_directory(build_dir):
-        return build_dir
-
-    build_dir = os.path.join(top_level, 'WebKitBuild', 'Debug')
-    if is_valid_build_directory(build_dir):
-        return build_dir
-    print "Could not determine build directory."
-    sys.exit(1)
-
-doc_dir = os.path.abspath(os.path.dirname(__file__))
-top_level = os.path.normpath(os.path.join(doc_dir, '..', '..',
-                                          '..', '..', '..', '..'))
-build_dir = find_build_directory(top_level)
-
-output_dir = os.path.join(build_dir, "Documentation", "webkit2gtk")
-src_dir = os.path.join(doc_dir, '..')
-library_path = os.path.join(build_dir, ".libs")
-pkg_config_path = \
-    os.path.join(build_dir, "Source", "WebKit2", "webkit2gtk-3.0.pc")
-
-derived_sources = os.path.join(build_dir, "DerivedSources", "WebKit2")
-cflags = \
-' -I' + os.path.join(derived_sources, 'webkit2gtk', 'include') + \
-' -I' + os.path.join(derived_sources, 'webkit2gtk') + \
-' -I' + os.path.join(derived_sources, 'include') + \
-' -I' + os.path.join(top_level, 'Source')
-' -I' + src_dir
-
-ignored_files = glob.glob("%s/*Private.h" % src_dir) + \
-                glob.glob("%s/PageClientImpl.*" % src_dir) + \
-                glob.glob("%s/tests/*.h" % src_dir)
-
-configure_logging()
-generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path,
-                                   module_name="webkit2gtk",
-                                   output_dir=output_dir,
-                                   source_dirs=[src_dir],
-                                   doc_dir=doc_dir,
-                                   cflags=cflags,
-                                   library_path=library_path,
-                                   decorator="WEBKIT_API",
-                                   deprecation_guard="WEBKIT_DISABLE_DEPRECATED",
-                                   ignored_files=ignored_files)
-generator.generate(html='--skip-html' not in sys.argv)
-sys.exit(generator.saw_warnings)
index d97b423..9ed0fa5 100644 (file)
@@ -1,3 +1,16 @@
+2011-11-17  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] Integrate build-gtkdoc into build-webkit and make
+        https://bugs.webkit.org/show_bug.cgi?id=72626
+
+        Reviewed by Philippe Normand.
+
+        * GNUmakefile.am: Added support for new scripts and "make docs".
+        * Scripts/webkitdirs.pm: Call generate-gtkdoc when building.
+        (buildAutotoolsProject):
+        * gtk/generate-gtkdoc: Added.
+        * gtk/gtkdoc.py: Renamed from Source/WebKit2/UIProcess/API/gtk/docs/gtkdoc.py.
+
 2011-11-25  Ádám Kallai  <Kallai.Adam@stud.u-szeged.hu>
 
         [Qt] Add support for using OWRT with Qt5
index fd9ef70..bb2b1a8 100644 (file)
@@ -227,3 +227,55 @@ TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
 
 CLEANFILES += TestNetscapePlugin/libtestnetscapeplugin.la
 endif
+
+EXTRA_DIST += \
+       Tools/gtk/common.py \
+       Tools/gtk/generate-gtkdoc \
+       Tools/gtk/gtkdoc.py \
+       Tools/Scripts/VCSUtils.pm \
+       Tools/Scripts/webkit-build-directory \
+       Tools/Scripts/webkitdirs.pm
+
+docs: docs-build.stamp
+.PHONY : docs
+DISTCLEANFILES += docs-build.stamp
+
+if ENABLE_WEBKIT2
+docs-build.stamp: \
+       $(BUILT_SOURCES) \
+       Source/WebKit/gtk/docs/webkitenvironment.xml \
+       Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
+       Source/WebKit/gtk/docs/webkitgtk-sections.txt \
+       libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+       libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+       Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
+       Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
+       $(srcdir)/Tools/gtk/generate-gtkdoc
+       @touch docs-build.stamp
+else
+docs-build.stamp: \
+       $(BUILT_SOURCES) \
+       libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+       Source/WebKit/gtk/docs/webkitenvironment.xml \
+       Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
+       Source/WebKit/gtk/docs/webkitgtk-sections.txt
+       $(srcdir)/Tools/gtk/generate-gtkdoc
+       @touch docs-build.stamp
+endif
+
+clean-local: doc-clean-local
+doc-clean-local:
+       @rm -f Documentation/webkitgtk/*~ Documentation/webkitgtk*.bak
+       @rm -f Documentation/webkit2gtk/*~ Documentation/webkit2gtk*.bak
+distclean-local: doc-distclean-local
+doc-distclean-local:
+       @rm -rf Documentation
+maintainer-clean-local: doc-maintainer-clean-local
+doc-maintainer-clean-local: clean
+       @rm -rf Documentation/webkitgtk Documentation/webkit2gtk
+       -@rmdir Documentation
+
+if ENABLE_GTK_DOC
+all: docs-build.stamp
+endif
+
index 0ca488b..9ba4058 100755 (executable)
@@ -1679,6 +1679,14 @@ sub buildAutotoolsProject($@)
     }
 
     chdir ".." or die;
+
+    if (isGtk()) {
+        my $relativeScriptsPath = relativeScriptsDir();
+        if (system("$relativeScriptsPath/../gtk/generate-gtkdoc --skip-html")) {
+            die "\n gtkdoc did not build without warnings\n";
+        }
+    }
+
     return 0;
 }
 
diff --git a/Tools/gtk/common.py b/Tools/gtk/common.py
new file mode 100644 (file)
index 0000000..c4003f1
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+# Copyright (C) 2011 Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+import os
+import subprocess
+import sys
+
+script_dir = None
+build_dir = None
+
+
+def script_path(*args):
+    global script_dir
+    if not script_dir:
+        script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts')
+    return os.path.join(*(script_dir,) + args)
+
+
+def top_level_path(*args):
+    return os.path.join(*((script_path('..', '..'),) + args))
+
+
+def get_build_path():
+    global build_dir
+    if build_dir:
+        return build_dir
+
+    def is_valid_build_directory(path):
+        return os.path.exists(os.path.join(path, '.libs'))
+
+    build_dir = top_level_path('WebKitBuild', 'Release')
+    if is_valid_build_directory(build_dir):
+        return build_dir
+
+    build_dir = top_level_path('WebKitBuild', 'Debug')
+    if is_valid_build_directory(build_dir):
+        return build_dir
+
+    # distcheck builds in a directory named _build in the top-level path.
+    build_dir = top_level_path("_build")
+    if is_valid_build_directory(build_dir):
+        return build_dir
+
+    build_dir = top_level_path()
+    if is_valid_build_directory(build_dir):
+        return build_dir
+
+    build_dir = top_level_path("WebKitBuild")
+    if is_valid_build_directory(build_dir):
+        return build_dir
+
+    print 'Could not determine build directory.'
+    sys.exit(1)
+
+
+def build_path(*args):
+    return os.path.join(*(get_build_path(),) + args)
diff --git a/Tools/gtk/generate-gtkdoc b/Tools/gtk/generate-gtkdoc
new file mode 100755 (executable)
index 0000000..55dc3fb
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/env python
+# Copyright (C) 2011 Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+import common
+import glob
+import gtkdoc
+import logging
+import os.path
+import sys
+
+def configure_logging():
+    level = logging.DEBUG if '-v' in sys.argv else logging.INFO
+    logger = logging.getLogger('gtkdoc')
+    logger.setLevel(level)
+    handler = logging.StreamHandler()
+    handler.setLevel(level)
+    logger.addHandler(handler)
+    if level == logging.DEBUG:
+        handler.setFormatter(logging.Formatter('[%(asctime)s]  %(message)s'))
+    else:
+        handler.setFormatter(logging.Formatter('%(message)s'))
+
+def get_common_options():
+    return {
+        'decorator': 'WEBKIT_API',
+        'deprecation_guard': 'WEBKIT_DISABLE_DEPRECATED',
+        'library_path' : common.build_path('.libs'),
+    }
+
+def get_webkit2_options():
+    def derived_sources_path(*args):
+        return common.build_path(*(('DerivedSources', 'WebKit2') + args))
+    def src_path(*args):
+        return common.top_level_path(*(('Source', 'WebKit2', 'UIProcess', 'API', 'gtk') + args))
+
+    derived_sources = common.build_path('DerivedSources', 'WebKit2')
+    options = get_common_options().copy()
+    options.update({
+        'module_name' : 'webkit2gtk',
+        'doc_dir' : src_path('docs'),
+        'output_dir' : common.build_path('Documentation', 'webkit2gtk'),
+        'source_dirs' : [src_path()],
+        'cflags' : ' -I' + derived_sources_path('webkit2gtk', 'include') + \
+                   ' -I' + derived_sources_path('webkit2gtk') + \
+                   ' -I' + derived_sources_path('include') + \
+                   ' -I' + common.top_level_path('Source') + \
+                   ' -I' + src_path(),
+        'ignored_files': glob.glob(src_path('*Private.h')) + \
+                         glob.glob(src_path('PageClientImpl.*')) + \
+                         glob.glob(src_path('tests/*.h'))
+    })
+    return (common.build_path('Source', 'WebKit2', 'webkit2gtk-3.0.pc'), options)
+
+def get_webkit1_options():
+    def derived_sources_path(*args):
+        return common.build_path(*(('DerivedSources', 'WebKit2') + args))
+    def src_path(*args):
+        return common.top_level_path(*(('Source', 'WebKit', 'gtk') + args))
+
+    derived_sources = common.build_path('DerivedSources', 'WebKit2')
+    options = get_common_options().copy()
+    options.update({
+        'module_name' : 'webkitgtk',
+        'doc_dir' : src_path('docs'),
+        'output_dir' : common.build_path('Documentation', 'webkitgtk'),
+        'source_dirs' : [src_path('webkit'), common.build_path('Source', 'WebKit', 'gtk', 'webkit')],
+        'cflags' : ' -I' + common.build_path('WebKit', 'gtk') + \
+                   ' -I' + common.build_path('DerivedSources') + \
+                   ' -I' + src_path() + \
+                   ' -I' + common.top_level_path('Source') + \
+                   ' -I' + common.top_level_path('Source', 'JavaScriptCore', 'ForwardingHeaders'),
+        'ignored_files': glob.glob(src_path('webkit', '*private.*'))
+    })
+    return (common.build_path('Source', 'WebKit', 'gtk', 'webkitgtk-3.0.pc'), options)
+
+configure_logging()
+
+# We need to add the JavaScriptCore build directory to the PKG_CONFIG_PATH
+# so that pkgconfig can properly resolve the libjavascriptcore dependency.
+os.environ['PKG_CONFIG_PATH'] = common.build_path('Source', 'JavaScriptCore') \
+                                + ':' + os.environ.get('PKG_CONFIG_PATH')
+
+print "Generating WebKit1 documentation..."
+pkg_config_path, options = get_webkit1_options()
+generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, **options)
+generator.generate(html='--skip-html' not in sys.argv)
+saw_webkit1_warnings = generator.saw_warnings
+
+# WebKit2 might not be enabled, so check for the pkg-config file before building documentation.
+if os.path.exists(common.build_path('Source', 'WebKit2', 'webkit2gtk-3.0.pc')):
+    print "\nGenerating WebKit2 documentation..."
+    pkg_config_path, options = get_webkit2_options()
+    generator = gtkdoc.PkgConfigGTKDoc(pkg_config_path, **options)
+    generator.generate(html='--skip-html' not in sys.argv)
+
+sys.exit(generator.saw_warnings or saw_webkit1_warnings)
similarity index 91%
rename from Source/WebKit2/UIProcess/API/gtk/docs/gtkdoc.py
rename to Tools/gtk/gtkdoc.py
index 307b62e..fc052fb 100644 (file)
@@ -1,19 +1,18 @@
-#  Copyright (C) 2011 Igalia S.L.
+# Copyright (C) 2011 Igalia S.L.
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2 of the License, or (at your option) any later version.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 import errno
 import logging
@@ -170,8 +169,9 @@ class GTKDoc(object):
             answer = raw_input(question).lower()
         return answer == 'y'
 
-    def _run_command(self, args, env=None, cwd=None, print_output=True):
-        self.logger.info("Running %s", args[0])
+    def _run_command(self, args, env=None, cwd=None, print_output=True, ignore_warnings=False):
+        if print_output:
+            self.logger.info("Running %s", args[0])
         self.logger.debug("Full command args: %s", str(args))
 
         process = subprocess.Popen(args, env=env, cwd=cwd,
@@ -189,7 +189,7 @@ class GTKDoc(object):
             raise Exception('%s produced a non-zero return code %i'
                              % (args[0], process.returncode))
 
-        if 'warning' in stderr or 'warning' in stdout:
+        if not ignore_warnings and ('warning' in stderr or 'warning' in stdout):
             self.saw_warnings = True
             if not self._ask_yes_or_no_question('%s produced warnings, '
                                                 'try to continue?' % args[0]):
@@ -283,7 +283,12 @@ class GTKDoc(object):
         ldflags = self.ldflags
         if self.library_path:
             ldflags = ' "-L%s" ' % self.library_path + ldflags
-            env['RUN'] = 'LD_LIBRARY_PATH="%s" ' % self.library_path
+            current_ld_library_path = env.get('LD_LIBRARY_PATH')
+            if current_ld_library_path:
+                env['RUN'] = 'LD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_ld_library_path)
+            else:
+                env['RUN'] = 'LD_LIBRARY_PATH="%s" ' % self.library_path
+
         if ldflags:
             env['LDFLAGS'] = ldflags
         if self.cflags:
@@ -338,7 +343,8 @@ class GTKDoc(object):
         self._run_command(['gtkdoc-fixxref',
                            '--module-dir=html',
                            '--html-dir=html'],
-                          cwd=self.output_dir)
+                          cwd=self.output_dir,
+                          ignore_warnings=True)
 
 
 class PkgConfigGTKDoc(GTKDoc):
index be42b3d..0e8e2e0 100644 (file)
@@ -1209,7 +1209,6 @@ GNUmakefile
 
 AC_CONFIG_FILES([
 Source/WebKit/gtk/webkit/webkitversion.h
-Documentation/version.xml:Source/WebKit/gtk/docs/version.xml.in
 ])
 
 AC_CONFIG_FILES([
@@ -1245,6 +1244,7 @@ Build configuration:
  Font backend                                             : $with_font_backend
  Optimized memory allocator                               : $enable_fast_malloc
  JavaScript Engine                                        : $with_jsengine
+
 Features:
  3D Rendering                                             : $enable_3d_rendering
  WebGL                                                    : $enable_webgl
@@ -1304,6 +1304,7 @@ GTK+ configuration:
  GDK target                                               : $with_target
  Hildon UI extensions                                     : $with_hildon
  Introspection support                                    : $enable_introspection
+ Generate documentation                                   : $enable_gtk_doc
 "
 if test "$with_unicode_backend" = "glib"; then
    echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"