Skip to content

Commit cc6a4c9

Browse files
authored
Merge pull request dogecoin#3846 from nformant1/docs
Update format build-windows.md
2 parents d7cc7f8 + 850eabe commit cc6a4c9

1 file changed

Lines changed: 59 additions & 58 deletions

File tree

doc/build-windows.md

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ will also work on other Linux distributions, however the commands for
5353
installing the toolchain will be different.
5454

5555
Install the general dependencies. First, ensure your system is updated and has the latest security patches.
56-
57-
sudo apt update
58-
sudo apt upgrade
59-
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
60-
56+
```bash
57+
sudo apt update
58+
sudo apt upgrade
59+
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
60+
```
6161
A host toolchain (`build-essential`) is necessary because some dependency
6262
packages (such as `protobuf`) need to build host utilities that are used in the
6363
build process.
@@ -69,29 +69,29 @@ a zip file. (Look at the green "<> Code" button on [the Dogecoin GitHub reposito
6969

7070
Make sure this code is available in your Ubuntu directory. If you've unzipped a single downloaded file, you may need to change
7171
the permissions of all extracted files with command like:
72-
73-
sudo chmod -R <your_username> .
74-
72+
```bash
73+
sudo chmod -R <your_username> .
74+
```
7575
If you've downloaded via `git`, do not use `sudo`. Instead prefer something like:
76-
77-
cd $HOME
78-
git clone https://github.com/dogecoin/dogecoin.git
79-
git checkout <branchname>
80-
76+
```bash
77+
cd $HOME
78+
git clone https://github.com/dogecoin/dogecoin.git
79+
git checkout <branchname>
80+
```
8181
... where `<branchname>` is the name of the branch you want to build, such as
8282
"1.14.7-dev" for the unstable branch or "master" for the most recent stable
8383
release.
8484

8585
## Building for 64-bit Windows
8686

8787
To build executables for Windows 64-bit, install the following dependencies:
88-
89-
sudo apt-get install g++-mingw-w64-x86-64
90-
88+
```bash
89+
sudo apt-get install g++-mingw-w64-x86-64
90+
```
9191
For Ubuntu 20.04, set the default mingw32 g++ compiler option to posix:
92-
93-
sudo update-alternatives --config x86_64-w64-mingw32-g++
94-
92+
```bash
93+
sudo update-alternatives --config x86_64-w64-mingw32-g++
94+
```
9595
...Choose the "posix" (vs 'auto' or 'win32') option, and continue.
9696

9797
Note that for WSL v1 the Dogecoin Core source path MUST be somewhere in the default mount file system, for
@@ -101,33 +101,33 @@ If this is not the case the dependency autoconf scripts will fail (silently.)
101101
This means you cannot use a directory that is located directly on the host Windows file system to perform the build.
102102

103103
To identify your version of WSL, run the command:
104-
105-
wsl -l -v
106-
104+
```powershell
105+
wsl -l -v
106+
```
107107
If using WSL 1, you'll need to turn off WSL Support for Win32 applications temporarily, or you will get ABI errors and format errors for some .o files.
108108

109109
If using WSL 1 then build using:
110-
111-
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
112-
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Temporarily Disable WSL support for Win32 applications.
113-
cd depends
114-
make HOST=x86_64-w64-mingw32
115-
cd ..
116-
./autogen.sh # not required when building from release tarball
117-
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
118-
make
119-
sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status" # Re-Enable WSL support for Win32 applications.
120-
110+
```bash
111+
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
112+
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Temporarily Disable WSL support for Win32 applications.
113+
cd depends
114+
make HOST=x86_64-w64-mingw32
115+
cd ..
116+
./autogen.sh # not required when building from release tarball
117+
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
118+
make
119+
sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status" # Re-Enable WSL support for Win32 applications.
120+
```
121121
If using WSL 2 then you should be able to build just with:
122-
123-
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
124-
cd depends
125-
make HOST=x86_64-w64-mingw32
126-
cd ..
127-
./autogen.sh # not required when building from release tarball
128-
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
129-
make
130-
122+
```bash
123+
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
124+
cd depends
125+
make HOST=x86_64-w64-mingw32
126+
cd ..
127+
./autogen.sh # not required when building from release tarball
128+
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
129+
make
130+
```
131131
In either case, be aware that if the first `make` invocation fails, you will see further errors during the `./configure` and second `make` stages. Please
132132
report any errors with this in mind.
133133

@@ -136,22 +136,22 @@ Also be careful using the `-j` flag with any `make` command. People have reporte
136136
## Building for 32-bit Windows
137137

138138
To build executables for Windows 32-bit, install the following dependencies:
139-
140-
sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
141-
139+
```bash
140+
sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
141+
```
142142
Ensure that this toolchain can build for `posix` (else you may have compilation errors for Dogecoin's dependencies):
143-
144-
sudo update-alternatives --config i686-w64-mingw32-g++
145-
143+
```bash
144+
sudo update-alternatives --config i686-w64-mingw32-g++
145+
```
146146
Choose the `posix` option (instead of `auto` or `win32`), and continue. Then build using:
147-
148-
cd depends
149-
make HOST=i686-w64-mingw32
150-
cd ..
151-
./autogen.sh # not required when building from tarball
152-
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/
153-
make
154-
147+
```bash
148+
cd depends
149+
make HOST=i686-w64-mingw32
150+
cd ..
151+
./autogen.sh # not required when building from tarball
152+
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/
153+
make
154+
```
155155
## Depends system
156156

157157
For further documentation on the depends system see [README.md](../depends/README.md) in the `depends/` directory.
@@ -163,5 +163,6 @@ After building using the Windows subsystem it can be useful to copy the compiled
163163
executables to a directory on the windows drive in the same directory structure
164164
as they appear in the release `.zip` archive. This can be done in the following
165165
way. This will install to `c:\workspace\dogecoin`, for example:
166-
167-
make install DESTDIR=/mnt/c/workspace/dogecoin
166+
```bash
167+
make install DESTDIR=/mnt/c/workspace/dogecoin
168+
```

0 commit comments

Comments
 (0)