]> granicus.if.org Git - fcron/commitdiff
updated : better management of db2man (more portable)
authorthib <thib>
Fri, 4 Jan 2002 19:11:29 +0000 (19:11 +0000)
committerthib <thib>
Fri, 4 Jan 2002 19:11:29 +0000 (19:11 +0000)
configure.in
doc/Makefile.in

index 94e95d23028651d5d156feda04caf87fd7c613ee..bef392911014696d179f7ba4834730005f8f5639 100644 (file)
@@ -716,10 +716,36 @@ if test -z "$JADE"; then
        AC_PATH_PROG(JADE,jade)
 fi
 
+AC_PATH_PROG(DB2MAN,docbook2man)
+if test -z "$DB2MAN"; then
+       AC_PATH_PROG(DB2MAN,db2man)
+fi
+AC_MSG_CHECKING(Looking for docbook2man converter)
+AC_ARG_WITH(db2man,
+[ --with-db2man-spec=PATH      set PATH to a docbook2man converter.],
+[ case "$withval" in
+  no) 
+    DB2MAN=""
+    AC_MSG_RESULT(none)
+    ;;
+  yes)
+    AC_MSG_ERROR(Must be set to PATH or "no".)
+    ;;
+  *)
+    if ! test -x "$withval"; then
+      AC_MSG_ERROR($withval is not an exe file.)
+    fi
+    DB2MAN="$withval"
+    AC_MSG_RESULT($withval)
+    ;;
+  esac ],
+  AC_MSG_RESULT(default: $DB2MAN)
+)
+AC_SUBST(DB2MAN)
+
 AC_PATH_PROG(NSGMLS, nsgmls)
 AC_PATH_PROG(SGMLSPL, sgmlspl)
 
-
 DB2MAN_SPEC="/usr/share/sgml/docbook/utils-0.6.9/helpers/docbook2man-spec.pl"
 
 AC_MSG_CHECKING(Looking for docbook2man-spec file)
@@ -745,6 +771,22 @@ AC_ARG_WITH(db2man-spec,
 )
 AC_SUBST(DB2MAN_SPEC)
 
+if test -x "$DB2MAN"; then
+  DB2MAN_BEFORE="$DB2MAN"
+  DB2MAN_AFTER=""
+else
+  if test \( \( -f "$DB2MAN_SPEC" \) -a \( -x "$NSGMLS" \) \
+          -a \( -x "$SGMLSPL" \) \); then
+    DB2MAN_BEFORE="$NSGMLS"
+    DB2MAN_AFTER="2> /dev/null | $SGMLSPL $DB2MAN_SPEC"
+  else
+    DB2MAN_BEFORE=""
+    DB2MAN_AFTER=""
+  fi
+fi
+AC_SUBST(DB2MAN_BEFORE)
+AC_SUBST(DB2MAN_AFTER)
+
 
 DSSSL_DIR="/usr/share/sgml/docbook/dsssl-stylesheets-1.72/"
 
index 0d3a49e4d3a3d7b70b69d0f6b007f719221dd03f..ebe0571b0a4e1191d7794f269322ab58ba1970b2 100644 (file)
@@ -4,7 +4,7 @@
 
 # @configure_input@
 
-# $Id: Makefile.in,v 1.5 2002-01-04 18:02:06 thib Exp $
+# $Id: Makefile.in,v 1.6 2002-01-04 19:11:52 thib Exp $
 
 # The following should not be edited manually (use configure options)
 # If you must do it, BEWARE : some of the following is also defined
@@ -20,9 +20,8 @@ DESTDOC               = @DOCDIR@
 
 INSTALL                = @INSTALL@
 JADE           = @JADE@
-NSGMLS         = @NSGMLS@
-SGMLSPL                = @SGMLSPL@
-DB2MAN_SPEC    = @DB2MAN_SPEC@
+DB2MAN_BEFORE  = @DB2MAN_BEFORE@
+DB2MAN_AFTER   = @DB2MAN_AFTER@
 
 ROOTNAME       = @ROOTNAME@
 ROOTGROUP      = @ROOTGROUP@
@@ -48,10 +47,11 @@ all: doc
 doc: HTML/index.html
 
 mandoc:
-       @(if test \( ! -f $(DB2MAN_SPEC) \) -o \( ! -x $(NSGMLS) \) -o \( ! -x $(SGMLSPL) \); then \
+       @(if test -z "$(DB2MAN_BEFORE)"; then \
           echo "ERROR: cannot generate man pages." ; \
-          echo "       Please check if nsgmls, sgmlspl are installed, and " ; \
-          echo "       if configure's option --with-db2man-spec is correctly set." ; \
+          echo "  Please check if a db2man converter is installed, or if" \
+          echo "  nsgmls, sgmlspl are installed, and if configure's options" \
+          echo "  --with-db2man and --with-db2man-spec are correctly set." ; \
           exit 1 ; \
        fi)
        @(echo ; echo "Building man pages ..."; echo )
@@ -62,7 +62,7 @@ mandoc:
                   <!ENTITY % decl SYSTEM "fcron-doc.mod"> \
                   %decl;]>' > _tmp_ ; \
           echo "&$$i;" >> _tmp_ ; \
-          $(NSGMLS) _tmp_ 2> /dev/null | $(SGMLSPL) $(DB2MAN_SPEC) 2>&1 > /dev/null ; \
+          $(DB2MAN_BEFORE) _tmp_ $(DB2MAN_AFTER) 2>&1 > /dev/null ; \
          rm -f _tmp_ ; \
          mv `basename $$i .sgml` man/ ; \
           done)