init support for cross platform (i.e. Apple OS X)

Signed-off-by: Conke <conke.hu@maxwit.com>