[PATCH] Makefile: use --unsafe option under Cygwin with asciidoc

Subsystems: documentation, the rest

DORMANTno replies

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] Makefile: use --unsafe option under Cygwin with asciidoc

From: Jari Aalto <hidden>
Date: 2016-06-15 22:43:07

New: variable ASCIIDOC_FLAGS was introduced. It was also added to two
new targets. The old ASCIIDOC_EXTRA is set to --unsafe under Cygwin to
ignore asciidoc error about unsafe include.

Signed-off-by: Jari Aalto <redacted>
---
 Documentation/Makefile |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3f92783..399ff12 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -37,6 +37,14 @@ man7dir=$(mandir)/man7
 
 ASCIIDOC=asciidoc
 ASCIIDOC_EXTRA =
+
+ifneq (,$(CYGWIN))
+# Ignore 'include' call errors
+ASCIIDOC_EXTRA = --unsafe
+endif
+
+ASCIIDOC_FLAGS += $(ASCIIDOC_EXTRA)
+
 INSTALL?=install
 DOC_REF = origin/man
 
@@ -112,7 +120,7 @@ clean:
 %.html : %.txt
 	rm -f $@+ $@
 	$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -o - $< | \
+		$(ASCIIDOC_FLAGS) -o - $< | \
 		sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
 	mv $@+ $@
 
@@ -122,12 +130,12 @@ clean:
 %.xml : %.txt
 	rm -f $@+ $@
 	$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
-		$(ASCIIDOC_EXTRA) -o - $< | \
+		$(ASCIIDOC_FLAGS) -o - $< | \
 		sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' >$@+
 	mv $@+ $@
 
 user-manual.xml: user-manual.txt user-manual.conf
-	$(ASCIIDOC) -b docbook -d book $<
+	$(ASCIIDOC) -b docbook -d book $(ASCIIDOC_FLAGS) $<
 
 XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
@@ -141,13 +149,13 @@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
 	mv $@+ $@
 
 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
-	$(ASCIIDOC) -b xhtml11 $*.txt
+	$(ASCIIDOC) -b xhtml11 $(ASCIIDOC_FLAGS) $*.txt
 
 WEBDOC_DEST = /pub/software/scm/git/docs
 
 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
 	rm -f $@+ $@
-	sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 - >$@+
+	sed -e '1,/^$$/d' $< | $(ASCIIDOC) -b xhtml11 $(ASCIIDOC_FLAGS) - >$@+
 	mv $@+ $@
 
 install-webdoc : html
-- 
1.5.1.3

Re: [PATCH] Makefile: use --unsafe option under Cygwin with asciidoc

From: Eric Blake <hidden>
Date: 2016-06-15 22:43:07

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jari Aalto on 5/2/2007 5:49 AM:
New: variable ASCIIDOC_FLAGS was introduced. It was also added to two
new targets. The old ASCIIDOC_EXTRA is set to --unsafe under Cygwin to
ignore asciidoc error about unsafe include.
This isn't just for cygwin, since it benefits any platform where the
installed asciidoc is 8.1 or better (asciidoc is currently at 8.2.1 if you
build the from tarballs).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGOIy+84KuGfSFAYARAo/XAKCuKOXb7cYzPL0AU4oiz5VbS54mtwCfVzX/
bTMHegP6uvmaFZB5pKL5Dxo=
=QYTe
-----END PGP SIGNATURE-----

Re: [PATCH] Makefile: use --unsafe option under Cygwin with asciidoc

From: Jari Aalto <hidden>
Date: 2016-06-15 22:43:07

Eric Blake [off-list ref] writes:
According to Jari Aalto on 5/2/2007 5:49 AM:
quoted
New: variable ASCIIDOC_FLAGS was introduced. It was also added to two
new targets. The old ASCIIDOC_EXTRA is set to --unsafe under Cygwin to
ignore asciidoc error about unsafe include.
This isn't just for cygwin, since it benefits any platform where the
installed asciidoc is 8.1 or better (asciidoc is currently at 8.2.1 if you
build the from tarballs).
I thought this was Cygwin issue only. Should --unsafe be
unconditionally enable by default?

Jari
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help