build: Fix 'make deploy' for OSX
[bitcoinplatinum.git] / doc / build-windows.md
blobb6a047b9c380ba0a17c80d660b08ac1a1cc540f0
1 WINDOWS BUILD NOTES
2 ====================
4 Below are some notes on how to build Bitcoin Core for Windows.
6 Most developers use cross-compilation from Ubuntu to build executables for
7 Windows. This is also used to build the release binaries.
9 While there are potentially a number of ways to build on Windows (for example using msys / mingw-w64),
10 using the Windows Subsystem For Linux is the most straightforward. If you are building with
11 another method, please contribute the instructions here for others who are running versions
12 of Windows that are not compatible with the Windows Subsystem for Linux.
14 Compiling with Windows Subsystem For Linux
15 -------------------------------------------
17 With Windows 10, Microsoft has released a new feature named the [Windows
18 Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about). This
19 feature allows you to run a bash shell directly on Windows in an Ubuntu based
20 environment. Within this environment you can cross compile for Windows without
21 the need for a separate Linux VM or Server.
23 This feature is not supported in versions of Windows prior to Windows 10 or on Windows Server SKUs.
25 To get the bash shell, you must first activate the feature in Windows.
27 1. Turn on Developer Mode
28   * Open Settings -> Update and Security -> For developers
29   * Select the Developer Mode radio button
30   * Restart if necessary
31 2. Enable the Windows Subsystem for Linux feature
32   * From Start, search for "Turn Windows features on or off" (type 'turn')
33   * Select Windows Subsystem for Linux (beta)
34   * Click OK
35   * Restart if necessary
36 3. Complete Installation
37   * Open a cmd prompt and type "bash"
38   * Accept the license
39   * Create a new UNIX user account (this is a separate account from your Windows account)
41 After the bash shell is active, you can follow the instructions below for Windows 64-bit Cross-compilation.
43 Cross-compilation
44 -------------------
46 These steps can be performed on, for example, an Ubuntu VM. The depends system
47 will also work on other Linux distributions, however the commands for
48 installing the toolchain will be different.
50 First, install the general dependencies:
52     sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl
54 A host toolchain (`build-essential`) is necessary because some dependency
55 packages (such as `protobuf`) need to build host utilities that are used in the
56 build process.
58 ## Building for 64-bit Windows
60 To build executables for Windows 64-bit, install the following dependencies:
62     sudo apt-get install g++-mingw-w64-x86-64 mingw-w64-x86-64-dev
64 Then build using:
66     cd depends
67     make HOST=x86_64-w64-mingw32 -j4
68     cd ..
69     ./autogen.sh # not required when building from tarball
70     CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
71     make
73 ## Building for 32-bit Windows
75 To build executables for Windows 32-bit, install the following dependencies:
77     sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev 
79 Then build using:
81     cd depends
82     make HOST=i686-w64-mingw32 -j4
83     cd ..
84     ./autogen.sh # not required when building from tarball
85     CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/
86     make
88 ## Depends system
90 For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.
92 Installation
93 -------------
95 After building using the Windows subsystem it can be useful to copy the compiled
96 executables to a directory on the windows drive in the same directory structure
97 as they appear in the release `.zip` archive. This can be done in the following
98 way. This will install to `c:\workspace\bitcoin`, for example:
100     make install DESTDIR=/mnt/c/workspace/bitcoin