Doug Bryant

Tech thought and notes

Customizing Mac OSX Using Opensource

by Jordan Hubbard + Kevin Van Vechten

recompiling software which come pre-built w/ osx

Darwin is the os core of osx. Includes kernel, IOKit families, and BSD commands and libraries.

Darwin source – developer.apple.com/darwin || darwinsource.opendarwing.org
.tar.gz snapshots organized by release.

OpenDarwin – community run site w/ standard opensource tools (bugzilla, cvs, irc, etc)

Webkit – webkit.opendarwind.org. Based on khtml/kjs
can progress live

DarwinPorts – similar to FreeBSD ports system. 2,500+ ports. Easy customization wiht “Variants”

Fink – Based on debian packages. 5K+ ports – offers pre-built packages.

Building Darwin

  • know objective
  • only replace system when necessary
  • beware of software updates (have to re-apply mods)
  • make backups

Potential Problems

  • Default compiler problems (different gcc version)
  • environment variables
  • build aliases
  • no private headers
  • no static libraries

user __gcc_select__ to change and report compiler versions

environment variables (where system looks for some things)

  • SRCROOT (src files)
  • OBJROOT (object files)
  • SYSROOT (debug bin)
  • DSTROOT (final bin)

Variables (compile)

  • MACOSX_DEPLOYMENT_TARGET (10.4)
  • RC_RELEASE (Tiger)
  • UNAME_RELEASE (8.0)
  • RC_ARCH (ppci386)
  • RC_ProjectName (name of project being built)

And many more compile time variables

Missing header files – private headers (ex. /usr/local/streams/streams.h /usr/local/lib/libkld.a)

No internal tools /usrl/local/kextool? – for building kernel modules

DarwinBuild – handles all the above incompatibilities

precode

  1. darwinbuild -init AC46 (ac46 is engineering build number)
  2. darwinbuild project_name
  3. darwinbuild bash
    /code/pre
    This will download sources build (missed point in which you could patch source) and install new binary