public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] doc-epub rule updates
@ 2012-01-17 23:42 Benjamin Kosnik
  2012-01-18  3:45 ` Cross-build breakage with libstdc++-v3 doc changes Hans-Peter Nilsson
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Kosnik @ 2012-01-17 23:42 UTC (permalink / raw)
  To: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]


This updates the support for generating epub docs to EPUB3. Using the
EPUB3 stylesheets allows the removal of ruby and other tool checks from
configure, and generates a much better documentation file. 

tested x86/linux

-benjamin

[-- Attachment #2: 20120117-1.patch --]
[-- Type: text/x-patch, Size: 4944 bytes --]

2012-01-17  Benjamin Kosnik  <bkoz@redhat.com>

	    * configure.ac (BUILD_EPUB): Adjust for epub3.
	    * configure: Regenerate.
	    * Makefile.in: Same.
	    * doc/Makefile.am (stamp-epub-docbook): Update for epub3.
	    * doc/Makefile.in: Regenerate.
	    * include/Makefile.in: Same.
	    * libsupc++/Makefile.in: Same.
	    * po/Makefile.in: Same.
	    * python/Makefile.in: Same.
	    * src/Makefile.in: Same.
	    * testsuite/Makefile.in: Same.

	    * doc/xml/manual/documentation_hacking.xml: Update.

diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index d453f63..1c62aea 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -373,18 +373,21 @@ AM_CONDITIONAL(BUILD_MAN,
 	       test $ac_cv_prog_DOXYGEN = "yes" &&
 	       test $ac_cv_prog_DOT = "yes")
 
-# Check for pdf/epub dependencies.
+# Check for pdf dependencies.
 AC_CHECK_PROG([DBLATEX], dblatex, yes, no)
 AC_CHECK_PROG([PDFLATEX], pdflatex, yes, no)
 AM_CONDITIONAL(BUILD_PDF,
 	       test $ac_cv_prog_DBLATEX = "yes" &&
 	       test $ac_cv_prog_PDFLATEX = "yes")
 
-AC_CHECK_PROG([RUBY], ruby, yes, no)
-AC_CHECK_PROG([DBTOEPUB], dbtoepub, yes, no)
+# Check for epub dependencies.
+AC_CHECK_FILE(/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl,
+	      ac_cv_file_epub3_a=yes, ac_cv_file_epub3_a=no)
+AC_CHECK_FILE(/usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl,
+	      ac_cv_file_epub3_b=yes, ac_cv_file_epub3_b=no)
 AM_CONDITIONAL(BUILD_EPUB,
-	       test $ac_cv_prog_RUBY = "yes" &&
-	       test $ac_cv_prog_DBTOEPUB = "yes")
+	       test $ac_cv_file_epub3_a = "yes" ||
+	       test $ac_cv_file_epub3_b = "yes")
 
 
 # Propagate the target-specific source directories through the build chain.
diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
index 3cb6dce..0f7b285 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -467,10 +467,11 @@ XSLT_PARAM = --param toc.section.depth 4
 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml-1_1/chunk.xsl
 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml-1_1/docbook.xsl
-XSL_EPUB_STYLE = $(XSL_STYLE_DIR)/epub/docbook.xsl
+XSL_EPUB_STYLE = $(XSL_STYLE_DIR)/epub3/chunk.xsl
 
 ${docbook_outdir}/epub:
 	mkdir -p ${docbook_outdir}/epub
+	mkdir -p ${docbook_outdir}/epub/OEBPS/images
 
 ${docbook_outdir}/fo:
 	mkdir -p ${docbook_outdir}/fo
@@ -592,20 +593,25 @@ doc-texinfo-docbook: stamp-texinfo-docbook
 
 doc-info-docbook: stamp-info-docbook
 
-# EPUB, via ruby + dbtoepub
-# Can verify document with: epubcheck
+# EPUB version 3
+# http://sourceforge.net/projects/docbook/files/epub3/
+# Can verify document with epubcheck
 manual_epub = ${docbook_outdir}/epub/libstdc++-manual.epub
 stamp-epub-docbook: stamp-xml-single-docbook ${docbook_outdir}/epub
 	@echo "Generating epub files..."
 	if [ ! -d "${docbook_outdir}/images" ]; then \
 	  $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/; \
 	fi
-	${XSL_STYLE_DIR}/epub/bin/dbtoepub -v -d -o ${manual_epub} ${set_xml}
+	$(XSLTPROC) $(XSLT_PARAM) $(XSLT_FLAGS) \
+	--stringparam base.dir "${docbook_outdir}/epub/OEBPS/" \
+	$(XSL_EPUB_STYLE) ${top_srcdir}/doc/xml/spine.xml
+	$(INSTALL_DATA)	$(xml_images) ${docbook_outdir}/epub/OEBPS/images
+	zip -X0 ${manual_epub} ${docbook_outdir}/epub/mimetype
+	zip -r -X9 ${manual_epub} ${docbook_outdir}/epub/META-INF ${docbook_outdir}/epub/OEBPS
 	$(STAMP) stamp-epub-docbook
 
 doc-epub-docbook: stamp-epub-docbook
 
-
 # Performance doc and graph configuration.
 # Assumes pychart, beautiful soup installed.
 # Generates the plots/graph imagery for performance testing.
diff --git a/libstdc++-v3/doc/xml/manual/documentation_hacking.xml b/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
index f6d7d55..2fe7692 100644
--- a/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
+++ b/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
@@ -611,6 +611,12 @@
       <entry>info output</entry>
     </row>
 
+    <row>
+      <entry>epub3 stylesheets</entry>
+      <entry>b3</entry>
+      <entry>epub output</entry>
+    </row>
+
   </tbody>
 </tgroup>
 </table>
@@ -675,6 +681,10 @@
 	For Texinfo output, something that transforms valid Docbook
 	XML to Texinfo is required. The default choice is <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://docbook2x.sourceforge.net/">docbook2X</link>.
       </para>
+
+      <para>
+	For epub output, the <link xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:href="http://sourceforge.net/projects/docbook/files/epub3/">stylesheets</link> for EPUB3 are required. These stylesheets are still in development. To validate the created file, <link xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:href="https://code.google.com/p/epubcheck/">epubcheck</link> is necessary.
+      </para>
     </section>
 
     <section xml:id="docbook.rules"><info><title>Generating the DocBook Files</title></info>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Cross-build breakage with libstdc++-v3 doc changes
  2012-01-17 23:42 [v3] doc-epub rule updates Benjamin Kosnik
@ 2012-01-18  3:45 ` Hans-Peter Nilsson
  2012-01-18 14:53   ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: Hans-Peter Nilsson @ 2012-01-18  3:45 UTC (permalink / raw)
  To: bkoz; +Cc: gcc-patches, libstdc++

> From: Benjamin Kosnik <bkoz@redhat.com>
> Date: Wed, 18 Jan 2012 00:41:59 +0100

> This updates the support for generating epub docs to EPUB3. Using the
> EPUB3 stylesheets allows the removal of ruby and other tool checks from
> configure, and generates a much better documentation file.

...or for cross-targets, breakage.  Something went wrong with
this or subsequent changes; somewhere in the r183262:183268 I've
started getting:

...
Configuring in cris-elf/libstdc++-v3
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking host system type... cris-axis-elf
checking target system type... cris-axis-elf
...
checking for GNU c++filt... /usr/bin/c++filt

(right there's a buglet,    ^^^^^^^^^^^^^^^^ but let's not get
distracted and it's a preexisting condition anyway )

checking whether the target supports .symver directive... yes
configure: versioning on shared library symbols is no
checking for size_t as unsigned int... no
checking for ptrdiff_t as int... no
checking whether the target supports hidden visibility... yes
configure: visibility supported: yes
checking for makeinfo... makeinfo --split-size=5000000
checking for modern makeinfo... yes
checking for doxygen... yes
checking for dot... no
checking for xsltproc... yes
checking for xmllint... yes
checking for stylesheets used in generation of documentation... no
checking for local stylesheet directory... no
checking for dblatex... no
checking for pdflatex... yes
checking for /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl... configure: error: cannot check for file existence when cross compiling
make[1]: *** [configure-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'
make: *** [all] Error 2

For r183262 I got, around the above point of breakage:
...
configure: visibility supported: yes
checking for makeinfo... makeinfo --split-size=5000000
checking for modern makeinfo... yes
checking for doxygen... yes
checking for dot... no
checking for xsltproc... yes
checking for xmllint... yes
checking for stylesheets used in generation of documentation... no
checking for local stylesheet directory... no
checking for dblatex... no
checking for pdflatex... yes
checking for ruby... yes
checking for dbtoepub... no
configure: updating cache ./config.cache
checking for gxx-include-dir... no
checking for --enable-version-specific-runtime-libs... no
checking for install location... ${prefix}/${target_alias}/include/c++/${gcc_version}
configure: creating ./config.status
config.status: creating Makefile
...

Pretty please cross-test for your favorite cross-target.  The
build system was running Fedora 12, FWIW.

brgds, H-P

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cross-build breakage with libstdc++-v3 doc changes
  2012-01-18  3:45 ` Cross-build breakage with libstdc++-v3 doc changes Hans-Peter Nilsson
@ 2012-01-18 14:53   ` Ulrich Weigand
  2012-01-18 21:20     ` Benjamin Kosnik
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2012-01-18 14:53 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: bkoz, gcc-patches, libstdc++

Hans-Peter Nilsson wrote:

> > From: Benjamin Kosnik <bkoz@redhat.com>
> > Date: Wed, 18 Jan 2012 00:41:59 +0100
> 
> > This updates the support for generating epub docs to EPUB3. Using the
> > EPUB3 stylesheets allows the removal of ruby and other tool checks from
> > configure, and generates a much better documentation file.
> 
> ...or for cross-targets, breakage.  Something went wrong with
> this or subsequent changes; somewhere in the r183262:183268 I've
> started getting:
[snip]
> checking for /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl... configure: error: cannot check for file existence when cross compiling
> make[1]: *** [configure-target-libstdc++-v3] Error 1
> make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'
> make: *** [all] Error 2

Yes, I'm seeing the same problem when building a spu-elf
cross-compiler ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cross-build breakage with libstdc++-v3 doc changes
  2012-01-18 14:53   ` Ulrich Weigand
@ 2012-01-18 21:20     ` Benjamin Kosnik
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Kosnik @ 2012-01-18 21:20 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Hans-Peter Nilsson, gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]



> > ...or for cross-targets, breakage.  Something went wrong with
> > this or subsequent changes; somewhere in the r183262:183268 I've
> > started getting:
> [snip]
> > checking
> > for /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl...
> > configure: error: cannot check for file existence when cross
> > compiling make[1]: *** [configure-target-libstdc++-v3] Error 1
> > make[1]: Leaving directory `/tmp/hpautotest-gcc1/cris-elf/gccobj'
> > make: *** [all] Error 2
> 
> Yes, I'm seeing the same problem when building a spu-elf
> cross-compiler ...

Testing this patch, will check it in if passes, sorry.

-benjamin

[-- Attachment #2: 20120118-1.patch --]
[-- Type: text/x-patch, Size: 2428 bytes --]

2012-01-18  Benjamin Kosnik  <bkoz@redhat.com>

	    * configure.ac: Move epub checks...
	    * acinclude (GLIBCXX_CONFIGURE_DOCBOOK): ...here, use
	    test -f instead of AC_CHECK_FILES.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 9d08178..fd3ba96 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -631,7 +631,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [
 
 
 dnl
-dnl Does any necessary configuration of the documentation directory.
+dnl Does any necessary configuration for docbook in the docs directory.
 dnl
 dnl XSLTPROC must be set before this
 dnl
@@ -642,7 +642,7 @@ dnl  XSL_STYLE_DIR
 dnl
 AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [
 
-AC_MSG_CHECKING([for stylesheets used in generation of documentation])
+AC_MSG_CHECKING([for docbook stylesheets for documentation creation])
 glibcxx_stylesheets=no
 if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then
   glibcxx_stylesheets=yes
@@ -669,6 +669,18 @@ if test x"$glibcxx_local_stylesheets" = x"yes"; then
 else
   glibcxx_stylesheets=no
 fi
+
+# Check for epub3 dependencies.
+AC_MSG_CHECKING([for epub3 stylesheets for documentation creation])
+glibcxx_epub_stylesheets=no
+if test x"$glibcxx_local_stylesheets" = x"yes"; then
+   if test -f ${XSL_STYLE_DIR}/epub3/chunk.xsl; then
+      glibcxx_epub_stylesheets=yes
+   fi
+fi
+AC_MSG_RESULT($glibcxx_epub_stylesheets)
+AM_CONDITIONAL(BUILD_EPUB, test $glibcxx_epub_stylesheets= "yes")
+
 ])
 
 
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 1c62aea..2429f04 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -380,15 +380,6 @@ AM_CONDITIONAL(BUILD_PDF,
 	       test $ac_cv_prog_DBLATEX = "yes" &&
 	       test $ac_cv_prog_PDFLATEX = "yes")
 
-# Check for epub dependencies.
-AC_CHECK_FILE(/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/epub3/chunk.xsl,
-	      ac_cv_file_epub3_a=yes, ac_cv_file_epub3_a=no)
-AC_CHECK_FILE(/usr/share/sgml/docbook/xsl-ns-stylesheets/epub3/chunk.xsl,
-	      ac_cv_file_epub3_b=yes, ac_cv_file_epub3_b=no)
-AM_CONDITIONAL(BUILD_EPUB,
-	       test $ac_cv_file_epub3_a = "yes" ||
-	       test $ac_cv_file_epub3_b = "yes")
-
 
 # Propagate the target-specific source directories through the build chain.
 ATOMICITY_SRCDIR=config/${atomicity_dir}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-18 21:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-17 23:42 [v3] doc-epub rule updates Benjamin Kosnik
2012-01-18  3:45 ` Cross-build breakage with libstdc++-v3 doc changes Hans-Peter Nilsson
2012-01-18 14:53   ` Ulrich Weigand
2012-01-18 21:20     ` Benjamin Kosnik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).