annotate DOCS/xml/configure @ 31773:69eadc0c5372

Adding XML entities for the English XML files to main.xml is enough. The English version is the master and will always be complete.
author diego
date Wed, 28 Jul 2010 06:47:50 +0000
parents ca68c0b0f4c4
children ba2ae47a445f
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
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
6 echo "Searching for XML catalogs..."
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
7 for try_catalog in \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
8 /etc/sgml/catalog \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
9 /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
10 /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
11 /usr/share/sgml/docbook/*/*catalog \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
12 /usr/share/apps/ksgmltools2/customization/en/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
13 /usr/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
14 /usr/local/share/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
15 /usr/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
16 /usr/local/lib/sgml/catalog \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
17 /usr/share/docbook-xml42/catalog.xml \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
18 /usr/share/sgml/docbook/xmlcatalog
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
19 do
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
20 if test -f "$try_catalog"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
21 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
22 catalog=$try_catalog
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
23 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
24 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
25 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
26
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
27 if test -n "$catalog"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
28 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
29 echo "Found SGML catalog at $catalog"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
30 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
31 echo "No SGML catalog found."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
32 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
33
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
34
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
35
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
36 echo "Searching for stylesheets..."
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
37 echo "Searching for html/chunk.xsl..."
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
38 for try_chunk_xsl in \
26149
484bf3498911 Add some more paths to find tools on Slackware 12.
diego
parents: 26021
diff changeset
39 /usr/share/xml/docbook/*/html/chunk.xsl \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
40 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
41 /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
42 /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
43 /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
44 /usr/share/docbook-xsl/html/chunk.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
45 /usr/share/sgml/docbook/xsl-stylesheets*/html/chunk.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
46 /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
47 /opt/local/share/xsl/docbook-xsl/html/chunk.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
48
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
49 do
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
50 if test -f "$try_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
51 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
52 chunk_xsl=$try_chunk_xsl
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
53 break
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
54 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
55 done
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
56
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
57 if test -z "$chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
58 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
59 chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
60 echo "Not found. Using default ($chunk_xsl)"
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
61 fake_chunk_xsl=yes
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
62 else
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
63 echo "Found chunk.xsl at $chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
64 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
65
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
66 echo "Searching for html/docbook.xsl..."
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
67 for try_docbook_xsl in \
26149
484bf3498911 Add some more paths to find tools on Slackware 12.
diego
parents: 26021
diff changeset
68 /usr/share/xml/docbook/*/html/docbook.xsl \
15132
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
69 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
70 /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
71 /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
72 /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
f3617970ae22 Break overly long lines into something more manageable.
diego
parents: 13838
diff changeset
73 /usr/share/docbook-xsl/html/docbook.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
74 /usr/share/sgml/docbook/xsl-stylesheets*/html/docbook.xsl \
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
75 /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
76 /opt/local/share/xsl/docbook-xsl/html/docbook.xsl \
17676
b7f727c156fd Add XML tool paths for SUSE 10.0
diego
parents: 17458
diff changeset
77
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
78 do
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
79 if test -f "$try_docbook_xsl"
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
80 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
81 docbook_xsl=$try_docbook_xsl
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
82 break
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
83 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
84 done
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
85
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
86 if test -z "$docbook_xsl"
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
87 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
88 docbook_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
89 echo "Not found. Using default ($docbook_xsl)"
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
90 else
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
91 echo "Found docbook.xsl at $docbook_xsl"
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
92 fi
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
93
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
94 cat > html-chunk.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
95 <?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
96 <!-- **************************************************
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
97 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
98 ************************************************** -->
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
99 <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
100 version="1.0">
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
101
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
102 <xsl:import href="$chunk_xsl"/>
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
103 <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
104
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
105 </xsl:stylesheet>
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
106 EOF
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
107
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
108
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
109 cat > html-single.xsl << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
110 <?xml version="1.0" encoding="utf-8"?>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
111 <!-- **************************************************
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
112 This file is generated automatically. DO NOT EDIT.
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
113 ************************************************** -->
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
114 <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
115 version="1.0">
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
116
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
117 <xsl:import href="$docbook_xsl"/>
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
118 <xsl:include href="html-common.xsl"/>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
119
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
120 </xsl:stylesheet>
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
121 EOF
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
122
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
123 echo "Searching for DTD..."
22496
e204544de710 Make sure docbook 4.x gets preferred over 3.x.
diego
parents: 22126
diff changeset
124 #FIXME: This should prefer higher version numbers, not the other way around ..
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
125 for try_dtd in \
22496
e204544de710 Make sure docbook 4.x gets preferred over 3.x.
diego
parents: 22126
diff changeset
126 /usr/share/xml/docbook/*/dtd/4*/docbookx.dtd \
17239
b654001ae89a Add current Cygwin tool paths.
diego
parents: 15133
diff changeset
127 /usr/share/xml/docbook/*/docbookx.dtd \
22126
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
128 /usr/share/sgml/docbook/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
129 /usr/share/sgml/docbook/dtd/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
130 /usr/share/sgml/docbook/dtd/xml/*/docbookx.dtd \
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
131 /usr/share/docbook-xml*/docbookx.dtd \
26021
69e007ee01d6 improve DTD dection of MacPort-install docbook package
gpoirier
parents: 22496
diff changeset
132 /opt/local/share/xml/docbook*/*/docbookx.dtd \
22126
b49bc3a14c3c some more docbook paths, patch by Torinthiel
diego
parents: 21806
diff changeset
133 /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
134 do
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
135 if test -f "$try_dtd"
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
136 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
137 dtd=$try_dtd
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
138 break
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
139 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
140 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
141
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
142 if test -z "$dtd"
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
143 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
144 dtd=/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
145 echo "Not found. Using default ($dtd)."
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
146 else
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
147 echo "Found docbookx.dtd at $dtd"
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
148 fi
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
149
27297
d41a06f831ee docs build fix
henry
parents: 26149
diff changeset
150 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
151 cat > $lang/main.xml << EOF
20761
3ea816dc678e Generated XSL files should be in UTF-8.
diego
parents: 20440
diff changeset
152 <?xml version="1.0" encoding="utf-8" standalone="no"?>
20440
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
153 <!-- **************************************************
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
154 This file is generated automatically. DO NOT EDIT.
ef1252f1ac2d Clearly state that main.xml is generated
torinthiel
parents: 17676
diff changeset
155 ************************************************** -->
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
156 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
157 "$dtd"
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28969
diff changeset
158 [
11817
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
159 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
160
31773
69eadc0c5372 Adding XML entities for the English XML files to main.xml is enough.
diego
parents: 31772
diff changeset
161 for file in $(find en -name \*.xml -exec basename \{\} \;); do
30990
0ad2da052b2e the great MPlayer tab removal: part I
diego
parents: 29968
diff changeset
162 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
163 done
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
164
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
165 cat >> $lang/main.xml << EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
166 ]>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
167 <book id="index" lang="$lang">
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
168 &documentation.xml;
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
169 </book>
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
170 EOF
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
171
19919e913e3d Shiny new build system by Torinthiel, polished and improved by myself.
diego
parents: 11468
diff changeset
172 done
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
173
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
174 echo "Looking for a valid XSLT processor..."
29968
4e0ff9be2b1e Avoid '&>' bashism for redirecting both stdout and stderr.
diego
parents: 29263
diff changeset
175 if xsltproc --version > /dev/null 2>&1
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
176 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
177 if test -z "$fake_chunk_xsl"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
178 then
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
179 echo "Found xsltproc. If it works, it's probably the best choice."
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
180 if test -n "$catalog"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
181 then
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
182 xsltcommand="xsltproc --catalogs -o \$\$1 \$\$2 \$\$3"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
183 else
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
184 xsltcommand="xsltproc -o \$\$1 \$\$2 \$\$3"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
185 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
186 else
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
187 echo "Found xsltproc but no stylesheets on your system."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
188 echo "xsltproc is unusable without stylesheets."
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
189 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
190 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
191
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
192
11206
e7534574320c html.xsl ---> html-single.xsl + more consistency + small fixes
diego
parents: 11188
diff changeset
193 echo "Searching for XML checker..."
31770
abfc5eb7af04 Simplify xmllint test.
diego
parents: 31472
diff changeset
194 if command -v xmllint > /dev/null 2>&1; then
abfc5eb7af04 Simplify xmllint test.
diego
parents: 31472
diff changeset
195 echo "Found xmllint"
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
196 if test -n "$catalog"; then
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
197 xmllint_command="xmllint --noout --noent --postvalid --catalogs \$*"
31770
abfc5eb7af04 Simplify xmllint test.
diego
parents: 31472
diff changeset
198 else
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
199 xmllint_command="xmllint --noout --noent --postvalid \$*"
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
200 fi
31770
abfc5eb7af04 Simplify xmllint test.
diego
parents: 31472
diff changeset
201 else
11188
6dfed0b2a300 Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
lumag
parents: 11012
diff changeset
202 echo "Not found"
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
203 xmllint_command=true
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
204 fi
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
205
31468
dbab16182ba2 Get rid of xmllint wrapper redirection; run commands directly from make.
diego
parents: 30990
diff changeset
206 cat > xml.mak << EOF
31771
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
207 CATALOG = $catalog
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
208 XMLLINT_COMMAND = $xmllint_command
75398f13e9f6 cosmetics: Drop leading underscores from variable names.
diego
parents: 31770
diff changeset
209 XSLT_COMMAND = $xsltcommand
10309
3c0e1b182fbc XML autoconfiguration by Dmitry Baryshkov <lumag@qnc.ru> with some
diego
parents:
diff changeset
210 EOF