mxcl/homebrew — Issue #9529: Dynamic MLton is (apparently) broken
Author: thoughtpolice
Created: 2012-01-10 18:15:43+00:00
State: open

OS X Version: 10.6.8

I decided to wipe my mlton and gmp install and do a fresh install (to do a full retest of the Ur/Web) formula but I hit a strange error:

```
11:49:50 a@kratos.local ~ mlton
dyld: Library not loaded: /opt/local/lib/libgmp.10.dylib
Referenced from: /usr/local/lib/mlton/mlton-compile
Reason: image not found
[1] 86804 trace trap mlton
```

The MLton build that the formula pulls down is a version which is dynamically linked to the MacPorts version of libgmp. The formula *claims* that the homebrew GMP will work fine. And it did, at one point. I have no idea how this broke or why it *wasn't* broken before, but it apparently is now.

There is an alternative. MLton provides a build for amd64 Snow Leopard that is statically linked to GMP - but generated executables require GMP. Otherwise there is no difference between the two builds.

I propose the `mlton` formula is changed to instead install the statically linked version, *while retaining the dependency on libgmp* - because all compiled programs will require it anyway.

I have made this change in my own local brew installation and everything happily works after that and I can install Ur/Web no problem. If this is an acceptable change I will put it in a different pull request, but I thought I'd run it by the maintainers first.