dash/doc/build-cross.md
MarcoFalke 39ff085409
Merge #13617: release: require macOS 10.10+
3828a79711 scripted-diff: prefer MAC_OSX over __APPLE__ (fanquake)
fa6e841e89 gui: remove macOS ProgressBar workaround (fanquake)
68c272527f gui: remove SubstituteFonts (fanquake)
6c6dbd8af5 doc: mention that macOS 10.10 is now required (fanquake)
84b0cfa8b6 release: bump minimum required macOS to 10.10 (fanquake)
26b15df99d depends: set OSX_MIN_VERSION to 10.10 (fanquake)

Pull request description:

  Closes #13362

  d99abfddb0c8f2111340a6127e77cc686e0043d8
  This workaround should no longer be required, as it should have only been in use when compiled with the 10.7 SDK, which we haven't been building with for a while now.

  5bc5ae30982a0f0f6a9804b05d99434af770c724
  The bugreport linked with this code is for an unrelated? issue, however from what I can tell the correct QTBUG is this one https://bugreports.qt.io/browse/QTBUG-20880. Reading though the discussion there, it seems that the way progress bars are animated changed in macOS 10.10.
  Qt was patched [here (5.5+)](https://codereview.qt-project.org/#/c/112379/):
  > Disable progress bar animations on 10.10 Yosemite and higher - the native style does not animate them any more. Keep the indeterminate progress bar animation.

  Given all of that, I don't think this is worth keeping around, as it would seem to only be useful in the case that a macOS user is compiling with a Qt < 5.5. That should be pretty unlikely, as we don't support downloaded Qt binaries, and brew currently provides [5.11.1](571b46213c/Formula/qt.rb).

Tree-SHA512: 4278cb30cc9bcb313e166129ecf032c808995f8b51a3123637c47860a0010ac88f86f82ec44792153b6b1e5cca595f25013b2eaeae80194647b9ce4f7eaf32c1
2020-12-18 01:14:34 +03:00

123 lines
4.3 KiB
Markdown

Cross-compiliation of Dash Core
===============================
Dash Core can be cross-compiled on Linux to all other supported host systems. This is done by changing
the `HOST` parameter when building the dependencies and then specifying another `--prefix` directory when building Dash.
The following instructions are only tested on Debian Stretch and Ubuntu Bionic.
MacOSX Cross-compilation
------------------------
Cross-compiling to MacOSX requires a few additional packages to be installed:
```bash
$ sudo apt-get install python3-setuptools libcap-dev zlib1g-dev libbz2-dev
```
Additionally, the Mac OSX SDK must be downloaded and extracted manually:
```bash
$ mkdir -p depends/sdk-sources
$ mkdir -p depends/SDKs
$ curl https://bitcoincore.org/depends-sources/sdks/MacOSX10.11.sdk.tar.gz -o depends/sdk-sources/MacOSX10.11.sdk.tar.gz
$ tar -C depends/SDKs -xf depends/sdk-sources/MacOSX10.11.sdk.tar.gz
```
When building the dependencies, as described in [build-generic](build-generic.md), use
```bash
$ make HOST=x86_64-apple-darwin14 -j4
```
When building Dash Core, use
```bash
$ ./configure --prefix=`pwd`/depends/x86_64-apple-darwin14
```
Windows 64bit Cross-compilation
-------------------------------
The steps below can be performed on Ubuntu (including in a VM) or WSL. The depends system
will also work on other Linux distributions, however the commands for
installing the toolchain will be different.
First, install the general dependencies:
sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git python3 cmake
A host toolchain (`build-essential`) is necessary because some dependency
packages need to build host utilities that are used in the build process.
See [dependencies.md](dependencies.md) for a complete overview.
If you want to build the windows installer with `make deploy` you need [NSIS](https://nsis.sourceforge.io/Main_Page):
sudo apt install nsis
Acquire the source in the usual way:
git clone https://github.com/dashpay/dash.git
cd dash
### Building for 64-bit Windows
The first step is to install the mingw-w64 cross-compilation tool chain:
sudo apt install g++-mingw-w64-x86-64
Ubuntu Bionic 18.04 <sup>[1](#footnote1)</sup>:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
Once the toolchain is installed the build steps are common:
Note that for WSL the Dash Core source path MUST be somewhere in the default mount file system, for
example /usr/src/dash, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
This means you cannot use a directory that is located directly on the host Windows file system to perform the build.
Build using:
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make
### Depends system
For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.
ARM-Linux Cross-compilation
-------------------
Cross-compiling to ARM-Linux requires a few additional packages to be installed:
```bash
$ sudo apt-get install g++-arm-linux-gnueabihf
```
When building the dependencies, as described in [build-generic](build-generic.md), use
```bash
$ make HOST=arm-linux-gnueabihf -j4
```
When building Dash Core, use
```bash
$ ./configure --prefix=`pwd`/depends/arm-linux-gnueabihf
```
Footnotes
---------
<a name="footnote1">1</a>: Starting from Ubuntu Xenial 16.04, both the 32 and 64 bit Mingw-w64 packages install two different
compiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more
efficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers
required to support win32 threads conflict with some of the classes in the C++11 standard library, in particular std::mutex.
It's not possible to build the Dash Core code using the win32 version of the Mingw-w64 cross compilers (at least not without
modifying headers in the Dash Core source code).