There is plenty of choice. You can use a package management system (MacPorts or Fink) or roll your own binary.
- Build Wine, the lightweight way
- Build Wine, the scripted way
- Wine hints and tips for source builds
- Build Wine, the Fink way
- Build Wine, the MacPorts way
- Build Wine git version, the MacPorts way
- How to build the Mac OS X Package from scratch
- Additional packages you might want
Note that since Xcode 3.x (as distributed with Leopard), a bug in the MacOS linker causes all 16 bit applications (incl. installers) to crash. If you have a Tiger system, use Xcode 2.x from your DVD. If you are a developer, you can obtain Xcode 2.x from Apple's Developer Connection (ADC). Or you may patch the Xcode 3.x linker source code per the instructions given in bug #14920. Otherwise use ./configure --disable-win16
As of Mac OS X 10.6 (Snow Leopard) the compiler compiles to 64-bit by default. This causes problems when attempting to compile the stable (1.0.1) release of Wine, but the newer (unstable) builds deal with this issue and is a lot easier to compile under Snow Leopard.
Build Wine, the lightweight way
Build with minimal fuss
In order to build/run Wine, you will need to have the following prerequisites installed on your Mac:
X11/XQuartz - If you are running Mac OS X 10.5 (Leopard) or newer, you can install X11 from your Mac OS X installation DVD by running the optional installs package. If you are running a version prior to Mac OS X 10.5, you will need to download and install XQuartz.
Xcode - Xcode is included on your Mac OS X installation DVD in the 'Optional Installs' folder. Either install the version that shipped with your operating system's DVD, or download the latest version from the Apple web site. If you do not wish to install the full Xcode suite, locate and install at least the GCC, CoreAudioSDK and X11SDK packages... (Notes for building with GCC 4.5 on Mac can be found here)
Download the Wine source. You need not install git (not part of Xcode) if you use a source tarball from ibiblio.org. However, we do recommend using git with Wine as you will be asked to perform RegressionTesting if you have an application that used to work and stopped working in a newer version.
You now have everything you need to build the Wine source code. Like thousands of other open source software packages, you should now run ./configure and make to build the code.
For native X11:
./configure --verbose --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib make
./configure --verbose --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib make
You may get errors related to 16 bit support, if so add --disable-win16 to the configure command line instruction.
Run ./wine winecfg and visit the audio tab to enable audio.
Build with all possible libraries
The above ./configure --verbose may report a dozen missing libraries.
configure: QuickTime 32-bit development files not found, video decoding won't be supported. configure: OpenCL 32-bit development files not found, OpenCL won't be supported. configure: libhal/libdbus 32-bit development files not found, no dynamic device support. configure: libgnutls 32-bit development files not found, no schannel support. configure: libsane 32-bit development files not found, scanners won't be supported. configure: libv4l 32-bit development files not found. configure: libgphoto2 32-bit development files not found, digital cameras won't be supported. configure: liblcms 32-bit development files not found, Color Management won't be supported. configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled configure: libcapi20 32-bit development files not found, ISDN won't be supported. configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported. configure: libtiff 32-bit development files not found, TIFF won't be supported. configure: WARNING: GetText 32-bit development files not found (or too old). Internationalization won't be fully supported. configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.
You can live without them, depending on your needs. If you need them (e.g. for printing, color management, or networking), consider using a package management system like Fink or MacPorts (see below). They ease installing and updating dozens or hundreds of libraries and packages. However, in order to build Wine, both Fink and MacPorts install many more packages (e.g. a complete X server among others?).
Neither hal nor dbus are needed on Mac OS as Wine uses the native volume management services. This message is gone since Wine-1.1.44.
libgnutls is unneeded, the MacOS Secure Transport API is used since Wine-1.3.16.
Gstreamer is unnecessary on MacOS, the QuickTime libraries should provide equivalent functionality. Install the QuickTimeSDK package from your Mac OS X installation DVD, the message will go away.
A missing JPEG library will cause several test failures, e.g. in olepicture.ok and gdiplus:image.ok
Installing Wine into /usr/local
After compiling the Wine source code, you can run Wine directly from the source code directory using the 'wine' shell script that is created. If you want to be able to run 'wine' from any directory, you can choose to install the necessary files into '/usr/local' by running:
sudo make install
You can later remove the files by running 'sudo make uninstall' from the directory containing the Wine source code
Build Wine, the scripted way
A scripted method for building and installing Wine on Mac OS X has been put together in order to simplify installation from source. A number of the additional packages described below are built as part of the Wine installation. This project is - as usual - not officially affiliated with Wine, and has its own issue tracker. If you encounter problems with the build script, please do not send a message to the Wine user or developer mailing lists; instead, access the project directly at http://code.google.com/p/osxwinebuilder/ and file a bug report with the developer there.
This method installs a Wine built from source code into the the user's home directory into the ~/wine directory hierarchy. As such, no system-level directories should be touched, nor should administrator access be needed.
Wine hints and tips for source builds
When installing Wine from source on Mac OS X, a user may need to set a few environment variables in their terminal/shell session.
Depending on your system configuration you may have to set the DYLD_FALLBACK_LIBRARY_PATH environment variable to tell Wine where to find the X11 OpenGL library files, or the Xfnt libraries along with its own library files. Therefore, in practice, running Wine on Mac OS X might require a command such as the following:
DYLD_FALLBACK_LIBRARY_PATH="/usr/X11/lib:/usr/lib" wine program_name.exe
A patch to insert DYLD_FALLBACK_LIBRARY_PATH into tools/winewrapper was rejected 2009-07.
An alternative method is to create symlinks to the required libraries in /usr/local. DYLD_FALLBACK_LIBRARY_PATH seems to be similar to similarly named PATHS in other UNIX implementations, and thus will ensure that libraries not located in the installation directory are found if their location is included in the environment variable path. Using the 'export' technique is the more comprehensive technique, but a discussion on alternatives using symlinks takes place on the forums at Installing Wine on Mac OSX 10.5 Leopard. This discussion includes the shell syntax to link the xfree libraries into /usr/local. You should place the export statement somewhere in the execution path such as .profile, .bash_profile, .bashrc or some wrapper of your own.
MacPorts and Fink may have their own workarounds for the DYLD_FALLBACK_LIBRARY_PATH issue.
Build Wine, the Fink way
Fink is a source code repository. Thus installing is like building Wine from scratch, except that Fink downloads, compiles and installs all dependent libraries and manages paths for you. Its packaging system is based on Debian's dpkg and apt.
The Fink package description shows which release is current in Fink's package management. If this is not the most recent Wine release, you should nevertheless be able to apply this description to build the most recent release yourself.
When Fink is installed on your system, you can query its list of packages:
$ fink list wine Information about 11789 packages read in 36 seconds. wine 1.3.21-1 Microsoft Windows compatibility layer wine-dev 1.3.21-1 Microsoft Windows compatibility layer wine-stable 1.2.2-1 Microsoft Windows compatibility layer wine-stable-dev 1.2.2-1 Microsoft Windows compatibility layer winefish 1.3.3-1005 LaTeX-oriented text editor winetricks 20100921-1 Install redistributable runtime tools in Wine
Build Wine, the MacPorts way
MacPorts is a source code repository. Thus installing is like building Wine from scratch, except that MacPorts downloads, compiles and installs all dependent libraries and manages paths for you. MacPorts also hosts the XQuartz server source, so it makes it easy for you to build the most up to date combination of XQuartz and Wine.
The MacPorts wine-devel package description shows which release is current in MacPorts' package management. If this does not correspond to the most recent Wine release, you should still be able to apply this description to build the most recent release yourself.
When MacPorts is installed on your system, you can see what version of Wine is current supported using the search command:
$ port search wine mystonline-wine @2010 (games, x11) Myst Online: URU Live Again wine @1.4.1 (x11) Wine Is Not an Emulator wine-crossover @11.2.0 (x11) Wine Is Not an Emulator (1.4.1 with CodeWeavers modifications for CrossOver) wine-crossover-games @11.0.3 (x11) this port is only a stub and has been made obsolete by wine-crossover wine-devel @1.5.11 (x11) Wine Is Not an Emulator winetricks @20120819 (x11) downloads and installs various redistributable runtime libraries Found 6 ports.
You should install wine-devel, which tracks the "unstable" branch, because a) the stable one is rapidly outdated and b) developers prefer you report bugs about their most current release than the one produced month ago. For several months AppDB did not let you submit test results about the stable branch because it was considered outdated and thus uninteresting (for developers).
Build Wine git version, the MacPorts way
This has the advantage of pulling in the dependencies Wine needs via MacPorts (tested 2013-08 on Lion). Use MacPorts to install git and Wine development version:
sudo port install apple-gcc42 git-core wine-devel
Use the following command to configure and build Wine with MacPorts libraries and OpenGL:
./configure CC="gcc-apple-4.2" CPPFLAGS='-I/usr/X11/include -I/opt/local/include' LIBS='-lGL -lGLU' LDFLAGS='-L/usr/X11/lib -L/opt/local/lib' make && sudo make install
Note that the default compiler is llvm-gcc, which won't work for wine. Clang can compile wine, but it miscompiles winemac.drv (and potentially other stuff). gcc-apple-4.2 is known to work.
Finally, be sure make your ~/.profile look similar to the following, making sure to modify the path set up by MacPorts to point to your wine git install, as well as to dynamically link to the proper libraries upon Wine execution:
# MacPorts Installer addition on 2011-02-18_at_11:29:25: adding an appropriate PATH variable for use with MacPorts. export PATH="$PATH:/opt/local/bin:/opt/local/sbin" # Finished adapting your PATH environment variable for use with MacPorts. export DYLD_FALLBACK_LIBRARY_PATH="/usr/X11/lib:/usr/lib:/opt/local/lib"
How to build the Mac OS X Package from scratch
See Compile Wine
Additional packages you might want
Both MacPorts and Fink will download all of these (and many more) and not let you build without them.
* Fontforge: http://fontforge.sourceforge.net/
* FreeType: http://freetype.org/
* LibJPEG: http://www.ijg.org/
* LibTIFF: http://remotesensing.org/libtiff/
* LibXML2: http://xmlsoft.org/
* LibXSLT: http://xmlsoft.org/xslt/
Add --enable-maintainer-mode or --verbose to your ./configure line to see a full list of packages that Mac OS X does not provide but Wine may possibly need.
Note: You can disable winemac.drv by passing --disable-winemac.drv to ./configure