aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-03-22 00:46:03 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-03-22 00:46:03 -0400
commitf2386d7136dacbb8bf59ebbe8e5c5b73db202813 (patch)
tree33af812cfc47a678d3170538618cade6bd5f3d23
parent0e85abd658738db9ea183c133c89c3c94ee37dae (diff)
downloadpostgresql-f2386d7136dacbb8bf59ebbe8e5c5b73db202813.tar.gz
postgresql-f2386d7136dacbb8bf59ebbe8e5c5b73db202813.zip
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.
-rw-r--r--config/docbook.m411
-rwxr-xr-xconfigure56
-rw-r--r--doc/src/sgml/Makefile8
3 files changed, 15 insertions, 60 deletions
diff --git a/config/docbook.m4 b/config/docbook.m4
index 636aefed4c1..4304fa7ea13 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 84d18a263d8..26e6b631a64 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
+if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then
+ COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl"
- ;;
-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
-
-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 19e640b5d25..04fba434509 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,