]> git.proxmox.com Git - ovs.git/blame - BUILD.Windows
ofp-util: Fix definition of OFPUTIL_P_OF13_UP.
[ovs.git] / BUILD.Windows
CommitLineData
1cc1e356
GS
1Open vSwitch support on Windows is a work in progress. This file describes
2the planned build system to compile Open vSwitch on Windows. Once the work
3is complete, this file will be replaced by a INSTALL.Windows file.
4
5Autoconf, Automake and Visual C++:
6---------------------------------
7Open vSwitch on Linux uses autoconf and automake for generating Makefiles.
8It will be useful to maintain the same build system while compiling on Windows
9too. One approach is to compile Open vSwitch in a MinGW environment that
10contains autoconf and automake utilities and then use Visual C++ as a compiler
11and linker.
12
13The following explains the steps in some detail.
14* Install Mingw on a Windows machine by following the instructions at:
15http://www.mingw.org/wiki/Getting_Started
16
17This should install mingw at C:\Mingw and msys at C:\Mingw\msys.
18Add "C:\MinGW\bin" and "C:\Mingw\msys\1.0\bin" to PATH environment variable
19of Windows.
20
21You can either use the MinGW installer or the command line utility 'mingw-get'
22to install both the base packages and additional packages like automake and
23autoconf(version 2.68).
24
25* Install the latest Python 2.x from python.org and verify that its path is
26part of Windows' PATH environment variable.
27
28* It is important to get the Visual Studio related environment variables and
29to have the $PATH inside the bash to point to the proper compiler and linker.
30One easy way to achieve this is to get into the "Developer Command prompt for
31visual studio" and through it enter into the bash shell available from msys.
32
57cfcebd
GS
33If after the above step, a 'which link' inside MSYS's bash says,
34"/bin/link.exe", rename /bin/link.exe to something else so that the
35Visual studio's linker is used.
36
94887cf4
GS
37* For pthread support, install the library, dll and includes of pthreads-win32
38project from
39ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release to a
40directory (e.g.: C:/pthread).
41
1cc1e356
GS
42* Get the Open vSwitch sources from either cloning the repo using git
43or from a distribution tar ball.
44
20bd44f8
GS
45* If you pulled the sources directly from an Open vSwitch Git tree,
46 run boot.sh in the top source directory:
47
48 % ./boot.sh
49
50* In the top source directory, configure the package by running the
51 configure script. You should provide some configure options to choose
52 the right compiler, linker, libraries, Open vSwitch component installation
53 directories, etc. For example,
54
61cdd287 55 % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32" \
20bd44f8 56 --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
94887cf4 57 --sysconfdir="C:/openvswitch/etc" --with-pthread="C:/pthread"
20bd44f8
GS
58
59* Run make for the ported executables in the top source directory, e.g.:
60
61cdd287
GS
61 % make lib/vswitch-idl.h lib/vtep-idl.h ofproto/ipfix-entities.def
62 % make ovsdb/ovsdb-server.exe ovsdb/ovsdb-tool.exe ovsdb/ovsdb-client.exe \
63 utilities/ovs-vsctl.exe utilities/ovs-ofctl.exe \
a085daef
GS
64 utilities/ovs-dpctl.exe vswitchd/ovs-vswitchd.exe \
65 utilities/ovs-appctl.exe
cf06c2e9
GS
66
67OpenSSL, Open vSwitch and Visual C++
68------------------------------------
69To get SSL support for Open vSwitch on Windows, do the following:
70
71* Install OpenSSL for Windows as suggested at
72http://www.openssl.org/related/binaries.html.
73The link as of this writing suggests to download it from
74http://slproweb.com/products/Win32OpenSSL.html and the latest version is
75"Win32 OpenSSL v1.0.1f".
76
77Note down the directory where OpenSSL is installed (e.g.: C:/OpenSSL-Win32).
78
79* While configuring the package, specify the OpenSSL directory path.
80For example,
81
82 % ./configure CC=./build-aux/cccl LD="`which link`" LIBS="-lws2_32 ..." \
83 --prefix="C:/openvswitch/usr" --localstatedir="C:/openvswitch/var" \
84 --sysconfdir="C:/openvswitch/etc" --enable-ssl \
85 --with-openssl="C:/OpenSSL-Win32"
86
87* Run make for the ported executables.