[esnacc-dev] [PATCH] cross-build: disable asn rose

Aaron Conole aconole at bytheb.org
Tue Jul 25 14:44:50 UTC 2017


When cross-compiling the system, it is not possible for the esnacc binary to
correctly execute on the build system (well, not always).  There is a
method to combat this, which is the approach gcc takes, to generate a stage
one version of the compiler and then execute that to generate the final
tools (stage 2).  That represents quite a bit of work.

On the other hand, people are using esnacc *now* and as Marty Galligan
reports at http://mail.esnacc.org/pipermail/dev/2017-July/000414.html there
can be problems cross building, especially related to this.

This commit detects that a cross-compilation is occuring and disables the
generation of the asn.1 ROSE support.  A future commit can enable this
when it becomes necessary.

Reported-by: Marty Galligan <m_galligan at comcast.net>
Signed-off-by: Aaron Conole <aconole at bytheb.org>
---
 configure.ac        | 4 ++++
 cxx-lib/automake.mk | 9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 26007ef..65b4b48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,10 @@ AC_PROG_INSTALL
 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
 AC_PROG_CC
 AC_PROG_CXX
+
+AM_CONDITIONAL([SNACCROSE], [test "$cross_compiling" = no])
+test x"$cross_compiling" == xyes && AC_DEFINE([SNACCROSE], [0], [No ROSE support])
+
 AM_PATH_PYTHON(,, [:])
 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 AC_USE_SYSTEM_EXTENSIONS
diff --git a/cxx-lib/automake.mk b/cxx-lib/automake.mk
index 2c5b7ea..fc841ca 100644
--- a/cxx-lib/automake.mk
+++ b/cxx-lib/automake.mk
@@ -1,5 +1,9 @@
-lib_LTLIBRARIES += cxx-lib/libcxxasn1.la \
-	cxx-lib/libcxxasn1rose.la
+lib_LTLIBRARIES += cxx-lib/libcxxasn1.la
+
+if SNACCROSE
+lib_LTLIBRARIES += cxx-lib/libcxxasn1rose.la
+nobase_include_HEADERS += cxx-lib/inc/snaccrose.h
+endif
 
 BUILT_SOURCES += cxx-lib/inc/snacc.h
 
@@ -17,7 +21,6 @@ nobase_include_HEADERS += cxx-lib/inc/asn-buf.h \
 	cxx-lib/inc/snacc.h \
 	cxx-lib/inc/snaccdll.h \
 	cxx-lib/inc/snaccexcept.h \
-	cxx-lib/inc/snaccrose.h \
 	cxx-lib/inc/tcl-if.h
 
 cxx_lib_libcxxasn1_la_SOURCES = \
-- 
2.9.4



More information about the dev mailing list