From f900afff3e8fc2c233ff59cc9bc2639f5efe4d8c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 26 Nov 2008 11:26:54 +0000 Subject: [PATCH] configure check for docbook2man program, used in the new XML-based man page build target. This covers from-source, Debian, and Fedora installation variants. --- config/docbook.m4 | 31 ++++++++++++++++++++++++++++++- configure | 35 ++++++++++++++++++++++++++++++++++- configure.in | 3 ++- doc/src/sgml/Makefile | 9 +++++---- src/Makefile.global.in | 3 ++- 5 files changed, 73 insertions(+), 8 deletions(-) diff --git a/config/docbook.m4 b/config/docbook.m4 index f7cc67d4f5..491d329d53 100644 --- a/config/docbook.m4 +++ b/config/docbook.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/docbook.m4,v 1.9 2008/09/05 09:37:37 petere Exp $ +# $PostgreSQL: pgsql/config/docbook.m4,v 1.10 2008/11/26 11:26:54 petere Exp $ # PGAC_PROG_JADE # -------------- @@ -97,3 +97,32 @@ if test -n "$DOCBOOKSTYLE"; then else AC_PATH_PROGS(COLLATEINDEX, collateindex.pl) fi])# PGAC_PATH_COLLATEINDEX + + +# PGAC_PATH_DOCBOOK2MAN +# --------------------- +# Find docbook2man program from the docbook2X package. Upstream calls +# this program docbook2man, but there is also a different docbook2man +# out there from the docbook-utils package. Thus, the program we want +# is called docbook2x-man on Debian and db2x_docbook2man on Fedora. +# +# (Consider rewriting this macro using AC_PATH_PROGS_FEATURE_CHECK +# when switching to Autoconf 2.62+.) +AC_DEFUN([PGAC_PATH_DOCBOOK2MAN], +[AC_CACHE_CHECK([for docbook2man], [ac_cv_path_DOCBOOK2MAN], +[if test -z "$DOCBOOK2MAN"; then + _AS_PATH_WALK([], + [for ac_prog in docbook2x-man db2x_docbook2man docbook2man; do + ac_path="$as_dir/$ac_prog" + AS_EXECUTABLE_P(["$ac_path"]) || continue + if "$ac_path" --version 2>/dev/null | $GREP docbook2x >/dev/null 2>&1; then + ac_cv_path_DOCBOOK2MAN=$ac_path + break + fi + done]) +else + ac_cv_path_DOCBOOK2MAN=$DOCBOOK2MAN +fi]) +DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN +AC_SUBST(DOCBOOK2MAN) +])# PGAC_PATH_DOCBOOK2MAN diff --git a/configure b/configure index 425c56e17a..89de116af8 100755 --- a/configure +++ b/configure @@ -766,6 +766,7 @@ have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL +DOCBOOK2MAN vpath_build LTLIBOBJS' ac_subst_files='' @@ -25880,6 +25881,37 @@ fi test -n "$SGMLSPL" && break done +{ echo "$as_me:$LINENO: checking for docbook2man" >&5 +echo $ECHO_N "checking for docbook2man... $ECHO_C" >&6; } +if test "${ac_cv_path_DOCBOOK2MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$DOCBOOK2MAN"; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in docbook2x-man db2x_docbook2man docbook2man; do + ac_path="$as_dir/$ac_prog" + { test -f "$ac_path" && $as_test_x "$ac_path"; } || continue + if "$ac_path" --version 2>/dev/null | $GREP docbook2x >/dev/null 2>&1; then + ac_cv_path_DOCBOOK2MAN=$ac_path + break + fi + done +done +IFS=$as_save_IFS + +else + ac_cv_path_DOCBOOK2MAN=$DOCBOOK2MAN +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_DOCBOOK2MAN" >&5 +echo "${ECHO_T}$ac_cv_path_DOCBOOK2MAN" >&6; } +DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN + + # Thread testing @@ -27004,11 +27036,12 @@ have_docbook!$have_docbook$ac_delim DOCBOOKSTYLE!$DOCBOOKSTYLE$ac_delim COLLATEINDEX!$COLLATEINDEX$ac_delim SGMLSPL!$SGMLSPL$ac_delim +DOCBOOK2MAN!$DOCBOOK2MAN$ac_delim vpath_build!$vpath_build$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index f8f507cd0c..e006a97a5b 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.573 2008/11/24 09:15:15 mha Exp $ +dnl $PostgreSQL: pgsql/configure.in,v 1.574 2008/11/26 11:26:54 petere Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -1693,6 +1693,7 @@ PGAC_CHECK_DOCBOOK(4.2) PGAC_PATH_DOCBOOK_STYLESHEETS PGAC_PATH_COLLATEINDEX AC_CHECK_PROGS(SGMLSPL, sgmlspl) +PGAC_PATH_DOCBOOK2MAN # Thread testing diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 033fd7bbb7..abf6811442 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -2,7 +2,7 @@ # # PostgreSQL documentation makefile # -# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.112 2008/11/14 10:22:45 petere Exp $ +# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.113 2008/11/26 11:26:54 petere Exp $ # #---------------------------------------------------------------------------- @@ -37,6 +37,10 @@ ifndef SGMLSPL SGMLSPL = sgmlspl endif +ifndef DOCBOOK2MAN +DOCBOOK2MAN = docbook2man_is_missing +endif + # docbook2man generates man pages from docbook refentry source code. D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl D2MLINKS = $(D2MDIR)/docbook2man-spec_makelinks @@ -276,9 +280,6 @@ MAKEINFO = makeinfo ## Experimental man page building through docbook2x ## -# called docbook2man on non-Debian -DOCBOOK2MAN = docbook2x-man - manx: postgres.xml stylesheet-man.xsl $(DOCBOOK2MAN) --solinks -s $(srcdir)/stylesheet-man.xsl --string-param default-manpage-section=$(DEFAULTSECTION) $< $(mkinstalldirs) man1 man7 diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 02fab8c84c..6789e182f4 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,5 +1,5 @@ # -*-makefile-*- -# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.246 2008/11/14 10:22:47 petere Exp $ +# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.247 2008/11/26 11:26:54 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -189,6 +189,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@ have_docbook = @have_docbook@ DOCBOOKSTYLE = @DOCBOOKSTYLE@ COLLATEINDEX = @COLLATEINDEX@ +DOCBOOK2MAN = @DOCBOOK2MAN@ ##########################################################################