浏览代码

Merge commit 'sebastian/manpage'

Nick Mathewson 15 年之前
父节点
当前提交
8719748767
共有 4 个文件被更改,包括 55 次插入36 次删除
  1. 10 1
      ChangeLog
  2. 23 0
      configure.in
  3. 7 3
      doc/Makefile.am
  4. 15 32
      doc/asciidoc-helper.sh

+ 10 - 1
ChangeLog

@@ -15,6 +15,10 @@ Changes in version 0.2.2.10-alpha - 2010-??-??
       circuits now only differ from fast ones in that they can use nodes
       circuits now only differ from fast ones in that they can use nodes
       not marked with the Fast flag.
       not marked with the Fast flag.
 
 
+  o Minor features:
+    - Allow disabling building of the manpages. This speeds up the
+      build considerably.
+
   o Minor bugfixes:
   o Minor bugfixes:
     - Fix a memleak in the EXTENDCIRCUIT logic. Spotted by coverity.
     - Fix a memleak in the EXTENDCIRCUIT logic. Spotted by coverity.
       Bugfix on 0.2.2.9-alpha.
       Bugfix on 0.2.2.9-alpha.
@@ -23,11 +27,16 @@ Changes in version 0.2.2.10-alpha - 2010-??-??
       fixes bug 1255.
       fixes bug 1255.
     - Disallow values larger than INT32_MAX for PerConnBWRate|Burst
     - Disallow values larger than INT32_MAX for PerConnBWRate|Burst
       config option. Bugfix on 0.2.2.7-alpha.
       config option. Bugfix on 0.2.2.7-alpha.
+    - Ship the asciidoc-helper file in the tarball, so that people can
+      build from source if they want to, and touching the .1.txt files
+      doesn't break the build. Bugfix on 0.2.2.9-alpha.
 
 
   o Code simplifications and refactoring:
   o Code simplifications and refactoring:
     - Fix some urls in the exit notice file and make it XHTML1.1 strict
     - Fix some urls in the exit notice file and make it XHTML1.1 strict
       compliant. Based on a patch from Christian Kujau.
       compliant. Based on a patch from Christian Kujau.
-
+    - Don't use sed in asciidoc-helper anymore.
+    - Make the build process fail if asciidoc cannot be found, and
+      building with asciidoc isn't disabled.
 
 
 Changes in version 0.2.2.9-alpha - 2010-02-22
 Changes in version 0.2.2.9-alpha - 2010-02-22
   o Directory authority changes:
   o Directory authority changes:

+ 23 - 0
configure.in

@@ -49,6 +49,15 @@ AC_ARG_ENABLE(transparent,
         *) AC_MSG_ERROR(bad value for --enable-transparent) ;;
         *) AC_MSG_ERROR(bad value for --enable-transparent) ;;
       esac], [transparent=true])
       esac], [transparent=true])
 
 
+AC_ARG_ENABLE(asciidoc,
+     AS_HELP_STRING(--disable-asciidoc, don't use asciidoc (disables building of manpages)),
+     [case "${enableval}" in
+        yes) asciidoc=true ;;
+        no)  asciidoc=false ;;
+        *) AC_MSG_ERROR(bad value for --disable-asciidoc) ;;
+      esac], [asciidoc=true])
+
+
 AC_ARG_ENABLE(threads,
 AC_ARG_ENABLE(threads,
      AS_HELP_STRING(--disable-threads, disable multi-threading support))
      AS_HELP_STRING(--disable-threads, disable multi-threading support))
 
 
@@ -97,6 +106,20 @@ AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
 dnl check for asciidoc and a2x
 dnl check for asciidoc and a2x
 AC_PATH_PROG([ASCIIDOC], [asciidoc], none)
 AC_PATH_PROG([ASCIIDOC], [asciidoc], none)
 AC_PATH_PROG([A2X], [a2x], none)
 AC_PATH_PROG([A2X], [a2x], none)
+AC_PATH_PROG([XSLTPROC], [xsltproc], none)
+if test x$asciidoc = xtrue ; then
+   if test x$ASCIIDOC = xnone ; then
+       AC_MSG_ERROR("Couldn't find asciidoc. reconfigure with --disable-asciidoc to build without asciidoc.")
+   fi
+   if test x$A2X = xnone ; then
+       AC_MSG_ERROR("Couldn't find a2x. reconfigure with --disable-asciidoc to build without a2x.")
+   fi
+   if test x$XSLTPROC = xnone ; then
+       AC_MSG_ERROR("Couldn't find xsltproc. reconfigure with --disable-asciidoc to build without xsltproc.")
+   fi
+fi
+
+AM_CONDITIONAL(USE_ASCIIDOC, test x$asciidoc = xtrue)
 
 
 AC_PATH_PROG([SHA1SUM], [sha1sum], none)
 AC_PATH_PROG([SHA1SUM], [sha1sum], none)
 AC_PATH_PROG([OPENSSL], [openssl], none)
 AC_PATH_PROG([OPENSSL], [openssl], none)

+ 7 - 3
doc/Makefile.am

@@ -13,13 +13,17 @@
 # part of the source distribution, so that people without asciidoc can
 # part of the source distribution, so that people without asciidoc can
 # just use the .1 and .html files.
 # just use the .1 and .html files.
 
 
+if USE_ASCIIDOC
 asciidoc_files = tor tor-gencert tor-resolve torify
 asciidoc_files = tor tor-gencert tor-resolve torify
+else
+asciidoc_files =
+endif
 
 
 html_in = $(asciidoc_files:=.html.in)
 html_in = $(asciidoc_files:=.html.in)
 
 
 man_in = $(asciidoc_files:=.1.in)
 man_in = $(asciidoc_files:=.1.in)
 
 
-EXTRA_DIST = HACKING                                         \
+EXTRA_DIST = HACKING asciidoc-helper.sh                      \
              $(html_in) $(man_in) $(asciidoc_files:=.1.txt)  \
              $(html_in) $(man_in) $(asciidoc_files:=.1.txt)  \
              tor-osx-dmg-creation.txt tor-rpm-creation.txt   \
              tor-osx-dmg-creation.txt tor-rpm-creation.txt   \
              tor-win32-mingw-creation.txt
              tor-win32-mingw-creation.txt
@@ -39,7 +43,7 @@ DIST_SUBDIRS = spec
 # Generate the html documentation from asciidoc, but don't do
 # Generate the html documentation from asciidoc, but don't do
 # machine-specific replacements yet
 # machine-specific replacements yet
 $(html_in) :
 $(html_in) :
-	$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ @SED@ $(top_srcdir)/doc/$@
+	$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
 
 
 tor.html.in : tor.1.txt
 tor.html.in : tor.1.txt
 torify.html.in : torify.1.txt
 torify.html.in : torify.1.txt
@@ -49,7 +53,7 @@ tor-resolve.html.in : tor-resolve.1.txt
 # Generate the manpage from asciidoc, but don't do
 # Generate the manpage from asciidoc, but don't do
 # machine-specific replacements yet
 # machine-specific replacements yet
 $(man_in) :
 $(man_in) :
-	$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ @SED@ $(top_srcdir)/doc/$@
+	$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
 
 
 tor.1.in : tor.1.txt
 tor.1.in : tor.1.txt
 torify.1.in : torify.1.txt
 torify.1.in : torify.1.txt

+ 15 - 32
doc/asciidoc-helper.sh

@@ -4,51 +4,34 @@
 # See LICENSE for licensing information
 # See LICENSE for licensing information
 # Run this to generate .html.in or .1.in files from asciidoc files.
 # Run this to generate .html.in or .1.in files from asciidoc files.
 # Arguments:
 # Arguments:
-# html|man asciidocpath sedpath outputfile
+# html|man asciidocpath outputfile
 
 
 set -e
 set -e
 
 
-if [ $# != 4 ]; then
+if [ $# != 3 ]; then
   exit 1;
   exit 1;
 fi
 fi
 
 
-output=$4
-input=`echo $output | $3 -e 's/html\.in$/1\.txt/g' -e 's/1\.in$/1\.txt/g'`
-base=`echo $output | $3 -e 's/\.html\.in$//g' -e 's/\.1\.in$//g'`
+output=$3
 
 
 if [ "$1" = "html" ]; then
 if [ "$1" = "html" ]; then
-    if [ "$2" != none ]; then
-      "$2" -d manpage -o $output $input;
-    else
-      echo "==================================";
-      echo;
-      echo "The manpage in html form for $base will ";
-      echo "NOT be available, because asciidoc doesn't appear to be ";
-      echo "installed!";
-      echo;
-      echo "==================================";
-    fi
+    input=${output%%.html.in}.1.txt
+    base=${output%%.html.in}
+    "$2" -d manpage -o $output $input;
 elif [ "$1" = "man" ]; then
 elif [ "$1" = "man" ]; then
-    if test "$2" != none; then
-      if $2 -f manpage $input; then
-        mv $base.1 $output;
-      else
-        echo "==================================";
-        echo;
-        echo "a2x is installed, but some required docbook support files are";
-        echo "missing. Please install docbook-xsl and docbook-xml (Debian)";
-        echo "or similar.";
-        echo;
-        echo "==================================";
-      fi;
+    input=${output%%.1.in}.1.txt
+    base=${output%%.1.in}
+    
+    if "$2" -f manpage $input; then
+      mv $base.1 $output;
     else
     else
       echo "==================================";
       echo "==================================";
       echo;
       echo;
-      echo "The manpage for $base will NOT be ";
-      echo "available, because a2x doesn't appear to be installed!";
+      echo "a2x is installed, but some required docbook support files are";
+      echo "missing. Please install docbook-xsl and docbook-xml (Debian)";
+      echo "or similar.";
       echo;
       echo;
       echo "==================================";
       echo "==================================";
+      exit 1;
     fi
     fi
 fi
 fi
-
-touch $output; \