Add support for DJGPP.
PR: 75
This commit is contained in:
parent
ff3dd00370
commit
573a568dd0
29
Configure
29
Configure
@ -513,6 +513,9 @@ my %table=(
|
|||||||
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
"Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown):CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32",
|
||||||
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
|
"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:win32:cygwin-shared:::.dll",
|
||||||
|
|
||||||
|
# DJGPP
|
||||||
|
"DJGPP", "gcc:-I/dev/env/DJDIR/watt32/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L$ENV{DJDIR}/watt32/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::",
|
||||||
|
|
||||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::",
|
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::",
|
||||||
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
|
"ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::",
|
||||||
@ -637,6 +640,7 @@ my $libs;
|
|||||||
my $target;
|
my $target;
|
||||||
my $options;
|
my $options;
|
||||||
my $symlink;
|
my $symlink;
|
||||||
|
my $make_depend=0;
|
||||||
my %withargs=();
|
my %withargs=();
|
||||||
|
|
||||||
my @argvcopy=@ARGV;
|
my @argvcopy=@ARGV;
|
||||||
@ -894,6 +898,7 @@ print "Configuring for $target\n";
|
|||||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
||||||
|
|
||||||
$exe_ext=".exe" if ($target eq "Cygwin");
|
$exe_ext=".exe" if ($target eq "Cygwin");
|
||||||
|
$exe_ext=".exe" if ($target eq "DJGPP");
|
||||||
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
|
$openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq "");
|
||||||
$prefix=$openssldir if $prefix eq "";
|
$prefix=$openssldir if $prefix eq "";
|
||||||
|
|
||||||
@ -901,7 +906,7 @@ chop $openssldir if $openssldir =~ /\/$/;
|
|||||||
chop $prefix if $prefix =~ /\/$/;
|
chop $prefix if $prefix =~ /\/$/;
|
||||||
|
|
||||||
$openssldir=$prefix . "/ssl" if $openssldir eq "";
|
$openssldir=$prefix . "/ssl" if $openssldir eq "";
|
||||||
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//;
|
$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/;
|
||||||
|
|
||||||
|
|
||||||
print "IsWindows=$IsWindows\n";
|
print "IsWindows=$IsWindows\n";
|
||||||
@ -1428,11 +1433,12 @@ if($IsWindows) {
|
|||||||
EOF
|
EOF
|
||||||
close(OUT);
|
close(OUT);
|
||||||
} else {
|
} else {
|
||||||
(system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?
|
my $make_command = "make -f Makefile.ssl PERL=\'$perl\'";
|
||||||
if $symlink;
|
my $make_targets = "";
|
||||||
### (system 'make depend') == 0 or exit $? if $depflags ne "";
|
$make_targets .= " links" if $symlink;
|
||||||
# Run "make depend" manually if you want to be able to delete
|
$make_targets .= " depend" if $depflags ne "" && $make_depend;
|
||||||
# the source code files of ciphers you left out.
|
(system $make_command.$make_targets) == 0 or exit $?
|
||||||
|
if $make_targets ne "";
|
||||||
if ( $perl =~ m@^/@) {
|
if ( $perl =~ m@^/@) {
|
||||||
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
&dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||||
&dofile("apps/der_chop",$perl,'^#!/', '#!%s');
|
&dofile("apps/der_chop",$perl,'^#!/', '#!%s');
|
||||||
@ -1442,7 +1448,16 @@ EOF
|
|||||||
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
&dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
|
||||||
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
|
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||||
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
&dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||||
}
|
}
|
||||||
|
if ($depflags ne "" && !$make_depend) {
|
||||||
|
print <<EOF;
|
||||||
|
|
||||||
|
Since you've disabled at least one algorithm, you need to do the following
|
||||||
|
before building:
|
||||||
|
|
||||||
|
make depend
|
||||||
|
EOF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
|
32
INSTALL.DJGPP
Normal file
32
INSTALL.DJGPP
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
|
||||||
|
INSTALLATION ON THE DOS PLATFORM WITH DJGPP
|
||||||
|
-------------------------------------------
|
||||||
|
|
||||||
|
Openssl has been ported to DOS, but only with long filename support. If
|
||||||
|
you wish to compile on native DOS with 8+3 filenames, you will have to
|
||||||
|
tweak the installation yourself, including renaming files with illegal
|
||||||
|
or duplicate names.
|
||||||
|
|
||||||
|
You should have a full DJGPP environment installed, including the
|
||||||
|
latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
|
||||||
|
requires that PERL and BC also be installed.
|
||||||
|
|
||||||
|
All of these can be obtained from the usual DJGPP mirror sites, such as
|
||||||
|
"ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp". You also need to have
|
||||||
|
the WATT-32 networking package installed before you try to compile
|
||||||
|
openssl. This can be obtained from "http://www.bgnett.no/~giva/". The
|
||||||
|
Makefile assumes that the WATT-32 code is in directory "watt32" under
|
||||||
|
/dev/env/DJDIR.
|
||||||
|
|
||||||
|
To compile openssl, start your BASH shell. Then configure for DOS by
|
||||||
|
running "./Configure" with appropriate arguments. The basic syntax for
|
||||||
|
DOS is:
|
||||||
|
./Configure no-threads --prefix=/dev/env/DJDIR DJGPP
|
||||||
|
|
||||||
|
You may run out of DPMI selectors when running in a DOS box under
|
||||||
|
Windows. If so, just close the BASH shell, go back to Windows, and
|
||||||
|
restart BASH. Then run "make" again.
|
||||||
|
|
||||||
|
Building openssl under DJGPP has been tested with DJGPP 2.03,
|
||||||
|
GCC 2.952, GCC 2.953, perl 5.005_02 and perl 5.006_01.
|
@ -347,10 +347,11 @@ asn1_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
|||||||
asn1_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
asn1_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||||
asn1_err.o: ../../include/openssl/symhacks.h asn1_err.c
|
asn1_err.o: ../../include/openssl/symhacks.h asn1_err.c
|
||||||
asn1_lib.o: ../../e_os.h ../../include/openssl/asn1.h
|
asn1_lib.o: ../../e_os.h ../../include/openssl/asn1.h
|
||||||
asn1_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
|
asn1_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
|
||||||
asn1_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
|
asn1_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
|
||||||
asn1_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
|
asn1_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
|
||||||
asn1_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
|
asn1_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
|
||||||
|
asn1_lib.o: ../../include/openssl/opensslconf.h
|
||||||
asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
|
||||||
asn1_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
asn1_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
|
||||||
asn1_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_lib.c
|
asn1_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_lib.c
|
||||||
|
@ -484,7 +484,11 @@ int BIO_socket_ioctl(int fd, long type, unsigned long *arg)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef __DJGPP__
|
||||||
|
i=ioctlsocket(fd,type,(char *)arg);
|
||||||
|
#else
|
||||||
i=ioctlsocket(fd,type,arg);
|
i=ioctlsocket(fd,type,arg);
|
||||||
|
#endif /* __DJGPP__ */
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
|
SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
|
||||||
return(i);
|
return(i);
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
#include "cryptlib.h"
|
#include "cryptlib.h"
|
||||||
#include "bn_lcl.h"
|
#include "bn_lcl.h"
|
||||||
|
|
||||||
#if defined(OPENSSL_NO_ASM) || !(defined(__i386) || defined(__i386__))/* Assembler implementation exists only for x86 */
|
#if defined(OPENSSL_NO_ASM) || !(defined(__i386) || defined(__i386__)) || defined(__DJGPP__) /* Assembler implementation exists only for x86 */
|
||||||
/* Here follows specialised variants of bn_add_words() and
|
/* Here follows specialised variants of bn_add_words() and
|
||||||
bn_sub_words(). They have the property performing operations on
|
bn_sub_words(). They have the property performing operations on
|
||||||
arrays of different sizes. The sizes of those arrays is expressed through
|
arrays of different sizes. The sizes of those arrays is expressed through
|
||||||
|
@ -246,7 +246,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
|
|||||||
long status;
|
long status;
|
||||||
unsigned short channel = 0;
|
unsigned short channel = 0;
|
||||||
#else
|
#else
|
||||||
#ifndef OPENSSL_SYS_MSDOS
|
#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
|
||||||
TTY_STRUCT tty_orig,tty_new;
|
TTY_STRUCT tty_orig,tty_new;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
* RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
|
* RAND_egd() is a wrapper for RAND_egd_bytes() with numbytes=255.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
|
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(__DJGPP__)
|
||||||
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
|
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
|
||||||
{
|
{
|
||||||
return(-1);
|
return(-1);
|
||||||
|
@ -269,7 +269,7 @@ static long tty_orig[3], tty_new[3]; /* XXX Is there any guarantee that this w
|
|||||||
static long status;
|
static long status;
|
||||||
static unsigned short channel = 0;
|
static unsigned short channel = 0;
|
||||||
#else
|
#else
|
||||||
#ifndef OPENSSL_SYS_MSDOS
|
#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
|
||||||
static TTY_STRUCT tty_orig,tty_new;
|
static TTY_STRUCT tty_orig,tty_new;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
12
e_os.h
12
e_os.h
@ -191,6 +191,14 @@ extern "C" {
|
|||||||
|
|
||||||
#if (defined(WINDOWS) || defined(MSDOS))
|
#if (defined(WINDOWS) || defined(MSDOS))
|
||||||
|
|
||||||
|
# ifdef __DJGPP__
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <sys/stat.h>
|
||||||
|
# define _setmode setmode
|
||||||
|
# define _O_TEXT O_TEXT
|
||||||
|
# define _O_BINARY O_BINARY
|
||||||
|
# endif /* __DJGPP__ */
|
||||||
|
|
||||||
# ifndef S_IFDIR
|
# ifndef S_IFDIR
|
||||||
# define S_IFDIR _S_IFDIR
|
# define S_IFDIR _S_IFDIR
|
||||||
# endif
|
# endif
|
||||||
@ -336,7 +344,7 @@ extern "C" {
|
|||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
#ifdef USE_SOCKETS
|
#ifdef USE_SOCKETS
|
||||||
# if defined(WINDOWS) || defined(MSDOS)
|
# if (defined(WINDOWS) || defined(MSDOS)) && !defined(__DJGPP__)
|
||||||
/* windows world */
|
/* windows world */
|
||||||
|
|
||||||
# ifdef OPENSSL_NO_SOCK
|
# ifdef OPENSSL_NO_SOCK
|
||||||
@ -423,7 +431,9 @@ extern HINSTANCE _hInstance;
|
|||||||
# define SSLeay_Write(a,b,c) write((a),(b),(c))
|
# define SSLeay_Write(a,b,c) write((a),(b),(c))
|
||||||
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); }
|
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); }
|
||||||
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); }
|
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); }
|
||||||
|
# ifndef INVALID_SOCKET
|
||||||
# define INVALID_SOCKET (-1)
|
# define INVALID_SOCKET (-1)
|
||||||
|
# endif /* INVALID_SOCKET */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl crl'
|
cmd='../apps/openssl crl'
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
SH="/bin/sh"
|
SH="/bin/sh"
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=./apps\;../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export SH PATH
|
export SH PATH
|
||||||
|
|
||||||
SSLEAY_CONFIG="-config CAss.cnf"
|
SSLEAY_CONFIG="-config CAss.cnf"
|
||||||
|
@ -6,7 +6,11 @@ CA=../certs/testca.pem
|
|||||||
|
|
||||||
/bin/rm -f $T.1 $T.2 $T.key
|
/bin/rm -f $T.1 $T.2 $T.key
|
||||||
|
|
||||||
PATH=../apps:$PATH;
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH;
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH;
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
echo "generating certificate request"
|
echo "generating certificate request"
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl pkcs7'
|
cmd='../apps/openssl pkcs7'
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl pkcs7'
|
cmd='../apps/openssl pkcs7'
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl req -config ../apps/openssl.cnf'
|
cmd='../apps/openssl req -config ../apps/openssl.cnf'
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
if ../apps/openssl no-rsa; then
|
if ../apps/openssl no-rsa; then
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl sess_id'
|
cmd='../apps/openssl sess_id'
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
PATH=../apps:$PATH
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
PATH=../apps\;$PATH
|
||||||
|
else
|
||||||
|
PATH=../apps:$PATH
|
||||||
|
fi
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
cmd='../apps/openssl x509'
|
cmd='../apps/openssl x509'
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
rm -f $2
|
rm -f $2
|
||||||
ln -s $1 $2
|
if test "$OSTYPE" = msdosdjgpp; then
|
||||||
|
cp $1 $2
|
||||||
|
else
|
||||||
|
ln -s $1 $2
|
||||||
|
fi
|
||||||
echo "$2 => $1"
|
echo "$2 => $1"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user