How to compile OpenSSL 0.9.6b under X?


Hi All!

I want to compile newest OpenSSL 0.9.6b on my Mac OS X 10.0.4 box... but at the end of compilation I only got many errors from linker. :-(

I replaced a string 'Rhapsody' in config script with a string 'Darwin', and all sources were configured without any errors, then compilation ran nice too, until I got this (all libraries *.a are created during the compilation process):

cc -DMONOLITH -I../include -O3 -DB_ENDIAN -c -o openssl.o openssl.c
rm -f openssl
cc -o openssl -DMONOLITH -I../include -O3 -DB_ENDIAN openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o x509.o genrsa.o gendsa.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o -L.. -lssl -L.. -lcrypto
/usr/bin/ld: Undefined symbols:
make[1]: *** [openssl] Error 1
make: *** [sub_all] Error 1

Any ideas?!




The problem is that even though you have -L.. on the command line, the
linker is *preferring* to link in the Apple supplied /usr/lib/libcrypto.dylib
instead of the openssl one and those symbols are not defined in the Apple libraries. If you didn't build openssl dylib's(you built .a's
instead, you can quickly get past the problem by specifying the
path to your .a's (and not using -L.. -lcrypto).