WIP: add support for OS X in the build script

X-Authored-By: @mn4367
X-Authored-By: @npinchot