]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Updated MSVC build scripts to Visual Studio 2008:
authorJames Yonan <james@openvpn.net>
Wed, 31 Mar 2010 06:38:21 +0000 (06:38 +0000)
committerJames Yonan <james@openvpn.net>
Wed, 31 Mar 2010 06:38:21 +0000 (06:38 +0000)
  python msvc\config.py
  nmake /f msvc\msvc.mak

Version 2.1.1e

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5516 e7ae566f-a301-0410-adde-c780ea21d3b5

17 files changed:
.svnignore
INSTALL
Makefile.am
buffer.c
config-win32.h [moved from config-win32.h.in with 86% similarity]
configure.ac
crypto.c
makefile.w32-vc [deleted file]
manage.c
misc.c
msvc/autodefs.h.in [new file with mode: 0644]
msvc/config.py [new file with mode: 0644]
msvc/msvc.mak [new file with mode: 0644]
multi.c
sig.c
tun.c
version.m4

index 34bbff24e8c69ddb4b4436ce3a06395b9c533c48..c02d2b8d30e9a97e1a0b1b66dc52e7d17b7c9204 100644 (file)
@@ -1,4 +1,5 @@
 *.o
+*.obj
 config.status
 config.log
 config.guess
@@ -12,7 +13,6 @@ config.h
 Makefile
 config.h.in
 configure
-config-win32.h
 config.sub
 openvpn.spec
 stamp-h1
diff --git a/INSTALL b/INSTALL
index ea1124abc0e68243aa7cf9b4fb08775f3fe0daae..961fbd608b98af606dcef61d78c431c0956e0272 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -12,9 +12,13 @@ QUICK START:
   Unix:
     ./configure && make && make-install
 
-  Windows:
+  Windows MinGW, using MSYS bash shell:
     ./domake-win (see comments in the script for more info)
 
+  Windows MSVC using Visual Studio 2008 Command Prompt window:
+    python msvc\config.py
+    nmake /f msvc\msvc.mak
+
 *************************************************************************
 
 To download OpenVPN, go to:
index 7bccc11df8353117482086d9ea6a6f6613d8fab1..4cc3ce22a429119a289ed51243b9ee80922740e3 100644 (file)
@@ -36,7 +36,7 @@ MAINTAINERCLEANFILES = \
        $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
        $(srcdir)/depcomp $(srcdir)/aclocal.m4 \
        $(srcdir)/config.guess $(srcdir)/config.sub \
-       $(srcdir)/config-win32.h $(srcdir)/openvpn.spec
+       $(srcdir)/openvpn.spec
 CLEANFILES = openvpn.8.html
 
 EXTRA_DIST = \
@@ -58,8 +58,7 @@ SUBDIRS = \
 TESTS = t_lpback.sh t_cltsrv.sh
 sbin_PROGRAMS = openvpn
 
-dist_noinst_HEADERS = \
-       config-win32.h
+dist_noinst_HEADERS =
 
 dist_noinst_SCRIPTS = \
        $(TESTS) \
index d448e5d7544dbee9c0f2185456448e07cfbbda9f..485c696a058f75f57de7eae8bc6a86fa20c29ec5 100644 (file)
--- a/buffer.c
+++ b/buffer.c
@@ -43,7 +43,7 @@ array_mult_safe (const size_t m1, const size_t m2, const size_t extra)
 }
 
 void
-buf_size_error (size_t size)
+buf_size_error (const size_t size)
 {
   msg (M_FATAL, "fatal buffer size error, size=%lu", (unsigned long)size);
 }
similarity index 86%
rename from config-win32.h.in
rename to config-win32.h
index 6f699bbb7e3257f97d2c081e36616413e8bb6f51..d845ec0cdbab7bbc33a15885c021a3aac2772372 100644 (file)
-/*
- *  OpenVPN -- An application to securely tunnel IP networks
- *             over a single UDP port, with support for SSL/TLS-based
- *             session authentication and key exchange,
- *             packet encryption, packet authentication, and
- *             packet compression.
- *
- *  Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2
- *  as published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program (see the file COPYING included with this
- *  distribution); if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/*
- * Configuration header for Win32 using the mingw environment.
- * Manually edited based on linux version as generated by autoconf.
- *
- * config-win32.h is normally generated by copying
- * config-win32.h.in -> config-win32.h and replacing
- * [ampersand] VERSION [ampersand]
- * with the appropriate version #.  This is normally
- * done automatically by configure.ac
- */
-
-#include <windows.h>
-#include <winsock2.h>
-#include "autodefs/defs.h"
-
-#define sleep(x) Sleep((x)*1000)
-
-#define random rand
-#define srandom srand
-
-typedef unsigned long in_addr_t;
-
-#ifndef _SSIZE_T_
-#define _SSIZE_T_
- typedef unsigned int ssize_t;
-#endif
-
-/* Append a label to program startup title */
-/*#define DEBUG_LABEL "DEBUG1"*/
-
-/* Should we print debug info from driver? */
-#ifdef PRODUCT_TAP_DEBUG
-#define TAP_WIN32_DEBUG
-#endif
-
-/*
- * Minimum TAP-Win32 version number expected by userspace
- *
- * The TAP-Win32 version number is defined in tap-win32/SOURCES
- */
-#define TAP_ID @TAP_ID@
-#define TAP_WIN32_MIN_MAJOR @TAP_WIN32_MIN_MAJOR@
-#define TAP_WIN32_MIN_MINOR @TAP_WIN32_MIN_MINOR@
-
-/* Enable client/server capability */
-#define ENABLE_CLIENT_SERVER 1
-
-/* Enable client capability only */
-/* #undef ENABLE_CLIENT_ONLY */
-
-/* Enable management server capability */
-#define ENABLE_MANAGEMENT 1
-
-/* Enable PKCS#11 support */
-#define USE_PKCS11 1
-
-/* Enable HTTP proxy support */
-#define ENABLE_HTTP_PROXY 1
-
-/* Enable Socks proxy support */
-#define ENABLE_SOCKS 1
-
-/* Enable internal fragmentation support */
-#define ENABLE_FRAGMENT 1
-
-/* Enable smaller executable size */
-/* #undef ENABLE_SMALL */
-
-/* Enable debugging support */
-#define ENABLE_DEBUG 1
-
-/* if defined, will allow usage of the --plugin directive */
-#define USE_LOAD_LIBRARY
-
-/* Dimension size to use for empty array declaration */
-#define EMPTY_ARRAY_SIZE 0
-
-/* Define to 1 if you have the `getsockname' function. */
-#define HAVE_GETSOCKNAME 1
-
-/* Define to 1 if you have the <openssl/engine.h> header file. */
-#define HAVE_OPENSSL_ENGINE_H 1
-
-/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */
-#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1
-
-/* Define to 1 if you have the `ENGINE_register_all_complete' function. */
-#define HAVE_ENGINE_REGISTER_ALL_COMPLETE 1
-
-/* Define to 1 if you have the `ENGINE_cleanup' function. */
-#define HAVE_ENGINE_CLEANUP 1
-
-/* gettimeofday() is implemented in otime.c for Windows */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if you have the 'chsize' function. */
-#define HAVE_CHSIZE 1
-
-/* Define to 1 if you have the `chdir' function. */
-#define HAVE_CHDIR 1
-
-/* Define to 1 if your compiler supports GNU GCC-style variadic macros */
-#ifndef _MSC_VER /* Defines MSFT compiler version. Defined as 1200 for MSVC++ 6.0. */
-#define HAVE_CPP_VARARG_MACRO_GCC 1
-#endif
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define to 1 if you have the `EVP_CIPHER_CTX_set_key_length' function. */
-#define HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `getsockopt' function. */
-#define HAVE_GETSOCKOPT 1
-
-/* Define to 1 if you have the `inet_ntoa' function. */
-#define HAVE_INET_NTOA 1
-
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
-   to 0 otherwise. */
-#define HAVE_MALLOC 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have the `setsockopt' function. */
-#define HAVE_SETSOCKOPT 1
-
-/* Define to 1 if you have the `socket' function. */
-#define HAVE_SOCKET 1
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#ifndef _MSC_VER
-#define HAVE_STDINT_H 1
-#endif
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#define HAVE_STDIO_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strerror' function. */
-#define HAVE_STRERROR 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the `system' function. */
-#define HAVE_SYSTEM 1
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#ifndef _MSC_VER
-#define HAVE_SYS_FILE_H 1
-#endif
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#ifndef _MSC_VER
-#define HAVE_SYS_TIME_H 1
-#endif
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the `time' function. */
-#define HAVE_TIME 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#ifndef _MSC_VER
-#define HAVE_UNISTD_H 1
-#endif
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#define HAVE_VSNPRINTF 1
-
-/* Special Windows version of getpass() defined in io.c */
-#define HAVE_GETPASS 1
-
-/* Name of package */
-#define PACKAGE @PACKAGE@
-
-/* Define to the address where bug reports for this package should be sent. */
-//#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME @PACKAGE_NAME@
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME @PACKAGE_TARNAME@
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION @PACKAGE_VERSION@
-
-/* Define to the full name and version of this package. */
-#ifdef DEBUG_LABEL
-#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL
-#else
-#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION
-#endif
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE void
-
-/* The size of a `unsigned int', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT 4
-
-/* The size of a `unsigned long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG 4
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* A string representing our target */
-#ifdef _MSC_VER
-#define TARGET_ALIAS "Win32-MSVC++"
-#else
-#define TARGET_ALIAS "Win32-MinGW"
-#endif
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#ifndef _MSC_VER
-#define TIME_WITH_SYS_TIME 1
-#endif
-
-/* Use OpenSSL crypto library */
-#define USE_CRYPTO 1
-
-/* Use LZO compression library */
-#define USE_LZO 1
-
-/* LZO version number */
-#define LZO_VERSION_NUM "2"
-
-/* Use lzo/ directory prefix for LZO header files (for LZO 2.0) */
-#define LZO_HEADER_DIR 1
-
-/* Use OpenSSL SSL library */
-#define USE_SSL 1
-
-/* Version number of package */
-#define VERSION PACKAGE_VERSION
-
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
-   if it is not supported. */
-#define inline __inline
-
-/* type to use in place of socklen_t if not defined */
-#define socklen_t unsigned int
-
-/* 32-bit unsigned type */
-#define uint32_t unsigned int
-
-/* 16-bit unsigned type */
-#define uint16_t unsigned short
-
-/* 8-bit unsigned type */
-#define uint8_t unsigned char
-
-/* Route command */
-#define ROUTE_PATH "route"
-
-/* Windows doesn't support PTHREAD yet */
-#ifdef USE_PTHREAD
-#error The Windows version of OpenVPN does not support PTHREAD yet
-#endif
-
-#ifdef _MSC_VER
-/* MSVC++ hacks */
-#include <io.h>
-#include <direct.h>
-#define vsnprintf _vsnprintf
-#define vsnwprintf _vsnwprintf
-#define snwprintf _snwprintf
-#define write _write
-#define open _open
-#define read _read
-#define close _close
-#define chdir _chdir
-#define S_IRUSR 0
-#define S_IWUSR 0
-typedef int intptr_t;
-/* Visual Studio 2005 supports vararg macros */
-#if _MSC_VER >= 1400
-#define HAVE_CPP_VARARG_MACRO_ISO 1
-#endif
-#endif
+/*\r
+ *  OpenVPN -- An application to securely tunnel IP networks\r
+ *             over a single UDP port, with support for SSL/TLS-based\r
+ *             session authentication and key exchange,\r
+ *             packet encryption, packet authentication, and\r
+ *             packet compression.\r
+ *\r
+ *  Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>\r
+ *\r
+ *  This program is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License version 2\r
+ *  as published by the Free Software Foundation.\r
+ *\r
+ *  This program is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  You should have received a copy of the GNU General Public License\r
+ *  along with this program (see the file COPYING included with this\r
+ *  distribution); if not, write to the Free Software Foundation, Inc.,\r
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ */\r
+\r
+/*\r
+ * Configuration header for Win32 using the MSVC environment.\r
+ */\r
+\r
+#include <windows.h>\r
+#include <winsock2.h>\r
+#include "autodefs.h" /* machine generated */\r
+\r
+//#define sleep(x) Sleep((x)*1000)\r
+\r
+//#define random rand\r
+//#define srandom srand\r
+\r
+typedef unsigned long in_addr_t;\r
+\r
+#ifndef _SSIZE_T_\r
+#define _SSIZE_T_\r
+ typedef unsigned int ssize_t;\r
+#endif\r
+\r
+/* Append a label to program startup title */\r
+/*#define DEBUG_LABEL "DEBUG1"*/\r
+\r
+/* Should we print debug info from driver? */\r
+#ifdef PRODUCT_TAP_DEBUG\r
+#define TAP_WIN32_DEBUG\r
+#endif\r
+\r
+/* Enable client/server capability */\r
+#define ENABLE_CLIENT_SERVER 1\r
+\r
+/* Enable client capability only */\r
+#define ENABLE_CLIENT_ONLY\r
+\r
+/* Enable management server capability */\r
+#define ENABLE_MANAGEMENT 1\r
+\r
+/* Enable PKCS#11 support */\r
+/* #define USE_PKCS11 1 */\r
+\r
+/* Enable HTTP proxy support */\r
+#define ENABLE_HTTP_PROXY 1\r
+\r
+/* Enable Socks proxy support */\r
+#define ENABLE_SOCKS 1\r
+\r
+/* Enable internal fragmentation support */\r
+#define ENABLE_FRAGMENT 1\r
+\r
+/* Enable smaller executable size */\r
+/* #undef ENABLE_SMALL */\r
+\r
+/* Enable debugging support */\r
+#define ENABLE_DEBUG 1\r
+\r
+/* if defined, will allow usage of the --plugin directive */\r
+#define USE_LOAD_LIBRARY\r
+\r
+/* Dimension size to use for empty array declaration */\r
+#define EMPTY_ARRAY_SIZE 0\r
+\r
+/* Define to 1 if you have the `getsockname' function. */\r
+#define HAVE_GETSOCKNAME 1\r
+\r
+/* Define to 1 if you have the <openssl/engine.h> header file. */\r
+#define HAVE_OPENSSL_ENGINE_H 1\r
+\r
+/* Define to 1 if you have the `ENGINE_load_builtin_engines' function. */\r
+#define HAVE_ENGINE_LOAD_BUILTIN_ENGINES 1\r
+\r
+/* Define to 1 if you have the `ENGINE_register_all_complete' function. */\r
+#define HAVE_ENGINE_REGISTER_ALL_COMPLETE 1\r
+\r
+/* Define to 1 if you have the `ENGINE_cleanup' function. */\r
+#define HAVE_ENGINE_CLEANUP 1\r
+\r
+/* gettimeofday() is implemented in otime.c for Windows */\r
+#define HAVE_GETTIMEOFDAY 1\r
+\r
+/* Define to 1 if you have the 'chsize' function. */\r
+#define HAVE_CHSIZE 1\r
+\r
+/* Define to 1 if you have the `chdir' function. */\r
+#define HAVE_CHDIR 1\r
+\r
+/* Define to 1 if your compiler supports GNU GCC-style variadic macros */\r
+#ifndef _MSC_VER /* Defines MSFT compiler version. Defined as 1200 for MSVC++ 6.0. */\r
+#define HAVE_CPP_VARARG_MACRO_GCC 1\r
+#endif\r
+\r
+/* Define to 1 if you have the <ctype.h> header file. */\r
+#define HAVE_CTYPE_H 1\r
+\r
+/* Define to 1 if you have the <errno.h> header file. */\r
+#define HAVE_ERRNO_H 1\r
+\r
+/* Define to 1 if you have the `EVP_CIPHER_CTX_set_key_length' function. */\r
+#define HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH 1\r
+\r
+/* Define to 1 if you have the <fcntl.h> header file. */\r
+#define HAVE_FCNTL_H 1\r
+\r
+/* Define to 1 if you have the `getsockopt' function. */\r
+#define HAVE_GETSOCKOPT 1\r
+\r
+/* Define to 1 if you have the `inet_ntoa' function. */\r
+#define HAVE_INET_NTOA 1\r
+\r
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and\r
+   to 0 otherwise. */\r
+#define HAVE_MALLOC 1\r
+\r
+/* Define to 1 if you have the `memset' function. */\r
+#define HAVE_MEMSET 1\r
+\r
+/* Define to 1 if you have the `setsockopt' function. */\r
+#define HAVE_SETSOCKOPT 1\r
+\r
+/* Define to 1 if you have the `socket' function. */\r
+#define HAVE_SOCKET 1\r
+\r
+/* Define to 1 if you have the <stdarg.h> header file. */\r
+#define HAVE_STDARG_H 1\r
+\r
+/* Define to 1 if you have the <stdint.h> header file. */\r
+#ifndef _MSC_VER\r
+#define HAVE_STDINT_H 1\r
+#endif\r
+\r
+/* Define to 1 if you have the <stdio.h> header file. */\r
+#define HAVE_STDIO_H 1\r
+\r
+/* Define to 1 if you have the <stdlib.h> header file. */\r
+#define HAVE_STDLIB_H 1\r
+\r
+/* Define to 1 if you have the `strerror' function. */\r
+#define HAVE_STRERROR 1\r
+\r
+/* Define to 1 if you have the <strings.h> header file. */\r
+#define HAVE_STRINGS_H 1\r
+\r
+/* Define to 1 if you have the <string.h> header file. */\r
+#define HAVE_STRING_H 1\r
+\r
+/* Define to 1 if you have the `system' function. */\r
+#define HAVE_SYSTEM 1\r
+\r
+/* Define to 1 if you have the <sys/file.h> header file. */\r
+#ifndef _MSC_VER\r
+#define HAVE_SYS_FILE_H 1\r
+#endif\r
+\r
+/* Define to 1 if you have the <sys/stat.h> header file. */\r
+#define HAVE_SYS_STAT_H 1\r
+\r
+/* Define to 1 if you have the <sys/time.h> header file. */\r
+#ifndef _MSC_VER\r
+#define HAVE_SYS_TIME_H 1\r
+#endif\r
+\r
+/* Define to 1 if you have the <sys/types.h> header file. */\r
+#define HAVE_SYS_TYPES_H 1\r
+\r
+/* Define to 1 if you have the `time' function. */\r
+#define HAVE_TIME 1\r
+\r
+/* Define to 1 if you have the <unistd.h> header file. */\r
+#ifndef _MSC_VER\r
+#define HAVE_UNISTD_H 1\r
+#endif\r
+\r
+/* Define to 1 if you have the `vsnprintf' function. */\r
+#define HAVE_VSNPRINTF 1\r
+\r
+/* Special Windows version of getpass() defined in io.c */\r
+#define HAVE_GETPASS 1\r
+\r
+/* Define to the address where bug reports for this package should be sent. */\r
+//#define PACKAGE_BUGREPORT "openvpn-users@lists.sourceforge.net"\r
+\r
+/* Define to the full name and version of this package. */\r
+#ifdef DEBUG_LABEL\r
+#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL\r
+#else\r
+#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION\r
+#endif\r
+\r
+/* Define as the return type of signal handlers (`int' or `void'). */\r
+#define RETSIGTYPE void\r
+\r
+/* The size of a `unsigned int', as computed by sizeof. */\r
+#define SIZEOF_UNSIGNED_INT 4\r
+\r
+/* The size of a `unsigned long', as computed by sizeof. */\r
+#define SIZEOF_UNSIGNED_LONG 4\r
+\r
+/* Define to 1 if you have the ANSI C header files. */\r
+#define STDC_HEADERS 1\r
+\r
+/* A string representing our target */\r
+#ifdef _MSC_VER\r
+#define TARGET_ALIAS "Win32-MSVC++"\r
+#else\r
+#define TARGET_ALIAS "Win32-MinGW"\r
+#endif\r
+\r
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */\r
+#ifndef _MSC_VER\r
+#define TIME_WITH_SYS_TIME 1\r
+#endif\r
+\r
+/* Use OpenSSL crypto library */\r
+#define USE_CRYPTO 1\r
+\r
+/* Use LZO compression library */\r
+#define USE_LZO 1\r
+\r
+/* LZO version number */\r
+#define LZO_VERSION_NUM "2"\r
+\r
+/* Use lzo/ directory prefix for LZO header files (for LZO 2.0) */\r
+#define LZO_HEADER_DIR 1\r
+\r
+/* Use OpenSSL SSL library */\r
+#define USE_SSL 1\r
+\r
+/* Version number of package */\r
+#define VERSION PACKAGE_VERSION\r
+\r
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing\r
+   if it is not supported. */\r
+#define inline __inline\r
+\r
+/* type to use in place of socklen_t if not defined */\r
+#define socklen_t unsigned int\r
+\r
+/* 32-bit unsigned type */\r
+#define uint32_t unsigned int\r
+\r
+/* 16-bit unsigned type */\r
+#define uint16_t unsigned short\r
+\r
+/* 8-bit unsigned type */\r
+#define uint8_t unsigned char\r
+\r
+/* Route command */\r
+#define ROUTE_PATH "route"\r
+\r
+/* Windows doesn't support PTHREAD yet */\r
+#ifdef USE_PTHREAD\r
+#error The Windows version of OpenVPN does not support PTHREAD yet\r
+#endif\r
+\r
+#ifdef _MSC_VER\r
+/* MSVC++ hacks */\r
+#pragma warning(disable:4244) // conversion from 'foo' to 'bar', possible loss of data\r
+#pragma warning(disable:4018) // signed/unsigned mismatch\r
+#include <io.h>\r
+#include <direct.h>\r
+//#define vsnprintf _vsnprintf\r
+//#define vsnwprintf _vsnwprintf\r
+#define snwprintf _snwprintf\r
+#define write _write\r
+#define open _open\r
+#define read _read\r
+#define close _close\r
+#define lseek _lseek\r
+#define chdir _chdir\r
+#define strdup _strdup\r
+#define chsize _chsize\r
+#define S_IRUSR 0\r
+#define S_IWUSR 0\r
+#define TV_SEC_CAST (long)\r
+#define TV_USEC_CAST (long)\r
+typedef int intptr_t;\r
+/* Visual Studio 2005 supports vararg macros */\r
+#if _MSC_VER >= 1400\r
+#define HAVE_CPP_VARARG_MACRO_ISO 1\r
+#endif\r
+#endif\r
index 116ff7c9bc15d05314d0eedd107189b28591cf28..4f7231a9342a825845d8b59d539624558cf492b2 100644 (file)
@@ -914,7 +914,6 @@ fi
 AC_OUTPUT([
        Makefile
        openvpn.spec
-       config-win32.h
        images/Makefile
        service-win32/Makefile
        install-win32/Makefile
index 444f036a0d1ed4bc64a3bec62b785181c4464d45..55cca43983870c81badf8f44598c5ff3514c96be 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -985,8 +985,8 @@ get_tls_handshake_key (const struct key_type *key_type,
 #endif
 
 /* header and footer for static key file */
-static const char static_key_head[] = "-----BEGIN " PACKAGE_NAME " Static key V1-----";
-static const char static_key_foot[] = "-----END " PACKAGE_NAME " Static key V1-----";
+static const char static_key_head[] = "-----BEGIN OpenVPN Static key V1-----";
+static const char static_key_foot[] = "-----END OpenVPN Static key V1-----";
 
 static const char printable_char_fmt[] =
   "Non-Hex character ('%c') found at line %d in key file '%s' (%d/%d/%d bytes found/min/max)";
@@ -1065,8 +1065,8 @@ read_key_file (struct key2 *key2, const char *file, const unsigned int flags)
       const unsigned char c = *cp;
 
 #if 0
-      msg (M_INFO, "char='%c' s=%d ln=%d li=%d m=%d c=%d",
-          c, state, line_num, line_index, match, count);
+      msg (M_INFO, "char='%c'[%d] s=%d ln=%d li=%d m=%d c=%d",
+          c, (int)c, state, line_num, line_index, match, count);
 #endif
 
       if (c == '\n')
@@ -1150,7 +1150,7 @@ read_key_file (struct key2 *key2, const char *file, const unsigned int flags)
   if (flags & RKF_MUST_SUCCEED)
     {
       if (!key2->n)
-       msg (M_FATAL, "Insufficient key material or header text not found found in file '%s' (%d/%d/%d bytes found/min/max)",
+       msg (M_FATAL, "Insufficient key material or header text not found in file '%s' (%d/%d/%d bytes found/min/max)",
             error_filename, count, onekeylen, keylen);
 
       if (state != PARSE_FINISHED)
@@ -1297,7 +1297,7 @@ write_key_file (const int nkeys, const char *filename)
   buf_printf (&out, "%s\n", static_key_foot);
 
   /* write number of bits */
-  buf_printf (&nbits_head_text, "#\n# %d bit " PACKAGE_NAME " static key\n#\n", nbits);
+  buf_printf (&nbits_head_text, "#\n# %d bit OpenVPN static key\n#\n", nbits);
   buf_write_string_file (&nbits_head_text, filename, fd);
 
   /* write key file, now formatted in out, to file */
diff --git a/makefile.w32-vc b/makefile.w32-vc
deleted file mode 100644 (file)
index addf9da..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-# This makefile builds the user-mode component
-# of OpenVPN for WIN32 in the MSVC++ environment.
-#
-# Build Dependencies:
-#      OpenSSL         (SSL/TLS/crypto library)
-#      LZO             (real-time compression library)
-#
-# Targets:
-#      static -- link statically with OpenSSL
-#      dynamic -- link dynamically with OpenSSL
-#
-# Note that LZO is always linked statically.
-
-# Change these to point to your OpenSSL and LZO top-level
-# directories.
-
-OPENSSL = \src\openssl-0.9.7d
-OPENSSL_STATIC = libeay32s.lib ssleay32s.lib
-#OPENSSL_STATIC = libeay32sd.lib ssleay32sd.lib
-OPENSSL_DYNAMIC = libeay32.lib ssleay32.lib
-#OPENSSL_DYNAMIC = libeay32d.lib ssleay32d.lib
-
-LZO = \src\lzo-1.08.vc
-
-PKCS11_HELPER = \src\pkcs11-helper-1.02
-
-INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include -I$(PKCS11_HELPER)/include
-
-LIBS = lzo.lib libpkcs11-helper-1.lib ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib
-
-LIB_DIRS = -LIBPATH:$(OPENSSL)\out -LIBPATH:$(LZO) -LIBPATH:$(PKCS11_HELPER)\lib
-
-EXE = openvpn.exe
-
-CPP=cl.exe
-CPP_ARG_COMMON=/nologo /W3 /G5 /O2 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CONSOLE -D_MBCS -D_CRT_SECURE_NO_DEPRECATE $(INCLUDE_DIRS) /FD /c
-# release:
-CPP_PROJ=$(CPP_ARG_COMMON) /MD -DNDEBUG
-# debug:
-#CPP_PROJ=$(CPP_ARG_COMMON) /MDd /Zi /Od -D_DEBUG
-
-LINK32=link.exe
-# release:
-LINK32_FLAGS=/nologo /subsystem:console /incremental:no /out:"$(EXE)"
-# debug:
-#LINK32_FLAGS=/nologo /subsystem:console /incremental:no /debug /out:"$(EXE)"
-
-# Make sure the HEADERS and OBJS definitions below match the same
-# definitions in makefile.w32.
-
-HEADERS = \
-       base64.h \
-       basic.h \
-       buffer.h \
-       circ_list.h common.h \
-       tap-win32/common.h \
-        config-win32.h \
-       crypto.h \
-       cryptoapi.h \
-       errlevel.h \
-       error.h \
-       event.h \
-        fdmisc.h \
-       forward-inline.h \
-       forward.h \
-       fragment.h \
-        gremlin.h \
-       helper.h \
-       init.h \
-       integer.h \
-       interval.h \
-       list.h \
-       lzo.h \
-       manage.h \
-       mbuf.h \
-       memdbg.h \
-       misc.h \
-       mroute.h \
-       mss.h \
-       mtcp.h \
-       mtu.h \
-       mudp.h \
-       multi.h \
-       ntlm.h \
-       occ-inline.h \
-       occ.h \
-       pkcs11.h \
-        openvpn.h \
-       openvpn-plugin.h \
-       options.h \
-       otime.h \
-       packet_id.h \
-       perf.h \
-       ping-inline.h \
-       ping.h \
-       plugin.h \
-       pool.h \
-        proto.h \
-       proxy.h \
-       push.h \
-       reliable.h \
-       route.h \
-       schedule.h \
-       session_id.h \
-        shaper.h \
-       sig.h \
-       socket.h \
-       socks.h \
-       ssl.h \
-        status.h \
-       syshead.h \
-        thread.h \
-       tun.h \
-       lladdr.h \
-       win32.h
-
-OBJS =  base64.obj \
-       buffer.obj \
-       crypto.obj \
-       cryptoapi.obj \
-       error.obj \
-       event.obj \
-       fdmisc.obj \
-       forward.obj \
-        fragment.obj \
-       gremlin.obj \
-       helper.obj \
-       init.obj \
-       interval.obj \
-        list.obj \
-       lzo.obj \
-       manage.obj \
-       mbuf.obj \
-       misc.obj \
-       mroute.obj \
-       mss.obj \
-       mtcp.obj \
-       mtu.obj \
-       mudp.obj \
-       multi.obj \
-       ntlm.obj \
-       occ.obj \
-       pkcs11.obj \
-        openvpn.obj \
-       options.obj \
-       otime.obj \
-       packet_id.obj \
-       perf.obj \
-       ping.obj \
-       plugin.obj \
-        pool.obj \
-       proto.obj \
-       proxy.obj \
-       push.obj \
-       reliable.obj \
-        route.obj \
-       schedule.obj \
-       session_id.obj \
-       shaper.obj \
-       sig.obj \
-       socket.obj \
-        socks.obj \
-       ssl.obj \
-       status.obj \
-       thread.obj \
-       tun.obj \
-       lladdr.obj \
-       win32.obj
-
-dynamic : $(OBJS)
-       $(LINK32) @<<
-       $(LINK32_FLAGS) $(LIB_DIRS) $(LIBS) $(OPENSSL_DYNAMIC) $(OBJS)
-<<
-
-static : $(OBJS)
-       $(LINK32) @<<
-       $(LINK32_FLAGS) $(LIB_DIRS) $(LIBS) $(OPENSSL_STATIC) $(OBJS)
-<<
-
-clean :
-       del /Q $(OBJS) $(EXE) *.idb *.pdb
-
-.c.obj::
-   $(CPP) @<<
-   $(CPP_PROJ) $<
-<<
index e87d996d31d51bb3a99868f634f1b201223b4b13..bd88c11c22d1fd63a3e9d795f1fcb33d4d71efa5 100644 (file)
--- a/manage.c
+++ b/manage.c
@@ -225,7 +225,7 @@ man_prompt (struct management *man)
     man_output_list_push (man, "ENTER PASSWORD:");
 #if 0 /* should we use prompt? */
   else
-    man_output_list_push (man, PACKAGE_NAME ">");
+    man_output_list_push (man, ">");
 #endif
 }
 
diff --git a/misc.c b/misc.c
index 33e676213d14d6af04ede5b0a9acc3a1905df779..b52a0427137f995e315bb0eb0fbcb12a03726fed 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1194,7 +1194,7 @@ create_temp_filename (const char *directory, const char *prefix, struct gc_arena
 const char *
 hostname_randomize(const char *hostname, struct gc_arena *gc)
 {
-  const int n_rnd_bytes = 6;
+# define n_rnd_bytes 6
 
   char *hst = string_alloc(hostname, gc);
   char *dot = strchr(hst, '.');
@@ -1213,6 +1213,7 @@ hostname_randomize(const char *hostname, struct gc_arena *gc)
     }
   else
     return hostname;
+# undef n_rnd_bytes
 }
 
 #else
diff --git a/msvc/autodefs.h.in b/msvc/autodefs.h.in
new file mode 100644 (file)
index 0000000..9814022
--- /dev/null
@@ -0,0 +1,20 @@
+/*\r
+ * Minimum TAP-Win32 version number expected by userspace\r
+ *\r
+ * The TAP-Win32 version number is defined in tap-win32/SOURCES\r
+ */\r
+#define TAP_ID "@PRODUCT_TAP_ID@"\r
+#define TAP_WIN32_MIN_MAJOR @PRODUCT_TAP_WIN32_MIN_MAJOR@\r
+#define TAP_WIN32_MIN_MINOR @PRODUCT_TAP_WIN32_MIN_MINOR@\r
+\r
+/* Name of package */\r
+#define PACKAGE "@PRODUCT_UNIX_NAME@"\r
+\r
+/* Define to the full name of this package. */\r
+#define PACKAGE_NAME "@PRODUCT_NAME@"\r
+\r
+/* Define to the one symbol short name of this package. */\r
+#define PACKAGE_TARNAME "@PRODUCT_UNIX_NAME@"\r
+\r
+/* Define to the version of this package. */\r
+#define PACKAGE_VERSION "@PRODUCT_VERSION@"\r
diff --git a/msvc/config.py b/msvc/config.py
new file mode 100644 (file)
index 0000000..04ea4c5
--- /dev/null
@@ -0,0 +1,93 @@
+# build autodefs.h and \r
+\r
+import re\r
+\r
+autogen = "Automatically generated by config.py"\r
+\r
+def parse_version_m4(kv, version_m4):\r
+    r = re.compile(r'^define\((\w+),\[(.*)\]\)$')\r
+    f = open(version_m4)\r
+    for line in f:\r
+        line = line.rstrip()\r
+        m = re.match(r, line)\r
+        if m:\r
+            g = m.groups()\r
+            kv[g[0]] = g[1]\r
+    f.close()\r
+\r
+def parse_settings_in(kv, settings_in):\r
+    r = re.compile(r'^!define\s+(\w+)(?:\s+"?(.*?)"?)$')\r
+    f = open(settings_in)\r
+    for line in f:\r
+        line = line.rstrip()\r
+        m = re.match(r, line)\r
+        if m:\r
+            g = m.groups()\r
+            kv[g[0]] = g[1] or ''\r
+    f.close()\r
+\r
+def build_autodefs(kv, autodefs_in, autodefs_out):\r
+    def repfn(m):\r
+        var, = m.groups()\r
+        return kv.get(var, '')\r
+\r
+    r = re.compile(r'@(\w+)@')\r
+    fin = open(autodefs_in)\r
+    fout = open(autodefs_out, 'w')\r
+    fout.write("/* %s */\n\n" % autogen)\r
+    for line in fin:\r
+        newline = re.sub(r, repfn, line)\r
+        fout.write(newline)\r
+    fin.close()\r
+    fout.close()\r
+\r
+def print_key_values(kv):\r
+    for k, v in sorted(kv.items()):\r
+        print "%s%s%s" % (k, ' '*(32-len(k)), repr(v))\r
+\r
+def get_sources(makefile_am):\r
+    c = set()\r
+    h = set()\r
+    f = open(makefile_am)\r
+    state = False\r
+    for line in f:\r
+        line = line.rstrip()\r
+        if line == 'openvpn_SOURCES = \\':\r
+            state = True\r
+        elif not line:\r
+            state = False\r
+        elif state:\r
+            for sf in line.split():\r
+                if sf.endswith('.c'):\r
+                    c.add(sf[:-2])\r
+                elif sf.endswith('.h'):\r
+                    h.add(sf[:-2])\r
+                elif sf == '\\':\r
+                    pass\r
+                else:\r
+                    print >>sys.stderr, "Unrecognized filename:", sf\r
+    f.close()\r
+    return [ sorted(list(s)) for s in (c, h) ]\r
+\r
+def output_mak_list(out, title, srclist, ext):\r
+    out.write("%s =" % (title,))\r
+    for x in srclist:\r
+        out.write(" \\\n\t%s.%s" % (x, ext))\r
+    out.write('\n\n')\r
+\r
+def output_mak(makefile_am, outfile):\r
+    c, h = get_sources(makefile_am)\r
+    out = open(outfile, 'w')\r
+    out.write("# %s\n\n" % autogen)\r
+    output_mak_list(out, 'HEADERS', h, 'h')\r
+    output_mak_list(out, 'OBJS', c, 'obj')\r
+    out.close()\r
+\r
+def main():\r
+    kv = {}\r
+    parse_version_m4(kv, 'version.m4')\r
+    parse_settings_in(kv, 'install-win32/settings.in')\r
+    build_autodefs(kv, 'msvc/autodefs.h.in', 'autodefs.h')\r
+    output_mak('Makefile.am', 'head_obj.mak')\r
+\r
+main()\r
diff --git a/msvc/msvc.mak b/msvc/msvc.mak
new file mode 100644 (file)
index 0000000..bca779f
--- /dev/null
@@ -0,0 +1,52 @@
+# This makefile builds the user-mode component\r
+# of OpenVPN for Windows in the Visual Studio 2008 environment.\r
+\r
+# To build:\r
+#    python msvc\config.py\r
+#    nmake /f msvc\msvc.mak\r
+\r
+# Each of the OPENSSL and LZO dirs should have 'lib' and 'include'\r
+# directories under them.\r
+\r
+OPENSSL = \src\openssl\r
+OPENSSL_DYNAMIC = libeay32.lib ssleay32.lib\r
+\r
+LZO = \src\lzo\r
+LZO_DYNAMIC = lzo2.lib\r
+\r
+INCLUDE_DIRS = -I$(OPENSSL)/include -I$(LZO)/include\r
+\r
+LIBS = $(OPENSSL_DYNAMIC) $(LZO_DYNAMIC) ws2_32.lib crypt32.lib iphlpapi.lib winmm.lib user32.lib gdi32.lib advapi32.lib wininet.lib\r
+\r
+LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(LZO)\lib\r
+\r
+EXE = openvpn.exe\r
+\r
+CPP=cl.exe\r
+CPP_ARG_COMMON=/nologo /W3 /O2 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CONSOLE -D_MBCS -D_CRT_SECURE_NO_DEPRECATE $(INCLUDE_DIRS) /FD /c\r
+# release:\r
+CPP_PROJ=$(CPP_ARG_COMMON) /MD -DNDEBUG\r
+# debug:\r
+#CPP_PROJ=$(CPP_ARG_COMMON) /MDd /Zi /Od -D_DEBUG\r
+\r
+LINK32=link.exe\r
+# release:\r
+LINK32_FLAGS=/nologo /subsystem:console /incremental:no /out:"$(EXE)"\r
+# debug:\r
+#LINK32_FLAGS=/nologo /subsystem:console /incremental:no /debug /out:"$(EXE)"\r
+\r
+# HEADERS and OBJS definitions, automatically generated\r
+!INCLUDE head_obj.mak\r
+\r
+openvpn : $(OBJS)\r
+       $(LINK32) @<<\r
+       $(LINK32_FLAGS) $(LIB_DIRS) $(LIBS) $(OBJS)\r
+<<\r
+\r
+clean :\r
+       del /Q $(OBJS) $(EXE) *.idb *.pdb\r
+\r
+.c.obj::\r
+   $(CPP) @<<\r
+   $(CPP_PROJ) $<\r
+<<\r
diff --git a/multi.c b/multi.c
index 342871a79337f2bc4a49ce8dbc24ea841defade7..2b04428836a8183586e6efd74a6c7ee9a6962554 100644 (file)
--- a/multi.c
+++ b/multi.c
@@ -721,7 +721,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
          /*
           * Status file version 1
           */
-         status_printf (so, PACKAGE_NAME " CLIENT LIST");
+         status_printf (so, "OpenVPN CLIENT LIST");
          status_printf (so, "Updated,%s", time_string (0, 0, false, &gc_top));
          status_printf (so, "Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since");
          hash_iterator_init (m->hash, &hi, true);
diff --git a/sig.c b/sig.c
index 4dd6b09208520e891dfa1e7110a88a259b997625..b7a35080030f31350f496bb4aa6ec07436083161 100644 (file)
--- a/sig.c
+++ b/sig.c
@@ -257,7 +257,7 @@ print_status (const struct context *c, struct status_output *so)
 
   status_reset (so);
 
-  status_printf (so, PACKAGE_NAME " STATISTICS");
+  status_printf (so, "OpenVPN STATISTICS");
   status_printf (so, "Updated,%s", time_string (0, 0, false, &gc));
   status_printf (so, "TUN/TAP read bytes," counter_format, c->c2.tun_read_bytes);
   status_printf (so, "TUN/TAP write bytes," counter_format, c->c2.tun_write_bytes);
diff --git a/tun.c b/tun.c
index d82ac49a56d88575cfabc39900d76a5ac0f30eb3..725dce4959172ca67e880c9be8948623718de66d 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -55,7 +55,7 @@ static void netsh_ifconfig (const struct tuntap_options *to,
                            const char *flex_name,
                            const in_addr_t ip,
                            const in_addr_t netmask,
-                           unsigned int flags);
+                           const unsigned int flags);
 
 static const char *netsh_get_id (const char *dev_node, struct gc_arena *gc);
 
index 826720b3608038c850d44d558484303bb53ad08c..0877b9c6ed5f56742123e8435b087fc61f5cc4a7 100644 (file)
@@ -1,5 +1,5 @@
 dnl define the OpenVPN version
-define(PRODUCT_VERSION,[2.1.1d])
+define(PRODUCT_VERSION,[2.1.1e])
 dnl define the TAP version
 define(PRODUCT_TAP_ID,[tap0901])
 define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])