This patch implements Mac build basically based on Linux platform implementations and configurations. The document to build it on Mac has been updated as well.