Skip to contentSkip to conversation

Fix cross compile support

Openvpn-devel Superseded David Sommerseth 5 participants 10 messages Feb 28, 2010 – Mar 16, 2010

lore
Share & tools
lore
#0 lore raw

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

I'm reviewing this patch in the patch tracker, and cannot make up my mind if this is correct or not. Can someone please advise if this is something we should include or not?

<https://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkuK3zYACgkQDC186MBRfrr9qQCghRPXQ9qOkVn1OYJXdXxAqHgy zEoAnjEUPrIjBXS3+hh1DuiY1p2HbVsk
=ri8p
-----END PGP SIGNATURE-----

#1 lore raw

Hi,

Quoted 5 lines · David Sommerseth

I'm reviewing this patch in the patch tracker, and cannot make up my mind if this is correct or not. Can someone please advise if this is something we should include or not?

<https://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

I don't really understand the subtleties of autoconf and friends, but I can attest that the current source tree cross-compiles just fine (e.g. "configure --prefix=/usr --host=armv5tel-unknown-linux-gnueabi").

Something to keep in mind: changing all TARGET_* #ifdef's in the actual code (as opposed to just changing the configure magic) *will* generate lots of merge problems with the new feature branches. Especially the IPv6 payload branch has lots of system dependent changes, so this part of the change would have to be done in parallel on multiple branches, causing the payload branch then to no longer apply to "base 2.1.1".

For this reason, I would NOT apply this patch right now - wait for the development tree to stabilize, before applying a mostly-religious change that affects 58 (!) places in the source.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw

Am 01.03.2010 11:58, schrieb Gert Doering:

Quoted 21 lines

Hi,

Quoted 5 lines · David Sommerseth

I'm reviewing this patch in the patch tracker, and cannot make up my mind if this is correct or not. Can someone please advise if this is something we should include or not?

<https://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

I don't really understand the subtleties of autoconf and friends, but I can attest that the current source tree cross-compiles just fine (e.g. "configure --prefix=/usr --host=armv5tel-unknown-linux-gnueabi").

Something to keep in mind: changing all TARGET_* #ifdef's in the actual code (as opposed to just changing the configure magic) *will* generate lots of merge problems with the new feature branches. Especially the IPv6 payload branch has lots of system dependent changes, so this part of the change would have to be done in parallel on multiple branches, causing the payload branch then to no longer apply to "base 2.1.1".

Quoted 3 lines

For this reason, I would NOT apply this patch right now - wait for the development tree to stabilize, before applying a mostly-religious change that affects 58 (!) places in the source.

Hi Gert,

No offense, but do you think it's within objective discussion to call the patch "mostly-religious change" (which is a non-objective comment in my book) if you "don't really understand the subtleties of autoconf and friends"?

Diego's proposal was/is sound -- I checked it for another project of mine when he sent a similar patch there --, and chases a cleanup in auto*, where build/host/target relations were polished a bit. As such, it's a desirable update and it is good to see elsewhere in this branch that it was accepted, so that Diego's effort wasn't wasted.

WRT practical merge concerns around TARGET_*, git knows the "rerere" sub-command to track merge conflict resolutions (see the manual); and since the required edits can be scripted, that could happen on the feature branches before attempting a merge. No big deal.

Anyways, I have a bit of auto* expertise, feel free to Cc:/ping me on auto* related proposals to openvpn. I've only cursorily been following the increased list traffic lately until the changed-procedure threads would have settled a bit, and the thread didn't catch my eye right away.

Best regards

Signature · 1 line
Matthias Andree
#3 lore raw

Hi,

Quoted 3 lines · Matthias Andree

No offense, but do you think it's within objective discussion to call the patch "mostly-religious change" (which is a non-objective comment in my book) if you "don't really understand the subtleties of autoconf and friends"?

Well, there's two parts to the original patch.

One is the functional patches in configure.ac - I can't say anything about that, so I'm not doing so.

The other part is changing all TARGET_* defines to HOST_* defines. This is not changing functionality or portability, as the very defines are explicitely set in configure.ac, and they could be MySystemIs_* as far as functionality is concerned. So the change is because people believe it to be "the right way" - which makes it "mostly-religious" in my book: not based on functional changes, but because "it's the right way".

Whitespace changes to cleanup broken formatting fall into the same category for me - quite often, there are very good reasons to do so, but if the circumstances are such that it conflicts with other development work, it might be prudent to postpone them until after other stuff has been merged.

... and this is exactly what I proposed: don't include the larger chunk of the changes right *now*. Wait for the multiple branches to settle down, and then decide how to adjust the TARGET_* definitions.

[..]

Quoted 4 lines

WRT practical merge concerns around TARGET_*, git knows the "rerere" sub-command to track merge conflict resolutions (see the manual); and since the required edits can be scripted, that could happen on the feature branches before attempting a merge. No big deal.

Well, this is putting extra work on David Sommerseth's lap. If he is willing to handle that, I won't object.

As for now, I have been operating under the premises that different branches in the openvpn-devel tree should avoid to cause merge conflicts (unless unavoidable for required functionality, see ipv6 payload vs. ipv6 transport).

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#4 lore raw

Am 14.03.2010, 12:19 Uhr, schrieb Gert Doering <[email protected]...>:

Quoted 12 lines

Hi,

Quoted 3 lines · Matthias Andree

No offense, but do you think it's within objective discussion to call the patch "mostly-religious change" (which is a non-objective comment in my book) if you "don't really understand the subtleties of autoconf and friends"?

Well, there's two parts to the original patch.

One is the functional patches in configure.ac - I can't say anything about that, so I'm not doing so.

Quoted 6 lines

The other part is changing all TARGET_* defines to HOST_* defines. This is not changing functionality or portability, as the very defines are explicitely set in configure.ac, and they could be MySystemIs_* as far as functionality is concerned. So the change is because people believe it to be "the right way" - which makes it "mostly-religious" in my book: not based on functional changes, but because "it's the right way".

Well, proper naming improves readability, hence maintainability. I think that's more objective than mere belief.
People will seldomly try to _quantify_ the efforts, but I've more often
than not lost hours debugging some software (not OpenVPN though) because variables/macros bore misleading names. The objective criterion here would be "proper names".

Quoted 3 lines

... and this is exactly what I proposed: don't include the larger chunk of the changes right *now*. Wait for the multiple branches to settle down, and then decide how to adjust the TARGET_* definitions.

Which is a valid technical reason (as much as "use proper names" is). I was trying to keep religion out though :)

Quoted 3 lines

As for now, I have been operating under the premises that different branches in the openvpn-devel tree should avoid to cause merge conflicts (unless unavoidable for required functionality, see ipv6 payload vs. ipv6 transport).

Point taken.

Thanks for your reply.

Signature · 1 line
Matthias Andree
#5 lore raw

Hi,

Quoted 5 lines · Matthias Andree
Quoted 3 lines

... and this is exactly what I proposed: don't include the larger chunk of the changes right *now*. Wait for the multiple branches to settle down, and then decide how to adjust the TARGET_* definitions.

Which is a valid technical reason (as much as "use proper names" is).

Good to see some understanding here. I really didn't want to get into a religious fight here, about me calling certain decisions "religious" :-)

Quoted 1 line

I was trying to keep religion out though :)

Given the amount of religous discussions about OpenSource stuff, this is a very reasonable point of view ;-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#6 lore raw

PATCH 1/1 Fix autotools cross-compiling support

In reply to David Sommerseth

This is a modified version of a patch sent to the sf.net patch tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

After having disucssed this patch on IRC (#openvpn-discussions) March 4, 2010, it was decided to accept this patch when not modifying TARGET_* defines through out the code. Further, in a mail comment Alon Bar-Lev had some other comments of what would be needed to be done.

Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>

This patch has been tested by bootstrapping the code on a RHEL4.6 box. with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2

It builds cleanly and 'make check' passes.

---
 acinclude.m4 |   10 +++++-----
 configure.ac |   35 +++++++++++++++++------------------
 2 files changed, 22 insertions(+), 23 deletions(-)
acinclude.m4 +5 -5
index f099de5..2d49020 100644
@@ -224,8 +224,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
 # pthread: Linux, etcetera
 # --thread-safe: KAI C++
 
-case "$target" in
-        *solaris*)
+case "$host" in
+        *-*-solaris*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -321,9 +321,9 @@ if test "x$acx_pthread_ok" = xyes; then
 
         AC_MSG_CHECKING([if more special flags are required for pthreads])
         flag=no
-        case "$target" in
-                *-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
-                *solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";;
+        case "$host" in
+                *-*-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
+                *-*-solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";;
         esac
         AC_MSG_RESULT(${flag})
         if test "x$flag" != xno; then
configure.ac +17 -18
index 116ff7c..a829a7d 100644
@@ -32,7 +32,6 @@ AC_CONFIG_SRCDIR(syshead.h)
 
 dnl Guess host type.
 AC_CANONICAL_HOST
-AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(openvpn, [$PACKAGE_VERSION])
 
 AC_ARG_WITH(cygwin-native,
@@ -44,11 +43,11 @@ AC_ARG_WITH(cygwin-native,
 WIN32="no"
 CYGWIN="no"
 case "${host}" in
-	*-mingw*)
+	*-*-mingw*)
 		WIN32="yes"
 		cross_compiling="yes"
 	;;
-	*-cygwin*)
+	*-*-cygwin*)
 		AC_MSG_CHECKING([cygwin mode to use])
 		if test "${CYGWIN_NATIVE}" = "yes"; then
 			AC_MSG_RESULT([Using native win32])
@@ -275,38 +274,38 @@ AC_ARG_WITH(mem-check,
 dnl fix search path, to allow compilers to find syshead.h
 CPPFLAGS="$CPPFLAGS -I${srcdir}"
 
-dnl check target OS
-openvpn_target=$target
-if test $target_alias; then
-  openvpn_target=$target_alias
+dnl check host OS
+openvpn_host=$host
+if test $host_alias; then
+  openvpn_host=$host_alias
 fi
-AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_target", [A string representing our target])
-case "$target" in
-*linux*)
+AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_host", [A string representing our host])
+case "$host" in
+*-*-linux*)
 	AC_DEFINE(TARGET_LINUX, 1, [Are we running on Linux?])
 	dnl RH9 SSL headers workaround
         if test -z $CS_HDR_DIR && test "$CRYPTO" = "yes"; then
            CPPFLAGS="$CPPFLAGS $(pkg-config --cflags openssl 2>/dev/null)"
         fi
 	;;
-*solaris*)
+*-*-solaris*)
 	AC_DEFINE(TARGET_SOLARIS, 1, [Are we running on Solaris?])
 	;;
-*openbsd*)
+*-*-openbsd*)
 	AC_DEFINE(TARGET_OPENBSD, 1, [Are we running on OpenBSD?])
 	;;
-*freebsd*)
+*-*-freebsd*)
 	AC_DEFINE(TARGET_FREEBSD, 1, [Are we running on FreeBSD?])
 	;;
-*netbsd*)
+*-*-netbsd*)
 	AC_DEFINE(TARGET_NETBSD, 1, [Are we running NetBSD?])
 	;;
-*darwin*)
+*-*-darwin*)
 	dnl some Mac OS X tendering (we use vararg macros...)
 	AC_DEFINE(TARGET_DARWIN, 1, [Are we running on Mac OS X?])
 	CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
 	;;
-*mingw*)
+*-*-mingw*)
 	AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?])
 	OPENVPN_ADD_LIBS(-lgdi32)
 	OPENVPN_ADD_LIBS(-lws2_32)
@@ -315,7 +314,7 @@ case "$target" in
 	OPENVPN_ADD_LIBS(-liphlpapi)
 	OPENVPN_ADD_LIBS(-lwinmm)
 	;;
-*dragonfly*)
+*-*-dragonfly*)
 	AC_DEFINE(TARGET_DRAGONFLY, 1, [Are we running on DragonFlyBSD?])
 	;;
 	
@@ -574,7 +573,7 @@ if test "$PTHREAD" = "yes"; then
   AC_MSG_RESULT([********* WARNING: pthread support is experimental for OpenVPN 2.0])
   ACX_PTHREAD(
         [
-	    case "$target" in
+	    case "$host" in
 	    *openbsd*)
 		AC_MSG_RESULT([WARNING: pthread support on OpenBSD is unstable!])
 		CFLAGS="$CFLAGS -pthread"
Signature · 1 line
1.5.4.7
#7 lore raw

Re: [Openvpn-devel] [PATCH] Fix autotools cross-compiling support

mingw should be *-mingw* and not *-*-mingw* as there are some notation without full notation.

Quoted 165 lines · David Sommerseth

This is a modified version of a patch sent to the sf.net patch tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

After having disucssed this patch on IRC (#openvpn-discussions) March 4, 2010, it was decided to accept this patch when not modifying TARGET_* defines through out the code.  Further, in a mail comment Alon Bar-Lev had some other comments of what would be needed to be done.

Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>

This patch has been tested by bootstrapping the code on a RHEL4.6 box. with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2

It builds cleanly and 'make check' passes.

---
 acinclude.m4 |   10 +++++-----
 configure.ac |   35 +++++++++++++++++------------------

 2 files changed, 22 insertions(+), 23 deletions(-)
acinclude.m4 +2 -2
index f099de5..2d49020 100644
@@ -224,8 +224,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
  # pthread: Linux, etcetera
  # --thread-safe: KAI C++
 
-case "$target" in
-        *solaris*)
+case "$host" in
+        *-*-solaris*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -321,9 +321,9 @@ if test "x$acx_pthread_ok" = xyes; then
 
         AC_MSG_CHECKING([if more special flags are required for pthreads])

        flag=no
-        case "$target" in
-                *-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
-                *solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";;
+        case "$host" in
+                *-*-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
+                *-*-solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";; esac
        AC_MSG_RESULT(${flag})
        if test "x$flag" != xno; then

configure.ac +0 -0
index 116ff7c..a829a7d 100644
@@ -32,7 +32,6 @@ AC_CONFIG_SRCDIR(syshead.h)
 

 dnl Guess host type.
 AC_CANONICAL_HOST
-AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(openvpn, [$PACKAGE_VERSION])

 AC_ARG_WITH(cygwin-native,

configure.ac +0 -0
@@ -44,11 +43,11 @@ AC_ARG_WITH(cygwin-native,

 WIN32="no"
 CYGWIN="no"
 case "${host}" in
-       *-mingw*)
+       *-*-mingw*)
               WIN32="yes"
               cross_compiling="yes"
       ;;
-       *-cygwin*)
+       *-*-cygwin*)
               AC_MSG_CHECKING([cygwin mode to use]) if test "${CYGWIN_NATIVE}" = "yes"; then AC_MSG_RESULT([Using native win32])

configure.ac +0 -0
@@ -275,38 +274,38 @@ AC_ARG_WITH(mem-check,

 dnl fix search path, to allow compilers to find syshead.h CPPFLAGS="$CPPFLAGS -I${srcdir}"

configure.ac +4 -4
-dnl check target OS
-openvpn_target=$target
-if test $target_alias; then
-  openvpn_target=$target_alias
+dnl check host OS
+openvpn_host=$host
+if test $host_alias; then
+  openvpn_host=$host_alias

 fi

configure.ac +3 -3
-AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_target", [A string representing our target])
-case "$target" in
-*linux*)
+AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_host", [A string representing our host])
+case "$host" in
+*-*-linux*)

       AC_DEFINE(TARGET_LINUX, 1, [Are we running on Linux?]) dnl RH9 SSL headers workaround
        if test -z $CS_HDR_DIR && test "$CRYPTO" = "yes"; then CPPFLAGS="$CPPFLAGS $(pkg-config --cflags openssl 2>/dev/null)" fi
       ;;

configure.ac +1 -1
-*solaris*)
+*-*-solaris*)

       AC_DEFINE(TARGET_SOLARIS, 1, [Are we running on Solaris?]) ;;

configure.ac +1 -1
-*openbsd*)
+*-*-openbsd*)

       AC_DEFINE(TARGET_OPENBSD, 1, [Are we running on OpenBSD?]) ;;

configure.ac +1 -1
-*freebsd*)
+*-*-freebsd*)

       AC_DEFINE(TARGET_FREEBSD, 1, [Are we running on FreeBSD?]) ;;

configure.ac +1 -1
-*netbsd*)
+*-*-netbsd*)

       AC_DEFINE(TARGET_NETBSD, 1, [Are we running NetBSD?]) ;;

configure.ac +1 -1
-*darwin*)
+*-*-darwin*)

       dnl some Mac OS X tendering (we use vararg macros...) AC_DEFINE(TARGET_DARWIN, 1, [Are we running on Mac OS X?]) CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
       ;;

configure.ac +1 -1
-*mingw*)
+*-*-mingw*)

       AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?]) OPENVPN_ADD_LIBS(-lgdi32) OPENVPN_ADD_LIBS(-lws2_32)

configure.ac +1 -1
@@ -315,7 +314,7 @@ case "$target" in
        OPENVPN_ADD_LIBS(-liphlpapi)
        OPENVPN_ADD_LIBS(-lwinmm)
        ;;
-*dragonfly*)
+*-*-dragonfly*)
        AC_DEFINE(TARGET_DRAGONFLY, 1, [Are we running on DragonFlyBSD?])
        ;;
 
@@ -574,7 +573,7 @@ if test "$PTHREAD" = "yes"; then
   AC_MSG_RESULT([********* WARNING: pthread support is experimental for OpenVPN 2.0])

  ACX_PTHREAD(
        [
-           case "$target" in
+           case "$host" in
           *openbsd*)
               AC_MSG_RESULT([WARNING: pthread support on OpenBSD is unstable!]) CFLAGS="$CFLAGS -pthread"
--
1.5.4.7

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#8 lore raw

PATCH v2 1/1 Fix autotools cross-compiling support

This is a modified version of a patch sent to the sf.net patch tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

After having disucssed this patch on IRC (#openvpn-discussions) March 4, 2010, it was decided to accept this patch when not modifying TARGET_* defines through out the code. Further, in a mail comment Alon Bar-Lev had some other comments of what would be needed to be done.

Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>

This patch has been tested by bootstrapping the code on a RHEL4.6 box. with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2

It builds cleanly and 'make check' passes.

---
 acinclude.m4 |   10 +++++-----
 configure.ac |   33 ++++++++++++++++-----------------
 2 files changed, 21 insertions(+), 22 deletions(-)
acinclude.m4 +5 -5
index f099de5..2d49020 100644
@@ -224,8 +224,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
 # pthread: Linux, etcetera
 # --thread-safe: KAI C++
 
-case "$target" in
-        *solaris*)
+case "$host" in
+        *-*-solaris*)
 
         # On Solaris (at least, for some versions), libc contains stubbed
         # (non-functional) versions of the pthreads routines, so link-based
@@ -321,9 +321,9 @@ if test "x$acx_pthread_ok" = xyes; then
 
         AC_MSG_CHECKING([if more special flags are required for pthreads])
         flag=no
-        case "$target" in
-                *-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
-                *solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";;
+        case "$host" in
+                *-*-aix* | *-freebsd*)               flag="-D_THREAD_SAFE";;
+                *-*-solaris* | alpha*-osf* | *linux*) flag="-D_REENTRANT";;
         esac
         AC_MSG_RESULT(${flag})
         if test "x$flag" != xno; then
configure.ac +16 -17
index e775665..8cb1f83 100644
@@ -32,7 +32,6 @@ AC_CONFIG_SRCDIR(syshead.h)
 
 dnl Guess host type.
 AC_CANONICAL_HOST
-AC_CANONICAL_SYSTEM
 AM_INIT_AUTOMAKE(openvpn, [$PACKAGE_VERSION])
 
 AC_ARG_WITH(cygwin-native,
@@ -48,7 +47,7 @@ case "${host}" in
 		WIN32="yes"
 		cross_compiling="yes"
 	;;
-	*-cygwin*)
+	*-*-cygwin*)
 		AC_MSG_CHECKING([cygwin mode to use])
 		if test "${CYGWIN_NATIVE}" = "yes"; then
 			AC_MSG_RESULT([Using native win32])
@@ -281,38 +280,38 @@ AC_ARG_WITH(mem-check,
 dnl fix search path, to allow compilers to find syshead.h
 CPPFLAGS="$CPPFLAGS -I${srcdir}"
 
-dnl check target OS
-openvpn_target=$target
-if test $target_alias; then
-  openvpn_target=$target_alias
+dnl check host OS
+openvpn_host=$host
+if test $host_alias; then
+  openvpn_host=$host_alias
 fi
-AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_target", [A string representing our target])
-case "$target" in
-*linux*)
+AC_DEFINE_UNQUOTED(TARGET_ALIAS, "$openvpn_host", [A string representing our host])
+case "$host" in
+*-*-linux*)
 	AC_DEFINE(TARGET_LINUX, 1, [Are we running on Linux?])
 	dnl RH9 SSL headers workaround
         if test -z $CS_HDR_DIR && test "$CRYPTO" = "yes"; then
            CPPFLAGS="$CPPFLAGS $(pkg-config --cflags openssl 2>/dev/null)"
         fi
 	;;
-*solaris*)
+*-*-solaris*)
 	AC_DEFINE(TARGET_SOLARIS, 1, [Are we running on Solaris?])
 	;;
-*openbsd*)
+*-*-openbsd*)
 	AC_DEFINE(TARGET_OPENBSD, 1, [Are we running on OpenBSD?])
 	;;
-*freebsd*)
+*-*-freebsd*)
 	AC_DEFINE(TARGET_FREEBSD, 1, [Are we running on FreeBSD?])
 	;;
-*netbsd*)
+*-*-netbsd*)
 	AC_DEFINE(TARGET_NETBSD, 1, [Are we running NetBSD?])
 	;;
-*darwin*)
+*-*-darwin*)
 	dnl some Mac OS X tendering (we use vararg macros...)
 	AC_DEFINE(TARGET_DARWIN, 1, [Are we running on Mac OS X?])
 	CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
 	;;
-*mingw*)
+*-mingw*)
 	AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?])
 	OPENVPN_ADD_LIBS(-lgdi32)
 	OPENVPN_ADD_LIBS(-lws2_32)
@@ -321,7 +320,7 @@ case "$target" in
 	OPENVPN_ADD_LIBS(-liphlpapi)
 	OPENVPN_ADD_LIBS(-lwinmm)
 	;;
-*dragonfly*)
+*-*-dragonfly*)
 	AC_DEFINE(TARGET_DRAGONFLY, 1, [Are we running on DragonFlyBSD?])
 	;;
 	
@@ -580,7 +579,7 @@ if test "$PTHREAD" = "yes"; then
   AC_MSG_RESULT([********* WARNING: pthread support is experimental for OpenVPN 2.0])
   ACX_PTHREAD(
         [
-	    case "$target" in
+	    case "$host" in
 	    *openbsd*)
 		AC_MSG_RESULT([WARNING: pthread support on OpenBSD is unstable!])
 		CFLAGS="$CFLAGS -pthread"
Signature · 1 line
1.6.6.1
author Applied
#9 lore raw

Re: [Openvpn-devel] [PATCHv2] Fix autotools cross-compiling support

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

Quoted 18 lines · David Sommerseth

This is a modified version of a patch sent to the sf.net patch tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>

After having disucssed this patch on IRC (#openvpn-discussions) March 4, 2010, it was decided to accept this patch when not modifying TARGET_* defines through out the code. Further, in a mail comment Alon Bar-Lev had some other comments of what would be needed to be done.

Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>

This patch has been tested by bootstrapping the code on a RHEL4.6 box. with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2

Quoted 8 lines

It builds cleanly and 'make check' passes.

---
 acinclude.m4 |   10 +++++-----
 configure.ac |   33 ++++++++++++++++-----------------
 2 files changed, 21 insertions(+), 22 deletions(-)

Applied to the bugfix2.1 branch, to be merged into allmerged. Commit ec40407472ce2df50d9f3826d984738108563695

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkuf/PcACgkQDC186MBRfrp/oQCdEy3PzQbf2Qv717aHjrgJDJsi 1LQAnRTncAfE3XbFE0+glgC/2/EuHOZG
=80do
-----END PGP SIGNATURE-----