mirage/mirage-tcpip — pull request #85 by talex5 (2014-12-02 10:25:40+00:00)
Title: [RFC] Build Xen stubs separately, with CFLAGS from Mini-OS

This is what mirage-tcpip looks like with C stubs compiled separately for Xen (for use with https://github.com/talex5/mirage/tree/xen_linkopts):

* A new OASIS flag `--enable-xen` controls whether the Xen stubs are compiled.
* A new `postconf.ml` script gets the flags from pkg-config and updates `setup.data`.
* A dummy `tcpip.xen` library allows compiling the C stubs conditionally and with the right flags.
* A symlink to the Unix C code prevents OASIS from "optimising" the build by building the library only once.
* I assume OPAM will be used for installation, so that if `mirage-xen-minios` is present then `tcpip` will always be compiled with Xen C stubs.
* The C stubs are added to the main `tcpip` ocamlfind package, not `tcpip.xen`, to simplify the `mirage` tool's job. Possibly we should have a `xen_package="tcpip.xen"` variable in `tcpip` and move the stubs to the sub-package.

Suggestions for better ways of doing this welcome!