ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
578 stars 241 forks source link

Setting `LDFLAGS` on macOS causes c_src compilation to fail #829

Open hauleth opened 5 years ago

hauleth commented 5 years ago

When compiling shared library I need to set LDFLAGS to link to proper OpenSSL library, but this results with flag -undefined dynamic_lookup flag to not being present which result in compilation errors (the same as in #267).

essen commented 5 years ago

Try LDFLAGS += -l....

hauleth commented 5 years ago

@essen I could do that only within Makefile which I cannot edit. I run it in the shell in form of env LDFLAGS='-L/path/to/openssl/lib' make compile and it fails, I need to run env LDFLAGS='-L/path/to/openssl/lib -undefined dynamic_lookup' make compile to make it work.

essen commented 5 years ago

Ah I see what you mean. Makes sense considering the way Erlang.mk does it currently. If you got time please add a test case based on c-src-nif: https://github.com/ninenines/erlang.mk/blob/master/test/plugin_c_src.mk and I will cook up a fix afterwards.