61f953c49705ff15904af6282459431ecfdc820f
[mupen64plus-pandora.git] / source / mupen64plus-core / tools / osx_build_instructions.txt
1 OSX build instructions (using OSX 10.8.3 and Xcode 4.6.2):
2
3 1. Install SDL framework
4    - go to http://www.libsdl.org/download-1.2.php
5      - download SDL-1.2.15.dmg
6    - Open the DMG and copy SDL.framework to /Library/Frameworks
7      - also, copy devel-lite to your desktop
8    - Build SDLMain.m_o:
9      - open terminal, cd ~/Desktop/devel-lite
10      - run: gcc -c -O3 -I./ -I/Library/Frameworks/SDL.framework/Headers -o SDLMain.m_o SDLMain.m
11 2. Install macports
12 3. Install the following ports (sudo port install <name>):
13    - bzip2
14    - freetype
15    - libpng
16    - libsamplerate
17    - speex
18    - zlib
19 4. Boost requires some special stuff. We must compile with clang and libc++.
20    - edit your /opt/local/etc/macports/macports.conf
21      - add to end: default_compiler     clang
22    - sudo port edit boost
23      - change this line:
24        write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags}\" ${compileflags} <linkflags>\"${configure.ldflags}\" : ;" 
25      - to this:
26        write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags} -std=c++11 -stdlib=libc++\" ${compileflags} <linkflags>\"${configure.ldflags} -stdlib=libc++\" : ;" 
27    - if you have boost already installed in macports, remove it:
28      - sudo port uninstall boost
29    - reinstall boost from source:
30      - sudo port -s install boost
31 5. Download the Mupen64Plus source code:
32    - Open terminal window, create build directory for Mupen64Plus
33    - Download and unpack the latest m64p_helper_scripts.tar.gz from: https://code.google.com/p/mupen64plus/wiki/CompilingFromHg
34    - run ./m64p_get.sh
35 6. Hack your ui-console makefile to build against SDLMain.m_o:
36    - edit source/mupen64plus-ui-console/projects/unix/Makefile
37      - change line:
38        CFLAGS += $(SDL_CFLAGS)
39      - to:
40        CFLAGS += $(SDL_CFLAGS) ~/devel-lite/SDLMain.m_o -framework Cocoa
41 7. Hack your m64p_build.sh script to build under OSX:
42    - change line:
43      "$MAKE" -C source/mupen64plus-${component}/projects/unix all $@
44    - to:
45       if [ "${component}" = "ui-console" ]; then
46           "$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3" LDFLAGS="-Wl,-rpath -Wl,@executable_path/../Frameworks"
47       else
48           "$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3"
49       fi
50 8. Build it
51    - copy osx_build_bundle.sh from source/mupen64plus-core/tools to current directory
52    - run ./osx_build_bundle.sh