diff -ur openssl-0.9.6/Configure openssl-0.9.6-llama/Configure
--- openssl-0.9.6/Configure	Sun Sep 24 11:27:37 2000
+++ openssl-0.9.6-llama/Configure	Sun Mar 18 06:25:19 2001
@@ -121,6 +121,24 @@
 "gcc",		"gcc:-O3::(unknown)::BN_LLONG:::",
 "cc",		"cc:-O::(unknown):::::",
 
+#### Mac OS X (Darwin) setup
+# This config is from Stuart A. Malone of Llamagraphics, Inc.
+# <samalone@llamagraphics.com>.  It is based on a release candidate of
+# Mac OS X, and so it might have to be changed for the final release.
+# Note that Mac OS X basically requires the use of dynamic shared
+# libraries.  This means that the dynamic shared libraries must be
+# installed before you can test the apps.  The makefiles do not
+# currently handle the installation of the dynamic shared libraries
+# automatically, so the recommended installation procedure is:
+#
+#	./config --prefix=/usr/local --openssldir=/usr/local/ssl shared threads
+#	make
+#	sudo make install
+#	sudo cp -R *.dylib /usr/local/lib
+#	make test
+#
+"Darwin","cc:-DTIMES -DNO_GMTIME_R -O3::-D_REENTRANT:::::::::::::darwin-shared:-dynamic",
+
 #### Solaris x86 setups
 # -DNO_INLINE_ASM switches off inline assembler. We have to do it
 # here because whenever GNU C instantiates an assembler template it
@@ -715,8 +733,16 @@
 	$cflags = "$shared_cflag $cflags";
 	if (!$no_shared)
 		{
-		$shared_mark1 = ".shlib-clean.";
-		$shared_mark2 = ".shlib.";
+		if ($target eq "Darwin")
+			{
+			$shared_mark1 = ".shlib.";
+			$shared_mark2 = "";
+			}
+		else
+			{
+			$shared_mark1 = ".shlib-clean.";
+			$shared_mark2 = ".shlib.";
+			}
 		}
 	}
 
diff -ur openssl-0.9.6/INSTALL openssl-0.9.6-llama/INSTALL
--- openssl-0.9.6/INSTALL	Mon Sep 11 08:41:47 2000
+++ openssl-0.9.6-llama/INSTALL	Sun Mar 18 06:08:59 2001
@@ -3,7 +3,8 @@
  ---------------------------------
 
  [Installation on Windows, OpenVMS and MacOS (before MacOS X) is described
-  in INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.]
+  in INSTALL.W32, INSTALL.VMS and INSTALL.MacOS.  There is a special
+  installation note for Mac OS X at the bottom of this file.]
 
  To install OpenSSL, you will need:
 
@@ -276,3 +277,22 @@
  targets for shared library creation, like linux-shared.  Those targets
  can currently be used on their own just as well, but this is expected
  to change in future versions of OpenSSL.
+
+
+ Note on Mac OS X
+ ----------------
+
+ In order to build OpenSSL on Mac OS X, you must first install the Mac
+ OS X Developer Tools.
+
+ Mac OS X basically requires the use of dynamic shared libraries.  This
+ means that the dynamic shared libraries must be installed before you
+ can test the apps.  The makefiles do not currently handle the installation
+ of the dynamic shared libraries automatically, so the recommended
+ installation procedure is:
+
+	./config --prefix=/usr/local --openssldir=/usr/local/ssl shared threads
+	make
+	sudo make install
+	sudo cp -R *.dylib /usr/local/lib
+	make test
diff -ur openssl-0.9.6/Makefile openssl-0.9.6-llama/Makefile
--- openssl-0.9.6/Makefile	Sun Sep 24 11:29:23 2000
+++ openssl-0.9.6-llama/Makefile	Sun Mar 18 07:57:51 2001
@@ -62,7 +62,7 @@
 EX_LIBS= 
 AR=ar r
 RANLIB= /usr/bin/ranlib
-PERL= /usr/local/bin/perl
+PERL= /usr/bin/perl
 TAR= tar
 TARFLAGS= --no-recursion
 
@@ -249,11 +249,44 @@
 		echo "There's no support for shared libraries on this platform" >&2; \
 	fi
 
+libcrypto.dylib: libcrypto.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=crypto $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+libssl.dylib: libcrypto.dylib libssl.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-L. -lcrypto' $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+
 clean-shared:
 	for i in ${SHLIBDIRS}; do \
 	rm -f lib$$i.so \
 		lib$$i.so.${SHLIB_MAJOR} \
 		lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
+	rm -f lib$$i.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib; \
+	done
+
+darwin-shared:
+	libs='${SHLIBDEPS}'; \
+	mid_version='${SHLIB_MINOR}'; \
+	mid_version=$${mid_version%%\.[0-9]*}; \
+	for i in ${SHLIBDIRS}; do \
+	( set -x; ${CC}  -shared -o lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		-nostartfiles -Wl,-dylib,-all_load \
+		-Wl,-dylib_compatibility_version,${SHLIB_MAJOR}.$${mid_version} \
+		-Wl,-dylib_current_version,${SHLIB_MAJOR}.${SHLIB_MINOR} \
+		lib$$i.a $$libs ${EX_LIBS} -lc -lcc_dynamic \
+		/usr/lib/dylib1.o) || exit 1; \
+	libs="$$libs -L. -l$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}"; \
+	( set -x; ln -s lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib; \
+	  ln -s lib$$i.${SHLIB_MAJOR}.dylib lib$$i.dylib) \
 	done
 
 linux-shared:
@@ -305,7 +338,7 @@
 	rm -f *.a */lib */*/lib
 
 clean:
-	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
+	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c *.dylib
 	@for i in $(DIRS) ;\
 	do \
 	if echo "$$i" | grep -v '^\.'; then \
@@ -314,7 +347,7 @@
 		rm -f $(LIBS); \
 	fi; \
 	done;
-	rm -f *.a *.o speed.* *.map *.so .pure core
+	rm -f *.a *.o speed.* *.map *.so *.dylib .pure core
 	rm -f $(TARFILE)
 	@for i in $(ONEDIRS) ;\
 	do \
diff -ur openssl-0.9.6/Makefile.org openssl-0.9.6-llama/Makefile.org
--- openssl-0.9.6/Makefile.org	Thu Sep 21 05:23:13 2000
+++ openssl-0.9.6-llama/Makefile.org	Sun Mar 18 07:14:38 2001
@@ -247,11 +247,44 @@
 		echo "There's no support for shared libraries on this platform" >&2; \
 	fi
 
+libcrypto.dylib: libcrypto.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=crypto $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+libssl.dylib: libcrypto.dylib libssl.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-L. -lcrypto' $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+
 clean-shared:
 	for i in ${SHLIBDIRS}; do \
 	rm -f lib$$i.so \
 		lib$$i.so.${SHLIB_MAJOR} \
 		lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
+	rm -f lib$$i.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib; \
+	done
+
+darwin-shared:
+	libs='${SHLIBDEPS}'; \
+	mid_version='${SHLIB_MINOR}'; \
+	mid_version=$${mid_version%%\.[0-9]*}; \
+	for i in ${SHLIBDIRS}; do \
+	( set -x; ${CC}  -shared -o lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		-nostartfiles -Wl,-dylib,-all_load \
+		-Wl,-dylib_compatibility_version,${SHLIB_MAJOR}.$${mid_version} \
+		-Wl,-dylib_current_version,${SHLIB_MAJOR}.${SHLIB_MINOR} \
+		lib$$i.a $$libs ${EX_LIBS} -lc -lcc_dynamic \
+		/usr/lib/dylib1.o) || exit 1; \
+	libs="$$libs -L. -l$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}"; \
+	( set -x; ln -s lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib; \
+	  ln -s lib$$i.${SHLIB_MAJOR}.dylib lib$$i.dylib) \
 	done
 
 linux-shared:
@@ -303,7 +336,7 @@
 	rm -f *.a */lib */*/lib
 
 clean:
-	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
+	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c *.dylib
 	@for i in $(DIRS) ;\
 	do \
 	if echo "$$i" | grep -v '^\.'; then \
@@ -312,7 +345,7 @@
 		rm -f $(LIBS); \
 	fi; \
 	done;
-	rm -f *.a *.o speed.* *.map *.so .pure core
+	rm -f *.a *.o speed.* *.map *.so *.dylib .pure core
 	rm -f $(TARFILE)
 	@for i in $(ONEDIRS) ;\
 	do \
diff -ur openssl-0.9.6/Makefile.ssl openssl-0.9.6-llama/Makefile.ssl
--- openssl-0.9.6/Makefile.ssl	Sun Sep 24 11:29:23 2000
+++ openssl-0.9.6-llama/Makefile.ssl	Sun Mar 18 07:57:51 2001
@@ -62,7 +62,7 @@
 EX_LIBS= 
 AR=ar r
 RANLIB= /usr/bin/ranlib
-PERL= /usr/local/bin/perl
+PERL= /usr/bin/perl
 TAR= tar
 TARFLAGS= --no-recursion
 
@@ -249,11 +249,44 @@
 		echo "There's no support for shared libraries on this platform" >&2; \
 	fi
 
+libcrypto.dylib: libcrypto.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=crypto $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+libssl.dylib: libcrypto.dylib libssl.a
+	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-L. -lcrypto' $(SHLIB_TARGET); \
+	else \
+		echo "There's no support for shared libraries on this platform" >&2; \
+	fi
+
 clean-shared:
 	for i in ${SHLIBDIRS}; do \
 	rm -f lib$$i.so \
 		lib$$i.so.${SHLIB_MAJOR} \
 		lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
+	rm -f lib$$i.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib; \
+	done
+
+darwin-shared:
+	libs='${SHLIBDEPS}'; \
+	mid_version='${SHLIB_MINOR}'; \
+	mid_version=$${mid_version%%\.[0-9]*}; \
+	for i in ${SHLIBDIRS}; do \
+	( set -x; ${CC}  -shared -o lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		-nostartfiles -Wl,-dylib,-all_load \
+		-Wl,-dylib_compatibility_version,${SHLIB_MAJOR}.$${mid_version} \
+		-Wl,-dylib_current_version,${SHLIB_MAJOR}.${SHLIB_MINOR} \
+		lib$$i.a $$libs ${EX_LIBS} -lc -lcc_dynamic \
+		/usr/lib/dylib1.o) || exit 1; \
+	libs="$$libs -L. -l$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}"; \
+	( set -x; ln -s lib$$i.${SHLIB_MAJOR}.${SHLIB_MINOR}.dylib \
+		lib$$i.${SHLIB_MAJOR}.dylib; \
+	  ln -s lib$$i.${SHLIB_MAJOR}.dylib lib$$i.dylib) \
 	done
 
 linux-shared:
@@ -305,7 +338,7 @@
 	rm -f *.a */lib */*/lib
 
 clean:
-	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
+	rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c *.dylib
 	@for i in $(DIRS) ;\
 	do \
 	if echo "$$i" | grep -v '^\.'; then \
@@ -314,7 +347,7 @@
 		rm -f $(LIBS); \
 	fi; \
 	done;
-	rm -f *.a *.o speed.* *.map *.so .pure core
+	rm -f *.a *.o speed.* *.map *.so *.dylib .pure core
 	rm -f $(TARFILE)
 	@for i in $(ONEDIRS) ;\
 	do \
diff -ur openssl-0.9.6/apps/CA.pl openssl-0.9.6-llama/apps/CA.pl
--- openssl-0.9.6/apps/CA.pl	Sun Sep 24 11:29:35 2000
+++ openssl-0.9.6-llama/apps/CA.pl	Sun Mar 18 07:58:05 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 #
 # CA - wrapper around ca to make it easier to use ... basically ca requires
 #      some setup stuff to be done before you can use it and this makes
diff -ur openssl-0.9.6/apps/der_chop openssl-0.9.6-llama/apps/der_chop
--- openssl-0.9.6/apps/der_chop	Sun Sep 24 11:29:34 2000
+++ openssl-0.9.6-llama/apps/der_chop	Sun Mar 18 07:58:05 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 #
 # der_chop ... this is one total hack that Eric is really not proud of
 #              so don't look at it and don't ask for support
diff -ur openssl-0.9.6/apps/speed.c openssl-0.9.6-llama/apps/speed.c
--- openssl-0.9.6/apps/speed.c	Sun Sep 24 11:27:42 2000
+++ openssl-0.9.6-llama/apps/speed.c	Sat Mar 17 15:14:06 2001
@@ -87,7 +87,7 @@
 #elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
 # define TIMES
 #endif
-#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE)
+#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(MPE) && !defined(__APPLE__)
 # define TIMEB
 #endif
 
Only in openssl-0.9.6-llama/apps: speed.c~
Only in openssl-0.9.6-llama/certs: .0
diff -ur openssl-0.9.6/crypto/asn1/a_gentm.c openssl-0.9.6-llama/crypto/asn1/a_gentm.c
--- openssl-0.9.6/crypto/asn1/a_gentm.c	Mon Sep 11 08:42:04 2000
+++ openssl-0.9.6-llama/crypto/asn1/a_gentm.c	Sat Mar 17 09:25:14 2001
@@ -203,7 +203,7 @@
 	if (s == NULL)
 		return(NULL);
 
-#if defined(THREADS) && !defined(WIN32)
+#if defined(THREADS) && !defined(WIN32) && !defined(NO_GMTIME_R)
 	gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
 	ts=&data;
 #else
Only in openssl-0.9.6-llama/crypto/asn1: a_gentm.c~
diff -ur openssl-0.9.6/crypto/asn1/a_time.c openssl-0.9.6-llama/crypto/asn1/a_time.c
--- openssl-0.9.6/crypto/asn1/a_time.c	Mon Sep 11 08:42:05 2000
+++ openssl-0.9.6-llama/crypto/asn1/a_time.c	Sat Mar 17 09:25:49 2001
@@ -113,7 +113,7 @@
 ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
 	{
 	struct tm *ts;
-#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(NO_GMTIME_R)
 	struct tm data;
 
 	gmtime_r(&t,&data);
Only in openssl-0.9.6-llama/crypto/asn1: a_time.c~
diff -ur openssl-0.9.6/crypto/asn1/a_utctm.c openssl-0.9.6-llama/crypto/asn1/a_utctm.c
--- openssl-0.9.6/crypto/asn1/a_utctm.c	Mon Sep 11 08:42:05 2000
+++ openssl-0.9.6-llama/crypto/asn1/a_utctm.c	Sat Mar 17 09:26:30 2001
@@ -203,7 +203,7 @@
 	if (s == NULL)
 		return(NULL);
 
-#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(NO_GMTIME_R)
 	gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
 	ts=&data;
 #else
@@ -286,7 +286,7 @@
 
 	t -= offset*60; /* FIXME: may overflow in extreme cases */
 
-#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
+#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) && !defined(NO_GMTIME_R)
 	{ struct tm data; gmtime_r(&t, &data); tm = &data; }
 #else
 	tm = gmtime(&t);
Only in openssl-0.9.6-llama/crypto/asn1: a_utctm.c~
Only in openssl-0.9.6-llama/crypto/stack: stack.a
Only in openssl-0.9.6-llama/test: certCA.srl
Only in openssl-0.9.6-llama/test: testkey.pem
Only in openssl-0.9.6-llama/test: testreq.pem
diff -ur openssl-0.9.6/tools/c_rehash openssl-0.9.6-llama/tools/c_rehash
--- openssl-0.9.6/tools/c_rehash	Sun Sep 24 11:29:34 2000
+++ openssl-0.9.6-llama/tools/c_rehash	Sun Mar 18 07:58:05 2001
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
 
 
 # Perl c_rehash script, scan all files in a directory
