Quellcode durchsuchen

Check a2x, asciidoc presence and only build documents when they are
available.

Tatsuhiro Tsujikawa vor 15 Jahren
Ursprung
Commit
7a3faa625b
3 geänderte Dateien mit 17 neuen und 3 gelöschten Zeilen
  1. 3 1
      Makefile.am
  2. 8 0
      configure.ac
  3. 6 2
      doc/Makefile.am

+ 3 - 1
Makefile.am

@@ -8,5 +8,7 @@ dist_doc_DATA = README README.asciidoc README.html
 
 dist_noinst_DATA = LICENSE.OpenSSL
 
+if HAVE_ASCIIDOC
 README.html: README.asciidoc
-	/usr/bin/asciidoc -d article -b xhtml11 -n README.asciidoc
+	@ASCIIDOC@ -d article -b xhtml11 -n README.asciidoc
+endif # HAVE_ASCIIDOC

+ 8 - 0
configure.ac

@@ -45,6 +45,14 @@ AC_PROG_MKDIR_P
 AC_PROG_RANLIB
 AC_PROG_YACC
 
+AC_PATH_PROG([A2X], [a2x])
+AC_SUBST([A2X])
+AM_CONDITIONAL([HAVE_A2X], [ test "x$A2X" != "x" ])
+
+AC_PATH_PROG([ASCIIDOC], [asciidoc])
+AC_SUBST([ASCIIDOC])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [ test "x$ASCIIDOC" != "x" ])
+
 # Setting language choice
 AC_LANG([C++])
 

+ 6 - 2
doc/Makefile.am

@@ -6,8 +6,12 @@ dist_doc_xmlrpc_DATA = xmlrpc/aria2mon \
 	xmlrpc/aria2rpc \
 	xmlrpc/README.txt
 
+if HAVE_A2X
 aria2c.1: aria2c.1.asciidoc
-	a2x -f manpage aria2c.1.asciidoc
+	@A2X@ -f manpage aria2c.1.asciidoc
+endif # HAVE_A2X
 
+if HAVE_ASCIIDOC
 aria2c.1.html: aria2c.1.asciidoc
-	asciidoc -d manpage -b xhtml11 -a toc -a max-width=55em aria2c.1.asciidoc
+	@ASCIIDOC@ -d manpage -b xhtml11 -a toc -a max-width=55em aria2c.1.asciidoc
+endif # HAVE_ASCIIDOC