This patch adds support for AmigaOS 2-3 with ixemul.library, and for
AmigaOS 4. It incorporates my previous patch to crypto/rand/rand_unix.c
since it was neither accepted nor rejected.
TODO: Fix native build and testing. Only cross-compiling on a UNIX
flavour is supported for now. Write some nifty install docs.
List of changes:
Configure: Add targets amigaos-m68k-ixemul and amigaos-ppc.
e_os.h: Add system specifics.
e_os2.h: Define symbol OPENSSL_SYS_AMIGAOS if compiling
for AmigaOS.
apps/apps.c: Use the same code for AmigaOS as Netware uses
when handling time.
apps/ca.c: Use the code that doesn't include <sys/file.h>
for AmigaOS too.
apps/speed.c: Use the code that doesn't define HAVE_FORK for
AmigaOS too.
crypto/rand/rand_egd.c: Use the dummy functions for AmigaOS.
crypto/rand/rand_unix.c: 1) Remove inclusion of <sys/times.h>, since
nothing depends directly on that header and clib2 doesn't have it. If
something breaks, it should be fixed by including the proper header
instead. 2) For AmigaOS, seed the PRNG somewhat more than in the generic
case.
crypto/ui/ui_openssl.c: Set DEV_TTY to "/CONSOLE" for AmigaOS.
Cheers,
Johan Gill
Index: Configure
===================================================================
RCS file: /bulky/openssl/cvs/openssl/Configure,v
retrieving revision 1.517
diff -u -r1.517 Configure
--- Configure 6 Nov 2005 17:58:24 -0000 1.517
+++ Configure 16 Nov 2005 11:39:21 -0000
@@ -526,6 +526,12 @@
##### 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:::",
+##### AmigaOS < 4 with ixemul.library
+"amigaos-m68k-ixemul","m68k-amigaos-gcc:-DB_ENDIAN -O2
-Wall:::::RC4_CHAR:::::::::::::::::m68k-amigaos-ranlib",
+
+##### AmigaOS 4
+"amigaos-ppc","ppc-amigaos-gcc:-DB_ENDIAN -DTERMIOS -O2 -Wall::::-lunix
-lnet:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1
DES_UNROLL:::::::::::::::::ppc-amigaos-ranlib",
+
);
my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
Index: e_os.h
===================================================================
RCS file: /bulky/openssl/cvs/openssl/e_os.h,v
retrieving revision 1.91
diff -u -r1.91 e_os.h
--- e_os.h 9 Nov 2005 17:19:38 -0000 1.91
+++ e_os.h 17 Nov 2005 09:39:58 -0000
@@ -383,8 +383,30 @@
# define LIST_SEPARATOR_CHAR ';'
# define EXIT(n) { if (n) printf("ERROR: %d\n", (int)n); exit(n); }
+# elif defined(OPENSSL_SYS_AMIGAOS)
+
+# define __USE_INLINE__
+# include <proto/exec.h>
+# undef __USE_INLINE__
+# include <unistd.h>
+# include <sys/types.h>
+# undef LONG /* LONG is a #define in AmigaOS headers */
+# define OPENSSL_CONF "openssl.cnf"
+# define SSLEAY_CONF OPENSSL_CONF
+# define RFILE ".rnd"
+# define LIST_SEPARATOR_CHAR '|'
+# define NUL_DEV "/NIL"
+# ifndef CLK_TCK
+# define CLK_TCK 50
+# endif
+# define NO_SYSLOG
+# define NO_SYS_PARAM_H
+# undef DEVRANDOM
+# undef DEVRANDOM_EGD
+# define EXIT(n) exit(n)
+
# else
- /* !defined VMS */
+ /* other systems */
# ifdef OPENSSL_SYS_MPE
# define NO_SYS_PARAM_H
# endif
Index: e_os2.h
===================================================================
RCS file: /bulky/openssl/cvs/openssl/e_os2.h,v
retrieving revision 1.30
diff -u -r1.30 e_os2.h
--- e_os2.h 2 Aug 2005 22:04:11 -0000 1.30
+++ e_os2.h 16 Nov 2005 11:39:21 -0000
@@ -70,6 +70,12 @@
#define OPENSSL_SYS_UNIX
+/* ------------------------AmigaOS------------------------------------------ */
+#if defined(amigaos) || defined(__amigaos4__)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_AMIGAOS
+#endif
+
/* ----------------------- Macintosh, before MacOS X ----------------------- */
#if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)
# undef OPENSSL_SYS_UNIX
Index: apps/apps.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/apps/apps.c,v
retrieving revision 1.107
diff -u -r1.107 apps.c
--- apps/apps.c 6 Nov 2005 21:11:41 -0000 1.107
+++ apps/apps.c 16 Nov 2005 11:39:21 -0000
@@ -2424,7 +2424,7 @@
return (ret);
}
-#elif defined(OPENSSL_SYSTEM_NETWARE)
+#elif defined(OPENSSL_SYSTEM_NETWARE) || defined(OPENSSL_SYS_AMIGAOS)
#include <time.h>
double app_tminterval(int stop,int usertime)
Index: apps/ca.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/apps/ca.c,v
retrieving revision 1.152
diff -u -r1.152 ca.c
--- apps/ca.c 4 Nov 2005 09:30:52 -0000 1.152
+++ apps/ca.c 16 Nov 2005 11:39:21 -0000
@@ -82,7 +82,7 @@
# else
# include <unixlib.h>
# endif
-# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) &&
!defined(OPENSSL_SYS_NETWARE)
+# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) &&
!defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_AMIGAOS)
# include <sys/file.h>
# endif
#endif
Index: apps/speed.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/apps/speed.c,v
retrieving revision 1.132
diff -u -r1.132 speed.c
--- apps/speed.c 6 Nov 2005 11:58:22 -0000 1.132
+++ apps/speed.c 16 Nov 2005 11:39:21 -0000
@@ -175,7 +175,7 @@
#include <openssl/ecdh.h>
#endif
-#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) &&
!defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) &&
!defined(OPENSSL_SYS_NETWARE)
+#if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) &&
!defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_OS2) &&
!defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_AMIGAOS)
# define HAVE_FORK 1
#endif
Index: crypto/rand/rand_egd.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/crypto/rand/rand_egd.c,v
retrieving revision 1.27
diff -u -r1.27 rand_egd.c
--- crypto/rand/rand_egd.c 19 Feb 2005 10:19:07 -0000 1.27
+++ crypto/rand/rand_egd.c 16 Nov 2005 11:39:21 -0000
@@ -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_NETWARE) || defined(OPENSSL_SYS_VOS)
+#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) ||
defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VXWORKS) ||
defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_VOS) ||
defined(OPENSSL_SYS_AMIGAOS)
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
{
return(-1);
Index: crypto/rand/rand_unix.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/crypto/rand/rand_unix.c,v
retrieving revision 1.22
diff -u -r1.22 rand_unix.c
--- crypto/rand/rand_unix.c 22 Jul 2005 03:36:29 -0000 1.22
+++ crypto/rand/rand_unix.c 17 Nov 2005 09:39:34 -0000
@@ -120,7 +120,6 @@
#include <sys/types.h>
#include <sys/time.h>
-#include <sys/times.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
@@ -258,6 +257,11 @@
}
#endif
+#ifdef OPENSSL_SYS_AMIGAOS
+ /* Add some data on available memory */
+ l = AvailMem(MEMF_ANY);
+ RAND_add(&l,sizeof(l),0.0);
+#endif
/* put in some default random data, we need more than just this */
l=curr_pid;
RAND_add(&l,sizeof(l),0.0);
Index: crypto/ui/ui_openssl.c
===================================================================
RCS file: /bulky/openssl/cvs/openssl/crypto/ui/ui_openssl.c,v
retrieving revision 1.25
diff -u -r1.25 ui_openssl.c
--- crypto/ui/ui_openssl.c 26 Sep 2005 11:18:04 -0000 1.25
+++ crypto/ui/ui_openssl.c 16 Nov 2005 11:39:21 -0000
@@ -479,6 +479,8 @@
#else
# ifdef OPENSSL_SYS_MSDOS
# define DEV_TTY "con"
+# elif defined(OPENSSL_SYS_AMIGAOS)
+# define DEV_TTY "/CONSOLE"
# else
# define DEV_TTY "/dev/tty"
# endif