support legacy and core context on OSX

Change-Id: Ib8cadb3f182ce49c0ca8b6ccaa95960eb8e5f9ae
fix indentation

Change-Id: I4f299e510fecb57f763818743d357ae6bf2333af