[gtk-doc] pdf: add imgdir option to get images working in pdfs
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk-doc] pdf: add imgdir option to get images working in pdfs
- Date: Thu, 16 Jul 2009 09:00:00 +0000 (UTC)
commit 2b3b002cf9def5233faf4a4b802289bcb8c8f286
Author: Stefan Kost <ensonic users sf net>
Date: Thu Jul 16 10:38:04 2009 +0300
pdf: add imgdir option to get images working in pdfs
imgsdir is extracted from HTML_IMAGES. Not so nice, but requires no changes for
buildsetup. Also fix mkhtml_options that were confusing shell with makefile
variables.
gtk-doc.make | 6 ++++--
gtk-doc.notmpl.make | 6 ++++--
gtkdoc-mkpdf.in | 7 +++++--
tests/gtk-doc.make | 6 ++++--
tests/gtk-doc.notmpl.make | 6 ++++--
5 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/gtk-doc.make b/gtk-doc.make
index 577a06c..5e035a9 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -128,7 +128,7 @@ 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)
@@ -140,7 +140,9 @@ 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
- @cd $(srcdir) && gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then for img in "$(HTML_IMAGES)"; do mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=`dirname $$img`"; done; fi; \
+ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
diff --git a/gtk-doc.notmpl.make b/gtk-doc.notmpl.make
index 9975bb1..0129645 100644
--- a/gtk-doc.notmpl.make
+++ b/gtk-doc.notmpl.make
@@ -113,7 +113,7 @@ 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)
@@ -125,7 +125,9 @@ 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
- @cd $(srcdir) && gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then for img in "$(HTML_IMAGES)"; do mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=`dirname $$img`"; done; fi; \
+ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
index 3da341e..c9a1149 100644
--- a/gtkdoc-mkpdf.in
+++ b/gtkdoc-mkpdf.in
@@ -2,7 +2,7 @@
#
usage="\
-Usage: gtkdoc-mkpdf [--path=SEARCH_PATH] MODULE DRIVER_FILE [BACKEND_OPTIONS...]"
+Usage: gtkdoc-mkpdf [--path=SEARCH_PATH] [--imgdir=DIR] MODULE DRIVER_FILE [BACKEND_OPTIONS...]"
#echo "args $0\n";
@@ -15,12 +15,14 @@ cleanexit() {
searchpath=
uninstalled=no
+imgdirs=
while true; do
case "X$1" in
X--version) echo "@VERSION@"; exit 0;;
X--help) echo "$usage"; exit 0;;
X--uninstalled) uninstalled=yes; shift;;
X--path=*) searchpath=`echo $1 | sed s/.*=//`; shift;;
+ X--imgdir=*) imgdirs="$imgdirs -I `echo $1 | sed s/.*=//`"; shift;;
X--*) shift;;
X*) break;;
esac
@@ -74,7 +76,8 @@ if $is_xml; then
# -T db2latex : different style
# xsltproc is already called with --xinclude
# does not work: --xslt-opts "$path_arg --nonet $@"
- @DBLATEX@ -o $module.pdf $document
+ #echo "calling: @DBLATEX@ -o $module.pdf $imgdirs $document"
+ @DBLATEX@ -o $module.pdf $imgdirs $document
else
if test -n "@FOP@"; then
@XSLTPROC@ $path_arg --nonet --xinclude \
diff --git a/tests/gtk-doc.make b/tests/gtk-doc.make
index b0c31ca..75ed76b 100644
--- a/tests/gtk-doc.make
+++ b/tests/gtk-doc.make
@@ -124,8 +124,10 @@ 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
- @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
- gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then for img in "$(HTML_IMAGES)"; do mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=`dirname $$img`"; done; fi; \
+ cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
+ gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
diff --git a/tests/gtk-doc.notmpl.make b/tests/gtk-doc.notmpl.make
index eaa2c1a..cc06de1 100644
--- a/tests/gtk-doc.notmpl.make
+++ b/tests/gtk-doc.notmpl.make
@@ -108,8 +108,10 @@ 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
- @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
- gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then for img in "$(HTML_IMAGES)"; do mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=`dirname $$img`"; done; fi; \
+ cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
+ gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]