macOS Net SSLeay and Carton

less than 1 minute read

First off, cpanm has no problem installing Net::SSLeay 1.78 without openssl being installed via homebrew. But because I needed a specific older version that was being installed by carton I had to find way to make it link appropriately.

Because Apple has done something with openssl, and doesn’t include the headers to compile against, openssl needs to be installed via homebrew brew install openssl. Unfortunately because of Apple’s doing again, homebrew is no longer linking the openssl libraries into /usr/local/include and /usr/local/lib so command line options are required.

I was strugging to figure out what I had to specifiy on the command line in order to get carton to accept the compiler options and pass them through so that the build would occur.

I found this syntax to install via cpanm, and by adding the -l local, was able to put the module where carton would find it, and continue the installation.

CONFIG_ARGS=$( cat <<_EOF_ | tr '\n' ' '
INC=-I/usr/local/opt/openssl/include
LDDLFLAGS="-bundle -undefined dynamic_lookup -fstack-protector-strong -L/usr/local/opt/openssl/lib"
LD="env MACOSX_DEPLOYMENT_TARGET=10.11 cc"
LDFLAGS="-fstack-protector-strong -L/usr/local/opt/openssl/lib"
_EOF_
)
cpanm MIKEM/Net-SSLeay-1.72.tar.gz --configure-args "$CONFIG_ARGS" --interactive --verbose -l local

Categories:

Updated: