saleyn / erlexec

Execute and control OS processes from Erlang/OTP
https://hexdocs.pm/erlexec/readme.html
Other
525 stars 139 forks source link

Now compile on OpenBSD but was not totally tested. #132

Closed niamtokik closed 4 years ago

niamtokik commented 4 years ago

It seems erlexec does not compile well on OpenBSD-current (67+) at this time:

$ uname -a
OpenBSD kin.puffy 6.7 GENERIC.MP#209 amd64

$ rebar3 compile
c_src/exec.cpp:496:6: error: #error setresuid(3) not supported!

I added the openbsd support. unfortunately, rebar3 pc plugin does not support OpenBSD as well, so you need to set CXX variable to c++ (clang/llvm default compiler on OpenBSD):

CXX=c++ rebar3 compile

or

CXX=c++ gmake
saleyn commented 4 years ago

Thank you for your contribution!

saleyn commented 4 years ago

Actually regarding the second part of your patch, I believe rebar does a regex check on the first item, so do you mind checking if the following would work instead, for brevity:

{"openbsd|freebsd|dragonfly",  "CXXFLAGS", "$CXXFLAGS -std=c++11 -DHAVE_SETRESUID" ++ X64},
{"openbsd|freebsd|dragonfly",  "LDFLAGS",  "$LDFLAGS" ++ X64},