Support additional Win32 compilers.
Borland C submitted by: Janez Jere <jj@void.si>
This commit is contained in:
parent
b282fdae25
commit
31a674d8c9
9 changed files with 383 additions and 224 deletions
6
CHANGES
6
CHANGES
|
@ -5,6 +5,12 @@
|
|||
|
||||
Changes between 0.9.2b and 0.9.3
|
||||
|
||||
*) Support Borland C++ builder.
|
||||
[Janez Jere <jj@void.si>, modified by Ulf Möller]
|
||||
|
||||
*) Support Mingw32.
|
||||
[Ulf Möller]
|
||||
|
||||
*) SHA-1 cleanups and performance enhancements.
|
||||
[Andy Polyakov <appro@fy.chalmers.se>]
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@ my %table=(
|
|||
|
||||
# CygWin32
|
||||
"CygWin32", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:",
|
||||
"Mingw32", "gcc:-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall:(unknown):BN_LLONG $x86_gcc_des $x86_gcc_opts:",
|
||||
|
||||
# Ultrix from Bernhard Simon <simon@zid.tuwien.ac.at>
|
||||
"ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN:(unknown)::::::",
|
||||
|
@ -255,7 +256,7 @@ my %table=(
|
|||
);
|
||||
|
||||
my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
|
||||
BC-16 CygWin32);
|
||||
BC-16 CygWin32 Mingw32);
|
||||
|
||||
my $prefix="";
|
||||
my $openssldir="";
|
||||
|
@ -634,6 +635,7 @@ if($IsWindows) {
|
|||
open (OUT,">crypto/date.h") || die "Can't open date.h";
|
||||
printf OUT "#define DATE \"%s\"\n", scalar gmtime();
|
||||
close(OUT);
|
||||
system "perl crypto/objects/obj_dat.pl <crypto/objects/objects.h >crypto/objects/obj_dat.h";
|
||||
} else {
|
||||
(system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $?;
|
||||
(system 'make depend') == 0 or exit $? if $depflags ne "";
|
||||
|
|
98
INSTALL.W32
98
INSTALL.W32
|
@ -6,24 +6,24 @@
|
|||
this is tested on Win32 but it may also work in Win 3.1 with some
|
||||
modification. See the end of this file for Eric's original comments.
|
||||
|
||||
Note: the default Win32 environment is to leave out any Windows NT specific
|
||||
features: (currently only BIO_s_log()) if you want NT specific features see
|
||||
the "Tweaks" section later.
|
||||
You will Perl for Win32 (available from http://activestate.com/ActivePerl)
|
||||
and one of the following C compilers:
|
||||
|
||||
You will need perl for Win32 (which can be got from various sources) and
|
||||
Visual C++.
|
||||
* Visual C++
|
||||
* Borland C
|
||||
* GNU C (Mingw32 or Cygwin32)
|
||||
|
||||
If you are compiling from a tarball or a CVS snapshot then the Win32 files
|
||||
may well be not up to date. This may mean that some "tweaking" is required to
|
||||
get it all to work. See the trouble shooting section later on for if (when?)
|
||||
it goes wrong.
|
||||
|
||||
Firstly you should run Configure:
|
||||
Visual C++
|
||||
----------
|
||||
|
||||
Firstly you should run Configure and build the Win32 Makefiles:
|
||||
|
||||
> perl Configure VC-WIN32
|
||||
|
||||
Then rebuild the Win32 Makefiles and friends:
|
||||
|
||||
> ms\do_ms
|
||||
|
||||
If you get errors about things not having numbers assigned then check the
|
||||
|
@ -40,6 +40,74 @@
|
|||
> cd out32dll
|
||||
> ..\ms\test
|
||||
|
||||
Tweaks:
|
||||
|
||||
There are various changes you can make to the Win32 compile environment. If
|
||||
you have the MASM assembler 'ml' then you can try the assembly language code.
|
||||
To do this remove the 'no-asm' part from do_ms.bat. You can also add 'debug'
|
||||
here to make a debugging version of the library.
|
||||
|
||||
The default Win32 environment is to leave out any Windows NT specific
|
||||
features.
|
||||
|
||||
If you want to enable the NT specific features of OpenSSL (currently only the
|
||||
logging BIO) follow the instructions above but call the batch file do_nt.bat
|
||||
instead of do_ms.bat.
|
||||
|
||||
You can also build a static version of the library using the Makefile
|
||||
ms\nt.mak
|
||||
|
||||
Borland C++ builder 3 and 4
|
||||
---------------------------
|
||||
|
||||
* Setup PATH. First must be GNU make then bcb4/bin
|
||||
|
||||
* Run ms\bcb4.bat
|
||||
|
||||
* Run make:
|
||||
> make -f bcb.mak
|
||||
|
||||
GNU C (Mingw32)
|
||||
---------------
|
||||
|
||||
To build OpenSSL, you need the Mingw32 package and GNU make.
|
||||
|
||||
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/
|
||||
mingw32/egcs-1.1.2/egcs-1.1.2-mingw32.zip>. GNU make is at
|
||||
<ftp://agnes.dida.physik.uni-essen.de/home/janjaap/mingw32/binaries/
|
||||
make-3.76.1.zip>. Install both of them in C:\egcs-1.1.2 and run
|
||||
C:\egcs-1.1.2\mingw32.bat to set the PATH.
|
||||
|
||||
* Cofigure OpenSSL:
|
||||
|
||||
> perl Configure Mingw32
|
||||
> perl util\mkfiles.pl >MINFO
|
||||
> perl util\mk1mf.pl Mingw32 >ms\mingw32.mak
|
||||
|
||||
* If you don't have the GNU file utilities (cp, rm, etc.) installed,
|
||||
an additional step is required:
|
||||
|
||||
> perl util\mk1mf.pl VC-WIN32 no-asm >ms\nt.mak
|
||||
> make -f ms/nt.mak
|
||||
|
||||
This will end with an error message. If you don't like that, install
|
||||
the file utilities. :)
|
||||
|
||||
* Compile the library:
|
||||
> make -f ms/mingw32.mak
|
||||
|
||||
You can now try the tests:
|
||||
|
||||
> cd out
|
||||
> ..\ms\test
|
||||
|
||||
* Build the OpenSSL DLLs:
|
||||
|
||||
> perl util\mkdef.pl 32 libeay > ms\libeay32.def
|
||||
> perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
|
||||
|
||||
[to be done]
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
|
@ -84,18 +152,6 @@
|
|||
Tweaks
|
||||
------
|
||||
|
||||
There are various changes you can make to the Win32 compile environment. If
|
||||
you have the MASM assembler 'ml' then you can try the assembly language code.
|
||||
To do this remove the 'no-asm' part from do_ms.bat. You can also add 'debug'
|
||||
here to make a debugging version of the library.
|
||||
|
||||
If you want to enable the NT specific features of OpenSSL (currently only the
|
||||
logging BIO) follow the instructions above but call the batch file do_nt.bat
|
||||
instead of do_ms.bat.
|
||||
|
||||
You can also build a static version of the library using the Makefile
|
||||
ms\nt.mak
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
The orignal Windows build instructions from SSLeay follow.
|
||||
Note: some of this may be out of date and no longer applicable
|
||||
|
|
|
@ -27,166 +27,166 @@ int main(int argc, char *argv[])
|
|||
|
||||
int key1(RSA *key, unsigned char *c)
|
||||
{
|
||||
unsigned char n[] = "\
|
||||
\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F\
|
||||
\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5\
|
||||
\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93\
|
||||
\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1\
|
||||
\xF5";
|
||||
unsigned char n[] =
|
||||
"\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
|
||||
"\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
|
||||
"\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
|
||||
"\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
|
||||
"\xF5";
|
||||
|
||||
unsigned char e[] = "\x11";
|
||||
|
||||
unsigned char d[] = "\
|
||||
\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44\
|
||||
\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64\
|
||||
\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9\
|
||||
\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51";
|
||||
unsigned char d[] =
|
||||
"\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
|
||||
"\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
|
||||
"\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
|
||||
"\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51";
|
||||
|
||||
unsigned char p[] = "\
|
||||
\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5\
|
||||
\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12\
|
||||
\x0D";
|
||||
unsigned char p[] =
|
||||
"\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5"
|
||||
"\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12"
|
||||
"\x0D";
|
||||
|
||||
unsigned char q[] = "\
|
||||
\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9\
|
||||
\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D\
|
||||
\x89";
|
||||
unsigned char q[] =
|
||||
"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9"
|
||||
"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D"
|
||||
"\x89";
|
||||
|
||||
unsigned char dmp1[] = "\
|
||||
\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF\
|
||||
\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05";
|
||||
unsigned char dmp1[] =
|
||||
"\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF"
|
||||
"\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05";
|
||||
|
||||
unsigned char dmq1[] = "\
|
||||
\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99\
|
||||
\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D\
|
||||
\x51";
|
||||
unsigned char dmq1[] =
|
||||
"\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99"
|
||||
"\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D"
|
||||
"\x51";
|
||||
|
||||
unsigned char iqmp[] = "\
|
||||
\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8\
|
||||
\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26";
|
||||
unsigned char iqmp[] =
|
||||
"\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8"
|
||||
"\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26";
|
||||
|
||||
unsigned char ctext_ex[] ="\
|
||||
\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89\
|
||||
\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52\
|
||||
\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44\
|
||||
\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2";
|
||||
unsigned char ctext_ex[] =
|
||||
"\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89"
|
||||
"\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52"
|
||||
"\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44"
|
||||
"\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2";
|
||||
|
||||
SetKey;
|
||||
}
|
||||
|
||||
int key2(RSA *key, unsigned char *c)
|
||||
{
|
||||
unsigned char n[] = "\
|
||||
\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8\
|
||||
\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26\
|
||||
\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8\
|
||||
\x34\x77\xCF";
|
||||
unsigned char n[] =
|
||||
"\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8"
|
||||
"\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26"
|
||||
"\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8"
|
||||
"\x34\x77\xCF";
|
||||
|
||||
unsigned char e[] = "\x3";
|
||||
|
||||
unsigned char d[] = "\
|
||||
\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2\
|
||||
\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41\
|
||||
\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21\
|
||||
\xE5\xEB";
|
||||
unsigned char d[] =
|
||||
"\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2"
|
||||
"\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41"
|
||||
"\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21"
|
||||
"\xE5\xEB";
|
||||
|
||||
unsigned char p[] = "\
|
||||
\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\
|
||||
\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91";
|
||||
unsigned char p[] =
|
||||
"\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92"
|
||||
"\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91";
|
||||
|
||||
unsigned char q[] = "\
|
||||
\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9\
|
||||
\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5F";
|
||||
unsigned char q[] =
|
||||
"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9"
|
||||
"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5F";
|
||||
|
||||
unsigned char dmp1[] = "\
|
||||
\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61\
|
||||
\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B";
|
||||
unsigned char dmp1[] =
|
||||
"\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61"
|
||||
"\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B";
|
||||
|
||||
unsigned char dmq1[] = "\
|
||||
\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90\
|
||||
\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F";
|
||||
unsigned char dmq1[] =
|
||||
"\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90"
|
||||
"\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F";
|
||||
|
||||
unsigned char iqmp[] = "\
|
||||
\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13\
|
||||
\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D";
|
||||
unsigned char iqmp[] =
|
||||
"\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13"
|
||||
"\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D";
|
||||
|
||||
unsigned char ctext_ex[] = "\
|
||||
\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a\
|
||||
\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4\
|
||||
\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52\
|
||||
\x62\x51";
|
||||
unsigned char ctext_ex[] =
|
||||
"\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a"
|
||||
"\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4"
|
||||
"\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52"
|
||||
"\x62\x51";
|
||||
|
||||
SetKey;
|
||||
}
|
||||
|
||||
int key3(RSA *key, unsigned char *c)
|
||||
{
|
||||
unsigned char n[] = "\
|
||||
\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71\
|
||||
\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5\
|
||||
\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD\
|
||||
\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80\
|
||||
\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25\
|
||||
\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39\
|
||||
\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68\
|
||||
\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD\
|
||||
\xCB";
|
||||
unsigned char n[] =
|
||||
"\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71"
|
||||
"\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5"
|
||||
"\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD"
|
||||
"\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80"
|
||||
"\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25"
|
||||
"\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39"
|
||||
"\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68"
|
||||
"\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD"
|
||||
"\xCB";
|
||||
|
||||
unsigned char e[] = "\x11";
|
||||
|
||||
unsigned char d[] = "\
|
||||
\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD\
|
||||
\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41\
|
||||
\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69\
|
||||
\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA\
|
||||
\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94\
|
||||
\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A\
|
||||
\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94\
|
||||
\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3\
|
||||
\xC1";
|
||||
unsigned char d[] =
|
||||
"\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD"
|
||||
"\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41"
|
||||
"\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69"
|
||||
"\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA"
|
||||
"\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94"
|
||||
"\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A"
|
||||
"\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94"
|
||||
"\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3"
|
||||
"\xC1";
|
||||
|
||||
unsigned char p[] = "\
|
||||
\x00\xEE\xCF\xAE\x81\xB1\xB9\xB3\xC9\x08\x81\x0B\x10\xA1\xB5\x60\
|
||||
\x01\x99\xEB\x9F\x44\xAE\xF4\xFD\xA4\x93\xB8\x1A\x9E\x3D\x84\xF6\
|
||||
\x32\x12\x4E\xF0\x23\x6E\x5D\x1E\x3B\x7E\x28\xFA\xE7\xAA\x04\x0A\
|
||||
\x2D\x5B\x25\x21\x76\x45\x9D\x1F\x39\x75\x41\xBA\x2A\x58\xFB\x65\
|
||||
\x99";
|
||||
unsigned char p[] =
|
||||
"\x00\xEE\xCF\xAE\x81\xB1\xB9\xB3\xC9\x08\x81\x0B\x10\xA1\xB5\x60"
|
||||
"\x01\x99\xEB\x9F\x44\xAE\xF4\xFD\xA4\x93\xB8\x1A\x9E\x3D\x84\xF6"
|
||||
"\x32\x12\x4E\xF0\x23\x6E\x5D\x1E\x3B\x7E\x28\xFA\xE7\xAA\x04\x0A"
|
||||
"\x2D\x5B\x25\x21\x76\x45\x9D\x1F\x39\x75\x41\xBA\x2A\x58\xFB\x65"
|
||||
"\x99";
|
||||
|
||||
unsigned char q[] = "\
|
||||
\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9\
|
||||
\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D\
|
||||
\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5\
|
||||
\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x15\
|
||||
\x03";
|
||||
unsigned char q[] =
|
||||
"\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9"
|
||||
"\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D"
|
||||
"\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5"
|
||||
"\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x15"
|
||||
"\x03";
|
||||
|
||||
unsigned char dmp1[] = "\
|
||||
\x54\x49\x4C\xA6\x3E\xBA\x03\x37\xE4\xE2\x40\x23\xFC\xD6\x9A\x5A\
|
||||
\xEB\x07\xDD\xDC\x01\x83\xA4\xD0\xAC\x9B\x54\xB0\x51\xF2\xB1\x3E\
|
||||
\xD9\x49\x09\x75\xEA\xB7\x74\x14\xFF\x59\xC1\xF7\x69\x2E\x9A\x2E\
|
||||
\x20\x2B\x38\xFC\x91\x0A\x47\x41\x74\xAD\xC9\x3C\x1F\x67\xC9\x81";
|
||||
unsigned char dmp1[] =
|
||||
"\x54\x49\x4C\xA6\x3E\xBA\x03\x37\xE4\xE2\x40\x23\xFC\xD6\x9A\x5A"
|
||||
"\xEB\x07\xDD\xDC\x01\x83\xA4\xD0\xAC\x9B\x54\xB0\x51\xF2\xB1\x3E"
|
||||
"\xD9\x49\x09\x75\xEA\xB7\x74\x14\xFF\x59\xC1\xF7\x69\x2E\x9A\x2E"
|
||||
"\x20\x2B\x38\xFC\x91\x0A\x47\x41\x74\xAD\xC9\x3C\x1F\x67\xC9\x81";
|
||||
|
||||
unsigned char dmq1[] = "\
|
||||
\x47\x1E\x02\x90\xFF\x0A\xF0\x75\x03\x51\xB7\xF8\x78\x86\x4C\xA9\
|
||||
\x61\xAD\xBD\x3A\x8A\x7E\x99\x1C\x5C\x05\x56\xA9\x4C\x31\x46\xA7\
|
||||
\xF9\x80\x3F\x8F\x6F\x8A\xE3\x42\xE9\x31\xFD\x8A\xE4\x7A\x22\x0D\
|
||||
\x1B\x99\xA4\x95\x84\x98\x07\xFE\x39\xF9\x24\x5A\x98\x36\xDA\x3D";
|
||||
unsigned char dmq1[] =
|
||||
"\x47\x1E\x02\x90\xFF\x0A\xF0\x75\x03\x51\xB7\xF8\x78\x86\x4C\xA9"
|
||||
"\x61\xAD\xBD\x3A\x8A\x7E\x99\x1C\x5C\x05\x56\xA9\x4C\x31\x46\xA7"
|
||||
"\xF9\x80\x3F\x8F\x6F\x8A\xE3\x42\xE9\x31\xFD\x8A\xE4\x7A\x22\x0D"
|
||||
"\x1B\x99\xA4\x95\x84\x98\x07\xFE\x39\xF9\x24\x5A\x98\x36\xDA\x3D";
|
||||
|
||||
unsigned char iqmp[] = "\
|
||||
\x00\xB0\x6C\x4F\xDA\xBB\x63\x01\x19\x8D\x26\x5B\xDB\xAE\x94\x23\
|
||||
\xB3\x80\xF2\x71\xF7\x34\x53\x88\x50\x93\x07\x7F\xCD\x39\xE2\x11\
|
||||
\x9F\xC9\x86\x32\x15\x4F\x58\x83\xB1\x67\xA9\x67\xBF\x40\x2B\x4E\
|
||||
\x9E\x2E\x0F\x96\x56\xE6\x98\xEA\x36\x66\xED\xFB\x25\x79\x80\x39\
|
||||
\xF7";
|
||||
unsigned char iqmp[] =
|
||||
"\x00\xB0\x6C\x4F\xDA\xBB\x63\x01\x19\x8D\x26\x5B\xDB\xAE\x94\x23"
|
||||
"\xB3\x80\xF2\x71\xF7\x34\x53\x88\x50\x93\x07\x7F\xCD\x39\xE2\x11"
|
||||
"\x9F\xC9\x86\x32\x15\x4F\x58\x83\xB1\x67\xA9\x67\xBF\x40\x2B\x4E"
|
||||
"\x9E\x2E\x0F\x96\x56\xE6\x98\xEA\x36\x66\xED\xFB\x25\x79\x80\x39"
|
||||
"\xF7";
|
||||
|
||||
unsigned char ctext_ex[] = "\
|
||||
\xb8\x24\x6b\x56\xa6\xed\x58\x81\xae\xb5\x85\xd9\xa2\x5b\x2a\xd7\
|
||||
\x90\xc4\x17\xe0\x80\x68\x1b\xf1\xac\x2b\xc3\xde\xb6\x9d\x8b\xce\
|
||||
\xf0\xc4\x36\x6f\xec\x40\x0a\xf0\x52\xa7\x2e\x9b\x0e\xff\xb5\xb3\
|
||||
\xf2\xf1\x92\xdb\xea\xca\x03\xc1\x27\x40\x05\x71\x13\xbf\x1f\x06\
|
||||
\x69\xac\x22\xe9\xf3\xa7\x85\x2e\x3c\x15\xd9\x13\xca\xb0\xb8\x86\
|
||||
\x3a\x95\xc9\x92\x94\xce\x86\x74\x21\x49\x54\x61\x03\x46\xf4\xd4\
|
||||
\x74\xb2\x6f\x7c\x48\xb4\x2e\xe6\x8e\x1f\x57\x2a\x1f\xc4\x02\x6a\
|
||||
\xc4\x56\xb4\xf5\x9f\x7b\x62\x1e\xa1\xb9\xd8\x8f\x64\x20\x2f\xb1";
|
||||
unsigned char ctext_ex[] =
|
||||
"\xb8\x24\x6b\x56\xa6\xed\x58\x81\xae\xb5\x85\xd9\xa2\x5b\x2a\xd7"
|
||||
"\x90\xc4\x17\xe0\x80\x68\x1b\xf1\xac\x2b\xc3\xde\xb6\x9d\x8b\xce"
|
||||
"\xf0\xc4\x36\x6f\xec\x40\x0a\xf0\x52\xa7\x2e\x9b\x0e\xff\xb5\xb3"
|
||||
"\xf2\xf1\x92\xdb\xea\xca\x03\xc1\x27\x40\x05\x71\x13\xbf\x1f\x06"
|
||||
"\x69\xac\x22\xe9\xf3\xa7\x85\x2e\x3c\x15\xd9\x13\xca\xb0\xb8\x86"
|
||||
"\x3a\x95\xc9\x92\x94\xce\x86\x74\x21\x49\x54\x61\x03\x46\xf4\xd4"
|
||||
"\x74\xb2\x6f\x7c\x48\xb4\x2e\xe6\x8e\x1f\x57\x2a\x1f\xc4\x02\x6a"
|
||||
"\xc4\x56\xb4\xf5\x9f\x7b\x62\x1e\xa1\xb9\xd8\x8f\x64\x20\x2f\xb1";
|
||||
|
||||
SetKey;
|
||||
}
|
||||
|
|
|
@ -183,7 +183,11 @@ double ms_time_diff(char *ap, char *bp)
|
|||
#else
|
||||
# ifdef WIN32
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
signed long long la,lb;
|
||||
#else
|
||||
signed _int64 la,lb;
|
||||
#endif
|
||||
la=a->ms_win32.dwHighDateTime;
|
||||
lb=b->ms_win32.dwHighDateTime;
|
||||
la<<=32;
|
||||
|
|
9
e_os.h
9
e_os.h
|
@ -150,8 +150,6 @@ extern "C" {
|
|||
|
||||
#endif
|
||||
|
||||
#define strncasecmp(a,b,c) strnicmp((a),(b),(c))
|
||||
|
||||
# ifdef WINDOWS
|
||||
# include <windows.h>
|
||||
# include <stddef.h>
|
||||
|
@ -162,6 +160,13 @@ extern "C" {
|
|||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
|
||||
#if defined (__BORLANDC__)
|
||||
#define _setmode setmode
|
||||
#define _O_TEXT O_TEXT
|
||||
#define _O_BINARY O_BINARY
|
||||
#define _int64 __int64
|
||||
#endif
|
||||
|
||||
#if defined(WIN16) && !defined(MONOLITH) && defined(SSLEAY) && defined(_WINEXITNOPERSIST)
|
||||
# define EXIT(n) { if (n == 0) _wsetexit(_WINEXITNOPERSIST); return(n); }
|
||||
#else
|
||||
|
|
|
@ -18,7 +18,8 @@ $infile="MINFO";
|
|||
"VC-WIN16", "Alias for VC-W31-32",
|
||||
"VC-W31-32", "Microsoft Visual C++ 1.52 - Windows 3.1 - 386+",
|
||||
"VC-MSDOS","Microsoft Visual C++ 1.52 - MSDOS",
|
||||
"BC-NT", "Borland C++ 4.5 - Windows NT - PROBABLY NOT WORKING",
|
||||
"Mingw32", "GNU C++ - Windows NT or 9x",
|
||||
"BC-NT", "Borland C++ 4.5 - Windows NT",
|
||||
"BC-W31", "Borland C++ 4.5 - Windows 3.1 - PROBABLY NOT WORKING",
|
||||
"BC-MSDOS","Borland C++ 4.5 - MSDOS",
|
||||
"linux-elf","Linux elf",
|
||||
|
@ -153,6 +154,10 @@ elsif (($platform eq "VC-WIN32") || ($platform eq "VC-NT"))
|
|||
$NT = 1 if $platform eq "VC-NT";
|
||||
require 'VC-32.pl';
|
||||
}
|
||||
elsif ($platform eq "Mingw32")
|
||||
{
|
||||
require 'Mingw32.pl';
|
||||
}
|
||||
elsif ($platform eq "BC-NT")
|
||||
{
|
||||
$bc=1;
|
||||
|
@ -346,8 +351,8 @@ O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp
|
|||
O_RSAGLUE= \$(LIB_D)$o$plib\$(RSAGLUE)$libp
|
||||
SO_SSL= $plib\$(SSL)$so_shlibp
|
||||
SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp
|
||||
L_SSL= \$(LIB_D)$o\$(SSL)$libp
|
||||
L_CRYPTO= \$(LIB_D)$o\$(CRYPTO)$libp
|
||||
L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp
|
||||
L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp
|
||||
|
||||
L_LIBS= \$(L_SSL) \$(L_CRYPTO)
|
||||
#L_LIBS= \$(O_SSL) \$(O_RSAGLUE) -lrsaref \$(O_CRYPTO)
|
||||
|
@ -384,7 +389,7 @@ $banner
|
|||
\$(MKDIR) \$(LIB_D)
|
||||
|
||||
\$(INCO_D): \$(INC_D)
|
||||
\$(MKDIR) \$(INC_D)${o}openssl
|
||||
\$(MKDIR) \$(INCO_D)
|
||||
|
||||
\$(INC_D):
|
||||
\$(MKDIR) \$(INC_D)
|
||||
|
@ -744,7 +749,7 @@ sub cc_compile_target
|
|||
local($ret);
|
||||
|
||||
# EAY EAY
|
||||
$ex_flags.=' -DCFLAGS="\"$(CC) $(CFLAG)\"" -DPLATFORM="\"$(PLATFORM)\""' if ($source =~ /cversion/);
|
||||
$ex_flags.=' -DCFLAGS="\"$(CC) $(CFLAG)\"" -DPLATFORM="\"$(PLATFORM)\""' if ($source =~ /cversion/ and $dcflags ne 'n');
|
||||
$target =~ s/\//$o/g if $o ne "/";
|
||||
$source =~ s/\//$o/g if $o ne "/";
|
||||
$ret ="$target: \$(SRC_D)$o$source\n\t";
|
||||
|
|
150
util/pl/BC-32.pl
150
util/pl/BC-32.pl
|
@ -1,102 +1,122 @@
|
|||
#!/usr/local/bin/perl
|
||||
# VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries
|
||||
# Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si>
|
||||
#
|
||||
|
||||
$ssl= "ssleay32";
|
||||
$crypto="libeay32";
|
||||
$RSAref="RSAref32";
|
||||
|
||||
$o='\\';
|
||||
$cp='copy';
|
||||
$rm='del';
|
||||
|
||||
# C compiler stuff
|
||||
$cc='bcc32';
|
||||
$lflags="-ap -Tpe -x -Gn ";
|
||||
$mlflags='';
|
||||
|
||||
$out_def="out32";
|
||||
$tmp_def="tmp32";
|
||||
$inc_def="inc32";
|
||||
#enable max error messages, disable most common errors, and be quiet
|
||||
$cflags="-j255 -w-aus -w-par -w-inl -c -tWC -tWM -DWINDOWS -DWIN32 -DL_ENDIAN ";
|
||||
$dcflags='n'
|
||||
if ($debug)
|
||||
{ $op="-v "; }
|
||||
else { $op="-O "; }
|
||||
|
||||
$cflags="-d $op -DL_ENDIAN ";
|
||||
# I add the stack opt
|
||||
$base_lflags="-c";
|
||||
$lflags="$base_lflags";
|
||||
|
||||
$cflags.=" -DWINDOWS -DWIN32";
|
||||
$app_cflag="-WC";
|
||||
$lib_cflag="-WC";
|
||||
$lflags.=" -Tpe";
|
||||
|
||||
if ($shlib)
|
||||
{
|
||||
$mlflags="$base_lflags -Tpe"; # stack if defined in .def file
|
||||
$libs="libw ldllcew";
|
||||
}
|
||||
{
|
||||
$cflags.="-Od -y -v -vi- -D_DEBUG";
|
||||
$mlflags.=' ';
|
||||
}
|
||||
else
|
||||
{ $mlflags=''; }
|
||||
{
|
||||
$cflags.="-O2 -ff -fp";
|
||||
}
|
||||
|
||||
$obj='.obj';
|
||||
$ofile="-o";
|
||||
|
||||
# EXE linking stuff
|
||||
$link="tlink32";
|
||||
$link="ilink32";
|
||||
$efile="";
|
||||
$exep='.exe';
|
||||
$ex_libs="CW32.LIB IMPORT32.LIB";
|
||||
$ex_libs.=$no_sock?"":" wsock32.lib";
|
||||
$shlib_ex_obj="" if $shlib;
|
||||
$app_ex_obj="C0X32.OBJ";
|
||||
if ($no_sock)
|
||||
{ $ex_libs=""; }
|
||||
else { $ex_libs="cw32mt.lib import32.lib"; }
|
||||
|
||||
# static library stuff
|
||||
$mklib='tlib';
|
||||
$mklib='tlib /P64';
|
||||
$ranlib='';
|
||||
$plib="";
|
||||
$libp=".lib";
|
||||
$shlibp=($shlib)?".dll":".lib";
|
||||
$lfile='';
|
||||
|
||||
$asm='ml /Cp /c /Cx';
|
||||
$shlib_ex_obj="";
|
||||
$app_ex_obj="c0x32.obj";
|
||||
|
||||
$asm='n_o_T_a_s_m';
|
||||
$asm.=" /Zi" if $debug;
|
||||
$afile='/Fo';
|
||||
if ($noasm)
|
||||
|
||||
$bn_mulw_obj='';
|
||||
$bn_mulw_src='';
|
||||
$des_enc_obj='';
|
||||
$des_enc_src='';
|
||||
$bf_enc_obj='';
|
||||
$bf_enc_src='';
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_asm_obj='';
|
||||
$bn_asm_src='';
|
||||
$bn_mulw_obj='crypto\bn\asm\bn-win32.obj';
|
||||
$bn_mulw_src='crypto\bn\asm\bn-win32.asm';
|
||||
$des_enc_obj='crypto\des\asm\d-win32.obj crypto\des\asm\y-win32.obj';
|
||||
$des_enc_src='crypto\des\asm\d-win32.asm crypto\des\asm\y-win32.asm';
|
||||
$bf_enc_obj='crypto\bf\asm\b-win32.obj';
|
||||
$bf_enc_src='crypto\bf\asm\b-win32.asm';
|
||||
$cast_enc_obj='crypto\cast\asm\c-win32.obj';
|
||||
$cast_enc_src='crypto\cast\asm\c-win32.asm';
|
||||
$rc4_enc_obj='crypto\rc4\asm\r4-win32.obj';
|
||||
$rc4_enc_src='crypto\rc4\asm\r4-win32.asm';
|
||||
$rc5_enc_obj='crypto\rc5\asm\r5-win32.obj';
|
||||
$rc5_enc_src='crypto\rc5\asm\r5-win32.asm';
|
||||
$md5_asm_obj='crypto\md5\asm\m5-win32.obj';
|
||||
$md5_asm_src='crypto\md5\asm\m5-win32.asm';
|
||||
$sha1_asm_obj='crypto\sha\asm\s1-win32.obj';
|
||||
$sha1_asm_src='crypto\sha\asm\s1-win32.asm';
|
||||
$rmd160_asm_obj='crypto\ripemd\asm\rm-win32.obj';
|
||||
$rmd160_asm_src='crypto\ripemd\asm\rm-win32.asm';
|
||||
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
|
||||
}
|
||||
else
|
||||
|
||||
if ($shlib)
|
||||
{
|
||||
$bn_asm_obj='crypto\bn\asm\x86b32.obj';
|
||||
$bn_asm_src='crypto\bn\asm\x86m32.asm';
|
||||
$mlflags.=" $lflags /dll";
|
||||
# $cflags =~ s| /MD| /MT|;
|
||||
$lib_cflag=" /GD -D_WINDLL -D_DLL";
|
||||
$out_def="out32dll";
|
||||
$tmp_def="tmp32dll";
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($target,$name,$shlib)=@_;
|
||||
local($objs,$target,$name,$shlib)=@_;
|
||||
local($ret,$Name);
|
||||
|
||||
$taget =~ s/\//$o/g if $o ne '/';
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RM) \$(O_$Name)\n";
|
||||
|
||||
# Due to a pathetic line length limit, I unwrap the args.
|
||||
local($lib_names)="";
|
||||
local($dll_names)="";
|
||||
foreach $_ (sort split(/\s+/,$Vars{"${Name}OBJ"}))
|
||||
{
|
||||
$lib_names.=" +$_ &\n";
|
||||
$dll_names.=" $_\n";
|
||||
}
|
||||
|
||||
# $target="\$(LIB_D)$o$target";
|
||||
$ret.="$target: $objs\n";
|
||||
if (!$shlib)
|
||||
{
|
||||
$ret.="\t\$(MKLIB) $target & <<|\n$lib_names\n,\n|\n";
|
||||
# $ret.="\t\$(RM) \$(O_$Name)\n";
|
||||
$ret.="\techo LIB $<\n";
|
||||
$ret.="\t\$(MKLIB) $lfile$target \$(addprefix +, $objs)\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
# $(SHLIB_EX_OBJ)
|
||||
local($ex)=($Name eq "SSL")?' $(L_CRYPTO) winsock':"";
|
||||
$ret.="\t\$(LINK) \$(MLFLAGS) @&&|\n";
|
||||
$ret.=$dll_names;
|
||||
$ret.="\n $target\n\n $ex $libs\nms$o${name}16.def;\n|\n";
|
||||
($out_lib=$target) =~ s/O_/L_/;
|
||||
$ret.="\timplib /nowep $out_lib $target\n\n";
|
||||
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
||||
$ex.=' wsock32.lib gdi32.lib';
|
||||
$ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
|
||||
}
|
||||
$ret.="\n";
|
||||
return($ret);
|
||||
|
@ -105,30 +125,12 @@ sub do_lib_rule
|
|||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$f,$_,@f);
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($targer);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.=" \$(LINK) @&&|";
|
||||
|
||||
# Due to a pathetic line length limit, I have to unwrap the args.
|
||||
$r=" \$(LFLAGS) ";
|
||||
if ($files =~ /\(([^)]*)\)$/)
|
||||
{
|
||||
@a=('$(APP_EX_OBJ)');
|
||||
push(@a,sort split(/\s+/,$Vars{$1}));
|
||||
foreach $_ (@a)
|
||||
{
|
||||
$ret.="\n $r $_ +";
|
||||
$r="";
|
||||
}
|
||||
chop($ret);
|
||||
$ret.="\n";
|
||||
}
|
||||
else
|
||||
{ $ret.="\n $r \$(APP_EX_OBJ) $files\n"; }
|
||||
$ret.=" $target\n\n $libs\n\n|\n\n";
|
||||
$ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
|
|
79
util/pl/Mingw32.pl
Normal file
79
util/pl/Mingw32.pl
Normal file
|
@ -0,0 +1,79 @@
|
|||
#!/usr/local/bin/perl
|
||||
#
|
||||
# unix.pl - the standard unix makefile stuff.
|
||||
#
|
||||
|
||||
# Need the Cygwin32 file utilities
|
||||
$o='/';
|
||||
$cp='cp';
|
||||
$rm='rm';
|
||||
|
||||
# gcc wouldn't accept backslashes in paths
|
||||
#$o='\\';
|
||||
#$cp='copy';
|
||||
#$rm='del';
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
$cc='gcc';
|
||||
if ($debug)
|
||||
{ $cflags="-g2 -ggdb"; }
|
||||
else
|
||||
{ $cflags="-O3 -fomit-frame-pointer"; }
|
||||
$dcflags='n' # Make can't handle -DCFLAGS definition
|
||||
|
||||
$obj='.o';
|
||||
$ofile='-o ';
|
||||
|
||||
# EXE linking stuff
|
||||
$link='${CC}';
|
||||
$lflags='${CFLAGS}';
|
||||
$efile='-o ';
|
||||
$exep='';
|
||||
$ex_libs="-lwsock32 -lgdi32";
|
||||
|
||||
# static library stuff
|
||||
$mklib='ar r';
|
||||
$mlflags='';
|
||||
$ranlib='ranlib';
|
||||
$plib='lib';
|
||||
$libp=".a";
|
||||
$shlibp=".a";
|
||||
$lfile='';
|
||||
|
||||
$asm='as';
|
||||
$afile='-o ';
|
||||
$bn_asm_obj="";
|
||||
$bn_asm_src="";
|
||||
$des_enc_obj="";
|
||||
$des_enc_src="";
|
||||
$bf_enc_obj="";
|
||||
$bf_enc_src="";
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($obj,$target,$name,$shlib)=@_;
|
||||
local($ret,$_,$Name);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne '/';
|
||||
$target="$target";
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RM) $target\n";
|
||||
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RANLIB) $target\n\n";
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
1;
|
Loading…
Reference in a new issue