Matthew Watkins wrote:
>I wonder if anyone can help me with a quick question. I've been 
>attempting to build OpenSSL on Mac OS X, and appear to have hit a 
>brick wall.

Indeed, it is a brick wall. But if you remove some stones, it leaves 
a gap wide enough to slip through... :-)

BTW, it was a concrete wall with Mac OS X Public Beta. Stupid frameworks...

>After trying several options, I decided the following commands would 
>be most suitable to compile from source:
>
>./Configure no-threads no-asm no-dso rhapsody-ppc-cc
>make

Both patches mentioned below add auto-recognition of Darwin.

>I get a reasonable way through, but the compile stops with undefined 
>symbols while running through the "apps" directory. Any ideas what 
>might be going wrong?

Okay, I'll try to explain. The fundamental problem is that a) Apple 
ships shared libraries built from OpenSSL 0.9.5a, b) they don't ship 
the associated headers so the libraries are useless for compiling 
apps on your own and c) the linker always prefers shared libraries, 
even when there is a static library in a directory listed earlier in 
the search path.

There are several ways out of this misery:

Alternative 1: Remove the symlinks /usr/lib/libssl.dylib and 
/usr/lib/libcrypto.dylib. Then the linker won't find these libraries 
while linking. Existing executables will still run because the look 
for libssl.0.9.dylib and libcrypto.0.9.dylib directly. This is a hack 
and will only get you static OpenSSL libraries.

Alternative 2: Try to use Apple's patch or, more accurately, Apple's 
patched version of OpenSSL. You can get it from the Darwin CVS 
repository, see <http://www.opensource.apple.com/>. I'm not sure 
which version it is. Also, Apple has a funny way of integrating 
packages into their overall build system, <http://www.darwinfo.org/> 
is of help here. IIRC, they let OpenSSL build static libraries and 
afterwards create shared ones from that (side note: this is possible 
on Darwin because all code is PIC by default). So this may or may not 
solve your problems.

Alternative 3: Try to use the patch that I composed for Fink 
(<http://fink.sourceforge.net>), an add-on distribution of Unix 
software for Mac OS X. That patch solves the problems by adding 
Darwin shared library support directly to OpenSSL 0.9.6 and making 
sure the libraries are built before the openssl executable is linked 
(SHLIB_MARK1 and SHLIB_MARK2). You can get the patch from the CVS 
repository, 
<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/fink/packages/dists/stable/crypto/finkinfo/openssl-0.9.6-1.patch>
 
(Apply with patch -p1 inside the OpenSSL source directory.)

Note that in all three cases you must add -DUSE_TOD to the compiler 
flags because Mac OS X ships with a header file for ftime(), but not 
with an implementation. :-(

Hope this helps,
chrisp

-- 
chrisp a.k.a. Christoph Pfisterer   "If that makes any sense
[EMAIL PROTECTED] - http://chrisp.de      to you, you have a big
PGP key & geek code available        problem."
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to