Support build under OS X

Signed-off-by: Shaka Huang <shakalaca@gmail.com>
Rewrite for ZenFone 5/6

Signed-off-by: Shaka Huang <shakalaca@gmail.com>