iOS patch no 19: Linking
Fix linking for cross compiler to iOS. This patch does these things:
- use libtool to link to a static library in place of an executable (because on iOS the final link must be done in Xcode),
- for packages, keep only the HS package libraries and throw out other options (because libtool doesn't accept them),
- fail if you try to link a dynamic library on iOS because it isn't supported (not really needed but there for completeness).
Note that there is a minor risk here, because in the normal case, the order of options passed to the linker is slightly different: The options relating to each dependent package are separated into three different kinds, but they're still in the same relative order per package. This should be perfectly OK.
The name of "libtool" is hard-coded and can't be set by options. Is this OK?