Using a cross platform library in Legato/MangOH

Hi all, I am having to port code from OpenAT as the FXT009 has been discontinued. This present me with the opportunity to create a cross-platform version of the gateway code that could run on Windows, Linux and Legato based modems.

I currently have a toolchain for building and debugging for Windows and Linux, however I am now stuck as to how I should go about integrating this into Legato/Dev Studio for the MangOH and whatever the FXT009 successor end up being. Ideally I could build it using command line tools.

Ideally I want to keep as much code cross platform and only implement the platform specific stuff for Windows, Linux (with broadband connections) and Legato modems (with GPRS/3G/SMS etc) and possibly Rasberry PIs etc down the line.

Has anyone attempted this? How did you go about it. How much legato code did you use etc?