Skip to content

Commit 4823c4f

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 275b341 commit 4823c4f

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
@@ -18548,7 +18547,7 @@ fi
1854818547
fi
1854918548

1855018549
#
18551-
# Check for DocBook and tools
18550+
# Check for documentation-building tools
1855218551
#
1855318552
if test -z "$XMLLINT"; then
1855418553
for ac_prog in xmllint
@@ -18604,55 +18603,19 @@ $as_echo_n "checking for XMLLINT... " >&6; }
1860418603
$as_echo "$XMLLINT" >&6; }
1860518604
fi
1860618605

18607-
18608-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.5" >&5
18609-
$as_echo_n "checking for DocBook XML V4.5... " >&6; }
18610-
if ${pgac_cv_check_docbook+:} false; then :
18611-
$as_echo_n "(cached) " >&6
18612-
else
18613-
cat >conftest.xml <<EOF
18614-
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
18615-
<book>
18616-
<title>test</title>
18617-
<chapter>
18618-
<title>random</title>
18619-
<sect1>
18620-
<title>testsect</title>
18621-
<para>text</para>
18622-
</sect1>
18623-
</chapter>
18624-
</book>
18625-
EOF
18626-
18627-
pgac_cv_check_docbook=no
18628-
18629-
if test -n "$XMLLINT"; then
18630-
$XMLLINT --noout --valid conftest.xml 1>&5 2>&1
18631-
if test $? -eq 0; then
18632-
pgac_cv_check_docbook=yes
18633-
fi
18634-
fi
18635-
rm -f conftest.xml
18636-
fi
18637-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
18638-
$as_echo "$pgac_cv_check_docbook" >&6; }
18639-
18640-
have_docbook=$pgac_cv_check_docbook
18641-
18642-
18643-
if test -z "$DBTOEPUB"; then
18644-
for ac_prog in dbtoepub
18606+
if test -z "$XSLTPROC"; then
18607+
for ac_prog in xsltproc
1864518608
do
1864618609
# Extract the first word of "$ac_prog", so it can be a program name with args.
1864718610
set dummy $ac_prog; ac_word=$2
1864818611
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1864918612
$as_echo_n "checking for $ac_word... " >&6; }
18650-
if ${ac_cv_path_DBTOEPUB+:} false; then :
18613+
if ${ac_cv_path_XSLTPROC+:} false; then :
1865118614
$as_echo_n "(cached) " >&6
1865218615
else
18653-
case $DBTOEPUB in
18616+
case $XSLTPROC in
1865418617
[\\/]* | ?:[\\/]*)
18655-
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
18618+
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
1865618619
;;
1865718620
*)
1865818621
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18662,7 +18625,7 @@ do
1866218625
test -z "$as_dir" && as_dir=.
1866318626
for ac_exec_ext in '' $ac_executable_extensions; do
1866418627
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18665-
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
18628+
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
1866618629
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1866718630
break 2
1866818631
fi
@@ -18673,40 +18636,40 @@ IFS=$as_save_IFS
1867318636
;;
1867418637
esac
1867518638
fi
18676-
DBTOEPUB=$ac_cv_path_DBTOEPUB
18677-
if test -n "$DBTOEPUB"; then
18678-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18679-
$as_echo "$DBTOEPUB" >&6; }
18639+
XSLTPROC=$ac_cv_path_XSLTPROC
18640+
if test -n "$XSLTPROC"; then
18641+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18642+
$as_echo "$XSLTPROC" >&6; }
1868018643
else
1868118644
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1868218645
$as_echo "no" >&6; }
1868318646
fi
1868418647

1868518648

18686-
test -n "$DBTOEPUB" && break
18649+
test -n "$XSLTPROC" && break
1868718650
done
1868818651

1868918652
else
18690-
# Report the value of DBTOEPUB in configure's output in all cases.
18691-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18692-
$as_echo_n "checking for DBTOEPUB... " >&6; }
18693-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18694-
$as_echo "$DBTOEPUB" >&6; }
18653+
# Report the value of XSLTPROC in configure's output in all cases.
18654+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18655+
$as_echo_n "checking for XSLTPROC... " >&6; }
18656+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18657+
$as_echo "$XSLTPROC" >&6; }
1869518658
fi
1869618659

18697-
if test -z "$XSLTPROC"; then
18698-
for ac_prog in xsltproc
18660+
if test -z "$FOP"; then
18661+
for ac_prog in fop
1869918662
do
1870018663
# Extract the first word of "$ac_prog", so it can be a program name with args.
1870118664
set dummy $ac_prog; ac_word=$2
1870218665
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1870318666
$as_echo_n "checking for $ac_word... " >&6; }
18704-
if ${ac_cv_path_XSLTPROC+:} false; then :
18667+
if ${ac_cv_path_FOP+:} false; then :
1870518668
$as_echo_n "(cached) " >&6
1870618669
else
18707-
case $XSLTPROC in
18670+
case $FOP in
1870818671
[\\/]* | ?:[\\/]*)
18709-
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
18672+
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
1871018673
;;
1871118674
*)
1871218675
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18716,7 +18679,7 @@ do
1871618679
test -z "$as_dir" && as_dir=.
1871718680
for ac_exec_ext in '' $ac_executable_extensions; do
1871818681
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18719-
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
18682+
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
1872018683
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1872118684
break 2
1872218685
fi
@@ -18727,40 +18690,40 @@ IFS=$as_save_IFS
1872718690
;;
1872818691
esac
1872918692
fi
18730-
XSLTPROC=$ac_cv_path_XSLTPROC
18731-
if test -n "$XSLTPROC"; then
18732-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18733-
$as_echo "$XSLTPROC" >&6; }
18693+
FOP=$ac_cv_path_FOP
18694+
if test -n "$FOP"; then
18695+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18696+
$as_echo "$FOP" >&6; }
1873418697
else
1873518698
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1873618699
$as_echo "no" >&6; }
1873718700
fi
1873818701

1873918702

18740-
test -n "$XSLTPROC" && break
18703+
test -n "$FOP" && break
1874118704
done
1874218705

1874318706
else
18744-
# Report the value of XSLTPROC in configure's output in all cases.
18745-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18746-
$as_echo_n "checking for XSLTPROC... " >&6; }
18747-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18748-
$as_echo "$XSLTPROC" >&6; }
18707+
# Report the value of FOP in configure's output in all cases.
18708+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18709+
$as_echo_n "checking for FOP... " >&6; }
18710+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18711+
$as_echo "$FOP" >&6; }
1874918712
fi
1875018713

18751-
if test -z "$FOP"; then
18752-
for ac_prog in fop
18714+
if test -z "$DBTOEPUB"; then
18715+
for ac_prog in dbtoepub
1875318716
do
1875418717
# Extract the first word of "$ac_prog", so it can be a program name with args.
1875518718
set dummy $ac_prog; ac_word=$2
1875618719
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1875718720
$as_echo_n "checking for $ac_word... " >&6; }
18758-
if ${ac_cv_path_FOP+:} false; then :
18721+
if ${ac_cv_path_DBTOEPUB+:} false; then :
1875918722
$as_echo_n "(cached) " >&6
1876018723
else
18761-
case $FOP in
18724+
case $DBTOEPUB in
1876218725
[\\/]* | ?:[\\/]*)
18763-
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
18726+
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
1876418727
;;
1876518728
*)
1876618729
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18770,7 +18733,7 @@ do
1877018733
test -z "$as_dir" && as_dir=.
1877118734
for ac_exec_ext in '' $ac_executable_extensions; do
1877218735
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18773-
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
18736+
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
1877418737
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1877518738
break 2
1877618739
fi
@@ -18781,25 +18744,25 @@ IFS=$as_save_IFS
1878118744
;;
1878218745
esac
1878318746
fi
18784-
FOP=$ac_cv_path_FOP
18785-
if test -n "$FOP"; then
18786-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18787-
$as_echo "$FOP" >&6; }
18747+
DBTOEPUB=$ac_cv_path_DBTOEPUB
18748+
if test -n "$DBTOEPUB"; then
18749+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18750+
$as_echo "$DBTOEPUB" >&6; }
1878818751
else
1878918752
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1879018753
$as_echo "no" >&6; }
1879118754
fi
1879218755

1879318756

18794-
test -n "$FOP" && break
18757+
test -n "$DBTOEPUB" && break
1879518758
done
1879618759

1879718760
else
18798-
# Report the value of FOP in configure's output in all cases.
18799-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18800-
$as_echo_n "checking for FOP... " >&6; }
18801-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18802-
$as_echo "$FOP" >&6; }
18761+
# Report the value of DBTOEPUB in configure's output in all cases.
18762+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18763+
$as_echo_n "checking for DBTOEPUB... " >&6; }
18764+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18765+
$as_echo "$DBTOEPUB" >&6; }
1880318766
fi
1880418767

1880518768

configure.ac

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

22392239
#
2240-
# Check for DocBook and tools
2240+
# Check for documentation-building tools
22412241
#
2242-
PGAC_PATH_XMLLINT
2243-
PGAC_CHECK_DOCBOOK(4.5)
2244-
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
2242+
PGAC_PATH_PROGS(XMLLINT, xmllint)
22452243
PGAC_PATH_PROGS(XSLTPROC, xsltproc)
22462244
PGAC_PATH_PROGS(FOP, fop)
2245+
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
22472246

22482247
#
22492248
# 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)