[osx/ios] - adapted README.osx and README.ios for usage with new unified depends
[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 See point 3.0a below for an updated list of supported/tested Xcode/osx constellations!!!
51
52 Install latest Xcode (4.3.2 or 3.2.6 as of the writing). You can download it from 
53
54 1. Apple's site after registration at http://developer.apple.com/tools/download (Xcode 3.2.6)
55 2. In the MacOSX AppStore (Xcode 4.3.x). 
56
57 If you are using XCode 4.3.x or later you also need to install the "Command Line Tools". To do so
58 after installing Xcode you have to go to "Xcode->Preferences->Downloads" and install the
59 package "Command Line Tools".
60
61 Xcode 3.2.6 only runs on 10.6.x (Snow Leopard). 
62 Xcode 4.3.x only runs on 10.7.x (Lion).
63 Xcode 4.4 only runs on 10.8.x (Mountain Lion).
64
65 -----------------------------------------------------------------------------
66 3.0a Supported Xcode and OSX constellations
67 -----------------------------------------------------------------------------
68 As far as we know the compilation for mac osx should work with the following
69 constellations of Xcode and osx versions (to be updated once we know more):
70  
71 1. XCode 3.2.6 against OSX SDK 10.6 on 10.6.x (Snow Leopard)
72 2. XCode 4.3.x against OSX SDK 10.6 and 10.7 on 10.7.x (Lion)
73 3. XCode 4.6 against OSX SDK 10.6, 10.7 and 10.8 on 10.7.x (Lion) and 10.8.x (ML)
74
75 -----------------------------------------------------------------------------
76 3.1 Install XBMC build depends
77 -----------------------------------------------------------------------------
78  The following commands will build using the latest OSX SDK found on your
79  system.
80
81 3.1.1 Compiling as 32 Bit binary
82  $ cd $HOME/XBMC
83  $ cd tools/depends
84  $ ./bootstrap
85  $ ./configure --host=i386-apple-darwin
86  $ make
87
88 3.1.2 Compiling as 64 Bit binary
89  $ cd $HOME/XBMC
90  $ cd tools/depends
91  $ ./bootstrap
92  $ ./configure --host=x86_64-apple-darwin
93  $ make
94
95  NOTE: You can speedup compilation on multicore systems by doing
96  "make -j<number of cores>" instead of "make". For a dualcore this would read:
97  "make -j2"
98
99  ADVANCED developers only! If you want to specify an OSX SDK version (if
100  multiple versions are installed) - then append it to the configure line
101  above (example below would use OSX SDK 10.7 and build for 64bit):
102
103  $ ./configure --host=x86_64-apple-darwin --with-sdk=10.7
104
105  Ensure that you also adapt the xcode project to use this SDK version.
106
107 -----------------------------------------------------------------------------
108 4. How to compile
109 -----------------------------------------------------------------------------
110 Both Xcode and Terminal compilation require that build environment be setup
111 first. This is a simple step and involves the following:
112
113 4.a Compilation by using command-line building via xcodebuild or
114     by compiling via Xcode GUI
115
116  $ cd $HOME/XBMC
117  $ make -C tools/depends/target/xbmc
118  $ make clean
119  $ make xcode_depends
120  $ make -C lib/addons/script.module.pil
121
122 4.b Compilation by using command-line building via make (experimental)
123
124  $ cd $HOME/XBMC
125  $ make -C tools/depends/target/xbmc
126  $ make clean
127
128 The configure operation will setup the build environment for codecs and
129 internal libraries that are used by XBMC. This step is required for both Xcode
130 and command-line building. The "make clean" ensures that there are no stale
131 binaries from git that might cause problems.
132
133 -----------------------------------------------------------------------------
134 4.1 Using Xcode
135 -----------------------------------------------------------------------------
136 Start XCode and open the XBMC project (XBMC.xcodeproj) located in $HOME/XBMC.
137 For development, XBMC is run from the $HOME/XBMC directory and needs to have
138 the XBMC_HOME environment variable set to know where that directory is located.
139 To set XBMC_HOME environment variable:
140
141 Xcode 3.2.6
142  Menu -> Project -> Edit Active Executable "XBMC", click "Arguments" tab and
143  add "XBMC_HOME" as an enviroment variable. Set the value to the path to the
144  XBMC root folder. For example, "/Users/bigdog/Documents/XBMC"
145
146 Xcode 4.3.x and later
147  Menu -> Product -> Edit Sheme -> "Run XBMC"/"Debug" -> Add XBMC_HOME into 
148  the List of "Environment Variables".Set the value to the path to thev XBMC 
149  root folder. For example, "/Users/bigdog/Documents/XBMC"       
150
151 There are two build targets "XBMC" and "XBMC.app" (each in 32Bit and 64Bit flavour) 
152 with debug and release settings. The "XBMC" target is used for rapid build and 
153 debug cycles while the "XBMC.app" target is used to build a self contained 
154 OSX application.
155
156 Set the build target to "XBMC" or "XBMC.app" and be sure to select the same 
157 architecture as selected in step 3.1 (either i386 for 32Bit or x86_64 for 64Bit), 
158 then build. 
159
160 If you have selected a specific OSX SDK Version in step 3.1 then you might need 
161 to adapt the active target to use the same OSX SDK version. Else build will fail 
162 (you will see alot of errors with at least non-found boost/shared_ptr.hpp).
163
164 The build process will take a long time when building the first time. 
165 You can see the progress in "Build Results". There are a large number of static 
166 and dynamic libaries that will need to be built. Once these are built, 
167 subsequent builds will be faster.
168
169 After the build, you can ether run XBMC for Mac from Xcode or run it from
170 the command-line. If you run it from the command-line, make sure your set
171 the XBMC_HOME environment variable (export XBMC_HOME=$HOME/XBMC). Then, to
172 run the debug version:
173
174 $ ./build/Debug/XBMC
175
176 Or the release version:
177
178 $ ./build/Release/XBMC
179
180 You can also build via Xcode from the command-line using the following:
181
182 $ xcodebuild -configuration Release ONLY_ACTIVE_ARCH=YES ARCHS=i386 VALID_ARCHS=i386 \
183   -target "XBMC.app" -project XBMC.xcodeproj
184
185 You can specify "Release" instead of "Debug" as a configuration. Be sure to set *_ARCHS
186 variables to the same architecture as selected in step 3.1 (either i386 for 32Bit or x86_64 
187 for 64Bit).
188
189 -----------------------------------------------------------------------------
190 4.2 Using Terminal (command-line) (this is a work in progress and might fail)
191 -----------------------------------------------------------------------------
192 There are two methods, a) make/Xcode and b) make (which might fail as it's under
193 construction).
194
195 If you want to build a cross-compiled version that can run under 10.6/10.7, 
196 you could try xcodebuild from the command-line (normally unneeded - for advanced
197 developers).
198
199  a)
200  $ cd $HOME/XBMC
201  $ export XBMC_HOME=`pwd`
202  $ make xcode_depends
203  $ make -C lib/addons/script.module.pil
204  $ xcodebuild -sdk macosx10.7 -project XBMC.xcodeproj -target XBMC.app ONLY_ACTIVE_ARCH=YES \
205    ARCHS=x86_64 VALID_ARCHS=x86_64  -configuration Release build
206
207  b) building via make
208  $ cd $HOME/XBMC
209  $ export XBMC_HOME=`pwd`
210  $ make
211  $ ./xbmc.bin
212
213 -----------------------------------------------------------------------------
214 5. Packaging
215 -----------------------------------------------------------------------------
216 This section describes how to package XBMC in a disk image for
217 distribution.
218
219   1. build XBMC.app from XCode so that the application bundle is correctly updated.
220
221   2. make -C tools/darwin/packaging/xbmc-osx
222
223   3. If completed successfully, a disk image named XBMC_for_Mac.dmg will be
224   present in the users XBMC build directory:
225
226 Remember to unmount/eject XBMC.dmg before attempting to recreate it,
227 otherwise dmgmaker.pl will fail.
228