annotate DOCS/xml/configure @ 31470:7c10f547ce96

Drop support for the Saxon XSLT processor. The XSLT processor detection needs to be overhauled and simplified. Since nobody appears to be using Saxon it is just a burden that hinders the simplification. It can be added back cleanly if there is popular request.
author diego
date Wed, 23 Jun 2010 12:38:40 +0000
parents e1b87583edef
children da0291f41eb7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
1 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
2
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
3 # Script to check for catalogs, stylesheets, XSL processors and all
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
4 # the other stuff necessary to convert the XML documentation.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
5
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
6 _xsltwrapper="xsltproc.sh"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
7
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
8 echo "Searching for XML catalogs..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
9 for _try_catalog in \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
10 /etc/sgml/catalog \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
11 /usr/share/xml/docbook/*/catalog.xml \
21806
5aaf8dbd177e add autodetection support for docbook stuff installed in /opt, such as macports do for ex.
gpoirier
parents: 20761
diff changeset
12 /opt/local/share/xml/docbook-xml/*/catalog.xml \
26149
484bf3498911 Add some more paths to find tools on Slackware 12.
diego
parents: 26021
diff changeset
13 /usr/share/sgml/docbook/*/*catalog \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
14 /usr/share/apps/ksgmltools2/customization/en/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
15 /usr/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
16 /usr/local/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
17 /usr/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
18 /usr/local/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
19 /usr/share/docbook-xml42/catalog.xml \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
20 /usr/share/sgml/docbook/xmlcatalog
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
21 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
22 if test -f "$_try_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
23 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
24 _catalog=$_try_catalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
25 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
26 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
27 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
28
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
29 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
30 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
31 echo "Found SGML catalog at $_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
32 _sgmlcatalog="export SGML_CATALOG_FILES=$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
33 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
34 echo "No SGML catalog found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
35 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
36
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
37
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
38
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
39 echo "Searching for stylesheets..."
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
40 echo "Searching for html/chunk.xsl..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
41 for _try_chunk_xsl in \
26149
484bf3498911 Add some more paths to find tools on Slackware 12.
diego
parents: 26021
diff changeset
42 /usr/share/xml/docbook/*/html/chunk.xsl \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
43 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
44 /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
45 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
46 /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
47 /usr/share/docbook-xsl/html/chunk.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
48 /usr/share/sgml/docbook/xsl-stylesheets*/html/chunk.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
49 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/chunk.xsl \
21806
5aaf8dbd177e add autodetection support for docbook stuff installed in /opt, such as macports do for ex.
gpoirier
parents: 20761
diff changeset
50 /opt/local/share/xsl/docbook-xsl/html/chunk.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
51
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
52 do
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
53 if test -f "$_try_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
54 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
55 _chunk_xsl=$_try_chunk_xsl
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
56 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
57 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
58 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
59
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
60 if test -z "$_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
61 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
62 _chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
63 echo "Not found. Using default ($_chunk_xsl)"
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
64 _fake_chunk_xsl=yes
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
65 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
66 echo "Found chunk.xsl at $_chunk_xsl"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
67 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
68
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
69 echo "Searching for html/docbook.xsl..."
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
70 for _try_docbook_xsl in \
26149
484bf3498911 Add some more paths to find tools on Slackware 12.
diego
parents: 26021
diff changeset
71 /usr/share/xml/docbook/*/html/docbook.xsl \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
72 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
73 /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
74 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
75 /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
76 /usr/share/docbook-xsl/html/docbook.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
77 /usr/share/sgml/docbook/xsl-stylesheets*/html/docbook.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
78 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl \
21806
5aaf8dbd177e add autodetection support for docbook stuff installed in /opt, such as macports do for ex.
gpoirier
parents: 20761
diff changeset
79 /opt/local/share/xsl/docbook-xsl/html/docbook.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
80
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
81 do
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
82 if test -f "$_try_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
83 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
84 _docbook_xsl=$_try_docbook_xsl
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
85 break
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
86 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
87 done
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
88
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
89 if test -z "$_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
90 then
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
91 _docbook_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
92 echo "Not found. Using default ($_docbook_xsl)"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
93 _fake_docbook_xsl=yes
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
94 else
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
95 echo "Found docbook.xsl at $_docbook_xsl"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
96 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
97
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
98 cat > html-chunk.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
99 <?xml version="1.0" encoding="utf-8"?>
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
100 <!-- **************************************************
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
101 This file is generated automatically. DO NOT EDIT.
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
102 ************************************************** -->
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
103 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
104 version="1.0">
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
105
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
106 <xsl:import href="$_chunk_xsl"/>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
107 <xsl:include href="html-common.xsl"/>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
108
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
109 </xsl:stylesheet>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
110 EOF
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
111
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
112
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
113 cat > html-single.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
114 <?xml version="1.0" encoding="utf-8"?>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
115 <!-- **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
116 This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
117 ************************************************** -->
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
118 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
119 version="1.0">
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
120
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
121 <xsl:import href="$_docbook_xsl"/>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
122 <xsl:include href="html-common.xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
123
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
124 </xsl:stylesheet>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
125 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
126
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
127 echo "Searching for DTD..."
22496
e204544de710 Make sure docbook 4.x gets preferred over 3.x.
diego
parents: 22126
diff changeset
128 #FIXME: This should prefer higher version numbers, not the other way around ..
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
129 for _try_dtd in \
22496
e204544de710 Make sure docbook 4.x gets preferred over 3.x.
diego
parents: 22126
diff changeset
130 /usr/share/xml/docbook/*/dtd/4*/docbookx.dtd \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
131 /usr/share/xml/docbook/*/docbookx.dtd \
22126
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
132 /usr/share/sgml/docbook/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
133 /usr/share/sgml/docbook/dtd/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
134 /usr/share/sgml/docbook/dtd/xml/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
135 /usr/share/docbook-xml*/docbookx.dtd \
26021
69e007ee01d6 improve DTD dection of MacPort-install docbook package
gpoirier
parents: 22496
diff changeset
136 /opt/local/share/xml/docbook*/*/docbookx.dtd \
22126
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
137 /usr/share/apps/ksgmltools2/docbook/*/docbookx.dtd
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
138 do
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
139 if test -f "$_try_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
140 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
141 _dtd=$_try_dtd
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
142 break
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
143 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
144 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
145
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
146 if test -z "$_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
147 then
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
148 _dtd=/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
149 echo "Not found. Using default ($_dtd)."
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
150 else
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
151 echo "Found docbookx.dtd at $_dtd"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
152 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
153
27297
d41a06f831ee docs build fix
henry
parents: 26149
diff changeset
154 for lang in `grep 'DOC_LANGS =' ../../config.mak|cut -d= -f2`; do
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
155 cat > $lang/main.xml << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
156 <?xml version="1.0" encoding="utf-8" standalone="no"?>
20440
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
157 <!-- **************************************************
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
158 This file is generated automatically. DO NOT EDIT.
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
159 ************************************************** -->
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
160 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
161 "$_dtd"
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28969
diff changeset
162 [
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
163 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
164
11827
bedae65be7d1 sort -u is equivalent to sort | uniq, hint by Dominik.
diego
parents: 11826
diff changeset
165 for file in `find $lang en -name \*.xml -exec basename \{\} \; | sort -u`; do
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29968
diff changeset
166 echo '<!ENTITY '$file' SYSTEM "'$file'">' >> $lang/main.xml
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
167 done
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
168
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
169 cat >> $lang/main.xml << EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
170 ]>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
171 <book id="index" lang="$lang">
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
172 &documentation.xml;
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
173 </book>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
174 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
175
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
176 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
177
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
178 echo "Looking for a valid XSLT processor..."
29968
4e0ff9be2b1e Avoid '&>' bashism for redirecting both stdout and stderr.
diego
parents: 29263
diff changeset
179 if xsltproc --version > /dev/null 2>&1
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
180 then
10912
6ec6b4a91003 Fix chunk.xsl autodetection.
lumag
parents: 10351
diff changeset
181 if test -z "$_fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
182 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
183 echo "Found xsltproc. If it works, it's probably the best choice."
28945
486844bc3b84 Avoid an error at the end of chunked HTML doc generation.
reimar
parents: 27297
diff changeset
184 # HACK: xslt always need a target file if a doctype is set
28969
ca733e5376af Fix HTML docs generation, broken in r28980.
rathann
parents: 28945
diff changeset
185 _xsltcommand="OUTPUT=\"\$1\"; if test -d \"\$OUTPUT\" ; then OUTPUT=\"\$OUTPUT/dummy.html\" ; fi;"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
186 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
187 then
28945
486844bc3b84 Avoid an error at the end of chunked HTML doc generation.
reimar
parents: 27297
diff changeset
188 _xsltcommand="$_xsltcommand xsltproc --catalogs -o \$OUTPUT \$2 \$3"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
189 else
28945
486844bc3b84 Avoid an error at the end of chunked HTML doc generation.
reimar
parents: 27297
diff changeset
190 _xsltcommand="$_xsltcommand xsltproc -o \$OUTPUT \$2 \$3"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
191 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
192 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
193 echo "Found xsltproc but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
194 echo "xsltproc is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
195 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
196 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
197
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
198
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
199
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
200 cat > $_xsltwrapper << EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
201 #!/bin/sh
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
202 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
203 # This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
204 # **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
205 # This is a small wrapper script around many ways to call the XSLT processor.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
206 # It accepts 3 arguments: <output_dir> <stylesheet_name> <main XML file name>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
207
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
208 $_sgmlcatalog
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
209 $_xsltcommand
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
210 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
211
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
212 chmod +x $_xsltwrapper
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
213
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
214
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
215 echo "Searching for XML checker..."
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
216 for _try_xmllint in xmllint
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
217 do
11468
bb3e24e796eb less verbosity
diego
parents: 11269
diff changeset
218 if command -v $_try_xmllint > /dev/null 2>&1
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
219 then
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
220 echo "Found $_try_xmllint"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
221 if test -n "$_catalog"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
222 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
223 _xmllint_command="$_try_xmllint --noout --noent --postvalid --catalogs \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
224 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
225 _xmllint_command="$_try_xmllint --noout --noent --postvalid \$*"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
226 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
227 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
228 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
229 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
230
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
231 if test -z "$_xmllint_command"
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
232 then
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
233 echo "Not found"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
234 _xmllint_command=true
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
235 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
236
31468
dbab16182ba2 Get rid of xmllint wrapper redirection; run commands directly from make.
diego
parents: 30990
diff changeset
237 cat > xml.mak << EOF
dbab16182ba2 Get rid of xmllint wrapper redirection; run commands directly from make.
diego
parents: 30990
diff changeset
238 CATALOG = $_catalog
dbab16182ba2 Get rid of xmllint wrapper redirection; run commands directly from make.
diego
parents: 30990
diff changeset
239 XMLLINT_COMMAND = $_xmllint_command
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
240 EOF