From 3c36d2c5f75827f098a691dfcf534ab3b95d7bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 29 Nov 2011 10:19:15 +0100 Subject: INSTALL.md: Update build instructions for Lion --- INSTALL.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 8a3b71e4ec..50d1aec2c4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -674,6 +674,44 @@ test on). Universal binaries and 64bit binaries are mutually exclusive options. +Building a fast Erlang VM on Mac OS Lion +---------------------------------------- + +Starting with XCode 4.2, Apple no longer includes a "real" `gcc` +compiler (not based on the LLVM). Building with `llvm-gcc` or `clang` +will work, but the performance of the Erlang run-time system will not +be the best possible. + +Note that if you have `gcc-4.2` installed and included in `PATH` +(from a previous version of XCode), `configure` will automatically +make sure that `gcc-4.2` will be used to compile `beam_emu.c` +(the source file most in need of `gcc`). + +If you don't have `gcc-4.2.` and want to build a run-time system with +the best possible performance, do like this: + +Install XCode from the AppStore if it is not already installed. + +Install MacPorts (). Then: + + $ sudo port selfupdate + $ sudo port install gcc45 +universal + +If you want to build the `wx` application, get wxMac-2.8.12 +(`wxMac-2.8.12.tar.gz` from +) and build: + + $ arch_flags="-arch i386" ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --prefix=/usr/local --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6 --enable-unicode --with-opengl --disable-shared + $ make + $ sudo make install + +Build Erlang with the MacPorts GCC as the main compiler (using `clang` +for the Objective-C Cocoa code in the `wx` application): + + $ PATH=/usr/local/bin:$PATH CC=/opt/local/bin/gcc-mp-4.5 CXX=/opt/local/bin/g++-mp-4.5 ./configure --enable-m32-build make + $ sudo make install + + How to Build a Debug Enabled Erlang RunTime System -------------------------------------------------- -- cgit v1.2.3