curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl fails to build with my custom openssl build on Mac OSX Tiger PPC

From: Rees Machtemes <reeskm_at_gmail.com>
Date: Thu, 9 Feb 2017 12:38:05 -0700

Daniel,
thanks for the reply. I actually got it working early this morning, by
rebuilding openssl with both static and shared librarys, and then
building curl shared and static, using the same configure options as
my OP. So, for whatever reason, curl does not like it when you build
openssl static libs exclusively, on OSX?

Now, my /usr/local/bin/curl is properly linked to dynamic libs, even
though this is not what I had wanted. Oh well, at least I can link
other programs against the static libs for curl.

rees_at_xserve-brains]:~> otool -L /usr/local/bin/curl
/usr/local/bin/curl:
    /usr/local/lib/libcurl.4.dylib (compatibility version 9.0.0,
current version 9.0.0)
    /usr/local/ssl/lib/libssl.1.0.0.dylib (compatibility version
1.0.0, current version 1.0.0)
    /usr/local/ssl/lib/libcrypto.1.0.0.dylib (compatibility version
1.0.0, current version 1.0.0)
    /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
(compatibility version 1.0.0, current version 2.2.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.1.12)

On Thu, Feb 9, 2017 at 2:39 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> When you specify .a files instead of using -l, you need to specify the full path to them. Did you?

Yes I did. I thought of that right away, and tried it but got the same
result: gcc calls the linker with "-lssl -lcrypto" instead of
"/usr/local/ssl/libs/libssl.a /usr/local/ssl/libs/libcrypto.a" that I
hard-coded in the Makefile.

I've heard Apple's linker agressively prefers .dylibs over static
.a's, but there should be no reason that even "-lssl -lcrypto" picks
up my custom openssl build! I've tried every flag I could find, as
seen in my OP, by comparing it with what Macports does. I think the
only solution is to edit the Makefile and play tought with the build
system.

>> but mysteriously a "make" shows the exact same error above, and appears to completely ignore my hand edits of Makefile.
>
> That seems strange to me.

Yeah, to me too! Is there something special about the build system for
curl that ignores user edits to the Makefile after the configure step?
I did the following, from a many-times configured build directory,
which I think is not a problem:

1. make distclean
2. ./configure <my options...>
3. vi Makefile (and make my changes to the lib vars as in OP)
4. make -j4

Now that I have curl building, this is a minor issue but still one I'd
like to solve. I'm pretty sure it's OSX specific. I wonder if any
other developers on this list use a more modern OSX (>=10.7) and can
reproduce this? I noticed a lot seem to compile curl statically for
iOS for use in their iOS apps, no doubt. They don't seem to have a
problem with this?

Rees
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-02-09