Skip to content

Commit d34916f

Browse files
committed
Remove configure-time probe for DocBook DTD.
Checking for DocBook being installed was valuable when we were on the OpenSP docs toolchain, because that was rather hard to get installed fully. Nowadays, as long as you have xmllint and xsltproc installed, you're good, because those programs will fetch the DocBook files off the net at need. Moreover, testing this at configure time means that a network access may well occur whether or not you have any interest in building the docs later. That can be slow (typically 2 or 3 seconds, though much higher delays have been reported), and it seems not very nice to be doing an off-machine access without warning, too. Hence, drop the PGAC_CHECK_DOCBOOK probe, and adjust related documentation. Without that macro, there's not much left of config/docbook.m4 at all, so I just removed it. Back-patch to v11, where we started to use xmllint in the PGAC_CHECK_DOCBOOK probe. Discussion: https://postgr.es/m/E2EE6B76-2D96-408A-B961-CAE47D1A86F0@yesql.se Discussion: https://postgr.es/m/A55A7FC9-FA60-47FE-98B5-139CDC57CE6E@gmail.com
1 parent fac31b2 commit d34916f

File tree

5 files changed

+81
-142
lines changed

5 files changed

+81
-142
lines changed

aclocal.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ m4_include([config/ax_pthread.m4])
55
m4_include([config/c-compiler.m4])
66
m4_include([config/c-library.m4])
77
m4_include([config/check_decls.m4])
8-
m4_include([config/docbook.m4])
98
m4_include([config/general.m4])
109
m4_include([config/libtool.m4])
1110
m4_include([config/llvm.m4])

config/docbook.m4

Lines changed: 0 additions & 40 deletions
This file was deleted.

configure

Lines changed: 50 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -630,10 +630,9 @@ vpath_build
630630
PG_SYSROOT
631631
PG_VERSION_NUM
632632
PROVE
633+
DBTOEPUB
633634
FOP
634635
XSLTPROC
635-
DBTOEPUB
636-
have_docbook
637636
XMLLINT
638637
TCL_SHLIB_LD_LIBS
639638
TCL_SHARED_BUILD
@@ -18464,7 +18463,7 @@ fi
1846418463
fi
1846518464

1846618465
#
18467-
# Check for DocBook and tools
18466+
# Check for documentation-building tools
1846818467
#
1846918468
if test -z "$XMLLINT"; then
1847018469
for ac_prog in xmllint
@@ -18520,55 +18519,19 @@ $as_echo_n "checking for XMLLINT... " >&6; }
1852018519
$as_echo "$XMLLINT" >&6; }
1852118520
fi
1852218521

18523-
18524-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.5" >&5
18525-
$as_echo_n "checking for DocBook XML V4.5... " >&6; }
18526-
if ${pgac_cv_check_docbook+:} false; then :
18527-
$as_echo_n "(cached) " >&6
18528-
else
18529-
cat >conftest.xml <<EOF
18530-
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
18531-
<book>
18532-
<title>test</title>
18533-
<chapter>
18534-
<title>random</title>
18535-
<sect1>
18536-
<title>testsect</title>
18537-
<para>text</para>
18538-
</sect1>
18539-
</chapter>
18540-
</book>
18541-
EOF
18542-
18543-
pgac_cv_check_docbook=no
18544-
18545-
if test -n "$XMLLINT"; then
18546-
$XMLLINT --noout --valid conftest.xml 1>&5 2>&1
18547-
if test $? -eq 0; then
18548-
pgac_cv_check_docbook=yes
18549-
fi
18550-
fi
18551-
rm -f conftest.xml
18552-
fi
18553-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
18554-
$as_echo "$pgac_cv_check_docbook" >&6; }
18555-
18556-
have_docbook=$pgac_cv_check_docbook
18557-
18558-
18559-
if test -z "$DBTOEPUB"; then
18560-
for ac_prog in dbtoepub
18522+
if test -z "$XSLTPROC"; then
18523+
for ac_prog in xsltproc
1856118524
do
1856218525
# Extract the first word of "$ac_prog", so it can be a program name with args.
1856318526
set dummy $ac_prog; ac_word=$2
1856418527
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1856518528
$as_echo_n "checking for $ac_word... " >&6; }
18566-
if ${ac_cv_path_DBTOEPUB+:} false; then :
18529+
if ${ac_cv_path_XSLTPROC+:} false; then :
1856718530
$as_echo_n "(cached) " >&6
1856818531
else
18569-
case $DBTOEPUB in
18532+
case $XSLTPROC in
1857018533
[\\/]* | ?:[\\/]*)
18571-
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
18534+
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
1857218535
;;
1857318536
*)
1857418537
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18578,7 +18541,7 @@ do
1857818541
test -z "$as_dir" && as_dir=.
1857918542
for ac_exec_ext in '' $ac_executable_extensions; do
1858018543
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18581-
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
18544+
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
1858218545
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1858318546
break 2
1858418547
fi
@@ -18589,40 +18552,40 @@ IFS=$as_save_IFS
1858918552
;;
1859018553
esac
1859118554
fi
18592-
DBTOEPUB=$ac_cv_path_DBTOEPUB
18593-
if test -n "$DBTOEPUB"; then
18594-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18595-
$as_echo "$DBTOEPUB" >&6; }
18555+
XSLTPROC=$ac_cv_path_XSLTPROC
18556+
if test -n "$XSLTPROC"; then
18557+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18558+
$as_echo "$XSLTPROC" >&6; }
1859618559
else
1859718560
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1859818561
$as_echo "no" >&6; }
1859918562
fi
1860018563

1860118564

18602-
test -n "$DBTOEPUB" && break
18565+
test -n "$XSLTPROC" && break
1860318566
done
1860418567

1860518568
else
18606-
# Report the value of DBTOEPUB in configure's output in all cases.
18607-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18608-
$as_echo_n "checking for DBTOEPUB... " >&6; }
18609-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18610-
$as_echo "$DBTOEPUB" >&6; }
18569+
# Report the value of XSLTPROC in configure's output in all cases.
18570+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18571+
$as_echo_n "checking for XSLTPROC... " >&6; }
18572+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18573+
$as_echo "$XSLTPROC" >&6; }
1861118574
fi
1861218575

18613-
if test -z "$XSLTPROC"; then
18614-
for ac_prog in xsltproc
18576+
if test -z "$FOP"; then
18577+
for ac_prog in fop
1861518578
do
1861618579
# Extract the first word of "$ac_prog", so it can be a program name with args.
1861718580
set dummy $ac_prog; ac_word=$2
1861818581
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1861918582
$as_echo_n "checking for $ac_word... " >&6; }
18620-
if ${ac_cv_path_XSLTPROC+:} false; then :
18583+
if ${ac_cv_path_FOP+:} false; then :
1862118584
$as_echo_n "(cached) " >&6
1862218585
else
18623-
case $XSLTPROC in
18586+
case $FOP in
1862418587
[\\/]* | ?:[\\/]*)
18625-
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
18588+
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
1862618589
;;
1862718590
*)
1862818591
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18632,7 +18595,7 @@ do
1863218595
test -z "$as_dir" && as_dir=.
1863318596
for ac_exec_ext in '' $ac_executable_extensions; do
1863418597
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18635-
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
18598+
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
1863618599
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1863718600
break 2
1863818601
fi
@@ -18643,40 +18606,40 @@ IFS=$as_save_IFS
1864318606
;;
1864418607
esac
1864518608
fi
18646-
XSLTPROC=$ac_cv_path_XSLTPROC
18647-
if test -n "$XSLTPROC"; then
18648-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18649-
$as_echo "$XSLTPROC" >&6; }
18609+
FOP=$ac_cv_path_FOP
18610+
if test -n "$FOP"; then
18611+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18612+
$as_echo "$FOP" >&6; }
1865018613
else
1865118614
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1865218615
$as_echo "no" >&6; }
1865318616
fi
1865418617

1865518618

18656-
test -n "$XSLTPROC" && break
18619+
test -n "$FOP" && break
1865718620
done
1865818621

1865918622
else
18660-
# Report the value of XSLTPROC in configure's output in all cases.
18661-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18662-
$as_echo_n "checking for XSLTPROC... " >&6; }
18663-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18664-
$as_echo "$XSLTPROC" >&6; }
18623+
# Report the value of FOP in configure's output in all cases.
18624+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18625+
$as_echo_n "checking for FOP... " >&6; }
18626+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18627+
$as_echo "$FOP" >&6; }
1866518628
fi
1866618629

18667-
if test -z "$FOP"; then
18668-
for ac_prog in fop
18630+
if test -z "$DBTOEPUB"; then
18631+
for ac_prog in dbtoepub
1866918632
do
1867018633
# Extract the first word of "$ac_prog", so it can be a program name with args.
1867118634
set dummy $ac_prog; ac_word=$2
1867218635
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1867318636
$as_echo_n "checking for $ac_word... " >&6; }
18674-
if ${ac_cv_path_FOP+:} false; then :
18637+
if ${ac_cv_path_DBTOEPUB+:} false; then :
1867518638
$as_echo_n "(cached) " >&6
1867618639
else
18677-
case $FOP in
18640+
case $DBTOEPUB in
1867818641
[\\/]* | ?:[\\/]*)
18679-
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
18642+
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
1868018643
;;
1868118644
*)
1868218645
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18686,7 +18649,7 @@ do
1868618649
test -z "$as_dir" && as_dir=.
1868718650
for ac_exec_ext in '' $ac_executable_extensions; do
1868818651
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18689-
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
18652+
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
1869018653
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1869118654
break 2
1869218655
fi
@@ -18697,25 +18660,25 @@ IFS=$as_save_IFS
1869718660
;;
1869818661
esac
1869918662
fi
18700-
FOP=$ac_cv_path_FOP
18701-
if test -n "$FOP"; then
18702-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18703-
$as_echo "$FOP" >&6; }
18663+
DBTOEPUB=$ac_cv_path_DBTOEPUB
18664+
if test -n "$DBTOEPUB"; then
18665+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18666+
$as_echo "$DBTOEPUB" >&6; }
1870418667
else
1870518668
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1870618669
$as_echo "no" >&6; }
1870718670
fi
1870818671

1870918672

18710-
test -n "$FOP" && break
18673+
test -n "$DBTOEPUB" && break
1871118674
done
1871218675

1871318676
else
18714-
# Report the value of FOP in configure's output in all cases.
18715-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18716-
$as_echo_n "checking for FOP... " >&6; }
18717-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18718-
$as_echo "$FOP" >&6; }
18677+
# Report the value of DBTOEPUB in configure's output in all cases.
18678+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18679+
$as_echo_n "checking for DBTOEPUB... " >&6; }
18680+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18681+
$as_echo "$DBTOEPUB" >&6; }
1871918682
fi
1872018683

1872118684

configure.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,13 +2243,12 @@ if test "$with_python" = yes; then
22432243
fi
22442244

22452245
#
2246-
# Check for DocBook and tools
2246+
# Check for documentation-building tools
22472247
#
2248-
PGAC_PATH_XMLLINT
2249-
PGAC_CHECK_DOCBOOK(4.5)
2250-
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
2248+
PGAC_PATH_PROGS(XMLLINT, xmllint)
22512249
PGAC_PATH_PROGS(XSLTPROC, xsltproc)
22522250
PGAC_PATH_PROGS(FOP, fop)
2251+
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
22532252

22542253
#
22552254
# Check for test tools

doc/src/sgml/docguide.sgml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@
155155
You can get away with not installing DocBook XML and the DocBook XSLT
156156
stylesheets locally, because the required files will be downloaded from the
157157
Internet and cached locally. This may in fact be the preferred solution if
158-
your operating system packages provide only an old version of especially
159-
the stylesheets or if no packages are available at all. See
160-
the <option>--nonet</option> option for <command>xmllint</command>
161-
and <command>xsltproc</command> for more information.
158+
your operating system packages provide only an old version of these files,
159+
or if no packages are available at all.
160+
If you want to prevent any attempt to access the Internet while building
161+
the documentation, you need to pass the <option>--nonet</option> option
162+
to <command>xmllint</command> and <command>xsltproc</command>; see below
163+
for an example.
162164
</para>
163165

164166
<sect2>
@@ -228,21 +230,37 @@ brew install docbook docbook-xsl fop
228230

229231
<para>
230232
Before you can build the documentation you need to run the
231-
<filename>configure</filename> script as you would when building
233+
<filename>configure</filename> script, as you would when building
232234
the <productname>PostgreSQL</productname> programs themselves.
233-
Check the output near the end of the run, it should look something
235+
Check the output near the end of the run; it should look something
234236
like this:
235237
<screen>
236238
checking for xmllint... xmllint
237-
checking for DocBook XML V4.5... yes
238-
checking for dbtoepub... dbtoepub
239239
checking for xsltproc... xsltproc
240240
checking for fop... fop
241+
checking for dbtoepub... dbtoepub
241242
</screen>
242-
If <filename>xmllint</filename> was not found then some of the following
243-
tests will be skipped.
243+
If <filename>xmllint</filename> or <filename>xsltproc</filename> is not
244+
found, you will not be able to build any of the documentation.
245+
<filename>fop</filename> is only needed to build the documentation in
246+
PDF format.
247+
<filename>dbtoepub</filename> is only needed to build the documentation
248+
in EPUB format.
244249
</para>
245250

251+
<para>
252+
If necessary, you can tell <filename>configure</filename> where to find
253+
these programs, for example
254+
<screen>
255+
./configure ... XMLLINT=/opt/local/bin/xmllint ...
256+
</screen>
257+
Also, if you want to ensure that <filename>xmllint</filename>
258+
and <filename>xsltproc</filename> will not perform any network access,
259+
you can do something like
260+
<screen>
261+
./configure ... XMLLINT="xmllint --nonet" XSLTPROC="xsltproc --nonet" ...
262+
</screen>
263+
</para>
246264
</sect2>
247265
</sect1>
248266

0 commit comments

Comments
 (0)