Skip to content

Basic support for FFI-relevant code #13

@gian

Description

@gian

I have a modest proposal. We have a reasonable number of projects now that rely on some kind of FFI code (usually C) in order to build end-user applications. This makes figuring out how to build applications reasonably complicated. I propose that we add another smackage command that interrogates a package (possibly just running another 'make' target) in order to compute the appropriate command line/CM options. We need not do anything clever in the realm of attempting to discover platform-specific weirdness (although this might be a nice v2 feature). An example usage might be:

(in my end-user Makefile):

foo: bla.mlb bla.sml
        mlton $(exec smackage linkopts curlsml v1) -output foo bla.mlb

Where smackage linkopts curlsml v1 is going to expand to something like:

-linkopt -lcurl $SMACKAGE_HOME/lib/curlsml/v1/curlsml.a

I can see some potential risks in platform-specific support being required, and we might have to think carefully about how one generates things appropriately for the chosen compiler/platform.

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions