Remove configure-time probe for DocBook DTD.
authorTom Lane
Mon, 30 Nov 2020 20:24:13 +0000 (15:24 -0500)
committerTom Lane
Mon, 30 Nov 2020 20:24:13 +0000 (15:24 -0500)
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

aclocal.m4
config/docbook.m4 [deleted file]
configure
configure.in
doc/src/sgml/docguide.sgml

index bfd34ecec8cd7d0e1e37a66435ffed2903f8f120..5e22482cd53de3330b0983465b96305b8404b6e5 100644 (file)
@@ -5,7 +5,6 @@ m4_include([config/ax_pthread.m4])
 m4_include([config/c-compiler.m4])
 m4_include([config/c-library.m4])
 m4_include([config/check_decls.m4])
-m4_include([config/docbook.m4])
 m4_include([config/general.m4])
 m4_include([config/libtool.m4])
 m4_include([config/llvm.m4])
diff --git a/config/docbook.m4 b/config/docbook.m4
deleted file mode 100644 (file)
index 34b829e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# config/docbook.m4
-
-# PGAC_PATH_XMLLINT
-# -----------------
-AC_DEFUN([PGAC_PATH_XMLLINT],
-[PGAC_PATH_PROGS(XMLLINT, xmllint)])
-
-
-# PGAC_CHECK_DOCBOOK(VERSION)
-# ---------------------------
-AC_DEFUN([PGAC_CHECK_DOCBOOK],
-[AC_REQUIRE([PGAC_PATH_XMLLINT])
-AC_CACHE_CHECK([for DocBook XML V$1], [pgac_cv_check_docbook],
-[cat >conftest.xml <
-
-
test
-  random
-   
-    testsect
-    text
-  
-
-EOF
-
-pgac_cv_check_docbook=no
-
-if test -n "$XMLLINT"; then
-  $XMLLINT --noout --valid conftest.xml 1>&AS_MESSAGE_LOG_FD 2>&1
-  if test $? -eq 0; then
-    pgac_cv_check_docbook=yes
-  fi
-fi
-rm -f conftest.xml])
-
-have_docbook=$pgac_cv_check_docbook
-AC_SUBST([have_docbook])
-])# PGAC_CHECK_DOCBOOK
index 2f094716c7c3f3275ec3de209ecbec2bd0193921..51dd90048628cfa69a0f9d90b32ab9af4472b152 100755 (executable)
--- a/configure
+++ b/configure
@@ -630,10 +630,9 @@ vpath_build
 PG_SYSROOT
 PG_VERSION_NUM
 PROVE
+DBTOEPUB
 FOP
 XSLTPROC
-DBTOEPUB
-have_docbook
 XMLLINT
 TCL_SHLIB_LD_LIBS
 TCL_SHARED_BUILD
@@ -18799,7 +18798,7 @@ fi
 fi
 
 #
-# Check for DocBook and tools
+# Check for documentation-building tools
 #
 if test -z "$XMLLINT"; then
   for ac_prog in xmllint
@@ -18855,55 +18854,19 @@ $as_echo_n "checking for XMLLINT... " >&6; }
 $as_echo "$XMLLINT" >&6; }
 fi
 
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML V4.2" >&5
-$as_echo_n "checking for DocBook XML V4.2... " >&6; }
-if ${pgac_cv_check_docbook+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.xml <
-
-
test
-  random
-   
-    testsect
-    text
-  
-
-EOF
-
-pgac_cv_check_docbook=no
-
-if test -n "$XMLLINT"; then
-  $XMLLINT --noout --valid conftest.xml 1>&5 2>&1
-  if test $? -eq 0; then
-    pgac_cv_check_docbook=yes
-  fi
-fi
-rm -f conftest.xml
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5
-$as_echo "$pgac_cv_check_docbook" >&6; }
-
-have_docbook=$pgac_cv_check_docbook
-
-
-if test -z "$DBTOEPUB"; then
-  for ac_prog in dbtoepub
+if test -z "$XSLTPROC"; then
+  for ac_prog in xsltproc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_DBTOEPUB+:} false; then :
+if ${ac_cv_path_XSLTPROC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $DBTOEPUB in
+  case $XSLTPROC in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
+  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18913,7 +18876,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -18924,40 +18887,40 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-DBTOEPUB=$ac_cv_path_DBTOEPUB
-if test -n "$DBTOEPUB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
-$as_echo "$DBTOEPUB" >&6; }
+XSLTPROC=$ac_cv_path_XSLTPROC
+if test -n "$XSLTPROC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
+$as_echo "$XSLTPROC" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$DBTOEPUB" && break
+  test -n "$XSLTPROC" && break
 done
 
 else
-  # Report the value of DBTOEPUB in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
-$as_echo_n "checking for DBTOEPUB... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
-$as_echo "$DBTOEPUB" >&6; }
+  # Report the value of XSLTPROC in configure's output in all cases.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
+$as_echo_n "checking for XSLTPROC... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
+$as_echo "$XSLTPROC" >&6; }
 fi
 
-if test -z "$XSLTPROC"; then
-  for ac_prog in xsltproc
+if test -z "$FOP"; then
+  for ac_prog in fop
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XSLTPROC+:} false; then :
+if ${ac_cv_path_FOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $XSLTPROC in
+  case $FOP in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
+  ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -18967,7 +18930,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -18978,40 +18941,40 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-XSLTPROC=$ac_cv_path_XSLTPROC
-if test -n "$XSLTPROC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
-$as_echo "$XSLTPROC" >&6; }
+FOP=$ac_cv_path_FOP
+if test -n "$FOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
+$as_echo "$FOP" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$XSLTPROC" && break
+  test -n "$FOP" && break
 done
 
 else
-  # Report the value of XSLTPROC in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XSLTPROC" >&5
-$as_echo_n "checking for XSLTPROC... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5
-$as_echo "$XSLTPROC" >&6; }
+  # Report the value of FOP in configure's output in all cases.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
+$as_echo_n "checking for FOP... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
+$as_echo "$FOP" >&6; }
 fi
 
-if test -z "$FOP"; then
-  for ac_prog in fop
+if test -z "$DBTOEPUB"; then
+  for ac_prog in dbtoepub
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FOP+:} false; then :
+if ${ac_cv_path_DBTOEPUB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $FOP in
+  case $DBTOEPUB in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_FOP="$FOP" # Let the user override the test with a path.
+  ac_cv_path_DBTOEPUB="$DBTOEPUB" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -19021,7 +18984,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_FOP="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_DBTOEPUB="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -19032,25 +18995,25 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-FOP=$ac_cv_path_FOP
-if test -n "$FOP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
-$as_echo "$FOP" >&6; }
+DBTOEPUB=$ac_cv_path_DBTOEPUB
+if test -n "$DBTOEPUB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
+$as_echo "$DBTOEPUB" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$FOP" && break
+  test -n "$DBTOEPUB" && break
 done
 
 else
-  # Report the value of FOP in configure's output in all cases.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FOP" >&5
-$as_echo_n "checking for FOP... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FOP" >&5
-$as_echo "$FOP" >&6; }
+  # Report the value of DBTOEPUB in configure's output in all cases.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBTOEPUB" >&5
+$as_echo_n "checking for DBTOEPUB... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBTOEPUB" >&5
+$as_echo "$DBTOEPUB" >&6; }
 fi
 
 
index 854eba2d3adf6d95bbd5dac08b45d32ea4acd13d..cce153f4399cf2414c9177091a5e2f3fb2cf0871 100644 (file)
@@ -2318,13 +2318,12 @@ if test "$with_python" = yes; then
 fi
 
 #
-# Check for DocBook and tools
+# Check for documentation-building tools
 #
-PGAC_PATH_XMLLINT
-PGAC_CHECK_DOCBOOK(4.2)
-PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
+PGAC_PATH_PROGS(XMLLINT, xmllint)
 PGAC_PATH_PROGS(XSLTPROC, xsltproc)
 PGAC_PATH_PROGS(FOP, fop)
+PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
 
 #
 # Check for test tools
index 555c7e25631dd244064565318f00acb91fc11a95..e4bab2a3b53e0f98ffcc43503221ba59dc34c6e8 100644 (file)
    You can get away with not installing DocBook XML and the DocBook XSLT
    stylesheets locally, because the required files will be downloaded from the
    Internet and cached locally.  This may in fact be the preferred solution if
-   your operating system packages provide only an old version of especially
-   the stylesheets or if no packages are available at all.  See
-   the  option for xmllint
-   and xsltproc for more information.
+   your operating system packages provide only an old version of these files,
+   or if no packages are available at all.
+   If you want to prevent any attempt to access the Internet while building
+   the documentation, you need to pass the  option
+   to xmllint and xsltproc; see below
+   for an example.
   
 
   
@@ -228,21 +230,37 @@ brew install docbook docbook-xsl fop
 
   
    Before you can build the documentation you need to run the
-   configure script as you would when building
+   configure script, as you would when building
    the PostgreSQL programs themselves.
-   Check the output near the end of the run, it should look something
+   Check the output near the end of the run; it should look something
    like this:
 
 checking for xmllint... xmllint
-checking for DocBook XML V4.2... yes
-checking for dbtoepub... dbtoepub
 checking for xsltproc... xsltproc
 checking for fop... fop
+checking for dbtoepub... dbtoepub
 
-   If xmllint was not found then some of the following
-   tests will be skipped.
+   If xmllint or xsltproc is not
+   found, you will not be able to build any of the documentation.
+   fop is only needed to build the documentation in
+   PDF format.
+   dbtoepub is only needed to build the documentation
+   in EPUB format.
   
 
+  
+   If necessary, you can tell configure where to find
+   these programs, for example
+
+./configure ... XMLLINT=/opt/local/bin/xmllint ...
+
+   Also, if you want to ensure that xmllint
+   and xsltproc will not perform any network access,
+   you can do something like
+
+./configure ... XMLLINT="xmllint --nonet" XSLTPROC="xsltproc --nonet" ...
+
+