From fd795679bbcc56980663610c8d9a62ca300b424f Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 8 Jan 2002 09:19:31 +0000 Subject: [PATCH] Patches to make OpenSSL compilable on MacOS/X. Submitted by Pier Fumagalli --- Configure | 2 +- Makefile.org | 11 +++++++++++ crypto/des/des_old.c | 2 +- crypto/o_time.c | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Configure b/Configure index b3d097a24b..0ed5d5c839 100755 --- 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 diff --git a/Makefile.org b/Makefile.org index 5684025ac2..0427ce9647 100644 --- a/Makefile.org +++ b/Makefile.org @@ -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 \ diff --git a/crypto/des/des_old.c b/crypto/des/des_old.c index 1992697362..b6943821f5 100644 --- a/crypto/des/des_old.c +++ b/crypto/des/des_old.c @@ -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); diff --git a/crypto/o_time.c b/crypto/o_time.c index 86b78e39e9..1bc0297b36 100644 --- a/crypto/o_time.c +++ b/crypto/o_time.c @@ -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); -- 2.25.1