Merge pull request #2167 from ulion/ios_event_pump_in_order_fix
[vuplus_xbmc] / docs / README.osx
1 TOC
2 1. Introduction
3 2. Getting the source code
4 3. Install required libs
5   3.1. Install Xcode
6   3.2. Install XBMC build depends
7 4. How to compile and run
8         4.1 Using XCode
9         4.2 Using Command line
10 5. Packaging
11
12 -----------------------------------------------------------------------------
13 1. Introduction
14 -----------------------------------------------------------------------------
15
16 This is a platform port of XBMC for the Apple OSX operating system. 10.6, 10.7
17 and 10.8 Intel development platforms are supported. Xcode 3.2.6 and 4.3 and newer
18 are the recommended versions.
19 There are 3 ways to build XBMC for Mac, from command-line with make, from command-line
20 using xcodebuild or from Xcode.
21
22 Generally, Xcode is the easiest as it presents the build system in a GUI environment.
23 The command-line build is still under development.
24
25 XBMC for Mac is composed of a main binary with numerous dynamic libraries and
26 codecs that support a multitude of music and video formats.
27
28 On Snow Leopard (OSX 10.6.x) we recommend using Xcode 3.2.6.
29 On Lion (OSX 10.7.x) we recommend using Xcode 4.3.x.
30 On Mountain Lion (OSX 10.8.1) we recommend using Xcode 4.4.
31
32 NOTE TO NEW OS X USERS: All lines that are prefixed with the '$' character are
33 commands that need to be typed into a Terminal window. Note that the '$'
34 character itself should NOT be typed as part of the command.
35
36 ATTENTION: When using Mountain Lion (OSX 10.8.x) you need to download and install
37 XQuartz from https://xquartz.macosforge.org/landing/ since its not part of OSX
38 anymore.
39
40 -----------------------------------------------------------------------------
41 2. Getting the source code
42 -----------------------------------------------------------------------------
43
44  $ cd $HOME
45  $ git clone git://github.com/xbmc/xbmc.git xbmc
46
47 -----------------------------------------------------------------------------
48 3.0 Install XCODE
49 -----------------------------------------------------------------------------
50 Install latest Xcode (4.3.2 or 3.2.6 as of the writing). You can download it from 
51
52 1. Apple's site after registration at http://developer.apple.com/tools/download (Xcode 3.2.6)
53 2. In the MacOSX AppStore (Xcode 4.3.x). 
54
55 If you are using XCode 4.3.x or later you also need to install the "Command Line Tools". To do so
56 after installing Xcode you have to go to "Xcode->Preferences->Downloads" and install the
57 package "Command Line Tools".
58
59 Xcode 3.2.6 only runs on 10.6.x (Snow Leopard). 
60 Xcode 4.3.x only runs on 10.7.x (Lion).
61 Xcode 4.4 only runs on 10.8.x (Mountain Lion).
62
63 -----------------------------------------------------------------------------
64 3.1 Install XBMC build depends
65 -----------------------------------------------------------------------------
66
67 3.1.1 Compiling as 32 Bit binary
68  $ cd $HOME/XBMC
69  $ cd tools/darwin/depends
70  $ ./bootstrap
71  $ ./configure --with-darwin=osx
72  $ make
73
74 3.1.2 Compiling as 64 Bit binary
75  $ cd $HOME/XBMC
76  $ cd tools/darwin/depends
77  $ ./bootstrap
78  $ ./configure --with-darwin=osx --with-arch=x86_64
79  $ make
80
81 -----------------------------------------------------------------------------
82 4. How to compile
83 -----------------------------------------------------------------------------
84 Both Xcode and Terminal compilation require that build environment be setup
85 first. This is a simple step and involves the following:
86
87 4.a Compilation by using command-line building via xcodebuild or
88     by compiling via Xcode GUI
89
90  $ cd $HOME/XBMC
91  $ make -C tools/darwin/depends/xbmc
92  $ make clean
93  $ make xcode_depends
94  $ make -C lib/addons/script.module.pil
95
96 4.b Compilation by using command-line building via make (experimental)
97
98  $ cd $HOME/XBMC
99  $ make -C tools/darwin/depends/xbmc
100  $ make clean
101
102 The configure operation will setup the build environment for codecs and
103 internal libraries that are used by XBMC. This step is required for both Xcode
104 and command-line building. The "make clean" ensures that there are no stale
105 binaries from git that might cause problems.
106
107 -----------------------------------------------------------------------------
108 4.1 Using Xcode
109 -----------------------------------------------------------------------------
110 Start XCode and open the XBMC project (XBMC.xcodeproj) located in $HOME/XBMC.
111 For development, XBMC is run from the $HOME/XBMC directory and needs to have
112 the XBMC_HOME environment variable set to know where that directory is located.
113 To set XBMC_HOME environment variable:
114
115 Xcode 3.2.6
116  Menu -> Project -> Edit Active Executable "XBMC", click "Arguments" tab and
117  add "XBMC_HOME" as an enviroment variable. Set the value to the path to the
118  XBMC root folder. For example, "/Users/bigdog/Documents/XBMC"
119
120 Xcode 4.3.x and later
121  Menu -> Product -> Edit Sheme -> "Run XBMC"/"Debug" -> Add XBMC_HOME into 
122  the List of "Environment Variables".Set the value to the path to thev XBMC 
123  root folder. For example, "/Users/bigdog/Documents/XBMC"       
124
125 There are two build targets "XBMC" and "XBMC.app" (each in 32Bit and 64Bit flavour) 
126 with debug and release settings. The "XBMC" target is used for rapid build and 
127 debug cycles while the "XBMC.app" target is used to build a self contained 
128 OSX application.
129
130 Set the build target to "XBMC" or "XBMC.app" and be sure to select the same 
131 architecture as selected in step 3.1 (either i386 for 32Bit or x86_64 for 64Bit), 
132 then build. 
133
134 The build process will take a long time when building the first time. 
135 You can see the progress in "Build Results". There are a large number of static 
136 and dynamic libaries that will need to be built. Once these are built, 
137 subsequent builds will be faster.
138
139 After the build, you can ether run XBMC for Mac from Xcode or run it from
140 the command-line. If you run it from the command-line, make sure your set
141 the XBMC_HOME environment variable (export XBMC_HOME=$HOME/XBMC). Then, to
142 run the debug version:
143
144 $ ./build/Debug/XBMC
145
146 Or the release version:
147
148 $ ./build/Release/XBMC
149
150 You can also build via Xcode from the command-line using the following:
151
152 $ xcodebuild -configuration Release ONLY_ACTIVE_ARCH=YES ARCHS=i386 VALID_ARCHS=i386 \
153   -target "XBMC.app" -project XBMC.xcodeproj
154
155 You can specify "Release" instead of "Debug" as a configuration. Be sure to set *_ARCHS
156 variables to the same architecture as selected in step 3.1 (either i386 for 32Bit or x86_64 
157 for 64Bit).
158
159 -----------------------------------------------------------------------------
160 4.2 Using Terminal (command-line) (this is a work in progress and might fail)
161 -----------------------------------------------------------------------------
162 There are two methods, a) make/Xcode and b) make (which might fail as it's under
163 construction).
164
165 If you want to build a cross-compiled version that can run under 10.6/10.7, 
166 you could try xcodebuild from the command-line (normally unneeded - for advanced
167 developers).
168
169  a)
170  $ cd $HOME/XBMC
171  $ export XBMC_HOME=`pwd`
172  $ make xcode_depends
173  $ make -C lib/addons/script.module.pil
174  $ xcodebuild -sdk macosx10.7 -project XBMC.xcodeproj -target XBMC.app ONLY_ACTIVE_ARCH=YES \
175    ARCHS=x86_64 VALID_ARCHS=x86_64  -configuration Release build
176
177  b) building via make
178  $ cd $HOME/XBMC
179  $ export XBMC_HOME=`pwd`
180  $ make
181  $ ./xbmc.bin
182
183 -----------------------------------------------------------------------------
184 5. Packaging
185 -----------------------------------------------------------------------------
186 This section describes how to package XBMC in a disk image for
187 distribution.
188
189   1. build XBMC.app from XCode so that the application bundle is correctly updated.
190
191   2. make -C tools/darwin/packaging/xbmc-osx
192
193   3. If completed successfully, a disk image named XBMC_for_Mac.dmg will be
194   present in the users XBMC build directory:
195
196 Remember to unmount/eject XBMC.dmg before attempting to recreate it,
197 otherwise dmgmaker.pl will fail.
198