From: Richard Levitte Date: Thu, 13 Jun 2002 20:40:49 +0000 (+0000) Subject: Add support for DJGPP. X-Git-Tag: OpenSSL_0_9_7-beta2~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=573a568dd09e3c376ae0fb66a80023b75fbf1cc5;p=oweals%2Fopenssl.git Add support for DJGPP. PR: 75 --- diff --git a/Configure b/Configure index 986db2f614..b3eae65d2d 100755 --- a/Configure +++ b/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", "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 "ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown):::::::", "ultrix-gcc","gcc:-O3 -DL_ENDIAN::(unknown):::::::", @@ -637,6 +640,7 @@ my $libs; my $target; my $options; my $symlink; +my $make_depend=0; my %withargs=(); my @argvcopy=@ARGV; @@ -894,6 +898,7 @@ print "Configuring for $target\n"; my $IsWindows=scalar grep /^$target$/,@WinTargets; $exe_ext=".exe" if ($target eq "Cygwin"); +$exe_ext=".exe" if ($target eq "DJGPP"); $openssldir="/usr/local/ssl" if ($openssldir eq "" and $prefix eq ""); $prefix=$openssldir if $prefix eq ""; @@ -901,7 +906,7 @@ chop $openssldir if $openssldir =~ /\/$/; chop $prefix if $prefix =~ /\/$/; $openssldir=$prefix . "/ssl" if $openssldir eq ""; -$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /^\//; +$openssldir=$prefix . "/" . $openssldir if $openssldir !~ /(^\/|^[a-zA-Z]:[\\\/])/; print "IsWindows=$IsWindows\n"; @@ -1428,11 +1433,12 @@ if($IsWindows) { EOF close(OUT); } else { - (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $? - if $symlink; - ### (system 'make depend') == 0 or exit $? if $depflags ne ""; - # Run "make depend" manually if you want to be able to delete - # the source code files of ciphers you left out. + my $make_command = "make -f Makefile.ssl PERL=\'$perl\'"; + my $make_targets = ""; + $make_targets .= " links" if $symlink; + $make_targets .= " depend" if $depflags ne "" && $make_depend; + (system $make_command.$make_targets) == 0 or exit $? + if $make_targets ne ""; if ( $perl =~ m@^/@) { &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &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("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s'); &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); - } + } + if ($depflags ne "" && !$make_depend) { + print < +# include +# define _setmode setmode +# define _O_TEXT O_TEXT +# define _O_BINARY O_BINARY +# endif /* __DJGPP__ */ + # ifndef S_IFDIR # define S_IFDIR _S_IFDIR # endif @@ -336,7 +344,7 @@ extern "C" { /*************/ #ifdef USE_SOCKETS -# if defined(WINDOWS) || defined(MSDOS) +# if (defined(WINDOWS) || defined(MSDOS)) && !defined(__DJGPP__) /* windows world */ # ifdef OPENSSL_NO_SOCK @@ -423,7 +431,9 @@ extern HINSTANCE _hInstance; # define SSLeay_Write(a,b,c) write((a),(b),(c)) # define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); } # define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); } +# ifndef INVALID_SOCKET # define INVALID_SOCKET (-1) +# endif /* INVALID_SOCKET */ # endif #endif diff --git a/test/tcrl b/test/tcrl index acaf8f3c47..f71ef7a863 100644 --- a/test/tcrl +++ b/test/tcrl @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl crl' diff --git a/test/testca b/test/testca index 88c186b6ab..8215ebb5d1 100644 --- a/test/testca +++ b/test/testca @@ -1,7 +1,11 @@ #!/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 SSLEAY_CONFIG="-config CAss.cnf" diff --git a/test/testgen b/test/testgen index 6a4b6b9221..55c496f4bc 100644 --- a/test/testgen +++ b/test/testgen @@ -6,7 +6,11 @@ CA=../certs/testca.pem /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 echo "generating certificate request" diff --git a/test/tpkcs7 b/test/tpkcs7 index 15bbba42c0..cf3bd9fadb 100644 --- a/test/tpkcs7 +++ b/test/tpkcs7 @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl pkcs7' diff --git a/test/tpkcs7d b/test/tpkcs7d index 46e5aa2bd6..18f9311b06 100644 --- a/test/tpkcs7d +++ b/test/tpkcs7d @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl pkcs7' diff --git a/test/treq b/test/treq index 9f5eb7eea5..47a8273cde 100644 --- a/test/treq +++ b/test/treq @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl req -config ../apps/openssl.cnf' diff --git a/test/trsa b/test/trsa index bd6c07650a..413e2ec0a0 100644 --- a/test/trsa +++ b/test/trsa @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH if ../apps/openssl no-rsa; then diff --git a/test/tsid b/test/tsid index 9e0854516c..40a1dfa97c 100644 --- a/test/tsid +++ b/test/tsid @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl sess_id' diff --git a/test/tx509 b/test/tx509 index 35169f3a43..d380963abc 100644 --- a/test/tx509 +++ b/test/tx509 @@ -1,6 +1,10 @@ #!/bin/sh -PATH=../apps:$PATH +if test "$OSTYPE" = msdosdjgpp; then + PATH=../apps\;$PATH +else + PATH=../apps:$PATH +fi export PATH cmd='../apps/openssl x509' diff --git a/util/point.sh b/util/point.sh index 47543c88e2..ce7dcc56df 100755 --- a/util/point.sh +++ b/util/point.sh @@ -1,6 +1,10 @@ #!/bin/sh rm -f $2 -ln -s $1 $2 +if test "$OSTYPE" = msdosdjgpp; then + cp $1 $2 +else + ln -s $1 $2 +fi echo "$2 => $1"