<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff -purN openssl-0.9.7j.orig/Configure openssl-0.9.7j/Configure
--- openssl-0.9.7j.orig/Configure	2006-04-24 09:32:55.000000000 -0400
+++ openssl-0.9.7j/Configure	2007-06-06 02:54:39.000000000 -0400
@@ -122,6 +122,8 @@ my $alpha_asm="::::::::";
 
 #config-string	$cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags
 
+my $pspdev=$ENV{'PSPDEV'};
+
 my %table=(
 # File 'TABLE' (created by 'make TABLE') contains the data from this list,
 # formatted for better readability.
@@ -587,6 +589,9 @@ my %table=(
 ##### Compaq Non-Stop Kernel (Tandem)
 "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
 
+##### PSP
+"psp", "psp-gcc:-mno-explicit-relocs -DPSP -DNO_CHMOD -DL_ENDIAN -DNO_STRINGS_H -DNO_SYSLOG -DNO_SYS_UN_H -DOPENSSL_SYS_PSP -O2 -G0 -I$pspdev/psp/sdk/include::(unknown)::-lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -liberty -lpspsdk -lpspnet -lpspaudio -lpspgu -lpspge -lpsphprm -lpspkernel -L$pspdev/psp/lib -L$pspdev/psp/sdk/lib:LL:::",
+#-DOPENSSL_NO_SOCK 
 );
 
 my @WinTargets=qw(VC-NT VC-CE VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS
@@ -976,6 +981,7 @@ $default_ranlib= &amp;which("ranlib") or $de
 $perl=$ENV{'PERL'} or $perl=&amp;which("perl5") or $perl=&amp;which("perl")
   or $perl="perl";
 
+
 chop $openssldir if $openssldir =~ /\/$/;
 chop $prefix if $prefix =~ /\/$/;
 
diff -purN openssl-0.9.7j.orig/INSTALL.PSP openssl-0.9.7j/INSTALL.PSP
--- openssl-0.9.7j.orig/INSTALL.PSP	1969-12-31 19:00:00.000000000 -0500
+++ openssl-0.9.7j/INSTALL.PSP	2007-06-06 02:54:39.000000000 -0400
@@ -0,0 +1,11 @@
+OpenSSL PSP Port by Raf.
+------------------------
+
+To configure and compile, run:
+
+user$&gt; make -f Makefile.psp prepare all
+
+To install, as root run:
+
+root$&gt; make install
+
diff -purN openssl-0.9.7j.orig/Makefile openssl-0.9.7j/Makefile
--- openssl-0.9.7j.orig/Makefile	2006-05-04 09:15:47.000000000 -0400
+++ openssl-0.9.7j/Makefile	2007-06-06 03:14:10.000000000 -0400
@@ -3,6 +3,8 @@
 ##
 ## Makefile for OpenSSL
 ##
+PSPDEV=$(shell psp-config --psp-prefix)
+PSPSDK=$(shell psp-config --pspsdk-path)
 
 VERSION=0.9.7j
 MAJOR=0
@@ -12,9 +14,9 @@ SHLIB_VERSION_HISTORY=
 SHLIB_MAJOR=0
 SHLIB_MINOR=9.7
 SHLIB_EXT=
-PLATFORM=dist
-OPTIONS= no-krb5
-CONFIGURE_ARGS=dist
+PLATFORM=psp
+OPTIONS=--prefix=$(PSPDEV) threads zlib no-shared no-asm no-krb5
+CONFIGURE_ARGS=psp --prefix=$(PSPDEV) threads zlib no-shared no-asm
 SHLIB_TARGET=
 
 # HERE indicates where this Makefile lives.  This can be used to indicate
@@ -26,10 +28,10 @@ HERE=.
 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
 # Normally it is left empty.
 INSTALL_PREFIX=
-INSTALLTOP=/usr/local/ssl
+INSTALLTOP=$(PSPDEV)
 
 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
-OPENSSLDIR=/usr/local/ssl
+OPENSSLDIR=$(PSPDEV)/ssl
 
 # NO_IDEA - Define to build without the IDEA algorithm
 # NO_RC4  - Define to build without the RC4 algorithm
@@ -59,12 +61,12 @@ OPENSSLDIR=/usr/local/ssl
 # equal 4.
 # PKCS1_CHECK - pkcs1 tests.
 
-CC= cc
+CC= psp-gcc
 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
-CFLAG= -DOPENSSL_NO_KRB5 -O
+CFLAG= -mno-explicit-relocs -DZLIB -DOPENSSL_THREADS -DOPENSSL_NO_KRB5 -DOPENSSL_NO_ASM -DPSP -DNO_CHMOD -DL_ENDIAN -DNO_STRINGS_H -DNO_SYSLOG -DNO_SYS_UN_H -DOPENSSL_SYS_PSP -O2 -G0 -I$(PSPSDK)/include
 DEPFLAG= 
 PEX_LIBS= 
-EX_LIBS= 
+EX_LIBS= -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -liberty -lpspsdk -lpspnet -lpspaudio -lpspgu -lpspge -lpsphprm -lpspkernel -L$(PSPDEV)/lib -L$(PSPSDK)/lib -lz
 EXE_EXT= 
 ARFLAGS= 
 AR=ar $(ARFLAGS) r
diff -purN openssl-0.9.7j.orig/Makefile.psp openssl-0.9.7j/Makefile.psp
--- openssl-0.9.7j.orig/Makefile.psp	1969-12-31 19:00:00.000000000 -0500
+++ openssl-0.9.7j/Makefile.psp	2007-06-06 02:54:39.000000000 -0400
@@ -0,0 +1,8 @@
+prepare:
+	chmod u+x configure_psp.sh &amp;&amp; ./configure_psp.sh
+
+all:
+	make -f Makefile
+
+install:
+	@echo "As root, run make install"
diff -purN openssl-0.9.7j.orig/apps/s_client.c openssl-0.9.7j/apps/s_client.c
--- openssl-0.9.7j.orig/apps/s_client.c	2005-02-19 05:17:25.000000000 -0500
+++ openssl-0.9.7j/apps/s_client.c	2007-06-06 02:54:39.000000000 -0400
@@ -117,6 +117,9 @@
 #ifdef OPENSSL_NO_STDIO
 #define APPS_WIN16
 #endif
+#ifdef OPENSSL_SYS_PSP
+#include &lt;sys/fd_set.h&gt;
+#endif
 
 /* With IPv6, it looks like Digital has mixed up the proper order of
    recursive header file inclusion, resulting in the compiler complaining
diff -purN openssl-0.9.7j.orig/apps/s_server.c openssl-0.9.7j/apps/s_server.c
--- openssl-0.9.7j.orig/apps/s_server.c	2003-09-27 17:56:12.000000000 -0400
+++ openssl-0.9.7j/apps/s_server.c	2007-06-06 02:54:39.000000000 -0400
@@ -119,6 +119,9 @@
 #ifdef OPENSSL_NO_STDIO
 #define APPS_WIN16
 #endif
+#ifdef OPENSSL_SYS_PSP
+#include &lt;sys/fd_set.h&gt;
+#endif
 
 /* With IPv6, it looks like Digital has mixed up the proper order of
    recursive header file inclusion, resulting in the compiler complaining
diff -purN openssl-0.9.7j.orig/apps/s_socket.c openssl-0.9.7j/apps/s_socket.c
--- openssl-0.9.7j.orig/apps/s_socket.c	2005-01-04 05:21:54.000000000 -0500
+++ openssl-0.9.7j/apps/s_socket.c	2007-06-06 02:54:39.000000000 -0400
@@ -479,6 +479,12 @@ err:
 	return(0);
 	}
 
+#ifdef OPENSSL_SYS_PSP
+int extract_port(char *str, short *port_ptr)
+{
+return -1;
+}
+#else
 int extract_port(char *str, short *port_ptr)
 	{
 	int i;
@@ -499,6 +505,7 @@ int extract_port(char *str, short *port_
 		}
 	return(1);
 	}
+#endif
 
 #define GHBN_NUM	4
 static struct ghbn_cache_st
diff -purN openssl-0.9.7j.orig/apps/s_time.c openssl-0.9.7j/apps/s_time.c
--- openssl-0.9.7j.orig/apps/s_time.c	2003-12-27 09:40:55.000000000 -0500
+++ openssl-0.9.7j/apps/s_time.c	2007-06-06 02:54:39.000000000 -0400
@@ -66,6 +66,9 @@
 #include &lt;stdio.h&gt;
 #include &lt;stdlib.h&gt;
 #include &lt;string.h&gt;
+#ifdef OPENSSL_SYS_PSP
+#include &lt;sys/fd_set.h&gt;
+#endif
 
 #define USE_SOCKETS
 #include "apps.h"
@@ -370,6 +373,14 @@ bad:
 #define START	0
 #define STOP	1
 
+#ifdef OPENSSL_SYS_PSP
+clock_t _times(struct tms *buf)
+{
+	buf-&gt;tms_utime = sceKernelLibcClock();
+	return sceKernelLibcClock();
+}
+#endif
+
 static double tm_Time_F(int s)
 	{
 	static double ret;
diff -purN openssl-0.9.7j.orig/apps/speed.c openssl-0.9.7j/apps/speed.c
--- openssl-0.9.7j.orig/apps/speed.c	2005-05-15 21:26:01.000000000 -0400
+++ openssl-0.9.7j/apps/speed.c	2007-06-06 02:54:39.000000000 -0400
@@ -189,6 +189,9 @@
 
 /* The following if from times(3) man page.  It may need to be changed */
 #ifndef HZ
+# if defined(OPENSSL_SYS_PSP)
+#	define HZ CLOCKS_PER_SEC
+# else
 # if defined(_SC_CLK_TCK) \
      &amp;&amp; (!defined(OPENSSL_SYS_VMS) || __CTRL_VER &gt;= 70000000)
 #  define HZ ((double)sysconf(_SC_CLK_TCK))
@@ -203,9 +206,10 @@
 #   define HZ ((double)CLK_TCK)
 #  endif
 # endif
+# endif
 #endif
 
-#if !defined(OPENSSL_SYS_VMS) &amp;&amp; !defined(OPENSSL_SYS_WINDOWS) &amp;&amp; !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) &amp;&amp; !defined(OPENSSL_SYS_OS2)
+#if !defined(OPENSSL_SYS_VMS) &amp;&amp; !defined(OPENSSL_SYS_WINDOWS) &amp;&amp; !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) &amp;&amp; !defined(OPENSSL_SYS_OS2) &amp;&amp; !defined(OPENSSL_SYS_PSP)
 # define HAVE_FORK 1
 #endif
 
@@ -239,6 +243,10 @@ static int lengths[SIZE_NUM]={16,64,256,
 static double rsa_results[RSA_NUM][2];
 static double dsa_results[DSA_NUM][2];
 
+#ifdef OPENSSL_SYS_PSP
+#undef SIGALRM
+#endif
+
 #ifdef SIGALRM
 #if defined(__STDC__) || defined(sgi) || defined(_AIX)
 #define SIGRETTYPE void
@@ -345,6 +353,22 @@ static double Time_F(int s)
 			return((ret &lt; 0.001)?0.001:ret);
 			}
                 }
+# elif OPENSSL_SYS_PSP
+                {
+		static unsigned long tick_start, tick_end;
+
+		if( s == START )
+			{
+			tick_start = clock();
+			return 0;
+			}
+		else
+			{
+			tick_end = clock();
+			ret = (double)(tick_end - tick_start) / (double)HZ;
+			return((ret &lt; 0.001)?0.001:ret);
+			}
+                }
 # elif defined(TIMEB)
 		{
 		static struct timeb tstart,tend;
diff -purN openssl-0.9.7j.orig/configure_psp.sh openssl-0.9.7j/configure_psp.sh
--- openssl-0.9.7j.orig/configure_psp.sh	1969-12-31 19:00:00.000000000 -0500
+++ openssl-0.9.7j/configure_psp.sh	2007-06-06 02:54:39.000000000 -0400
@@ -0,0 +1,20 @@
+#!/bin/sh
+export SHAREDLIB_DIR="../.."
+rm Makefile config.cache config.h config.log config.status  stamp-h 
+export psp=yes
+export INCL="-I$SHAREDLIB_DIR/Tools"
+export CC="psp-gcc -I$SHAREDLIB_DIR/libpthread -I$PSPDEV/psp/include/ -I$PSPDEV/psp/sdk/include/ -I$PSPDEV/psp/include/machine/" 
+export CFLAGS="-I$PSPDEV/psp/sdk/include/ -I$PSPDEV/psp/include/machine/ $INCL" 
+export LDFLAGS="-L$(psp-config --pspsdk-path)/lib -L$(psp-config --pspsdk-path)/sdk/lib -L$SHAREDLIB_DIR/lib" 
+export LIBS="-lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -liberty -lpspsdk -lpspnet -lpspaudio -lpspgu -lpspge -lpsphprm -lpspkernel" 
+
+echo "Building internal configure dependencies..."
+cd $SHAREDLIB_DIR/libpthread &amp;&amp; pwd &amp;&amp; make all || (echo "Error building libpthread"; exit 0);
+cd -
+
+echo "Calling configure..."
+./Configure psp --prefix=$(psp-config --psp-prefix) threads zlib no-shared no-asm
+
+echo "Done."
+
+
diff -purN openssl-0.9.7j.orig/crypto/Makefile openssl-0.9.7j/crypto/Makefile
--- openssl-0.9.7j.orig/crypto/Makefile	2006-02-03 20:50:06.000000000 -0500
+++ openssl-0.9.7j/crypto/Makefile	2007-06-06 03:14:10.000000000 -0400
@@ -9,7 +9,7 @@ INCLUDE=	-I. -I$(TOP) -I../include
 INCLUDES=	-I.. -I../.. -I../../include
 CFLAG=		-g
 INSTALL_PREFIX=
-OPENSSLDIR=     /usr/local/ssl
+OPENSSLDIR=     $(shell psp-config --psp-prefix)/ssl
 INSTALLTOP=	/usr/local/ssl
 MAKEDEPPROG=	makedepend
 MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
@@ -19,9 +19,11 @@ AR=		ar r
 
 PEX_LIBS=
 EX_LIBS=
- 
-CFLAGS= $(INCLUDE) $(CFLAG)
 
+CFLAGS= $(INCLUDE) $(CFLAG) -DOPENSSLDIR="$(OPENSSLDIR)"
+
+foo:
+	echo -- $(CFLAGS)
 
 LIBS=
 
diff -purN openssl-0.9.7j.orig/crypto/bio/b_sock.c openssl-0.9.7j/crypto/bio/b_sock.c
--- openssl-0.9.7j.orig/crypto/bio/b_sock.c	2003-12-27 09:40:49.000000000 -0500
+++ openssl-0.9.7j/crypto/bio/b_sock.c	2007-06-06 02:54:39.000000000 -0400
@@ -159,8 +159,11 @@ int BIO_get_host_ip(const char *str, uns
 int BIO_get_port(const char *str, unsigned short *port_ptr)
 	{
 	int i;
+#ifdef OPENSSL_SYS_PSP
+	char *s = NULL;
+#else
 	struct servent *s;
-
+#endif
 	if (str == NULL)
 		{
 		BIOerr(BIO_F_BIO_GET_PORT,BIO_R_NO_PORT_DEFINED);
@@ -171,6 +174,9 @@ int BIO_get_port(const char *str, unsign
 		*port_ptr=(unsigned short)i;
 	else
 		{
+#ifdef OPENSSL_SYS_PSP
+		s = NULL;
+#else
 		CRYPTO_w_lock(CRYPTO_LOCK_GETSERVBYNAME);
 		/* Note: under VMS with SOCKETSHR, it seems like the first
 		 * parameter is 'char *', instead of 'const char *'
@@ -183,6 +189,7 @@ int BIO_get_port(const char *str, unsign
 		if(s != NULL)
 			*port_ptr=ntohs((unsigned short)s-&gt;s_port);
 		CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME);
+#endif
 		if(s == NULL)
 			{
 			if (strcmp(str,"http") == 0)
@@ -490,7 +497,7 @@ void BIO_sock_cleanup(void)
 #endif
 	}
 
-#if !defined(OPENSSL_SYS_VMS) || __VMS_VER &gt;= 70000000
+#if !defined(OPENSSL_SYS_VMS) &amp;&amp; !defined(OPENSSL_SYS_PSP) || __VMS_VER &gt;= 70000000
 
 int BIO_socket_ioctl(int fd, long type, void *arg)
 	{
diff -purN openssl-0.9.7j.orig/crypto/opensslconf.h openssl-0.9.7j/crypto/opensslconf.h
--- openssl-0.9.7j.orig/crypto/opensslconf.h	2006-05-04 09:15:47.000000000 -0400
+++ openssl-0.9.7j/crypto/opensslconf.h	2007-06-06 03:14:10.000000000 -0400
@@ -9,6 +9,12 @@
 #endif
 
 #endif /* OPENSSL_DOING_MAKEDEPEND */
+#ifndef OPENSSL_THREADS
+# define OPENSSL_THREADS
+#endif
+#ifndef OPENSSL_NO_ASM
+# define OPENSSL_NO_ASM
+#endif
 
 /* The OPENSSL_NO_* macros are also defined as NO_* if the application
    asks for it.  This is a transient feature that is provided for those
diff -purN openssl-0.9.7j.orig/crypto/rand/rand_egd.c openssl-0.9.7j/crypto/rand/rand_egd.c
--- openssl-0.9.7j.orig/crypto/rand/rand_egd.c	2005-02-19 05:17:26.000000000 -0500
+++ openssl-0.9.7j/crypto/rand/rand_egd.c	2007-06-06 02:54:39.000000000 -0400
@@ -95,7 +95,7 @@
  *   RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
  */
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_VOS)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_VOS) || defined(OPENSSL_SYS_PSP)
 int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
 	{
 	return(-1);
diff -purN openssl-0.9.7j.orig/crypto/rand/rand_unix.c openssl-0.9.7j/crypto/rand/rand_unix.c
--- openssl-0.9.7j.orig/crypto/rand/rand_unix.c	2005-01-14 11:19:47.000000000 -0500
+++ openssl-0.9.7j/crypto/rand/rand_unix.c	2007-06-06 02:54:39.000000000 -0400
@@ -115,13 +115,16 @@
 #include &lt;openssl/rand.h&gt;
 #include "rand_lcl.h"
 
-#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS))
+#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS)) || defined(OPENSSL_SYS_PSP)
 
 #include &lt;sys/types.h&gt;
 #include &lt;sys/time.h&gt;
 #include &lt;sys/times.h&gt;
 #include &lt;sys/stat.h&gt;
 #include &lt;fcntl.h&gt;
+#ifdef OPENSSL_SYS_PSP
+#include &lt;sys/fd_set.h&gt;
+#endif
 #include &lt;unistd.h&gt;
 #include &lt;time.h&gt;
 
@@ -257,8 +260,10 @@ int RAND_poll(void)
 	/* put in some default random data, we need more than just this */
 	l=curr_pid;
 	RAND_add(&amp;l,sizeof(l),0);
+#if !defined (OPENSSL_SYS_PSP)
 	l=getuid();
 	RAND_add(&amp;l,sizeof(l),0);
+#endif
 
 	l=time(NULL);
 	RAND_add(&amp;l,sizeof(l),0);
diff -purN openssl-0.9.7j.orig/crypto/ui/ui_openssl.c openssl-0.9.7j/crypto/ui/ui_openssl.c
--- openssl-0.9.7j.orig/crypto/ui/ui_openssl.c	2003-01-13 08:15:19.000000000 -0500
+++ openssl-0.9.7j/crypto/ui/ui_openssl.c	2007-06-06 02:54:39.000000000 -0400
@@ -193,7 +193,7 @@
 # define SGTTY
 #endif
 
-#if defined(OPENSSL_SYS_VXWORKS)
+#if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_PSP)
 #undef TERMIOS
 #undef TERMIO
 #undef SGTTY
@@ -275,7 +275,7 @@ static long tty_orig[3], tty_new[3]; /* 
 static long status;
 static unsigned short channel = 0;
 #else
-#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
+#if !defined(OPENSSL_SYS_MSDOS) &amp;&amp; !defined(OPENSSL_SYS_PSP) || defined(__DJGPP__)
 static TTY_STRUCT tty_orig,tty_new;
 #endif
 #endif
diff -purN openssl-0.9.7j.orig/crypto/uid.c openssl-0.9.7j/crypto/uid.c
--- openssl-0.9.7j.orig/crypto/uid.c	2002-10-09 09:41:11.000000000 -0400
+++ openssl-0.9.7j/crypto/uid.c	2007-06-06 02:54:39.000000000 -0400
@@ -65,7 +65,7 @@ int OPENSSL_issetugid(void)
 	return issetugid();
 	}
 
-#elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS)
+#elif defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_PSP)
 
 int OPENSSL_issetugid(void)
 	{
diff -purN openssl-0.9.7j.orig/include/openssl/opensslconf.h openssl-0.9.7j/include/openssl/opensslconf.h
--- openssl-0.9.7j.orig/include/openssl/opensslconf.h	2006-05-04 09:15:47.000000000 -0400
+++ openssl-0.9.7j/include/openssl/opensslconf.h	2007-06-06 03:14:10.000000000 -0400
@@ -9,6 +9,12 @@
 #endif
 
 #endif /* OPENSSL_DOING_MAKEDEPEND */
+#ifndef OPENSSL_THREADS
+# define OPENSSL_THREADS
+#endif
+#ifndef OPENSSL_NO_ASM
+# define OPENSSL_NO_ASM
+#endif
 
 /* The OPENSSL_NO_* macros are also defined as NO_* if the application
    asks for it.  This is a transient feature that is provided for those
diff -purN openssl-0.9.7j.orig/include/openssl/opensslconf.h.rej openssl-0.9.7j/include/openssl/opensslconf.h.rej
--- openssl-0.9.7j.orig/include/openssl/opensslconf.h.rej	1969-12-31 19:00:00.000000000 -0500
+++ openssl-0.9.7j/include/openssl/opensslconf.h.rej	2007-06-06 03:14:17.000000000 -0400
@@ -0,0 +1,17 @@
+***************
+*** 33,39 ****
+  
+  #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
+  #if defined(HEADER_CRYPTLIB_H) &amp;&amp; !defined(OPENSSLDIR)
+- #define OPENSSLDIR "/usr/local/pspdev/psp/ssl"
+  #endif
+  #endif
+  
+--- 33,39 ----
+  
+  #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
+  #if defined(HEADER_CRYPTLIB_H) &amp;&amp; !defined(OPENSSLDIR)
++ #define OPENSSLDIR "/usr/local/ssl"
+  #endif
+  #endif
+  
diff -purN openssl-0.9.7j.orig/ssl/ssl_cert.c openssl-0.9.7j/ssl/ssl_cert.c
--- openssl-0.9.7j.orig/ssl/ssl_cert.c	2005-06-01 04:36:38.000000000 -0400
+++ openssl-0.9.7j/ssl/ssl_cert.c	2007-06-06 02:54:39.000000000 -0400
@@ -746,6 +746,10 @@ err:
 #ifndef OPENSSL_SYS_VMS		/* XXXX This may be fixed in the future */
 #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! */
 
+#if defined(OPENSSL_SYS_PSP)
+#include &lt;sys/dirent.h&gt;
+#endif
+
 int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
 				       const char *dir)
 	{
diff -purN openssl-0.9.7j.orig/tools/c_rehash openssl-0.9.7j/tools/c_rehash
--- openssl-0.9.7j.orig/tools/c_rehash	2006-05-04 09:15:54.000000000 -0400
+++ openssl-0.9.7j/tools/c_rehash	2007-06-06 03:14:17.000000000 -0400
@@ -6,7 +6,8 @@
 
 my $openssl;
 
-my $dir = "/usr/local/ssl";
+chomp (my $psp_prefix = `psp-config --psp-prefix`);
+my $dir = "$psp_prefix/ssl";
 
 if(defined $ENV{OPENSSL}) {
 	$openssl = $ENV{OPENSSL};
</pre></body></html>