Skip to content

Instantly share code, notes, and snippets.

@sarimarton
Forked from Alex4386/crossover-howtocompile.md
Last active November 12, 2024 01:25
Show Gist options
  • Save sarimarton/471e9ff8046cc746f6ecb8340f942647 to your computer and use it in GitHub Desktop.
Save sarimarton/471e9ff8046cc746f6ecb8340f942647 to your computer and use it in GitHub Desktop.
CodeWeavers CrossOver - How to compile from source! for macOS

UPDATE 2023-01-22 21:34:33

This guide was last tested on an Intel MacBook 2017. Since then it's unmaintained and won't be updated (I quit the game and bought a life-time crossover licence).


This has been forked from https://gist.github.com/Alex4386/4cce275760367e9f5e90e2553d655309

For the latest discussion, see the comments there.

Updated guide (for CrossOver 20.0.0)

  • Install dependencies: Xcode developer tools (Command Line); cmake; gcc or clang to compile C code; bison >= 3.0 (can be upgraded via homebrew); xquartz; flex; mingw-w64; pkgconfig; you might also need freetype with brew install freetype
  • Make sure the right version of bison is in path: brew upgrade bison then check version and cd /usr/local/Cellar/bison/<version>/bin and export PATH="$(pwd):$PATH" then check with which bison
  • Download source (CodeWeavers CrossOver FOSS version Source) and extract it (double click the file in Finder or untar it: tar -xz source.tar.gz)
  • Add missing wine/include/distversion.h file with this content:
/* ---------------------------------------------------------------
*   distversion.c
*
* Copyright 2013, CodeWeavers, Inc.
*
* Information from DISTVERSION which needs to find
* its way into the wine tree.
* --------------------------------------------------------------- */

#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine. You may want to check <a href=\"http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/</a> for tips about running this application."

#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the \"Save As\" button, then <a href=\"http://www.codeweavers.com/support/tickets/enter/\">file a bug report</a> and attach that file to the report."
  • Create this script and run:
## TESTED WITH CROSSOVER 20.0.0
## https://www.codeweavers.com/crossover/source
## https://media.codeweavers.com/pub/crossover/source/crossover-sources-20.0.0.tar.gz

echo Compiling LLVM...

cd clang/llvm
mkdir build
cd build
cmake ../
make
cd bin
export PATH="$(pwd):$PATH"
cd ../../../..

echo LLVM Compile done

echo Compiling Clang...

cd clang/clang
mkdir build
cd build
cmake ../
make
cd bin
export PATH="$(pwd):$PATH"
cd ../../../..

echo CLang compile done

echo Compiling Wine...

cd wine
export PATH="$(pwd):$PATH"
export MACOSX_DEPLOYMENT_TARGET=10.14

CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms

make

Original guide below

How to compile codeweavers crossover from source

If you are lazy enough, or you are really fan of Wine project.
How about supporting wine development by supporting Crossover.
They claim that they support the WineHQ project, and it seems they do so. (shrug) WineGitRepoSearch

Installing Dependencies

To install, you need following dependencies to be installed on your Mac machine.

  • Xcode developer tools (Command Line)
  • cmake
  • gcc or clang to compile c codes.
  • bison >= 3.0 (can be upgraded via homebrew) (@sarimarton: after installing a newer version via brew, it doesn't switch the default one to that newer version automatically. An additional command is needed for the system to see the newer version: export PATH=/usr/local/Cellar/bison/<version>/bin:$PATH)
  • xquartz
  • flex
  • mingw-w64
  • pkgconfig

(If more dependencies are found, the list will be updated)

Getting the Source

Go to CodeWeavers CrossOver FOSS version Source and download the source.

This guide is strictly for Compiling on Mac. use command tar -xz whatever_the_filename_is.tar.gz to untar it.

Compiling LLVM

Go to llvm directory and create build directory with command mkdir build.

cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take a long time... Take your time and have a break.
(Build Time: 1h 25m 45s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Clang

Go to clang directory and create build directory with command mkdir build. (PATH setup from llvm required!!)

cd build to go there and run cmake ../ to configure build directory.
When cmake is done, you can run make to compile.
This will take some time... Take your time and have a break.
(Build Time: 34m 36s on 2018 Macbook Pro with intel Core i9 Processor)
now cd bin and add binaries to PATH via export PATH="$(pwd):$PATH".

Compiling Wine

(@sarimarton: cd /wine before compiling Wine)

(@sarimarton: Add file wine/include/distversion.h with the content given below in the notes)

The custom build of wine by codeweavers have special flag called --enable-win32on64.
Use that to when you setup with ./configure.

Use command CC="clang" CXX="clang++" ./configure --enable-win32on64 (@sarimarton: Use this command instead (see notes below): CC="clang" CXX="clang++" MACOSX_DEPLOYMENT_TARGET=10.14 ./configure --enable-win32on64 -disable-winedbg --without-x --without-vulkan --disable-mscms Then compile with make

Notes

The compile without the insertions will fail with these errors:

  • missing file distversion.h:
programs/winedbg/resource.h:23: error: distversion.h: No such file or directory
programs/winedbg/crashdlg.c:31: note: resource.h was first included here
config.status: error: could not create Makefile

Solution:

@sarimarton I'm the maintainer of wine in MacPorts. I reported the missing distversion.h to CodeWeavers back in 2013 and reminded them of it in 2018. I guess they're never going to add it. But they provided its contents to me; it's here, in patch form:

https://github.com/macports/macports-ports/blob/master/x11/wine-crossover/files/patch-include-distversion.h.diff

Content of the file:

/* ---------------------------------------------------------------
*   distversion.c
*
* Copyright 2013, CodeWeavers, Inc.
*
* Information from DISTVERSION which needs to find
* its way into the wine tree.
* --------------------------------------------------------------- */

#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine. You may want to check <a href=\"http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/</a> for tips about running this application."

#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the \"Save As\" button, then <a href=\"http://www.codeweavers.com/support/tickets/enter/\">file a bug report</a> and attach that file to the report."
@dinosauria123
Copy link

dinosauria123 commented Mar 28, 2024

I am able to compile CrossOver FOSS (24.0.1) on Linux (Ubuntu 23.10).
Get CrossOver FOSS code and Go to source directory and execute commands below.

sudo dpkg --add-architecture i386
sudo apt install make libc6-dev-i386 flex bison g++-mingw-w64-i686 g++-mingw-w64-x86-64 libx11-dev libfreetype-dev libfontconfig1-dev
nano wine/include/distversion.h

#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine. You may want to check <a href="http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/ for tips about running this application."

#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the "Save As" button, then <a href="http://www.codeweavers.com/support/tickets/enter/\">file a bug report and attach that file to the report."

cp wine/include/distversion.h wine/programs/winedbg/
cd wine
./configure --enable-archs=i386,x86_64
make -j4

sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment