Take a look at the thrift or protoc scripts - the ...
# general
e
Take a look at the thrift or protoc scripts - the biggest deal is to get the full static binary bit right