Fix configure's search for collateindex.pl.

PGAC_PATH_COLLATEINDEX supposed that it could use AC_PATH_PROGS to search
for collateindex.pl, but that macro will only accept files that are marked
executable, and at least some DocBook installations don't mark the script
executable (a case the docs Makefile was already prepared for).  Accept the
script if it's present and readable in $DOCBOOKSTYLE/bin, and otherwise
search the PATH as before.

Having fixed that up, we don't need the fallback case that was in the docs
Makefile, and instead can throw an understandable error if configure didn't
find the script.  Per recent trouble report from John Lumby.
This commit is contained in:
Tom Lane 2012-03-22 00:46:03 -04:00
parent 0e85abd658
commit f2386d7136
3 changed files with 15 additions and 60 deletions

View File

@ -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

56
configure vendored
View File

@ -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

View File

@ -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,