cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl 7.12.2 compile fail on Mac OS X

From: Jim Napier <jnapier_at_urchin.com>
Date: Wed, 01 Dec 2004 09:19:40 -0800

Just wanted to follow up with the solution on this topic. The problem is
that despite using all the right configuration, compile, and linking
options to try and utilize my statically built OpenSSL, the compiler on the
Mac will dynamically link in system libs it finds first no matter what
options you specify. What's worse is that it will do this silently and you
can't tell it's happening by looking at the output of your compilation. In
the Mac OS X world they apparently want to force dynamically linking this
way. There is a hack to get around this. I would only advise using it if
you're quite familiar with the implications if you do it wrong. What I did
was to move the symbolic links /usr/lib/libcrypto.dylib,
/usr/lib/libk5crypto.dylib, and /usr/lib/libssl.dylib and saved them
somewhere else. Moving the links prevents ld from finding the dynamic libs
they point to but allows other programs that are compiled to use those
dynamic libs to continue to function. If you want to be sure you don't link
dynamically at all you could also move and save the actual libs the
symbolic links point to at the risk of causing some malfunction on your
machine (I did this because I was the only user on the machine I was
compiling on). Once you have built Curl you should use otool to check the
curl binary and make sure you didn't accidently dynamically link something
you didn't intend. Then restore the symbolic links in /usr/lib that you moved.

Jim Napier
Received on 2004-12-01