[esnacc-dev,v2] build: Do not fail build if xsltproc is missing

Message ID 20171102185140.19310-1-aconole@bytheb.org
State Accepted
Delegated to: Aaron Conole
Headers show

Commit Message

Aaron Conole Nov. 2, 2017, 6:51 p.m.
From: Vegar Westerlund <vegarwe@gmail.com>

As a side-effect this makes it possible to compile without
having network access (since xsltproc needs to go online to
fetch some xml).

Signed-off-by: Vegar Westerlund <vegarwe@gmail.com>
Signed-off-by: Aaron Conole <aconole@bytheb.org>
---
v1->v2: The && condition was always creating a failure case.

 compiler/automake.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Sagara Wickramasekara Nov. 13, 2017, 11:55 a.m. | #1
Acked-by: Sagara Wickramasekara <sagaraw@gmail.com>

On Thu, Nov 2, 2017 at 2:51 PM, Aaron Conole <aconole@bytheb.org> wrote:

> From: Vegar Westerlund <vegarwe@gmail.com>
>
> As a side-effect this makes it possible to compile without
> having network access (since xsltproc needs to go online to
> fetch some xml).
>
> Signed-off-by: Vegar Westerlund <vegarwe@gmail.com>
> Signed-off-by: Aaron Conole <aconole@bytheb.org>
> ---
> v1->v2: The && condition was always creating a failure case.
>
>  compiler/automake.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/compiler/automake.mk b/compiler/automake.mk
> index dd59446..b5bab03 100644
> --- a/compiler/automake.mk
> +++ b/compiler/automake.mk
> @@ -92,7 +92,8 @@ DISTCLEANFILES += compiler/esnacc.1
>  endif
>
>  compiler/esnacc.1: compiler/esnacc.xml
> -       $(XSLTPROC) --novalid -o $@ $(DOCBOOK_LOCATION) $<
> +       @test -x "$(XSLTPROC)" && $(XSLTPROC) --novalid -o $@
> $(DOCBOOK_LOCATION) $<; true
> +       @test -x "$(XSLTPROC)" || echo "Not generating documentation,
> xsltproc missing"
>
>  CLEANFILES += compiler/core/lex-asn1.c \
>         compiler/core/y.output \
> --
> 2.9.5
>
> _______________________________________________
> dev mailing list
> dev@lists.esnacc.org
> http://mail.esnacc.org/mailman/listinfo/dev
>
Aaron Conole Nov. 13, 2017, 3:15 p.m. | #2
Sagara Wickramasekara <sagaraw@gmail.com> writes:

> Acked-by: Sagara Wickramasekara <sagaraw@gmail.com>
>
> On Thu, Nov 2, 2017 at 2:51 PM, Aaron Conole <aconole@bytheb.org> wrote:
>
>  From: Vegar Westerlund <vegarwe@gmail.com>
>
>  As a side-effect this makes it possible to compile without
>  having network access (since xsltproc needs to go online to
>  fetch some xml).
>
>  Signed-off-by: Vegar Westerlund <vegarwe@gmail.com>
>  Signed-off-by: Aaron Conole <aconole@bytheb.org>
>  ---

Thanks, Sagara.

Applied.

Patch

diff --git a/compiler/automake.mk b/compiler/automake.mk
index dd59446..b5bab03 100644
--- a/compiler/automake.mk
+++ b/compiler/automake.mk
@@ -92,7 +92,8 @@  DISTCLEANFILES += compiler/esnacc.1
 endif
 
 compiler/esnacc.1: compiler/esnacc.xml
-	$(XSLTPROC) --novalid -o $@ $(DOCBOOK_LOCATION) $<
+	@test -x "$(XSLTPROC)" && $(XSLTPROC) --novalid -o $@ $(DOCBOOK_LOCATION) $<; true
+	@test -x "$(XSLTPROC)" || echo "Not generating documentation, xsltproc missing"
 
 CLEANFILES += compiler/core/lex-asn1.c \
 	compiler/core/y.output \