Skip to content

Commit 8d01559

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 942e441 commit 8d01559

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
@@ -18406,7 +18405,7 @@ fi
1840618405
fi
1840718406

1840818407
#
18409-
# Check for DocBook and tools
18408+
# Check for documentation-building tools
1841018409
#
1841118410
if test -z "$XMLLINT"; then
1841218411
for ac_prog in xmllint
@@ -18462,55 +18461,19 @@ $as_echo_n "checking for XMLLINT... " >&6; }
1846218461
$as_echo "$XMLLINT" >&6; }
1846318462
fi
1846418463

18465-
18466-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
18467-
$as_echo_n "checking for DocBook XML V4.2... " >&6; }
18468-
if ${pgac_cv_check_docbook+:} false; then :
18469-
$as_echo_n "(cached) " >&6
18470-
else
18471-
cat >conftest.xml <<EOF
18472-
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
18473-
<book>
18474-
<title>test</title>
18475-
<chapter>
18476-
<title>random</title>
18477-
<sect1>
18478-
<title>testsect</title>
18479-
<para>text</para>
18480-
</sect1>
18481-
</chapter>
18482-
</book>
18483-
EOF
18484-
18485-
pgac_cv_check_docbook=no
18486-
18487-
if test -n "$XMLLINT"; then
18488-
$XMLLINT --noout --valid conftest.xml 1>&5 2>&1
18489-
if test $? -eq 0; then
18490-
pgac_cv_check_docbook=yes
18491-
fi
18492-
fi
18493-
rm -f conftest.xml
18494-
fi
18495-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
18496-
$as_echo "$pgac_cv_check_docbook" >&6; }
18497-
18498-
have_docbook=$pgac_cv_check_docbook
18499-
18500-
18501-
if test -z "$DBTOEPUB"; then
18502-
for ac_prog in dbtoepub
18464+
if test -z "$XSLTPROC"; then
18465+
for ac_prog in xsltproc
1850318466
do
1850418467
# Extract the first word of "$ac_prog", so it can be a program name with args.
1850518468
set dummy $ac_prog; ac_word=$2
1850618469
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1850718470
$as_echo_n "checking for $ac_word... " >&6; }
18508-
if ${ac_cv_path_DBTOEPUB+:} false; then :
18471+
if ${ac_cv_path_XSLTPROC+:} false; then :
1850918472
$as_echo_n "(cached) " >&6
1851018473
else
18511-
case $DBTOEPUB in
18474+
case $XSLTPROC in
1851218475
[\\/]* | ?:[\\/]*)
18513-
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
18476+
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
1851418477
;;
1851518478
*)
1851618479
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18520,7 +18483,7 @@ do
1852018483
test -z "$as_dir" && as_dir=.
1852118484
for ac_exec_ext in '' $ac_executable_extensions; do
1852218485
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18523-
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
18486+
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
1852418487
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1852518488
break 2
1852618489
fi
@@ -18531,40 +18494,40 @@ IFS=$as_save_IFS
1853118494
;;
1853218495
esac
1853318496
fi
18534-
DBTOEPUB=$ac_cv_path_DBTOEPUB
18535-
if test -n "$DBTOEPUB"; then
18536-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18537-
$as_echo "$DBTOEPUB" >&6; }
18497+
XSLTPROC=$ac_cv_path_XSLTPROC
18498+
if test -n "$XSLTPROC"; then
18499+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18500+
$as_echo "$XSLTPROC" >&6; }
1853818501
else
1853918502
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1854018503
$as_echo "no" >&6; }
1854118504
fi
1854218505

1854318506

18544-
test -n "$DBTOEPUB" && break
18507+
test -n "$XSLTPROC" && break
1854518508
done
1854618509

1854718510
else
18548-
# Report the value of DBTOEPUB in configure's output in all cases.
18549-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18550-
$as_echo_n "checking for DBTOEPUB... " >&6; }
18551-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18552-
$as_echo "$DBTOEPUB" >&6; }
18511+
# Report the value of XSLTPROC in configure's output in all cases.
18512+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18513+
$as_echo_n "checking for XSLTPROC... " >&6; }
18514+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18515+
$as_echo "$XSLTPROC" >&6; }
1855318516
fi
1855418517

18555-
if test -z "$XSLTPROC"; then
18556-
for ac_prog in xsltproc
18518+
if test -z "$FOP"; then
18519+
for ac_prog in fop
1855718520
do
1855818521
# Extract the first word of "$ac_prog", so it can be a program name with args.
1855918522
set dummy $ac_prog; ac_word=$2
1856018523
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1856118524
$as_echo_n "checking for $ac_word... " >&6; }
18562-
if ${ac_cv_path_XSLTPROC+:} false; then :
18525+
if ${ac_cv_path_FOP+:} false; then :
1856318526
$as_echo_n "(cached) " >&6
1856418527
else
18565-
case $XSLTPROC in
18528+
case $FOP in
1856618529
[\\/]* | ?:[\\/]*)
18567-
ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
18530+
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
1856818531
;;
1856918532
*)
1857018533
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18574,7 +18537,7 @@ do
1857418537
test -z "$as_dir" && as_dir=.
1857518538
for ac_exec_ext in '' $ac_executable_extensions; do
1857618539
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18577-
ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
18540+
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
1857818541
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1857918542
break 2
1858018543
fi
@@ -18585,40 +18548,40 @@ IFS=$as_save_IFS
1858518548
;;
1858618549
esac
1858718550
fi
18588-
XSLTPROC=$ac_cv_path_XSLTPROC
18589-
if test -n "$XSLTPROC"; then
18590-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18591-
$as_echo "$XSLTPROC" >&6; }
18551+
FOP=$ac_cv_path_FOP
18552+
if test -n "$FOP"; then
18553+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18554+
$as_echo "$FOP" >&6; }
1859218555
else
1859318556
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1859418557
$as_echo "no" >&6; }
1859518558
fi
1859618559

1859718560

18598-
test -n "$XSLTPROC" && break
18561+
test -n "$FOP" && break
1859918562
done
1860018563

1860118564
else
18602-
# Report the value of XSLTPROC in configure's output in all cases.
18603-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
18604-
$as_echo_n "checking for XSLTPROC... " >&6; }
18605-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
18606-
$as_echo "$XSLTPROC" >&6; }
18565+
# Report the value of FOP in configure's output in all cases.
18566+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18567+
$as_echo_n "checking for FOP... " >&6; }
18568+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18569+
$as_echo "$FOP" >&6; }
1860718570
fi
1860818571

18609-
if test -z "$FOP"; then
18610-
for ac_prog in fop
18572+
if test -z "$DBTOEPUB"; then
18573+
for ac_prog in dbtoepub
1861118574
do
1861218575
# Extract the first word of "$ac_prog", so it can be a program name with args.
1861318576
set dummy $ac_prog; ac_word=$2
1861418577
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1861518578
$as_echo_n "checking for $ac_word... " >&6; }
18616-
if ${ac_cv_path_FOP+:} false; then :
18579+
if ${ac_cv_path_DBTOEPUB+:} false; then :
1861718580
$as_echo_n "(cached) " >&6
1861818581
else
18619-
case $FOP in
18582+
case $DBTOEPUB in
1862018583
[\\/]* | ?:[\\/]*)
18621-
ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
18584+
ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
1862218585
;;
1862318586
*)
1862418587
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18628,7 +18591,7 @@ do
1862818591
test -z "$as_dir" && as_dir=.
1862918592
for ac_exec_ext in '' $ac_executable_extensions; do
1863018593
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
18631-
ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
18594+
ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
1863218595
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
1863318596
break 2
1863418597
fi
@@ -18639,25 +18602,25 @@ IFS=$as_save_IFS
1863918602
;;
1864018603
esac
1864118604
fi
18642-
FOP=$ac_cv_path_FOP
18643-
if test -n "$FOP"; then
18644-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18645-
$as_echo "$FOP" >&6; }
18605+
DBTOEPUB=$ac_cv_path_DBTOEPUB
18606+
if test -n "$DBTOEPUB"; then
18607+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18608+
$as_echo "$DBTOEPUB" >&6; }
1864618609
else
1864718610
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1864818611
$as_echo "no" >&6; }
1864918612
fi
1865018613

1865118614

18652-
test -n "$FOP" && break
18615+
test -n "$DBTOEPUB" && break
1865318616
done
1865418617

1865518618
else
18656-
# Report the value of FOP in configure's output in all cases.
18657-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
18658-
$as_echo_n "checking for FOP... " >&6; }
18659-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
18660-
$as_echo "$FOP" >&6; }
18619+
# Report the value of DBTOEPUB in configure's output in all cases.
18620+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
18621+
$as_echo_n "checking for DBTOEPUB... " >&6; }
18622+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
18623+
$as_echo "$DBTOEPUB" >&6; }
1866118624
fi
1866218625

1866318626

configure.in

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

23202320
#
2321-
# Check for DocBook and tools
2321+
# Check for documentation-building tools
23222322
#
2323-
PGAC_PATH_XMLLINT
2324-
PGAC_CHECK_DOCBOOK(4.2)
2325-
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
2323+
PGAC_PATH_PROGS(XMLLINT, xmllint)
23262324
PGAC_PATH_PROGS(XSLTPROC, xsltproc)
23272325
PGAC_PATH_PROGS(FOP, fop)
2326+
PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
23282327

23292328
#
23302329
# 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.2... 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)