]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Reverted r3181, accomplish the same thing via a special case
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Tue, 5 Aug 2008 20:34:43 +0000 (20:34 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Tue, 5 Aug 2008 20:34:43 +0000 (20:34 +0000)
for Windows stdcall functions in configure.ac (Alon Bar-Lev).

Minor fix to cryptoapi.c to not compile itself unless USE_CRYPTO
and USE_SSL flags are enabled (Alon Bar-Lev).

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

configure.ac
cryptoapi.c
syshead.h

index da534072c8a923444b2f3fe0606cb5e3a607a144..bd256b1f9c75afeaffadfeb6693503514df1cba5 100644 (file)
@@ -458,17 +458,25 @@ AC_CHECK_SIZEOF(unsigned long)
 
 AC_CACHE_SAVE
 
+AC_CHECK_FUNCS([ctime memset vsnprintf strdup], ,
+               [AC_MSG_ERROR([Required library function not found])])
 AC_CHECK_FUNCS(daemon chroot getpwnam setuid nice system getpid dup dup2 dnl
               getpass strerror syslog openlog mlockall getgrnam setgid dnl
-              setgroups stat flock readv writev setsockopt getsockopt dnl
+              setgroups stat flock readv writev time dnl
               setsid chdir putenv getpeername unlink dnl
-              poll chsize ftruncate sendmsg recvmsg getsockname dnl
-              execve)
-AC_CACHE_SAVE
+              chsize ftruncate execve)
+
+# Windows use stdcall for winsock so we cannot auto detect these
+m4_define([SOCKET_FUNCS], [socket recv recvfrom send sendto listen dnl
+          accept connect bind select gethostbyname inet_ntoa])
+m4_define([SOCKET_OPT_FUNCS], [setsockopt getsockopt getsockname poll])
 
 if test "${WIN32}" = "yes"; then
 
        AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [We fake gettimeofday for win32 at otime.c])
+       m4_foreach([F], m4_split(SOCKET_FUNCS SOCKET_OPT_FUNCS),
+               m4_define(UF, [[m4_join([_], [HAVE], m4_toupper(F))]])
+               AC_DEFINE([UF], [1], [Win32 builtin]))
 
 else
 
@@ -489,10 +497,9 @@ else
 
        AC_CHECK_FUNCS(gettimeofday)
 
-       AC_CHECK_FUNCS(socket recv recvfrom send sendto listen dnl
-                      accept connect bind select gethostbyname dnl
-                      inet_ntoa time ctime memset vsnprintf strdup, [],
-                      [AC_MSG_ERROR([Required library function not found])])
+       AC_CHECK_FUNCS(SOCKET_FUNCS, ,
+              [AC_MSG_ERROR([Required library function not found])])
+       AC_CHECK_FUNCS(SOCKET_OPT_FUNCS sendmsg recvmsg)
 
 fi
 
index 3b78e2bdf1699c908d2f2fa6d9230d42b2df2d12..9406c7a538f3752ca01c07f111986a6e9f18682c 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "syshead.h"
 
-#ifdef WIN32
+#if defined(WIN32) && defined(USE_CRYPTO) && defined(USE_SSL)
 
 #include <openssl/ssl.h>
 #include <openssl/err.h>
index 358c0bce14be4a374f28793d4a47d6e0beabe574..e87814eecb7d598bcdd3f18a80808d1c94171148 100644 (file)
--- a/syshead.h
+++ b/syshead.h
 #define sleep(x) Sleep((x)*1000)
 #define random rand
 #define srandom srand
-
-/* MinGW autoconf workaround */
-
-#undef HAVE_SETSOCKOPT
-#define HAVE_SETSOCKOPT 1
-
-#undef HAVE_GETSOCKOPT
-#define HAVE_GETSOCKOPT 1
-
-#undef HAVE_POLL
-#define HAVE_POLL 1
-
 #endif
 
 #ifdef HAVE_SYS_TYPES_H