]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
* ipv6-0.4.16: fix mingw32 build
authorJuanJo Ciarlante <juanjosec@gmail.com>
Sun, 27 Mar 2011 21:41:22 +0000 (23:41 +0200)
committerJuanJo Ciarlante <juanjosec@gmail.com>
Sun, 27 Mar 2011 21:41:22 +0000 (23:41 +0200)
acinclude.m4
install-win32/makeopenvpn
options.c
socket.c

index 185907f9f876fe4f0fdd7ceeedb1dfd8341c6849..acfc01d9378fa51827bbbf7c1423991d3e70f4ed 100644 (file)
@@ -123,5 +123,9 @@ AC_DEFUN([TYPE_SOCKLEN_T],
       AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
                        [type to use in place of socklen_t if not defined])],
       [#include <sys/types.h>
-#include <sys/socket.h>])
+#ifdef WIN32
+#include <ws2tcpip.h>
+#else
+#include <sys/socket.h>
+#endif])
 ])
index 0f06a01662d593fba58088c6f9dac5a5896b9f34..ced2a5464ee920728a70383754a0a7932a88cc60 100755 (executable)
@@ -2,27 +2,34 @@
 
 H=`pwd`
 
-# get version.nsi definitions
-. autodefs/defs.sh
-
-[ -z "$CC" ] && CC=gcc
-LZO_INC_DIR=$H/$LZO_DIR/include
-LZO_LIB_DIR=$H/$LZO_DIR
-PKCS11_INC_DIR=$H/$PKCS11_HELPER_DIR/usr/local/include
-PKCS11_LIB_DIR=$H/$PKCS11_HELPER_DIR/usr/local/lib
-XAUTOCONF=""
-
 case "`uname -o 2>/dev/null`" in
-  *inux) 
+  *inux)
+
     # cross-compiling, make dude's life easier
-    XAUTOCONF="--host=i586-mingw32msvc --build=i386-linux"
+    XAUTOCONF="--host=i586-mingw32msvc --build=i386-linux $XAUTOCONF"
     export CC=i586-mingw32msvc-gcc
     export CXXCPP=i586-mingw32msvc-cpp
     export CXX=i586-mingw32msvc-g++
-    # when cross-compiling from src, you'll typically get:
-    LZO_LIB_DIR=$H/$LZO_DIR/src/.libs
-    PKCS11_INC_DIR=$H/$PKCS11_HELPER_DIR/include/pkcs11-helper-1.0/
-    PKCS11_LIB_DIR=$H/$PKCS11_HELPER_DIR/lib/.libs/
+    # this requires the human to setup these environ vars:
+    # OPENSSL_DIR LZO_DIR PKCS11_HELPER_DIR
+    OPENSSL_INC_DIR=$OPENSSL_DIR/include
+    OPENSSL_LIB_DIR=$OPENSSL_DIR/out
+    LZO_INC_DIR=$LZO_DIR/include
+    LZO_LIB_DIR=$LZO_DIR/src/.libs
+    PKCS11_INC_DIR=$PKCS11_HELPER_DIR/include/pkcs11-helper-1.0/
+    PKCS11_LIB_DIR=$PKCS11_HELPER_DIR/lib/.libs/
+    ;;
+  *)
+    # get version.nsi definitions
+    . autodefs/defs.sh
+    XAUTOCONF=""
+    # default configuration creates relative-path environ vars:
+    OPENSSL_INC_DIR=$H/$OPENSSL_DIR/include
+    OPENSSL_LIB_DIR=$H/$OPENSSL_DIR/out
+    LZO_INC_DIR=$H/$LZO_DIR/include
+    LZO_LIB_DIR=$H/$LZO_DIR
+    PKCS11_INC_DIR=$H/$PKCS11_HELPER_DIR/usr/local/include
+    PKCS11_LIB_DIR=$H/$PKCS11_HELPER_DIR/usr/local/lib
     ;;
 esac
 if $CC --version &>/dev/null && [ -d "$OPENSSL_DIR" ] && [ -d "$LZO_DIR" ] && [ -d "$PKCS11_HELPER_DIR" ]; then
@@ -34,23 +41,26 @@ if $CC --version &>/dev/null && [ -d "$OPENSSL_DIR" ] && [ -d "$LZO_DIR" ] && [
            --enable-strict \
            --prefix=$H/windest \
            MAN2HTML=true \
-           --with-ssl-headers=$H/$OPENSSL_DIR/include \
-           --with-ssl-lib=$H/$OPENSSL_DIR/out \
+           --with-ssl-headers=$OPENSSL_INC_DIR \
+           --with-ssl-lib=$OPENSSL_LIB_DIR \
            --with-lzo-headers=$LZO_INC_DIR \
            --with-lzo-lib=$LZO_LIB_DIR \
            --with-pkcs11-helper-headers=$PKCS11_INC_DIR \
-           --with-pkcs11-helper-lib=$PKCS11_LIB_DIR
+           --with-pkcs11-helper-lib=$PKCS11_LIB_DIR \
+           || exit 1
     fi
 
     make -j $MAKE_JOBS && make install
 
+    if [ -n "$GENOOUT" ];then
     # copy OpenVPN and service executables to GENOUT/bin
-    mkdir -p $GENOUT/bin &>/dev/null
-    cp windest/sbin/openvpn.exe $GENOUT/bin
-    cp windest/sbin/openvpnserv.exe $GENOUT/bin
-    if [ -z "$NO_STRIP" ]; then
-       strip $GENOUT/bin/openvpn.exe
-       strip $GENOUT/bin/openvpnserv.exe
+      mkdir -p $GENOUT/bin &>/dev/null
+      cp windest/sbin/openvpn.exe $GENOUT/bin
+      cp windest/sbin/openvpnserv.exe $GENOUT/bin
+      if [ -z "$NO_STRIP" ]; then
+       strip $GENOUT/bin/openvpn.exe
+       strip $GENOUT/bin/openvpnserv.exe
+      fi
     fi
 else
     echo DID NOT BUILD openvpn.exe and openvpnserv.exe because one or more of gcc, OPENSSL_DIR, LZO_DIR, or PKCS11_HELPER_DIR directories were missing
index ff65ca29059dc2a8ed47f41a5ba39c5135ed836c..174ea896e79b30b8681d2a7026dbc539edf0ed33 100644 (file)
--- a/options.c
+++ b/options.c
@@ -80,7 +80,7 @@ const char title_string[] =
 #ifdef ENABLE_EUREPHIA
   " [eurephia]"
 #endif
-#ifdef ENABLE_IP_PKTINFO
+#if ENABLE_IP_PKTINFO
   " [MH]"
 #endif
 #ifdef USE_PF_INET6
index 7cd6276914d768c77d5614e66d545d7a109b7c9b..1059d3add454de4d52fd3a4a4d60bfd30f6f0af5 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -2490,6 +2490,10 @@ print_link_socket_actual (const struct link_socket_actual *act, struct gc_arena
   return print_link_socket_actual_ex (act, ":", PS_SHOW_PORT|PS_SHOW_PKTINFO, gc);
 }
 
+#ifndef IF_NAMESIZE
+#define IF_NAMESIZE 16
+#endif
+
 const char *
 print_link_socket_actual_ex (const struct link_socket_actual *act,
                             const char *separator,