batari Basic - COMPILE.txt - Version 1.0 - 2013.09.24

_What_Is_This_Doc?_

  This is the bB utility compilation documentation. It's meant to be helpful
  for those of you that wish to rebuild the bB utilities from source code.

  If you only want to use bB as provided, you can stop reading now.


_Requirements_

  A Unix type system, or mingw32/cygwin environment on Windows, with...

    -lex/flex
    -make
    -an ANSI C compiler
 

_Quick_Build_From_Source_

  If you just wish to get bB running on your platform, and not create a full
  distribution of bB, building bB should just require typing "make" from 
  command-line while inside the bB directory.


_Cross_Compiling_All_OS_Binaries_

  The official binaries are produced under Linux using cross-compiling for the
  Windows and OS X binaries.

  Setting up cross compilers is the difficult part. Building all OS binaries
  is just a matter of typing "make dist" in the bB directory. This will call
  each OS specific makefile in turn.

  If you want to cross compile just one particular set of OS binaries, specify
  the os-specific makefile with the -f switch. e.g. make -f makefile.xcmp.win32


  _Cross_Compiling_for_Windows_

    The mingw64 gcc is used for producing Windows binaries. To set this up 
    under Ubuntu or Debian should just be a matter of typing 
    "sudo apt-get install mingw-w64" from command-line. 

    For cross compiling from other OSes, look up instructions at 
    http://www.mingw.org/


  _Cross_Compiling_for_OS_X_

    Cross compiling OS X requires a custom gcc and Apple SDK. The easiest way
    to aquire these is from an unofficial, but readily available, repository.

    The following instructions are for recent versions of Ubuntu, though it
    may work with other closely related OSes, like Debian and Mint.

    Cross Compiling for OS X on another OS is out of the scope of this doc, 
    but sufficed to say you'll need Apple-patched gcc sources, Apple-patched 
    odcctools sources, and the Apple 10.5 SDK. 


    _Cross_Compiling_OS_X_on_Ubuntu_64-bit_x86_

      break out your command prompt, and...

      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb
      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-x86-odcctools_758.159-0flosoft11_amd64.deb
      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-x86-gcc_4.2.1~5646.1flosoft2_amd64.deb

      sudo dpkg -i apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb
      sudo dpkg -i apple-x86-odcctools_758.159-0flosoft11_amd64.deb
      sudo dpkg -i apple-x86-gcc_4.2.1~5646.1flosoft2_amd64.deb

      NOTE: if you may get an error of "Package libssl0.9.8 is not installed" 
      when you try to install odcctools, install libssl 0.9.8...
      wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.1_amd64.deb
      sudo dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.1_amd64.deb


    _Cross_Compiling_OS_X_on_Ubuntu_32-bit_x86_

      break out your command prompt, and...

      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-uni-sdk-10.5_20110407-0.flosoft1_i386.deb
      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-x86-odcctools_758.159-0flosoft11_i386.deb
      wget https://launchpad.net/~flosoft/+archive/ubuntu/cross-apple/+files/apple-x86-gcc_4.2.1~5646.1flosoft2_i386.deb

      sudo dpkg -i apple-uni-sdk-10.5_20110407-0.flosoft1_i386.deb
      sudo dpkg -i apple-x86-odcctools_758.159-0flosoft11_i386.deb
      sudo dpkg -i apple-x86-gcc_4.2.1~5646.1flosoft2_i386.deb

      NOTE: if you may get an error of "Package libssl0.9.8 is not installed" 
      when you try to install odcctools, install libssl 0.9.8...
      wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_i386.deb
      sudo dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_i386.deb
