Mark 'memcmp' obsolete.
[gnulib.git] / build-aux / gendocs.sh
index 480c1d4..aded2c4 100755 (executable)
@@ -2,7 +2,7 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2008-01-13.10
+scriptversion=2008-03-05.14
 
 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
 # Free Software Foundation, Inc.
@@ -122,8 +122,7 @@ while test $# -gt 0; do
     -o) shift; outdir=$1;;
     --docbook) docbook=yes;;
     --html) shift; html=$1;;
-    --texi2html) use_texi2html=1
-                 html="$html --node-files";;
+    --texi2html) use_texi2html=1;;
     -*)
       echo "$0: Unknown or ambiguous option \`$1'." >&2
       echo "$0: Try \`--help' for more information." >&2
@@ -158,6 +157,11 @@ if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
   exit 1
 fi
 
+case $outdir in
+  /*) dotdot_outdir="$outdir";;
+  *) dotdot_outdir="../$outdir";;
+esac
+
 echo Generating output formats for $srcfile
 
 cmd="$SETLANG $MAKEINFO -o $PACKAGE.info \"$srcfile\""
@@ -200,14 +204,14 @@ ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz`
 mv $PACKAGE.txt $outdir/
 
 html_split() {
-  cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html --split=$1 $html \"$srcfile\""
+  cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html --split=$1 $html --node-files \"$srcfile\""
   echo "Generating html by $1... ($cmd)"
   eval "$cmd"
   split_html_dir=$PACKAGE.html
   (
     cd ${split_html_dir} || exit 1
     ln -sf ${PACKAGE}.html index.html
-    tar -czf ../$outdir/${PACKAGE}.html_$1.tar.gz -- *.html
+    tar -czf $dotdot_outdir/${PACKAGE}.html_$1.tar.gz -- *.html
   )
   eval html_$1_tgz_size=`calcsize $outdir/${PACKAGE}.html_$1.tar.gz`
   rm -f $outdir/html_$1/*.html
@@ -232,7 +236,7 @@ if test -z "$use_texi2html"; then
   split_html_dir=$PACKAGE.html
   (
    cd ${split_html_dir} || exit 1
-   tar -czf ../$outdir/${PACKAGE}.html_node.tar.gz -- *.html
+   tar -czf $dotdot_outdir/${PACKAGE}.html_node.tar.gz -- *.html
   )
   html_node_tgz_size=`calcsize $outdir/${PACKAGE}.html_node.tar.gz` 
   rm -f $outdir/html_node/*.html
@@ -274,7 +278,7 @@ if test -n "$docbook"; then
   split_html_db_dir=html_node_db
   (
     cd ${split_html_db_dir} || exit 1
-    tar -czf ../$outdir/${PACKAGE}.html_node_db.tar.gz -- *.html
+    tar -czf $dotdot_outdir/${PACKAGE}.html_node_db.tar.gz -- *.html
   )
   html_node_db_tgz_size=`calcsize $outdir/${PACKAGE}.html_node_db.tar.gz`
   rm -f $outdir/html_node_db/*.html