summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-05-22 22:56:51 +0200
committerSimon Josefsson <simon@josefsson.org>2010-05-22 22:56:51 +0200
commitdd69dd08e254e9ce50cc9eb0b67d3482342c71ad (patch)
tree4086253987fe67a54a01d5d38152791e6fce07ed
parenta3c6eb56d34e0816fe305c4e00b55adaa8788094 (diff)
downloadgnutls-dd69dd08e254e9ce50cc9eb0b67d3482342c71ad.tar.gz
Support GTK-DOC PDF file.
-rw-r--r--doc/reference/Makefile.am16
-rw-r--r--gtk-doc.make65
-rw-r--r--m4/gtk-doc.m42
3 files changed, 61 insertions, 22 deletions
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 4808caefbb..af5fca918b 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -18,11 +18,11 @@ DOC_MODULE=$(PACKAGE)
# 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=../../lib --source-dir=../../libextra
+# Directories containing the source code, relative to $(srcdir).
+# gtk-doc will search all .c and .h files beneath these paths
+# for inline comments documenting functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk
+DOC_SOURCE_DIR=../../lib ../../libextra
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
@@ -50,7 +50,9 @@ 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)/lib/includes/gnutls/*.h $(top_builddir)/lib/includes/gnutls/*.h $(top_srcdir)/libextra/includes/gnutls/*.h
+HFILE_GLOB=$(top_srcdir)/lib/includes/gnutls/*.h \
+ $(top_builddir)/lib/includes/gnutls/*.h \
+ $(top_srcdir)/libextra/includes/gnutls/*.h
CFILE_GLOB=$(top_srcdir)/lib/*.c \
$(top_srcdir)/lib/x509/*.c \
$(top_srcdir)/lib/openpgp/*.c \
@@ -156,6 +158,6 @@ EXTRA_DIST +=
# Comment this out if you want your docs-status tested during 'make check'
if ENABLE_GTK_DOC
-#TESTS_ENVIRONMENT = cd $(srcsrc)
+#TESTS_ENVIRONMENT = cd $(srcsrc) &&
#TESTS = $(GTKDOC_CHECK)
endif
diff --git a/gtk-doc.make b/gtk-doc.make
index 66463652ef..57fab98686 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -23,7 +23,7 @@ GPATH = $(srcdir)
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-EXTRA_DIST = \
+EXTRA_DIST = \
$(content_files) \
$(HTML_IMAGES) \
$(DOC_MAIN_SGML_FILE) \
@@ -31,10 +31,12 @@ EXTRA_DIST = \
$(DOC_MODULE)-overrides.txt
DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+ pdf-build.stamp \
+ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
+ $(srcdir)/pdf.stamp
-SCANOBJ_FILES = \
- $(DOC_MODULE).args \
+SCANOBJ_FILES = \
+ $(DOC_MODULE).args \
$(DOC_MODULE).hierarchy \
$(DOC_MODULE).interfaces \
$(DOC_MODULE).prerequisites \
@@ -48,12 +50,23 @@ REPORT_FILES = \
CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
if ENABLE_GTK_DOC
-all-local: html-build.stamp
+if GTK_DOC_BUILD_HTML
+HTML_BUILD_STAMP=html-build.stamp
+else
+HTML_BUILD_STAMP=
+endif
+if GTK_DOC_BUILD_PDF
+PDF_BUILD_STAMP=pdf-build.stamp
+else
+PDF_BUILD_STAMP=
+endif
+
+all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
else
all-local:
endif
-docs: html-build.stamp
+docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
$(REPORT_FILES): sgml-build.stamp
@@ -62,8 +75,11 @@ $(REPORT_FILES): sgml-build.stamp
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
@echo 'gtk-doc: Scanning header files'
@-chmod -R u+w $(srcdir)
- @cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ _source_dir="$${_source_dir} --source-dir=$$i" ; \
+ done ; \
+ cd $(srcdir) && \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
@if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
else \
@@ -96,8 +112,11 @@ $(srcdir)/tmpl/*.sgml:
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
@echo 'gtk-doc: Building XML'
@-chmod -R u+w $(srcdir)
- @cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
+ @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ _source_dir="$${_source_dir} --source-dir=$$i" ; \
+ done ; \
+ cd $(srcdir) && \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
@@ -115,12 +134,31 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
if test "$(?)" = "0"; then \
mkhtml_options=--path="$(srcdir)"; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
@test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
@echo 'gtk-doc: Fixing cross-references'
@cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
+#### pdf ####
+
+pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+ @echo 'gtk-doc: Building PDF'
+ @-chmod -R u+w $(srcdir)
+ @rm -rf $(srcdir)/$(DOC_MODULE).pdf
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then \
+ for img in $(HTML_IMAGES); do \
+ part=`dirname $$img`; \
+ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ if test $$? != 0; then \
+ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ fi; \
+ done; \
+ fi; \
+ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @touch pdf-build.stamp
+
##############
clean-local:
@@ -129,7 +167,7 @@ clean-local:
distclean-local:
cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) \
+ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
$(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
maintainer-clean-local: clean
@@ -180,11 +218,10 @@ endif
dist-hook: dist-check-gtkdoc dist-hook-local
mkdir $(distdir)/tmpl
- mkdir $(distdir)/xml
mkdir $(distdir)/html
-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- -cp $(srcdir)/xml/*.xml $(distdir)/xml
cp $(srcdir)/html/* $(distdir)/html
+ -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
cd $(distdir) && rm -f $(DISTCLEANFILES)
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
index ef01a82d08..2cfa1e7178 100644
--- a/m4/gtk-doc.m4
+++ b/m4/gtk-doc.m4
@@ -48,7 +48,7 @@ AC_DEFUN([GTK_DOC_CHECK],
[build documentation in pdf format [[default=no]]]),,
[enable_gtk_doc_pdf=no])
- if test -n "$GTKDOC_MKPDF"; then
+ if test -z "$GTKDOC_MKPDF"; then
enable_gtk_doc_pdf=no
fi