bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH RESEND] build: don't try to generate docs when cross-compiling


From: Aaro Koskinen
Subject: [PATCH RESEND] build: don't try to generate docs when cross-compiling
Date: Sat, 30 Aug 2014 00:36:20 +0300

We usually cannot run the just created binaries when cross-compiling,
so in that case ignore the documentation dependencies. The use case
for this are GNU distributions, who just want to build the vanilla
release tar ball for multiple architectures. In such cases relying
on the pre-generated documentation should be fine.

* configure.ac: add automake conditional for cross-compiling
* doc/local.mk: ignore dependencies when cross-compiling
---
 configure.ac |  5 +++++
 doc/local.mk | 16 ++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2658d73..05aeb5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,6 +237,11 @@ case $VALGRIND:$host_os in
     ;;
 esac
 
+AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
+if test "$cross_compiling" = "yes"; then
+  AC_MSG_WARN([documentation cannot be generated when cross-compiling])
+fi
+
 AM_MISSING_PROG([AUTOM4TE], [autom4te])
 # Needed by tests/atlocal.in.
 AC_SUBST([GCC])
diff --git a/doc/local.mk b/doc/local.mk
index 4fe0859..3a7e127 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -84,9 +84,15 @@ doc/refcard.pdf: doc/refcard.tex
 # compilations of cross-option.texi and bison.1.  At the cost of
 # repeated builds of bison.help.
 
+if IS_CROSS_COMPILE
+HELP_DEPS=
+else
+HELP_DEPS=src/bison$(EXEEXT)
+endif
+
 EXTRA_DIST += $(top_srcdir)/doc/bison.help
 MAINTAINERCLEANFILES += $(top_srcdir)/doc/bison.help
-$(top_srcdir)/doc/bison.help: src/bison$(EXEEXT)
+$(top_srcdir)/doc/bison.help: $(HELP_DEPS)
        $(AM_V_GEN)src/bison$(EXEEXT) --version >doc/bison.help.tmp
        $(AM_V_at) src/bison$(EXEEXT) --help   >>doc/bison.help.tmp
        $(AM_V_at)$(top_srcdir)/build-aux/move-if-change doc/bison.help.tmp $@
@@ -106,7 +112,13 @@ remove_time_stamp = \
   sed 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
 
 # Depend on configure to get version number changes.
-$(top_srcdir)/doc/bison.1: doc/bison.help doc/bison.x $(top_srcdir)/configure
+if IS_CROSS_COMPILE
+MAN_DEPS=
+else
+MAN_DEPS=doc/bison.help doc/bison.x $(top_srcdir)/configure
+endif
+
+$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
        $(AM_V_GEN)$(HELP2MAN)                  \
            --include=$(top_srcdir)/doc/bison.x \
            address@hidden src/bison$(EXEEXT)
-- 
2.0.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]