ao_coreaudio: fix partial volume control
[mplayer.git] / DOCS / xml / configure
blobe4c63d49349b50cab5fae5e6211e3372ae4da5fa
1 #!/bin/sh
3 # Script to check for catalogs, stylesheets, XSL processors and all
4 # the other stuff necessary to convert the XML documentation.
6 echo "Searching for XML catalogs..."
7 for try_catalog in \
8 /etc/sgml/catalog \
9 /usr/share/xml/docbook/*/catalog.xml \
10 /opt/local/share/xml/docbook-xml/*/catalog.xml \
11 /opt/local/share/xml/docbook/*/catalog.xml \
12 /usr/share/sgml/docbook/*/*catalog \
13 /usr/share/apps/ksgmltools2/customization/en/catalog \
14 /usr/share/sgml/catalog \
15 /usr/local/share/sgml/catalog \
16 /usr/lib/sgml/catalog \
17 /usr/local/lib/sgml/catalog \
18 /usr/share/docbook-xml42/catalog.xml \
19 /usr/share/sgml/docbook/xmlcatalog
21 if test -f "$try_catalog"; then
22 catalog=$try_catalog
23 break
25 done
27 if test -n "$catalog"; then
28 echo "Found SGML catalog at $catalog"
29 catalog_opts=--catalogs
30 else
31 echo "No SGML catalog found."
36 echo "Searching for stylesheets..."
37 echo "Searching for html/chunk.xsl..."
38 for try_chunk_xsl in \
39 /usr/share/xml/docbook/*/html/chunk.xsl \
40 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
41 /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
42 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl \
43 /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl \
44 /usr/share/docbook-xsl/html/chunk.xsl \
45 /usr/share/sgml/docbook/xsl-stylesheets*/html/chunk.xsl \
46 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/chunk.xsl \
47 /opt/local/share/xsl/docbook-xsl/html/chunk.xsl \
50 if test -f "$try_chunk_xsl"; then
51 chunk_xsl=$try_chunk_xsl
52 break
54 done
56 if test -z "$chunk_xsl"; then
57 chunk_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl
58 echo "Not found. Using default ($chunk_xsl)"
59 fake_chunk_xsl=yes
60 else
61 echo "Found chunk.xsl at $chunk_xsl"
64 echo "Searching for html/docbook.xsl..."
65 for try_docbook_xsl in \
66 /usr/share/xml/docbook/*/html/docbook.xsl \
67 /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
68 /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
69 /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
70 /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl \
71 /usr/share/docbook-xsl/html/docbook.xsl \
72 /usr/share/sgml/docbook/xsl-stylesheets*/html/docbook.xsl \
73 /usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl \
74 /opt/local/share/xsl/docbook-xsl/html/docbook.xsl \
77 if test -f "$try_docbook_xsl"; then
78 docbook_xsl=$try_docbook_xsl
79 break
81 done
83 if test -z "$docbook_xsl"; then
84 docbook_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl
85 echo "Not found. Using default ($docbook_xsl)"
86 else
87 echo "Found docbook.xsl at $docbook_xsl"
90 cat > html-chunk.xsl << EOF
91 <?xml version="1.0" encoding="utf-8"?>
92 <!-- **************************************************
93 This file is generated automatically. DO NOT EDIT.
94 ************************************************** -->
95 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
96 version="1.0">
98 <xsl:import href="$chunk_xsl"/>
99 <xsl:include href="html-common.xsl"/>
101 </xsl:stylesheet>
105 cat > html-single.xsl << EOF
106 <?xml version="1.0" encoding="utf-8"?>
107 <!-- **************************************************
108 This file is generated automatically. DO NOT EDIT.
109 ************************************************** -->
110 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
111 version="1.0">
113 <xsl:import href="$docbook_xsl"/>
114 <xsl:include href="html-common.xsl"/>
116 </xsl:stylesheet>
119 echo "Searching for DTD..."
120 #FIXME: This should prefer higher version numbers, not the other way around ..
121 for try_dtd in \
122 /usr/share/xml/docbook/*/dtd/4*/docbookx.dtd \
123 /usr/share/xml/docbook/*/docbookx.dtd \
124 /usr/share/sgml/docbook/*/docbookx.dtd \
125 /usr/share/sgml/docbook/dtd/*/docbookx.dtd \
126 /usr/share/sgml/docbook/dtd/xml/*/docbookx.dtd \
127 /usr/share/docbook-xml*/docbookx.dtd \
128 /opt/local/share/xml/docbook*/*/docbookx.dtd \
129 /usr/share/apps/ksgmltools2/docbook/*/docbookx.dtd
131 if test -f "$try_dtd"; then
132 dtd=$try_dtd
133 break
135 done
137 if test -z "$dtd"; then
138 dtd=/usr/share/sgml/docbook/dtd/xml/4.1.2/docbookx.dtd
139 echo "Not found. Using default ($dtd)."
140 else
141 echo "Found docbookx.dtd at $dtd"
144 for lang in `grep 'DOC_LANGS =' ../../config.mak|cut -d= -f2`; do
145 cat > $lang/main.xml << EOF
146 <?xml version="1.0" encoding="utf-8" standalone="no"?>
147 <!-- **************************************************
148 This file is generated automatically. DO NOT EDIT.
149 ************************************************** -->
150 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
151 "$dtd"
155 for file in $(find en -name \*.xml -exec basename \{\} \;); do
156 echo '<!ENTITY '$file' SYSTEM "'$file'">' >> $lang/main.xml
157 done
159 cat >> $lang/main.xml << EOF
161 <book id="index" lang="$lang">
162 &documentation.xml;
163 </book>
166 done
168 echo "Looking for a valid XSLT processor..."
169 if xsltproc --version > /dev/null 2>&1; then
170 if test -z "$fake_chunk_xsl"; then
171 echo "Found xsltproc. If it works, it's probably the best choice."
172 xsltcommand="xsltproc $catalog_opts -o \$\$1 \$\$2 \$\$3"
173 else
174 echo "Found xsltproc but no stylesheets on your system."
175 echo "xsltproc is unusable without stylesheets."
180 cat > xml.mak << EOF
181 CATALOG = $catalog
182 XMLLINT_COMMAND = xmllint --noout --noent --postvalid $catalog_opts \$*
183 XSLT_COMMAND = $xsltcommand