[ovs-dev] [PATCH 4/4] configure: Identify OpenSSL libraries in Windows.

Gurucharan Shetty shettyg at nicira.com
Fri Jan 31 00:12:11 UTC 2014


Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 BUILD.Windows          |   22 ++++++++++++++++++++++
 Makefile.am            |    1 +
 m4/ax_check_openssl.m4 |    9 +++++++--
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/BUILD.Windows b/BUILD.Windows
index 45a3c0a..f00a722 100644
--- a/BUILD.Windows
+++ b/BUILD.Windows
@@ -54,3 +54,25 @@ or from a distribution tar ball.
 * Run make for the ported executables in the top source directory, e.g.:
 
   % make utilities/ovs-vsctl.exe ovsdb/ovsdb-server.exe
+
+OpenSSL, Open vSwitch and Visual C++
+------------------------------------
+To get SSL support for Open vSwitch on Windows, do the following:
+
+* Install OpenSSL for Windows as suggested at
+http://www.openssl.org/related/binaries.html.
+The link as of this writing suggests to download it from
+http://slproweb.com/products/Win32OpenSSL.html and the latest version is
+"Win32 OpenSSL v1.0.1f".
+
+Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32).
+
+* While configuring the package, specify the OpenSSL directory and its library
+path. For example,
+
+  % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32 ..." \
+  --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
+  --sysconfdir="C:/openvswitch/etc" --enable-ssl \
+  --with-openssl="C:/OpenSSL-Win32" LDFLAGS="-LC:/OpenSSL-Win32/lib"
+
+* Run make for the ported executables.
diff --git a/Makefile.am b/Makefile.am
index 32775cc..b0d860d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,7 @@ AM_CPPFLAGS = $(SSL_CFLAGS)
 
 if WIN32
 AM_CPPFLAGS += -I $(top_srcdir)/include/windows
+AM_CPPFLAGS += $(SSL_INCLUDES)
 endif
 
 AM_CPPFLAGS += -I $(top_srcdir)/include
diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4
index 2d543e6..7846fb0 100644
--- a/m4/ax_check_openssl.m4
+++ b/m4/ax_check_openssl.m4
@@ -79,7 +79,11 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
             if test -f "$ssldir/include/openssl/ssl.h"; then
                 SSL_INCLUDES="-I$ssldir/include"
                 SSL_LDFLAGS="-L$ssldir/lib"
-                SSL_LIBS="-lssl -lcrypto"
+                if test "$WIN32" = "yes"; then
+                    SSL_LIBS="-lssleay32 -llibeay32"
+                else
+                    SSL_LIBS="-lssl -lcrypto"
+                fi
                 found=true
                 AC_MSG_RESULT([yes])
                 break
@@ -106,7 +110,8 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
     LIBS="$SSL_LIBS $LIBS"
     CPPFLAGS="$SSL_INCLUDES $CPPFLAGS"
     AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
+        [AC_LANG_PROGRAM([#include <openssl/ssl.h>],
+            [SSL_CTX *ctx=NULL;SSL_new(ctx)])],
         [
             AC_MSG_RESULT([yes])
             $1
-- 
1.7.9.5




More information about the dev mailing list