mingw related changes as in head

This commit is contained in:
Ulf Möller 2003-02-22 01:25:37 +00:00
parent dab0aaa612
commit 0480574310
5 changed files with 297 additions and 375 deletions

View File

@ -16,7 +16,7 @@
* Visual C++ * Visual C++
* Borland C * Borland C
* GNU C (Mingw32 or Cygwin) * GNU C (MinGW or Cygwin)
If you want to compile in the assembly language routines with Visual C++ then If you want to compile in the assembly language routines with Visual C++ then
you will need an assembler. This is worth doing because it will result in you will need an assembler. This is worth doing because it will result in
@ -120,18 +120,14 @@
* Run make: * Run make:
> make -f bcb.mak > make -f bcb.mak
GNU C (Mingw32) GNU C (MinGW)
--------------- -------------
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/ MinGW is available from http://www.mingw.org. Run the installer and
gnu-win32/mingw32/gcc-2.95.2/gcc-2.95.2-msvcrt.exe>. Extract it set the MinGW \bin directory to the PATH in "System Properties" or
to a directory such as C:\gcc-2.95.2 and add c:\gcc-2.95.2\bin to autoexec.bat.
the PATH environment variable in "System Properties"; or edit and
run C:\gcc-2.95.2\mingw32.bat to set the PATH.
* Compile OpenSSL: * Compile OpenSSL:
@ -161,7 +157,7 @@
Consequently, a make of OpenSSL with Cygwin is closer to a GNU Consequently, a make of OpenSSL with Cygwin is closer to a GNU
bash environment such as Linux than to other W32 makes which are bash environment such as Linux than to other W32 makes which are
based on a single makefile approach. Cygwin implements Posix/Unix based on a single makefile approach. Cygwin implements Posix/Unix
calls through cygwin1.dll, and is contrasted to Mingw32 which links calls through cygwin1.dll, and is contrasted to MingW which links
dynamically to msvcrt.dll or crtdll.dll. dynamically to msvcrt.dll or crtdll.dll.
To build OpenSSL using Cygwin: To build OpenSSL using Cygwin:

View File

@ -66,21 +66,16 @@ cd ..\..\..
echo Generating makefile echo Generating makefile
perl util\mkfiles.pl >MINFO perl util\mkfiles.pl >MINFO
perl util\mk1mf.pl gaswin Mingw32 >ms\mingw32a.mak perl util\mk1mf.pl gaswin Mingw32 >ms\mingw32a.mak
perl util\mk1mf.pl gaswin Mingw32-files >ms\mingw32f.mak
echo Generating DLL definition files echo Generating DLL definition files
perl util\mkdef.pl 32 libeay >ms\libeay32.def perl util\mkdef.pl 32 libeay >ms\libeay32.def
if errorlevel 1 goto end if errorlevel 1 goto end
perl util\mkdef.pl 32 ssleay >ms\ssleay32.def perl util\mkdef.pl 32 ssleay >ms\ssleay32.def
if errorlevel 1 goto end if errorlevel 1 goto end
rem Create files -- this can be skipped if using the GNU file utilities rem copy ms\tlhelp32.h outinc
make -f ms/mingw32f.mak
echo You can ignore the error messages above
copy ms\tlhelp32.h outinc
echo Building the libraries echo Building the libraries
make -f ms/mingw32a.mak mingw32-make -f ms/mingw32a.mak
if errorlevel 1 goto end if errorlevel 1 goto end
echo Generating the DLLs and input libraries echo Generating the DLLs and input libraries

View File

@ -67,6 +67,10 @@ echo dsatest
dsatest dsatest
if errorlevel 1 goto done if errorlevel 1 goto done
echo ectest
ectest
if errorlevel 1 goto done
echo testenc echo testenc
call %test%\testenc openssl call %test%\testenc openssl
if errorlevel 1 goto done if errorlevel 1 goto done

View File

@ -1,17 +1,17 @@
#!/usr/local/bin/perl #!/usr/local/bin/perl
# #
# Mingw32.pl -- Mingw32 with GNU cp (Mingw32f.pl uses DOS tools) # Mingw32.pl -- Mingw
# #
$o='/'; $o='/';
$cp='cp'; $cp='cp';
$rm='rem'; # use 'rm -f' if using GNU file utilities $rm='rm -f';
$mkdir='gmkdir'; $mkdir='gmkdir';
# gcc wouldn't accept backslashes in paths $o='\\';
#$o='\\'; $cp='copy';
#$cp='copy'; $rm='del';
#$rm='del'; $mkdir='mkdir';
# C compiler stuff # C compiler stuff
@ -19,29 +19,29 @@ $cc='gcc';
if ($debug) if ($debug)
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; } { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
else else
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -m486 -Wall"; } { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
if ($gaswin and !$no_asm) if ($gaswin and !$no_asm)
{ {
$bn_asm_obj='$(OBJ_D)/bn-win32.o'; $bn_asm_obj='$(OBJ_D)\bn-win32.o';
$bn_asm_src='crypto/bn/asm/bn-win32.s'; $bn_asm_src='crypto/bn/asm/bn-win32.s';
$bnco_asm_obj='$(OBJ_D)/co-win32.o'; $bnco_asm_obj='$(OBJ_D)\co-win32.o';
$bnco_asm_src='crypto/bn/asm/co-win32.s'; $bnco_asm_src='crypto/bn/asm/co-win32.s';
$des_enc_obj='$(OBJ_D)/d-win32.o $(OBJ_D)/y-win32.o'; $des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
$des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s'; $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
$bf_enc_obj='$(OBJ_D)/b-win32.o'; $bf_enc_obj='$(OBJ_D)\b-win32.o';
$bf_enc_src='crypto/bf/asm/b-win32.s'; $bf_enc_src='crypto/bf/asm/b-win32.s';
# $cast_enc_obj='$(OBJ_D)/c-win32.o'; # $cast_enc_obj='$(OBJ_D)\c-win32.o';
# $cast_enc_src='crypto/cast/asm/c-win32.s'; # $cast_enc_src='crypto/cast/asm/c-win32.s';
$rc4_enc_obj='$(OBJ_D)/r4-win32.o'; $rc4_enc_obj='$(OBJ_D)\r4-win32.o';
$rc4_enc_src='crypto/rc4/asm/r4-win32.s'; $rc4_enc_src='crypto/rc4/asm/r4-win32.s';
$rc5_enc_obj='$(OBJ_D)/r5-win32.o'; $rc5_enc_obj='$(OBJ_D)\r5-win32.o';
$rc5_enc_src='crypto/rc5/asm/r5-win32.s'; $rc5_enc_src='crypto/rc5/asm/r5-win32.s';
$md5_asm_obj='$(OBJ_D)/m5-win32.o'; $md5_asm_obj='$(OBJ_D)\m5-win32.o';
$md5_asm_src='crypto/md5/asm/m5-win32.s'; $md5_asm_src='crypto/md5/asm/m5-win32.s';
$rmd160_asm_obj='$(OBJ_D)/rm-win32.o'; $rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
$rmd160_asm_src='crypto/ripemd/asm/rm-win32.s'; $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
$sha1_asm_obj='$(OBJ_D)/s1-win32.o'; $sha1_asm_obj='$(OBJ_D)\s1-win32.o';
$sha1_asm_src='crypto/sha/asm/s1-win32.s'; $sha1_asm_src='crypto/sha/asm/s1-win32.s';
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM";
} }

View File

@ -1,73 +0,0 @@
#!/usr/local/bin/perl
#
# Mingw32f.pl -- copy files; Mingw32.pl is needed to do the compiling.
#
$o='\\';
$cp='copy';
$rm='del';
# C compiler stuff
$cc='gcc';
if ($debug)
{ $cflags="-g2 -ggdb -DDSO_WIN32"; }
else
{ $cflags="-O3 -fomit-frame-pointer -DDSO_WIN32"; }
$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;