diff --git a/config/docbook.m4 b/config/docbook.m4 index 636aefed4c..4304fa7ea1 100644 --- a/config/docbook.m4 +++ b/config/docbook.m4 @@ -89,11 +89,14 @@ fi])# PGAC_PATH_DOCBOOK_STYLESHEETS # PGAC_PATH_COLLATEINDEX # ---------------------- +# Some DocBook installations provide collateindex.pl in $DOCBOOKSTYLE/bin, +# but it's not necessarily marked executable, so we can't use AC_PATH_PROG +# to check for it there. Other installations just put it in the PATH. AC_DEFUN([PGAC_PATH_COLLATEINDEX], [AC_REQUIRE([PGAC_PATH_DOCBOOK_STYLESHEETS])dnl -if test -n "$DOCBOOKSTYLE"; then - AC_PATH_PROGS(COLLATEINDEX, collateindex.pl, [], - [$DOCBOOKSTYLE/bin $PATH]) +if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then + COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl" + AC_SUBST([COLLATEINDEX]) else - AC_PATH_PROGS(COLLATEINDEX, collateindex.pl) + AC_PATH_PROG(COLLATEINDEX, collateindex.pl) fi])# PGAC_PATH_COLLATEINDEX diff --git a/configure b/configure index 84d18a263d..26e6b631a6 100755 --- a/configure +++ b/configure @@ -29430,57 +29430,12 @@ else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi -if test -n "$DOCBOOKSTYLE"; then - for ac_prog in collateindex.pl -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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_COLLATEINDEX+set}" = set; then - $as_echo_n "(cached) " >&6 -else - case $COLLATEINDEX in - [\\/]* | ?:[\\/]*) - ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $DOCBOOKSTYLE/bin $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -COLLATEINDEX=$ac_cv_path_COLLATEINDEX -if test -n "$COLLATEINDEX"; then - { $as_echo "$as_me:$LINENO: result: $COLLATEINDEX" >&5 -$as_echo "$COLLATEINDEX" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$COLLATEINDEX" && break -done +if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then + COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl" else - for ac_prog in collateindex.pl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + # Extract the first word of "collateindex.pl", so it can be a program name with args. +set dummy collateindex.pl; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_COLLATEINDEX+set}" = set; then @@ -29519,9 +29474,6 @@ $as_echo "no" >&6; } fi - test -n "$COLLATEINDEX" && break -done - fi for ac_prog in xsltproc do diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 19e640b5d2..04fba43450 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -27,10 +27,6 @@ all: html man distprep: html distprep-man -ifndef COLLATEINDEX -COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl -endif - ifndef JADE JADE = jade endif @@ -120,7 +116,11 @@ HTML.index: postgres.sgml $(ALMOSTALLSGML) stylesheet.dsl $(JADE.html.call) -V html-index $< bookindex.sgml: HTML.index +ifdef COLLATEINDEX LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g -i 'bookindex' -o $@ $< +else + @$(missing) collateindex.pl $< $@ +endif # Technically, this should depend on Makefile.global, but then # version.sgml would need to be rebuilt after every configure run,