Skip to contentSkip to conversation

Windows build was messed up!

Openvpn-devel Alon Bar-Lev 5 participants 15 messages Sep 13, 2010 – Sep 20, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

Does anyone know why the socklet_t detection was added this way?

I mean the TYPE_SOCKLEN_T m4 macro.

First, it should be sufficient to just try to see if socklen_t is defined. Next, on all platforms it would be int in all other platforms. And, there is no need to check for the type in monolitic environment like Windows, as it will be always the same.

Currently it fails cross compile windows in mingw-w64 compiler, as winsock.h is as follows:
"""
/* define WINSOCK_API_LINKAGE and WSAAPI for less
* diff output between winsock.h and winsock2.h, but
* remember to undefine them at the end of file */
"""
And the macro uses these macros which are internal winsock macros and should not be used anyway.

Also, when did the autodefs.h went mandatory? Why is it in tap-win32/common.h while no constant is actually used?

The use of WSA_IO_INCOMPLETE without including winsock2.h is invalid! Look at [1].

Attached is a patch to solve all these issues for now. Apply to both 2.1, 2.2.

The whole build environment of openvpn is malformed, using two separate build systems for windows and posix, invalid use of autoconf, and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

Alon.

[1] http://msdn.microsoft.com/en-us/library/aa921087.aspx

acinclude.m4 +32 -27
diff -urNp openvpn-2.1.3/acinclude.m4 openvpn-2.1.3.new/acinclude.m4
@@ -90,34 +90,39 @@ AC_DEFUN([TYPE_SOCKLEN_T],
       AC_MSG_CHECKING([for socklen_t equivalent])
       AC_CACHE_VAL([curl_cv_socklen_t_equiv],
       [
-         # Systems have either "struct sockaddr *" or
-         # "void *" as the second argument to getpeername
-         curl_cv_socklen_t_equiv=
-         for arg2 in "struct sockaddr" void; do
-            for t in int size_t unsigned long "unsigned long"; do
-               AC_TRY_COMPILE([
-                  #ifdef _WIN32
-                  #include <windows.h>
-                  #define PREFIX1 WINSOCK_API_LINKAGE
-                  #define PREFIX2 PASCAL
-                  #else
-                  #include <sys/types.h>
-                  #include <sys/socket.h>
-                  #define PREFIX1
-                  #define PREFIX2
-                  #define SOCKET int
-                  #endif
-
-                  PREFIX1 int PREFIX2 getpeername (SOCKET, $arg2 *, $t *);
-               ],[
-                  $t len;
-                  getpeername(0,0,&len);
-               ],[
-                  curl_cv_socklen_t_equiv="$t"
-                  break
-               ])
+         case "$target" in
+	 *mingw*) curl_cv_socklen_t_equiv=int ;;
+	 *)
+            # Systems have either "struct sockaddr *" or
+            # "void *" as the second argument to getpeername
+            curl_cv_socklen_t_equiv=
+            for arg2 in "struct sockaddr" void; do
+               for t in int size_t unsigned long "unsigned long"; do
+                  AC_TRY_COMPILE([
+                     #ifdef _WIN32
+                     #include <windows.h>
+                     #define PREFIX1 WINSOCK_API_LINKAGE
+                     #define PREFIX2 PASCAL
+                     #else
+                     #include <sys/types.h>
+                     #include <sys/socket.h>
+                     #define PREFIX1
+                     #define PREFIX2
+                     #define SOCKET int
+                     #endif
+
+                     PREFIX1 int PREFIX2 getpeername (SOCKET, $arg2 *, $t *);
+                  ],[
+                     $t len;
+                     getpeername(0,0,&len);
+                  ],[
+                     curl_cv_socklen_t_equiv="$t"
+                     break
+                  ])
+               done
             done
-         done
+	 ;;
+	 esac
 
          if test "x$curl_cv_socklen_t_equiv" = x; then
             AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
configure.ac +1 -0
diff -urNp openvpn-2.1.3/configure.ac openvpn-2.1.3.new/configure.ac
@@ -308,6 +308,7 @@ case "$target" in
 	;;
 *mingw*)
 	AC_DEFINE(TARGET_WIN32, 1, [Are we running WIN32?])
+	CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
 	OPENVPN_ADD_LIBS(-lgdi32)
 	OPENVPN_ADD_LIBS(-lws2_32)
 	OPENVPN_ADD_LIBS(-lwininet)
syshead.h +1 -0
diff -urNp openvpn-2.1.3/syshead.h openvpn-2.1.3.new/syshead.h
@@ -51,6 +51,7 @@
 
 #ifdef WIN32
 #include <windows.h>
+#include <winsock2.h>
 #define sleep(x) Sleep((x)*1000)
 #define random rand
 #define srandom srand
tap-win32/common.h +2 -0
diff -urNp openvpn-2.1.3/tap-win32/common.h openvpn-2.1.3.new/tap-win32/common.h
@@ -28,7 +28,9 @@
 // common to both.
 //===============================================
 
+#ifndef HAVE_CONFIG_H
 #include "autodefs.h"
+#endif
 
 //=============
 // TAP IOCTLs
#1 lore raw
Quoted 2 lines · Alon Bar-Lev

The whole build environment of openvpn is malformed, using two separate build systems for windows and posix,

Only two? Oh that's nothing. We're having lots of fun with build systems in libusb-1.0, where each contributing Windows developer actually requires a separate build system. So we have stuff for VC6, VS2005, VS2008, DDK/WDK, MinGW and Cygwin. :) Fortunately at least the last two use autotools, and I do consider that the canonical build method since it covers all supported systems, and allows automated packaging on a POSIX host, which is what still dominates in the project. But the Windows support is important, as are the developers, and as long as someone agrees to maintain a particular build method then I think it's fine to offer it on some kind of best-effort basis.

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

Quoted 2 lines

and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

How can the installer situation be improved? I want to make an NSIS installer as well, and I would quite like to keep it *within* the project..? Is there a much better way?

//Peter

#2 lore raw
Quoted 8 lines · Peter Stuge
Quoted 2 lines · Alon Bar-Lev

The whole build environment of openvpn is malformed, using two separate build systems for windows and posix,

Only two? Oh that's nothing. We're having lots of fun with build systems in libusb-1.0, where each contributing Windows developer actually requires a separate build system. So we have stuff for VC6, VS2005, VS2008, DDK/WDK, MinGW and Cygwin. :)

I consider diversity of working build environments a net benefit to the project. It's another useful axis of portability and helps rub off non-portable burrs.

Quoted 11 lines

Fortunately at least
the last two use autotools, and I do consider that the canonical build method since it covers all supported systems, and allows automated packaging on a POSIX host, which is what still dominates in the project. But the Windows support is important, as are the developers, and as long as someone agrees to maintain a particular build method then I think it's fine to offer it on some kind of best-effort basis.

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

--Toby

Quoted 21 lines
Quoted 4 lines

and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

How can the installer situation be improved? I want to make an NSIS installer as well, and I would quite like to keep it *within* the project..? Is there a much better way?

//Peter

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw
Quoted 5 lines · Toby Thain

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

Won't work ever!
Forget about wine and Microsoft compilers.
mingw provides a decent environment, fully integrated to autotools and cross environments.

Alon.

#4 lore raw
Quoted 8 lines · Alon Bar-Lev
Quoted 5 lines · Toby Thain

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

Won't work ever!

Are you certain?

Certainly this works:

	$ wine nmake /f foo.mak

I have dozens of projects which cross-build this way for 32 and 64 bit Windows.

--Toby

Quoted 5 lines

Forget about wine and Microsoft compilers.
mingw provides a decent environment, fully integrated to autotools and cross environments.

Alon.

#5 lore raw
Quoted 8 lines · Toby Thain
Quoted 7 lines
Quoted 5 lines

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

Won't work ever!

Quoted 7 lines

Are you certain?

Certainly this works:

       $ wine nmake /f foo.mak

I have dozens of projects which cross-build this way for 32 and 64 bit Windows.

autoconf/automake/libtool will not be able to execute the compilers correctly. You still need to write and maintain two separate build systems, one for windows and the other for the rest of the world.
I would also avoid calling using wine "cross-build"... :)

#6 lore raw
In reply to Toby Thain
Quoted 5 lines · Toby Thain
Quoted 1 line

So we have stuff for VC6, VS2005, VS2008, DDK/WDK, MinGW and Cygwin. :)

I consider diversity of working build environments a net benefit to the project. It's another useful axis of portability and helps rub off non-portable burrs.

I see your point and I agree in part, but personally I would e.g. prefer to ignore VC6, since it requires a fair amount source code workarounds because it's *so* old.

Also, someone needs to maintain these build methods, and I wish people didn't have to spend time on that part so much.

Quoted 8 lines
Quoted 2 lines

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

Maybe it works for cross-compiling, but then MinGW(-w64) will be way better tested so why bother, when for people on Windows it's no real help, they want the GUI stuff. Also, being a library, there are some more build options like e.g. enable debugging or not. This is typically a separate target in VS but only a configure switch with autotools, and while this case is easy enough, I don't think those targets scale so well..

Personally I'm missing a way to do some build-time scripting also on Windows. The best idea I've come up with so far is a .cmd which does some of what autoconf does, e.g. "sed" version number from configure.ac into .rc files and create a config.h, but that doesn't mean it's a very good idea. :\

//Peter

#7 lore raw
Quoted 18 lines · Peter Stuge
Quoted 5 lines · Toby Thain
Quoted 1 line

So we have stuff for VC6, VS2005, VS2008, DDK/WDK, MinGW and Cygwin. :)

I consider diversity of working build environments a net benefit to the project. It's another useful axis of portability and helps rub off non-portable burrs.

I see your point and I agree in part, but personally I would e.g. prefer to ignore VC6, since it requires a fair amount source code workarounds because it's *so* old.

Also, someone needs to maintain these build methods, and I wish people didn't have to spend time on that part so much.

Quoted 3 lines
Quoted 2 lines

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

Quoted 8 lines
Quoted 5 lines

NMAKE is convenient for Windows builds as it will also happily run under Linux/WINE, targeting both 32 and 64 bit Windows runtimes with the 'freely downloadable' Express toolchain. It may even be possible to combine autotools with the Microsoft compiler, though I haven't tried it (CC="wine cl", etc).

Maybe it works for cross-compiling, but then MinGW(-w64) will be way better tested so why bother,

Actually I moved OFF mingw32 (which I did use for years), because I saw some dubious and hard to diagnose runtime failures. These seem to have disappeared from builds made with Microsoft toolchain. I haven't tried recent mingw, though.

Quoted 9 lines

when for people on Windows it's no real
help, they want the GUI stuff. Also, being a library, there are some more build options like e.g. enable debugging or not. This is typically a separate target in VS but only a configure switch with autotools, and while this case is easy enough, I don't think those targets scale so well..

Personally I'm missing a way to do some build-time scripting also on Windows.

NMAKE works ok for my purposes. Have you tried that?

--Toby

Quoted 17 lines

The best idea I've come up with so far is a .cmd which does some of what autoconf does, e.g. "sed" version number from configure.ac into .rc files and create a config.h, but that doesn't mean it's a very good idea. :\

//Peter

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#8 lore raw
In reply to Peter Stuge
Quoted 2 lines · Peter Stuge

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

In OpenVPN upstream provides binaries using mingw anyway. So there is no need to support any other environment for Windows. This makes it easy.
Also, please keep in mind that OpenVPN is not a library... so much easier to manage.

Quoted 5 lines
Quoted 2 lines

and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

How can the installer situation be improved? I want to make an NSIS installer as well, and I would quite like to keep it *within* the

I just saying that most users do not interested in compiling the tap driver, also compiling the tap driver requires Microsoft DDK. So separating the tap into its own release management would be wise... a separate MSI for the TAP that can be embedded within other installers.

Easy-rsa has nothing to do with openvpn, it is great that it is provided, but as a separate process, fix in easy-rsa should not modify openvpn release

The same for Windows installer, a fix in Windows installer should not modify openvpn version, as it has nothing to do with it.

Alon.

#9 lore raw

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

Quoted 21 lines · Alon Bar-Lev
Quoted 2 lines · Peter Stuge

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

In OpenVPN upstream provides binaries using mingw anyway. So there is no need to support any other environment for Windows. This makes it easy.
Also, please keep in mind that OpenVPN is not a library... so much easier to manage.

Quoted 5 lines
Quoted 2 lines

and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

How can the installer situation be improved? I want to make an NSIS installer as well, and I would quite like to keep it *within* the

I just saying that most users do not interested in compiling the tap driver, also compiling the tap driver requires Microsoft DDK. So separating the tap into its own release management would be wise... a separate MSI for the TAP that can be embedded within other installers.

Quoted 6 lines

Easy-rsa has nothing to do with openvpn, it is great that it is provided, but as a separate process, fix in easy-rsa should not modify openvpn release

The same for Windows installer, a fix in Windows installer should not modify openvpn version, as it has nothing to do with it.

Alon, I completely agree with you! And I think this is going to bite us harder in the future if we don't begin to think about alternatives. So thank you for brining this up!

- From my point of view, it makes not much sense to provide building support for other Windows platforms than mingw for the OpenVPN binary. And I do share your opinion about the TAP driver, as well as easy-rsa and Windows installer.

Another issue which has bitten us lately is also that we needed to release a new OpenVPN *version* because the build scripts changed, which meant increasing the version number. In this case, we should normally just need to update a build number on Windows and not the complete OpenVPN release version for all platforms. How things are now, we even need to update the OpenVPN version number if we only update the Windows TAP driver, which is relevant for only one platform.

My suggestion is that we first move those parts related to the Windows TAP driver, Windows installer and easy-rsa into separate git trees. Next, the Windows building scripts needs to be split up, so that there's a separate building process for Windows TAP driver and the OpenVPN binary. As those processes *are* different, it should actually simplify the building process in the long run. Then we need to come up with a better Windows installer process, which f.ex. can require a pre-compiled TAP and OpenVPN binary.

This way, it can also be easier for people creating installers for Mac OSX as well, maybe even other platforms which uses their own installers.

For those wanting to pull down everything in one go ... we can always look into git submodule, which can pull down several separate git trees in a few operations. This might be useful for the Windows installer, especially to include the easy-rsa files.

The time frame I imagine for this is when OpenVPN 2.2 is released. That's a reasonable time to think this through and we need to do some other improvements to the git tree when we release OpenVPN 2.2. As a side-note, I hope we will be able to get 2.2 released within this year.

Alon, when it comes to your patch, I've looked at it, and it looks sane to me. But as I'm neither a Windows developer nor an autotools expert, I'll wait for an ACK from someone who can understand it better. But I'll try to remember to bring it up on Thursday's developments meeting, unless someone ACKs it earlier.

kind regards,

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

iEYEARECAAYFAkyWFYoACgkQDC186MBRfrrZKQCfbZIH4kLB/lFLO/CVdbTxRT3f iXAAmQGl+sndowcQlqXXwDzK4Wv/xEI9
=mvMe
-----END PGP SIGNATURE-----

#10 lore raw

Look at the date.... Since ~2007 we are discussing modular. It is so needed... :)
Better later than ever...

---------- Forwarded message ----------
From: Alon Bar-Lev <[email protected]...>
Date: Wed, Dec 27, 2006 at 8:20 PM
Subject: Re: [openvpn] cross compile
To: James Yonan <[email protected]...>

Silent again... :)
So there must be something else wrong.
I think that the System of nsis can be replaced with a simple program/script/file detection.
And I don't know if to convert the DDK build environment to mingw will be the best think to do, although it is very interesting to do that :)

So I thought I will raise another idea you won't like... Why won't you package the easy-rsa and tap in separate packages, maintaining them with their own versions?
I recommend people to use easy-rsa... But they don't with to/understand why install OpenVPN.
Also co-linux uses the tap implementation...

I don't mean all component should not be under the same installer... But maintained as separate components, each have its own installer.

Best Regards,
Alon Bar-Lev.

Quoted 91 lines · David Sommerseth

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

Quoted 21 lines · Alon Bar-Lev
Quoted 2 lines · Peter Stuge

autotools is absolutely alien in Windows, and to be honest a bit of a hassle to set up if you're already a VS wizard.

In OpenVPN upstream provides binaries using mingw anyway. So there is no need to support any other environment for Windows. This makes it easy.
Also, please keep in mind that OpenVPN is not a library... so much easier to manage.

Quoted 5 lines
Quoted 2 lines

and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

How can the installer situation be improved? I want to make an NSIS installer as well, and I would quite like to keep it *within* the

I just saying that most users do not interested in compiling the tap driver, also compiling the tap driver requires Microsoft DDK. So separating the tap into its own release management would be wise... a separate MSI for the TAP that can be embedded within other installers.

Quoted 6 lines

Easy-rsa has nothing to do with openvpn, it is great that it is provided, but as a separate process, fix in easy-rsa should not modify openvpn release

The same for Windows installer, a fix in Windows installer should not modify openvpn version, as it has nothing to do with it.

Alon, I completely agree with you!  And I think this is going to bite us harder in the future if we don't begin to think about alternatives.  So thank you for brining this up!

- From my point of view, it makes not much sense to provide building support for other Windows platforms than mingw for the OpenVPN binary. And I do share your opinion about the TAP driver, as well as easy-rsa and Windows installer.

Another issue which has bitten us lately is also that we needed to release a new OpenVPN *version* because the build scripts changed, which meant increasing the version number.  In this case, we should normally just need to update a build number on Windows and not the complete OpenVPN release version for all platforms.  How things are now, we even need to update the OpenVPN version number if we only update the Windows TAP driver, which is relevant for only one platform.

My suggestion is that we first move those parts related to the Windows TAP driver, Windows installer and easy-rsa into separate git trees. Next, the Windows building scripts needs to be split up, so that there's a separate building process for Windows TAP driver and the OpenVPN binary.  As those processes *are* different, it should actually simplify the building process in the long run.  Then we need to come up with a better Windows installer process, which f.ex. can require a pre-compiled TAP and OpenVPN binary.

This way, it can also be easier for people creating installers for Mac OSX as well, maybe even other platforms which uses their own installers.

For those wanting to pull down everything in one go ... we can always look into git submodule, which can pull down several separate git trees in a few operations.  This might be useful for the Windows installer, especially to include the easy-rsa files.

The time frame I imagine for this is when OpenVPN 2.2 is released. That's a reasonable time to think this through and we need to do some other improvements to the git tree when we release OpenVPN 2.2.  As a side-note, I hope we will be able to get 2.2 released within this year.

Alon, when it comes to your patch, I've looked at it, and it looks sane to me.  But as I'm neither a Windows developer nor an autotools expert, I'll wait for an ACK from someone who can understand it better.  But I'll try to remember to bring it up on Thursday's developments meeting, unless someone ACKs it earlier.

kind regards,

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

iEYEARECAAYFAkyWFYoACgkQDC186MBRfrrZKQCfbZIH4kLB/lFLO/CVdbTxRT3f iXAAmQGl+sndowcQlqXXwDzK4Wv/xEI9
=mvMe
-----END PGP SIGNATURE-----

#11 lore raw

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

Quoted 3 lines · Alon Bar-Lev

Look at the date.... Since ~2007 we are discussing modular. It is so needed... :)
Better later than ever...

Indeed ... I promise you I'll start a discussion here on the ML and on the the weekly meetings some weeks before we're going to establish the new git tree when OpenVPN 2.2 is getting ready for a release. That will be the best time to pick up this. Feel free to bug me about it if you think it's about to slip my mind!

kind regards,

David Sommerseth

Quoted 23 lines

---------- Forwarded message ----------
From: Alon Bar-Lev <[email protected]...>
Date: Wed, Dec 27, 2006 at 8:20 PM
Subject: Re: [openvpn] cross compile
To: James Yonan <[email protected]...>

Silent again... :)
So there must be something else wrong.
I think that the System of nsis can be replaced with a simple program/script/file detection.
And I don't know if to convert the DDK build environment to mingw will be the best think to do, although it is very interesting to do that :)

So I thought I will raise another idea you won't like... Why won't you package the easy-rsa and tap in separate packages, maintaining them with their own versions?
I recommend people to use easy-rsa... But they don't with to/understand why install OpenVPN.
Also co-linux uses the tap implementation...

Quoted 7 lines

I don't mean all component should not be under the same installer... But maintained as separate components, each have its own installer.

Best Regards,
Alon Bar-Lev.

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

iEYEARECAAYFAkyWayMACgkQDC186MBRfrprOwCgjM8j5WBABX4hil7D29onPF2e WesAoJLdF1OzrC79FeegE2Ux8rXliHuV
=7Ltr
-----END PGP SIGNATURE-----

#12 lore raw
In reply to David Sommerseth

Hi David and Alon,

Quoted 8 lines

My suggestion is that we first move those parts related to the Windows TAP driver, Windows installer and easy-rsa into separate git trees. Next, the Windows building scripts needs to be split up, so that there's a separate building process for Windows TAP driver and the OpenVPN binary. As those processes *are* different, it should actually simplify the building process in the long run. Then we need to come up with a better Windows installer process, which f.ex. can require a pre-compiled TAP and OpenVPN binary.

Makes perfect sense to me. There's little advantage in keeping these in the same tree, and we've definitely seen the disadvantages.

Quoted 4 lines

The time frame I imagine for this is when OpenVPN 2.2 is released. That's a reasonable time to think this through and we need to do some other improvements to the git tree when we release OpenVPN 2.2. As a side-note, I hope we will be able to get 2.2 released within this year.

Do you consider the build system / git tree organization a new feature? Or could the first non-beta/rc 2.2 release use the separated build systems?

Quoted 5 lines

Alon, when it comes to your patch, I've looked at it, and it looks sane to me. But as I'm neither a Windows developer nor an autotools expert, I'll wait for an ACK from someone who can understand it better. But I'll try to remember to bring it up on Thursday's developments meeting, unless someone ACKs it earlier.

I added Alon's patch and this build system modularization to next meeting's topic list:

<https://community.openvpn.net/openvpn/wiki/Topics-2010-09-23>

James probably has some insights about the issues with our current build system. I'm also sure he can ACK Alon's patch if nobody else does it first.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
#13 lore raw
In reply to David Sommerseth

Hi David and Alon,

Quoted 8 lines

My suggestion is that we first move those parts related to the Windows TAP driver, Windows installer and easy-rsa into separate git trees. Next, the Windows building scripts needs to be split up, so that there's a separate building process for Windows TAP driver and the OpenVPN binary. As those processes *are* different, it should actually simplify the building process in the long run. Then we need to come up with a better Windows installer process, which f.ex. can require a pre-compiled TAP and OpenVPN binary.

Makes perfect sense to me. There's little advantage in keeping these in the same tree, and we've definitely seen the disadvantages.

Quoted 4 lines

The time frame I imagine for this is when OpenVPN 2.2 is released. That's a reasonable time to think this through and we need to do some other improvements to the git tree when we release OpenVPN 2.2. As a side-note, I hope we will be able to get 2.2 released within this year.

Do you consider the build system / git tree organization a new feature? Or could the first non-beta/rc 2.2 release use the separated build systems?

Quoted 5 lines

Alon, when it comes to your patch, I've looked at it, and it looks sane to me. But as I'm neither a Windows developer nor an autotools expert, I'll wait for an ACK from someone who can understand it better. But I'll try to remember to bring it up on Thursday's developments meeting, unless someone ACKs it earlier.

I added Alon's patch and this build system modularization to next meeting's topic list:

<https://community.openvpn.net/openvpn/wiki/Topics-2010-09-23>

James probably has some insights about the issues with our current build system. I'm also sure he can ACK Alon's patch if nobody else does it first.

Signature · 5 lines
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock
#14 lore raw
In reply to Alon Bar-Lev

Samuli,
Please peek this up.
Thanks.

Quoted 38 lines · Alon Bar-Lev

Hello,

Does anyone know why the socklet_t detection was added this way?

I mean the TYPE_SOCKLEN_T m4 macro.

First, it should be sufficient to just try to see if socklen_t is defined. Next, on all platforms it would be int in all other platforms. And, there is no need to check for the type in monolitic environment like Windows, as it will be always the same.

Currently it fails cross compile windows in mingw-w64 compiler, as winsock.h is as follows:
"""
/* define WINSOCK_API_LINKAGE and WSAAPI for less
 * diff output between winsock.h and winsock2.h, but
 * remember to undefine them at the end of file */
"""
And the macro uses these macros which are internal winsock macros and should not be used anyway.

Also, when did the autodefs.h went mandatory? Why is it in tap-win32/common.h while no constant is actually used?

The use of WSA_IO_INCOMPLETE without including winsock2.h is invalid! Look at [1].

Attached is a patch to solve all these issues for now. Apply to both 2.1, 2.2.

The whole build environment of openvpn is malformed, using two separate build systems for windows and posix, invalid use of autoconf, and the mixture of different projects: openvpn, tap, windows installer, easy-rsa.

Alon.

[1] http://msdn.microsoft.com/en-us/library/aa921087.aspx