Skip to content

Commit

Permalink
configure: Identify OpenSSL libraries in Windows.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Jan 31, 2014
1 parent b1705c5 commit cf06c2e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
22 changes: 22 additions & 0 deletions BUILD.Windows
Original file line number Diff line number Diff line change
Expand Up @@ -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 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"

* Run make for the ported executables.
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = datapath

AM_CPPFLAGS = $(SSL_CFLAGS)
AM_LDFLAGS = $(SSL_LDFLAGS)

if WIN32
AM_CPPFLAGS += -I $(top_srcdir)/include/windows
endif

AM_CPPFLAGS += $(SSL_INCLUDES)

AM_CPPFLAGS += -I $(top_srcdir)/include
AM_CPPFLAGS += -I $(top_srcdir)/lib
AM_CPPFLAGS += -I $(top_builddir)/lib
Expand Down
9 changes: 7 additions & 2 deletions m4/ax_check_openssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit cf06c2e

Please sign in to comment.