"/bin/link.exe", rename /bin/link.exe to something else so that the
Visual studio's linker is used.
+* For pthread support, install the library, dll and includes of pthreads-win32
+project from
+ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release to a
+directory (e.g.: C:/pthread).
+
* Get the Open vSwitch sources from either cloning the repo using git
or from a distribution tar ball.
% ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32 ..." \
--prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
- --sysconfdir="C:/openvswitch/etc"
+ --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread"
* Run make for the ported executables in the top source directory, e.g.:
if WIN32
AM_CPPFLAGS += -I $(top_srcdir)/include/windows
+AM_CPPFLAGS += $(PTHREAD_INCLUDES)
+AM_LDFLAGS += $(PTHREAD_LDFLAGS)
endif
AM_CPPFLAGS += $(SSL_INCLUDES)
-L*)
path=`echo "$1" | sed 's/-L//'`
- linkopt="$linkopt ${slash}LIBPATH:\"$path\""
+ linkopt="$linkopt ${slash}LIBPATH:$path"
cl_linkopt="${slash}link ${slash}LIBPATH:\"$path\""
;;
lib_LTLIBRARIES += lib/libopenvswitch.la
lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
+
+if WIN32
+lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
+endif
+
lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
lib_libopenvswitch_la_SOURCES = \
[WIN32=no])
AM_CONDITIONAL([WIN32], [test "$WIN32" = yes])
if test "$WIN32" = yes; then
+ AC_ARG_WITH([pthread],
+ [AS_HELP_STRING([--with-pthread=DIR],
+ [root of the pthread-win32 directory])],
+ [
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ AC_MSG_ERROR([Invalid --with-pthread value])
+ ;;
+ *)
+ PTHREAD_INCLUDES="-I$withval/include"
+ PTHREAD_LDFLAGS="-L$withval/lib/x86"
+ PTHREAD_LIBS="-lpthreadVC2"
+ AC_SUBST([PTHREAD_INCLUDES])
+ AC_SUBST([PTHREAD_LDFLAGS])
+ AC_SUBST([PTHREAD_LIBS])
+ ;;
+ esac
+ ], [
+ AC_MSG_ERROR([pthread directory not specified])
+ ]
+ )
AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.])
AH_BOTTOM([#ifdef WIN32
#include "include/windows/windefs.h"
ofproto_libofproto_la_CPPFLAGS = $(AM_CPPFLAGS)
ofproto_libofproto_la_CFLAGS = $(AM_CFLAGS)
ofproto_libofproto_la_LIBADD = lib/libsflow.la
+if WIN32
+ofproto_libofproto_la_LIBADD += ${PTHREAD_LIBS}
+endif
+
# Distribute this generated file in order not to require Python at
# build time if ofproto/ipfix.xml is not modified.