Patches to make OpenSSL compilable on MacOS/X.
authorRichard Levitte <levitte@openssl.org>
Tue, 8 Jan 2002 09:19:31 +0000 (09:19 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 8 Jan 2002 09:19:31 +0000 (09:19 +0000)
Submitted by Pier Fumagalli <pier@betaversion.org>

Configure
Makefile.org
crypto/des/des_old.c
crypto/o_time.c

index b3d097a..0ed5d5c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -514,7 +514,7 @@ my %table=(
 
 ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
 "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
-"darwin-ppc-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::-fPIC",
+"darwin-ppc-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
 "darwin-i386-cc","cc:-O3 -nostdinc -I/System/Library/Frameworks/System.framework/Headers -I/System/Library/Frameworks/System.frameworks/Headers/bsd -I/usr/include -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown):MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::-fPIC",
 
 ##### Sony NEWS-OS 4.x
index 5684025..0427ce9 100644 (file)
@@ -274,6 +274,17 @@ DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
        [ -n "$$my_ld" ] && \
        $$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1
 
+# For Darwin AKA Mac OS/X (dyld)
+do_darwin-shared: 
+       libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x ; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
+               lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               -compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
+               -install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
+       libs="$$libs -l`basename $$i${SHLIB_EXT} .dylib`"; \
+       echo "" ; \
+       done
+
 # This assumes that GNU utilities are *not* used
 do_alpha-osf1-shared:
        if ${DETECT_GNU_LD}; then \
index 1992697..b694382 100644 (file)
@@ -193,7 +193,7 @@ char *des_crypt(const char *buf,const char *salt)
        {
        return DES_crypt(buf, salt);
        }
-#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT)
+#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(_DARWIN)
 char *crypt(const char *buf,const char *salt)
        {
        return DES_crypt(buf, salt);
index 86b78e3..1bc0297 100644 (file)
@@ -73,7 +73,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
        {
        struct tm *ts = NULL;
 
-#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_OS2) && !defined(__CYGWIN32__) && (!defined(OPENSSL_SYS_VMS) || defined(gmtime_r))
+#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_OS2) && !defined(__CYGWIN32__) && (!defined(OPENSSL_SYS_VMS) || defined(gmtime_r)) && !defined(OPENSSL_SYS_MACOSX)
        /* should return &data, but doesn't on some systems,
           so we don't even look at the return value */
        gmtime_r(timer,result);