Skip to content

OS X Cross Compiled on Linux

Ben Rossi edited this page Jun 17, 2014 · 8 revisions

DEPRECATED! - NEEDS TO BE UPDATED WITH RECENT CHANGES TO THE BULID PROCESS RETAINING THE INFORMATION IN CASE WE ARE ABLE TO MAKE THIS WORK IN THE FUTURE.

Resources: https://github.com/tpoechtrager/osxcross

Configure a Virtual Machine

  1. Download and install VirtualBox
  2. Download Ubuntu 14.02 image
  3. Configure a new virtual machine
  4. Set up a network shared drive
  5. Install Ubuntu
  6. From Terminal, sudo apt-get update
  7. sudo apt-get install git
  8. Confirm network drive, sudo adduser USERNAME vboxsf
  9. Restart
  10. Devices: Computer > Media > sf_SHAREDFOLDER

Clone the OSXCross repo into the shared drive

https://github.com/tpoechtrager/osxcross

git clone https://github.com/tpoechtrager/osxcross

Load Linux-side dependencies

cd /media/sf_SHAREDFOLDER/osxcross/tools
sudo ./get_dependencies.sh

Download the Apple Xcode SDK

  1. Boot into OS X
  2. [Download Xcode (used 5.1)]
  3. [Mount Xcode.dmg (Open With -> DiskImageMounter)]
  4. Run: ./tools/gen_sdk_package.sh (from the OSXCross package). This script will generate a packaged SDK for each version of OS X that is contained in the Xcode disk image. You only need to move the one you need in the next step (todo: need to specify if it's going to be 10.8 or 10.9)
  5. Copy the packaged SDK (.tar. or *.pkg) on a USB Stick
  6. Reboot back into Linux
  7. Copy or move the SDK into the tarball/ directory of OSXCross

Build the toolchain

(FIRST TEST PASS: OSX10.9SDK with min version 10.7)

  1. From /media/sf_SHAREDFOLDER/osxcross, run OSX_VERSION_MIN=10.7 ./build.sh (It will search 'tarballs' for your SDK and then build in its own directory)

Building GCC

  1. sudo apt-get install libmpc-dev libmpfr-dev libgmp-dev
  2. ./build_gcc.sh