]> granicus.if.org Git - re2c/commitdiff
Got rid of asciidoc build-time dependency.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 28 Jul 2014 10:58:36 +0000 (13:58 +0300)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 28 Jul 2014 10:58:36 +0000 (13:58 +0300)
re2c/Makefile.am
re2c/configure.in
re2c/re2c_docs.sh [deleted file]

index 017691d4046fcbe3b2ee687b9222b5127d5d0eab..26ea27def634557b5bedf06a6d2c2c934842302b 100755 (executable)
@@ -20,15 +20,22 @@ YFLAGS       = -d
 RE2C         = re2c$(EXEEXT)
 RE2CFLAGS    = -bi
 
-CLEANFILES   = parser.cc y.tab.c y.tab.h scanner.cc re2c.1 .version htdocs/manual.html
+CLEANFILES = parser.cc y.tab.c y.tab.h scanner.cc .version
+if HAVE_ASCIIDOC
+    CLEANFILES += htdocs/manual.html
+endif HAVE_ASCIIDOC
+if HAVE_A2X
+    CLEANFILES += re2c.1
+endif HAVE_A2X
 
 DISTCLEANFILES = makerpm re2c.spec README scanner.cc re2c$(EXEEXT)
 
 man_MANS = re2c.1
+DOCS = $(man_MANS) htdocs/manual.html
 
 EXTRA_SRC    = README parser.y scanner.re y.tab.h CHANGELOG NO_WARRANTY \
                doc examples test bootstrap/*.cc bootstrap/*.h lessons \
-               $(man_MANS) $(DOCS_IN) $(DOCS_GEN)
+               $(DOCS)
 EXTRA_DIST   = $(EXTRA_SRC) makerpm.in re2c.spec.in re2c.spec README.in config_w32.h.in
 EXTRA_ZIP    = $(EXTRA_SRC) config_w32.h *.sln *.vcproj re2c.rules
 
@@ -95,11 +102,12 @@ vtests: all $(TESTS)
        test -x $(TESTS) || chmod +x $(TESTS)
        ./$(TESTS) --valgrind
 
-DOCS_IN  = re2c.ad
-DOCS = re2c.1 htdocs/manual.html
-DOCS_GEN = ./re2c_docs.sh
-
 docs: $(DOCS)
-
-$(DOCS): $(DOCS_GEN) $(DOCS_IN)
-       $(DOCS_GEN)
+$(DOCS): re2c.ad
+       @if test $(A2X) = "yes"; then \
+               a2x -f manpage re2c.ad; \
+       fi
+       @if test $(ASCIIDOC) = "yes"; then \
+               mkdir -p htdocs; \
+               asciidoc -o htdocs/manual.html re2c.ad; \
+       fi
index 2665de23a691b171c07041da2a6e31f8f1026814..67e92117d5ec20f58705a6fd98d4964c61c21d0c 100644 (file)
@@ -16,6 +16,10 @@ AC_PROG_YACC
 AC_PROG_CXX
 AC_PROG_CC
 AC_PROG_INSTALL
+AC_CHECK_PROG(ASCIIDOC, asciidoc, yes, no)
+AM_CONDITIONAL(HAVE_ASCIIDOC, [test "$ASCIIDOC" = yes])
+AC_CHECK_PROG(A2X, a2x, yes, no)
+AM_CONDITIONAL(HAVE_A2X, [test "$A2X" == yes])
 
 if test "$GCC" = "yes"; then
   AC_MSG_CHECKING([Testing GCC version])
diff --git a/re2c/re2c_docs.sh b/re2c/re2c_docs.sh
deleted file mode 100755 (executable)
index 8fbce9b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# generate re2c.1 from re2c.ad
-a2x -f manpage re2c.ad
-
-# generate htdocs/manual.html from re2c.ad
-mkdir -p htdocs
-asciidoc -o htdocs/manual.html re2c.ad