From 6f06336954b28fa419b2f73a496e451b67ee047b Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 28 Jul 2014 13:58:36 +0300 Subject: [PATCH] Got rid of asciidoc build-time dependency. --- re2c/Makefile.am | 26 +++++++++++++++++--------- re2c/configure.in | 4 ++++ re2c/re2c_docs.sh | 8 -------- 3 files changed, 21 insertions(+), 17 deletions(-) delete mode 100755 re2c/re2c_docs.sh diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 017691d4..26ea27de 100755 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -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 diff --git a/re2c/configure.in b/re2c/configure.in index 2665de23..67e92117 100644 --- a/re2c/configure.in +++ b/re2c/configure.in @@ -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 index 8fbce9b1..00000000 --- a/re2c/re2c_docs.sh +++ /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 -- 2.40.0