Wine support tools
buildwine
buildwine.py
is a script to build Wine variants from source. It supports cross-compiler setups for
non-Intel architectures. Run with '--help' for usage.
By default, buildwine
always builds shared WoW64 Wine (32-bit and 64-bit), except when cross-compiling (non-Intel).
Note the following defaults:
- building of tests is disabled, enable it by passing
--enable-tests
to the script - integration of Wine-Mono is disabled when building from HEAD (no explicit
--version
), enable it by passing--enable-mscoree
to the script
The script maintains a specific top-level directory structure to separate sources and build artifacts for various variants and host/target architectures.
Sources:
custom-install-x86_64
custom-src
...
mainline-src
mainline-src-1.3.28
...
staging-patches
staging-patches-4.0
staging-src
staging-src-4.0
...
mainline-src-5.5
mainline-src-reference-gitmirror
Build directories:
custom-build-i686
custom-build-x86_64
...
mainline-build-1.3.28-i686
mainline-build-1.3.28-x86_64
...
mainline-build-aarch64
mainline-build-arm
...
mainline-build-i686
mainline-build-x86_64
...
staging-build-4.0-i686
staging-build-4.0-x86_64
...
staging-build-i686
staging-build-x86_64
Install directories:
custom-install-x86_64
...
mainline-install-1.3.28-x86_64
...
mainline-install-5.5-x86_64
mainline-install-aarch64
mainline-install-x86_64
...
staging-install-4.0-x86_64
staging-install-x86_64
Build Wine from current branch HEAD:
./buildwine.py
Build a specific Wine release:
./buildwine.py --version=5.5
Build Wine-Staging variant of a Wine release:
./buildwine.py --variant=staging --version=4.0
Build a custom variant, useful when doing Git bisect:
./buildwine.py --variant=custom
Build a range of Wine releases:
# build Wine 1.7.[51..53]
for i in 1.7.{51..53} ; do ./buildwine.py --version=$i --clean || break ; done
# build Wine 1.7.[40..49]
for i in `git -C mainline-src tag | sed -n 's/^wine-\(1.7.4[0-9]\)/\1/p' | \
sort -V` ; do ./buildwine.py --version=$i --clean || break ; done
To better diagnose/debug build failures, pass --jobs=1
to the script.
Missing development packages
See How to show missing development packages when building Wine from source.
Cross-compiling using LLVM MinGw toolchain
See project home page LLVM/Clang/LLD based mingw-w64 toolchain for overview.
Main benefits:
- Wine builtin modules cross-compiled to PE format (no ELF hybrids as with GCC)
- symbol information generated in PDB format which can be used with many Windows debugging tools
Tarballs are available from LLVM/Clang/LLD mingw-w64 release downloads.
Make sure it can be found in path by prepending the bin
directory from the unpacked tarball to the PATH
environment variable.
Cross-compiling using Poky SDK cross-toolchain
For more information on how to create Poky SDK cross-toolchains see meta-winedev: Yocto layer for Wine cross-development.
Wine currently doesn't build with Yocto/Poky SDK cross-toolchains due to following bugs:
Apply the patches.
After that, configure
needs to be updated. Since cross-compiling is done, a host-build for running wine tools must exist.
./buildwine.py --clean --force-autoconf
Install Poky SDK toolchain(s):
./build-$MACHINE/tmp/deploy/sdk/*-toolchain-*.sh -d sdk-install -y
Register the cross-toolchain in the shell environment.
For 64-bit ARM:
source sdk-install/environment-setup-aarch64*
For 32-bit ARM:
source sdk-install/environment-setup-armv7*
Build Wine for target arch.
./buildwine.py --cross-compile-prefix=$CROSS_COMPILE --disable-mingw --clean --force-autoconf
Links