Skip to content

Commit

Permalink
Fix Building Using MSVC
Browse files Browse the repository at this point in the history
This patch enables the building of OpenVPN for the 2.4 and master
branches using MSVC (Visual Studio 2013 / MSVC v120), which currently
doesn't work with 2.4 or a clone of master. 2013 is being used as it
reduces the complexity of the redistributable requirements and has
mostly complete C99 support. Further changes will be necessary for 2015
support when the switch is made.

Note the changes to config-msvc-version.h.in are more of a work around.
It was a simpler approach when compared to modifying msvc-generate.js to
handle m4 syntax, and so it may be dropped if there is an intention to
update the javascript generator.

Signed-off by: Eric Thorpe <eric@sparklabs.com>

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <df273b9b-6ca4-a539-cdf5-d4f9f991896b@sparklabs.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14268.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
  • Loading branch information
Eric Thorpe authored and cron2 committed Mar 16, 2017
1 parent fd03618 commit 5ab106d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
8 changes: 6 additions & 2 deletions config-msvc-version.h.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#define PACKAGE_NAME "@PRODUCT_NAME@"
#define PACKAGE_STRING "@PRODUCT_NAME@ @PRODUCT_VERSION@"
#define PACKAGE_STRING "@PRODUCT_NAME@ @PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@@PRODUCT_VERSION_PATCH@"
#define PACKAGE_TARNAME "@PRODUCT_TARNAME@"
#define PACKAGE "@PRODUCT_TARNAME@"
#define PACKAGE_VERSION "@PRODUCT_VERSION@"
#define PRODUCT_VERSION_MAJOR "@PRODUCT_VERSION_MAJOR@"
#define PRODUCT_VERSION_MINOR "@PRODUCT_VERSION_MINOR@"
#define PRODUCT_VERSION_PATCH "@PRODUCT_VERSION_PATCH@"
#define PACKAGE_VERSION "@PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@.@PRODUCT_VERSION_PATCH@"
#define PRODUCT_VERSION "@PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@.@PRODUCT_VERSION_PATCH@"
#define PRODUCT_BUGREPORT "@PRODUCT_BUGREPORT@"
#define OPENVPN_VERSION_RESOURCE @PRODUCT_VERSION_RESOURCE@
#define TAP_WIN_COMPONENT_ID "@PRODUCT_TAP_WIN_COMPONENT_ID@"
Expand Down
1 change: 1 addition & 0 deletions config-msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
typedef uint16_t in_port_t;

#ifdef HAVE_CONFIG_MSVC_LOCAL_H
#include <config-msvc-local.h>
Expand Down
7 changes: 7 additions & 0 deletions src/openvpn/openvpn.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="argv.c" />
<ClCompile Include="base64.c" />
<ClCompile Include="block_dns.c" />
<ClCompile Include="buffer.c" />
<ClCompile Include="clinat.c" />
<ClCompile Include="comp-lz4.c" />
<ClCompile Include="comp.c" />
<ClCompile Include="compstub.c" />
<ClCompile Include="console.c" />
<ClCompile Include="console_builtin.c" />
<ClCompile Include="crypto.c" />
<ClCompile Include="crypto_openssl.c" />
<ClCompile Include="cryptoapi.c" />
Expand Down Expand Up @@ -164,12 +167,15 @@
<ClCompile Include="ssl_verify.c" />
<ClCompile Include="ssl_verify_openssl.c" />
<ClCompile Include="status.c" />
<ClCompile Include="tls_crypt.c" />
<ClCompile Include="tun.c" />
<ClCompile Include="win32.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="argv.h" />
<ClInclude Include="base64.h" />
<ClInclude Include="basic.h" />
<ClInclude Include="block_dns.h" />
<ClInclude Include="buffer.h" />
<ClInclude Include="circ_list.h" />
<ClInclude Include="clinat.h" />
Expand Down Expand Up @@ -249,6 +255,7 @@
<ClInclude Include="ssl_verify_openssl.h" />
<ClInclude Include="status.h" />
<ClInclude Include="syshead.h" />
<ClInclude Include="tls_crypt.h" />
<ClInclude Include="tun.h" />
<ClInclude Include="win32.h" />
</ItemGroup>
Expand Down
26 changes: 25 additions & 1 deletion src/openvpn/openvpn.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@
<ClCompile Include="comp-lz4.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="argv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="block_dns.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="console_builtin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="tls_crypt.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="base64.h">
Expand Down Expand Up @@ -464,10 +476,22 @@
<ClInclude Include="win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="compstub.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="argv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="block_dns.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="tls_crypt.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="openvpn_win32_resources.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>

0 comments on commit 5ab106d

Please sign in to comment.