TrustedUser
2,147
edits
m (Fix one too many bracket) |
(→Compile and Deploy: Add comment about the need to disable bitcode generation option) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
== Creating the Xcode project == | == Creating the Xcode project == | ||
Clone the ScummVM repository from GitHub to get the source code: | Clone the ScummVM repository from GitHub to get the source code: | ||
< | <syntaxhighlight lang="bash"> | ||
git clone https://github.com/scummvm/scummvm.git | git clone https://github.com/scummvm/scummvm.git | ||
</ | </syntaxhighlight> | ||
Generate the create_project tool: | Generate the create_project tool: | ||
< | <syntaxhighlight lang="bash"> | ||
cd scummvm/devtools/create_project/xcode | cd scummvm/devtools/create_project/xcode | ||
xcodebuild | xcodebuild | ||
</ | </syntaxhighlight> | ||
''Note:'' you may need to run xcodebuild with sudo the first time ('sudo xcodebuild') if the Xcode command line tools are not yet installed. Command line tools can also be installed from Xcode or using 'sudo xcode-select --install' | ''Note:'' you may need to run xcodebuild with sudo the first time ('sudo xcodebuild') if the Xcode command line tools are not yet installed. Command line tools can also be installed from Xcode or using 'sudo xcode-select --install' | ||
Create a build directory | Create a build directory: | ||
< | <syntaxhighlight lang="bash"> | ||
cd ../../../.. | cd ../../../.. | ||
mkdir build | mkdir build | ||
cd build | cd build | ||
</ | </syntaxhighlight> | ||
Download the [https://www.scummvm.org/frs/build/scummvm-ios7-libs.zip iOS libraries package] and extract them in the build directory: | Download the [https://www.scummvm.org/frs/build/scummvm-ios7-libs-v2.zip iOS libraries package] and extract them in the build directory: | ||
< | <syntaxhighlight lang="bash"> | ||
unzip ~/Downloads/ | unzip ~/Downloads/scummvm-ios7-libs-v2.zip | ||
</ | </syntaxhighlight> | ||
Generate Xcode project and open it: | Generate Xcode project and open it: | ||
< | <syntaxhighlight lang="bash"> | ||
../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --enable-fluidsynth --disable-bink | ../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --enable-fluidsynth --disable-bink --disable-nasm --disable-opengl --disable-theora --disable-taskbar --disable-tts | ||
</ | </syntaxhighlight> | ||
At this point your build directory should contain: | At this point your build directory should contain: | ||
Line 51: | Line 51: | ||
You are now ready to compile ScummVM. First open the project in Xcode: | You are now ready to compile ScummVM. First open the project in Xcode: | ||
< | <syntaxhighlight lang="bash"> | ||
open scummvm.xcodeproj | open scummvm.xcodeproj | ||
</ | </syntaxhighlight> | ||
''Note:'' you can also double-click on the ''scummvm.xcodeproj'' file in the Finder to open it with Xcode. | ''Note:'' you can also double-click on the ''scummvm.xcodeproj'' file in the Finder to open it with Xcode. | ||
Line 62: | Line 62: | ||
* In the project ''General'' settings you need to specify a unique ''Bundle Identifier'' (for example ''org.yourname.scummvm''). | * In the project ''General'' settings you need to specify a unique ''Bundle Identifier'' (for example ''org.yourname.scummvm''). | ||
* You need to configure the ``Signing`` settings. Add an account by using your Apple ID if needed and then select it. | * You need to configure the ``Signing`` settings. Add an account by using your Apple ID if needed and then select it. | ||
* You may need to disable bitcode generation in the build settings. This should already be disabled by default when you make a build specifically for your device, but it is enabled by default when you build for a ''Generic iOS Device''. | |||
Then click on the Play button in the top left of the window to start the build. The App will be automatically installed on your device at the end of the build. | Then click on the Play button in the top left of the window to start the build. The App will be automatically installed on your device at the end of the build. | ||
Line 76: | Line 78: | ||
Here is a script to download, and compile all the required tools. This script has been wrote for Debian 8.2, and should be run as root. | Here is a script to download, and compile all the required tools. This script has been wrote for Debian 8.2, and should be run as root. | ||
< | <syntaxhighlight lang="bash"> | ||
#!/bin/bash | #!/bin/bash | ||
Line 155: | Line 157: | ||
tar xjf iPhoneOS8.1.sdk.tbz2 | tar xjf iPhoneOS8.1.sdk.tbz2 | ||
rm iPhoneOS8.1.sdk.tbz2 | rm iPhoneOS8.1.sdk.tbz2 | ||
</ | </syntaxhighlight> | ||
Now, in order to compile ScummVM, execute the following commands: | Now, in order to compile ScummVM, execute the following commands: | ||
< | <syntaxhighlight lang="bash"> | ||
export SDKROOT=/usr/share/ios-sdk/iPhoneOS8.1.sdk | export SDKROOT=/usr/share/ios-sdk/iPhoneOS8.1.sdk | ||
export CC=ios-clang | export CC=ios-clang | ||
Line 164: | Line 166: | ||
./configure --host=ios7 --disable-mt32emu --enable-release | ./configure --host=ios7 --disable-mt32emu --enable-release | ||
make ios7bundle | make ios7bundle | ||
</ | </syntaxhighlight> | ||
At the end of the compilation, you'll find a '''ScummVM.app''' application: copy it over SSH, and reboot your device. | At the end of the compilation, you'll find a '''ScummVM.app''' application: copy it over SSH, and reboot your device. | ||
Line 197: | Line 199: | ||
* For ''iphone'' use: | * For ''iphone'' use: | ||
< | <syntaxhighlight lang="bash"> | ||
export TARGET=arm-apple-darwin9 | export TARGET=arm-apple-darwin9 | ||
</ | </syntaxhighlight> | ||
* For ''ios7'' use: | * For ''ios7'' use: | ||
< | <syntaxhighlight lang="bash"> | ||
export TARGET=arm-apple-darwin11 | export TARGET=arm-apple-darwin11 | ||
</ | </syntaxhighlight> | ||
==== Setting up the Environment ==== | ==== Setting up the Environment ==== | ||
< | <syntaxhighlight lang="bash"> | ||
export PATH="$IOS_TOOLCHAIN_BASE/bin:$IOS_TOOLCHAIN_BASE/$TARGET/bin:$IOS_TOOLCHAIN_BASE/$TARGET/usr/bin:$PATH" | export PATH="$IOS_TOOLCHAIN_BASE/bin:$IOS_TOOLCHAIN_BASE/$TARGET/bin:$IOS_TOOLCHAIN_BASE/$TARGET/usr/bin:$PATH" | ||
export CPPFLAGS="-isystem $IOS_TOOLCHAIN_BASE/$TARGET/usr/include" | export CPPFLAGS="-isystem $IOS_TOOLCHAIN_BASE/$TARGET/usr/include" | ||
export LDFLAGS="-L$IOS_TOOLCHAIN_BASE/$TARGET/usr/lib" | export LDFLAGS="-L$IOS_TOOLCHAIN_BASE/$TARGET/usr/lib" | ||
</ | </syntaxhighlight> | ||
Where ''IOS_TOOLCHAIN_BASE'' contains the directory where you installed the toolchain. And ''TRAGET'' has been setup from the previous step. | Where ''IOS_TOOLCHAIN_BASE'' contains the directory where you installed the toolchain. And ''TRAGET'' has been setup from the previous step. | ||
Line 223: | Line 225: | ||
First, navigate to a path where you want your build files to be located (this can be the ScummVM root directory but does not have to be). | First, navigate to a path where you want your build files to be located (this can be the ScummVM root directory but does not have to be). | ||
Then run the following: | Then run the following: | ||
< | <syntaxhighlight lang="bash"> | ||
./path/to/scummvm/configure --host=ios7 --with-staticlib-prefix=$IOS_TOOLCHAIN_BASE/$TARGET/usr | ./path/to/scummvm/configure --host=ios7 --with-staticlib-prefix=$IOS_TOOLCHAIN_BASE/$TARGET/usr | ||
</ | </syntaxhighlight> | ||
Replace ''ios7'' with ''iphone'' if you want to build the older version of our iOS backend. | Replace ''ios7'' with ''iphone'' if you want to build the older version of our iOS backend. | ||
Line 231: | Line 233: | ||
You can compile ScummVM with running make: | You can compile ScummVM with running make: | ||
< | <syntaxhighlight lang="bash"> | ||
make iphone | make iphone | ||
</ | </syntaxhighlight> | ||
If you simply want to test whether changes you made compile but do not plan to use the binary for deployment you can also simply run ''make''. | If you simply want to test whether changes you made compile but do not plan to use the binary for deployment you can also simply run ''make''. | ||
Please note that if you want to deploy ScummVM on your iOS device you will need to generate a bundle file. For this run either: | Please note that if you want to deploy ScummVM on your iOS device you will need to generate a bundle file. For this run either: | ||
< | <syntaxhighlight lang="bash"> | ||
make ios7bundle | make ios7bundle | ||
</ | </syntaxhighlight> | ||
for the ''ios7'' backend. Or | for the ''ios7'' backend. Or | ||
< | <syntaxhighlight lang="bash"> | ||
make iphonebundle | make iphonebundle | ||
</ | </syntaxhighlight> | ||
for the ''iphone'' backend. | for the ''iphone'' backend. | ||
Then simply upload the whole ScummVM.app directory to your device under the /Applications folder, and you're done! | Then simply upload the whole ScummVM.app directory to your device under the /Applications folder, and you're done! |