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

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

Commit Message

Aaron Conole July 25, 2017, 2:44 p.m.
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@comcast.net>
Signed-off-by: Aaron Conole <aconole@bytheb.org>

---
 configure.ac        | 4 ++++
 cxx-lib/automake.mk | 9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

Comments

Aaron Conole July 25, 2017, 2:50 p.m. | #1
Aaron Conole <aconole@bytheb.org> writes:

> 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@comcast.net>
> Signed-off-by: Aaron Conole <aconole@bytheb.org>
> ---

So, you'll notice that this is implemented without using --enable /
--disable for the ASN-ROSE feature.  If someone thinks that's a better
approach, I'm okay to include it, but I don't like being able to
configure away these kinds of built-in features (IE: there isn't any
real reason a user would ever build without --enable-asnrose - it's a
separate library in C++).

-Aaron
Marty Galligan July 25, 2017, 6:22 p.m. | #2
Are you planning to push this to master?  Or do I need to ACK the change, or is it just on one branch (which one)?


--
-Marty Galligan, m_galligan@comcast.net, c: 978-505-5185


> 
>     On July 25, 2017 at 10:44 AM Aaron Conole <aconole@bytheb.org> wrote:
> 
>     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@comcast.net>
> 
>     Signed-off-by: Aaron Conole <aconole@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
> 
>     _______________________________________________
>     dev mailing list
>     dev@lists.esnacc.org
>     http://mail.esnacc.org/mailman/listinfo/dev
>
<!DOCTYPE html>
<html><head>
    <meta charset="UTF-8">
</head><body><p class="io-ox-signature">Are you planning to push this to master? &#160;Or do I need to ACK the change, or is it just on one branch (which one)?</p><p class="io-ox-signature"><br></p><p class="io-ox-signature">--<br>-Marty Galligan, m_galligan@comcast.net, c: 978-505-5185</p><p><br></p><blockquote><p>On July 25, 2017 at 10:44 AM Aaron Conole &#60;aconole@bytheb.org&#62; wrote:</p><p>When cross-compiling the system, it is not possible for the esnacc binary to<br>correctly execute on the build system (well, not always). There is a<br>method to combat this, which is the approach gcc takes, to generate a stage<br>one version of the compiler and then execute that to generate the final<br>tools (stage 2). That represents quite a bit of work.</p><p>On the other hand, people are using esnacc *now* and as Marty Galligan<br>reports at <a href="http://mail.esnacc.org/pipermail/dev/2017-July/000414.html">http://mail.esnacc.org/pipermail/dev/2017-July/000414.html</a> there<br>can be problems cross building, especially related to this.</p><p>This commit detects that a cross-compilation is occuring and disables the<br>generation of the asn.1 ROSE support. A future commit can enable this<br>when it becomes necessary.</p><p>Reported-by: Marty Galligan &#60;m_galligan@comcast.net&#62;</p><p>Signed-off-by: Aaron Conole &#60;aconole@bytheb.org&#62;</p><p>---<br> configure.ac | 4 ++++<br> cxx-lib/automake.mk | 9 ++++++---<br> 2 files changed, 10 insertions(+), 3 deletions(-)</p><p>diff --git a/configure.ac b/configure.ac<br>index 26007ef..65b4b48 100644<br>--- a/configure.ac<br>+++ b/configure.ac<br>@@ -32,6 +32,10 @@ AC_PROG_INSTALL<br> AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])<br> AC_PROG_CC<br> AC_PROG_CXX<br>+<br>+AM_CONDITIONAL([SNACCROSE], [test &#34;$cross_compiling&#34; = no])<br>+test x&#34;$cross_compiling&#34; == xyes &#38;&#38; AC_DEFINE([SNACCROSE], [0], [No ROSE support])<br>+<br> AM_PATH_PYTHON(,, [:])<br> AM_CONDITIONAL([HAVE_PYTHON], [test &#34;$PYTHON&#34; != :])<br> AC_USE_SYSTEM_EXTENSIONS<br>diff --git a/cxx-lib/automake.mk b/cxx-lib/automake.mk<br>index 2c5b7ea..fc841ca 100644<br>--- a/cxx-lib/automake.mk<br>+++ b/cxx-lib/automake.mk<br>@@ -1,5 +1,9 @@<br>-lib_LTLIBRARIES += cxx-lib/libcxxasn1.la \</p><ul><li><p>cxx-lib/libcxxasn1rose.la<br>+lib_LTLIBRARIES += cxx-lib/libcxxasn1.la<br>+<br>+if SNACCROSE<br>+lib_LTLIBRARIES += cxx-lib/libcxxasn1rose.la<br>+nobase_include_HEADERS += cxx-lib/inc/snaccrose.h<br>+endif</p><p>BUILT_SOURCES += cxx-lib/inc/snacc.h</p></li></ul><p>@@ -17,7 +21,6 @@ nobase_include_HEADERS += cxx-lib/inc/asn-buf.h \<br> cxx-lib/inc/snacc.h \<br> cxx-lib/inc/snaccdll.h \<br> cxx-lib/inc/snaccexcept.h \</p><ul><li><p>cxx-lib/inc/snaccrose.h \<br>cxx-lib/inc/tcl-if.h</p><p>cxx_lib_libcxxasn1_la_SOURCES = \<br>--<br>2.9.4</p></li></ul><p>_______________________________________________<br>dev mailing list<br>dev@lists.esnacc.org<br><a href="http://mail.esnacc.org/mailman/listinfo/dev">http://mail.esnacc.org/mailman/listinfo/dev</a></p></blockquote></body></html>
Aaron Conole July 25, 2017, 6:27 p.m. | #3
Marty Galligan <m_galligan@comcast.net> writes:

> Are you planning to push this to master?  Or do I need to ACK the change, or is it just on one branch
> (which one)?

I do plan to push this to master.

If you post an acked-by tag, then I will apply it in the next batch,
along with your tag.  You should understand what 'Acked-by' means,
though.

You can always see the outstanding patches at:
http://patchwork.esnacc.org

Even further, you can download them, apply them, and see the discussion
surrounding them.

-Aaron

> --
> -Marty Galligan, m_galligan@comcast.net, c: 978-505-5185
>
>  On July 25, 2017 at 10:44 AM Aaron Conole <aconole@bytheb.org> wrote:
>
>  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@comcast.net>
>
>  Signed-off-by: Aaron Conole <aconole@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
>
>  _______________________________________________
>  dev mailing list
>  dev@lists.esnacc.org
>  http://mail.esnacc.org/mailman/listinfo/dev
>
> _______________________________________________
> dev mailing list
> dev@lists.esnacc.org
> http://mail.esnacc.org/mailman/listinfo/dev
Marty Galligan July 27, 2017, 12:16 a.m. | #4
ack.

I manually put this patch into my checkout from github, and the cross 
compile worked well.  So I'm in favor of committing the change.

-Marty

At 10:44 AM 7/25/2017, Aaron Conole wrote:
>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@comcast.net>
>Signed-off-by: Aaron Conole <aconole@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
>
>_______________________________________________
>dev mailing list
>dev@lists.esnacc.org
>http://mail.esnacc.org/mailman/listinfo/dev

-Marty Galligan, m_galligan@comcast.net, c: 978-505-5185
Aaron Conole July 27, 2017, 1:56 p.m. | #5
Marty Galligan <m_galligan@comcast.net> writes:

> ack.
>
> I manually put this patch into my checkout from github, and the cross
> compile worked well.  So I'm in favor of committing the change.

Applied.  Thanks, Marty.  I've also added you to the AUTHORS file under
the Reporters heading.

> -Marty
>
> At 10:44 AM 7/25/2017, Aaron Conole wrote:
>>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@comcast.net>
>>Signed-off-by: Aaron Conole <aconole@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
>>
>>_______________________________________________
>>dev mailing list
>>dev@lists.esnacc.org
>>http://mail.esnacc.org/mailman/listinfo/dev
>
> -Marty Galligan, m_galligan@comcast.net, c: 978-505-5185  
>
> _______________________________________________
> dev mailing list
> dev@lists.esnacc.org
> http://mail.esnacc.org/mailman/listinfo/dev

Patch

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 = \