Generate DLLs with Mingw32.

This commit is contained in:
Ulf Möller 1999-05-07 22:55:27 +00:00
parent 12d7d32f24
commit 7d5d27b9a3
5 changed files with 61 additions and 40 deletions

View File

@ -72,44 +72,31 @@
To build OpenSSL, you need the Mingw32 package and GNU make. To build OpenSSL, you need the Mingw32 package and GNU make.
Compiler installation: * Compiler installation:
Mingw32 is available from <ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/ 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 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/ <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 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. C:\egcs-1.1.2\mingw32.bat to set the PATH.
* Configure OpenSSL: * Compile OpenSSL:
> perl Configure Mingw32 Run ms\mw.bat
> perl util\mkfiles.pl >MINFO
> perl util\mk1mf.pl Mingw32 >ms\mingw32.mak
* This step can be skipped if you have the GNU file utitilities (cp, rm, ...) This will create the library and binaries in out.
installed:
> perl util\mk1mf.pl Mingw32-files >ms\mingw32f.mak libcrypto.a and libssl.a are the static libraries. To use the DLLs,
> make -f ms/mingw32f.mak link with libeay32.a and libssl32.a instead.
This will end with an error message. If you don't like that, install See troubleshooting if you get error messages about functions not having
the file utilities. :) a number assigned.
* Compile the library: * You can now try the tests:
> make -f ms/mingw32.mak
You can now try the tests:
> cd out > cd out
> ..\ms\test > ..\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 Troubleshooting
--------------- ---------------
@ -151,9 +138,6 @@
program will almost certainly crash: see the original SSLeay description program will almost certainly crash: see the original SSLeay description
below for more details. below for more details.
Tweaks
------
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
The orignal Windows build instructions from SSLeay follow. The orignal Windows build instructions from SSLeay follow.
Note: some of this may be out of date and no longer applicable Note: some of this may be out of date and no longer applicable

34
ms/mw.bat Normal file
View File

@ -0,0 +1,34 @@
@rem OpenSSL with Mingw32
@rem --------------------
perl Configure Mingw32
if errorlevel 1 goto end
@rem Makefile
perl util\mkfiles.pl >MINFO
perl util\mk1mf.pl Mingw32 >ms\mingw32.mak
perl util\mk1mf.pl Mingw32-files >ms\mingw32f.mak
@rem DLL defintion files
perl util\mkdef.pl 32 libeay >ms\libeay32.def
if errorlevel 1 goto end
perl util\mkdef.pl 32 ssleay >ms\ssleay32.def
if errorlevel 1 goto end
@rem Create files -- this can be skipped if using the GNU file utilities
make -f ms/mingw32f.mak
echo You can ignore the error messages above
@rem Build the libraries
make -f ms/mingw32.mak
if errorlevel 1 goto end
@rem Generate the DLLs and input libraries
dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32
if errorlevel 1 goto end
dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/libssl32.def out/libssl.a out/libeay32.a
if errorlevel 1 goto end
echo Done compiling OpenSSL
:end

View File

@ -109,13 +109,13 @@ if($do_crypto == 1) {
} }
} else { } else {
my $err = 0;
&print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func) $err += &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func)
if $do_ssl == 1; if $do_ssl == 1;
&print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func) $err += &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func)
if $do_crypto == 1; if $do_crypto == 1;
exit($err);
} }
@ -290,6 +290,7 @@ sub print_def_file
{ {
(*OUT,my $name,*nums,@functions)=@_; (*OUT,my $name,*nums,@functions)=@_;
my $n =1; my $n =1;
my $nodef=0;
if ($W32) if ($W32)
{ $name.="32"; } { $name.="32"; }
@ -329,14 +330,17 @@ EOF
foreach $func (@functions) { foreach $func (@functions) {
if (!defined($nums{$func})) { if (!defined($nums{$func})) {
printf STDERR "$func does not have a number assigned\n" if(!$do_update) {
if(!$do_update); printf STDERR "$func does not have a number assigned\n";
$nodef = 1;
}
} else { } else {
$n=$nums{$func}; $n=$nums{$func};
printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n; printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n;
} }
} }
printf OUT "\n"; printf OUT "\n";
return ($nodef);
} }
sub load_numbers sub load_numbers

View File

@ -1,12 +1,11 @@
#!/usr/local/bin/perl #!/usr/local/bin/perl
# #
# unix.pl - the standard unix makefile stuff. # Mingw32.pl -- Mingw32 with GNU cp (Mingw32f.pl uses DOS tools)
# #
# Need the Cygwin32 file utilities
$o='/'; $o='/';
$cp='cp'; $cp='cp';
$rm='rm'; $rm='del'; # use 'rm -f' if using GNU file utilities
$mkdir='gmkdir'; $mkdir='gmkdir';
# gcc wouldn't accept backslashes in paths # gcc wouldn't accept backslashes in paths

View File

@ -1,6 +1,6 @@
#!/usr/local/bin/perl #!/usr/local/bin/perl
# #
# unix.pl - the standard unix makefile stuff. # Mingw32f.pl -- copy files; Mingw32.pl is needed to do the compiling.
# #
$o='\\'; $o='\\';