fix build directives, add routine so that darwin will cross-compile (with non-optimal runtime results though)