Backport of CPUID support in mk1mf and update Mingw32 batch file to build

cpuid source file.
This commit is contained in:
Dr. Stephen Henson 2006-05-05 13:19:35 +00:00
parent 84971b39f5
commit b03a4917be
3 changed files with 105 additions and 91 deletions

View File

@ -60,6 +60,10 @@ echo RC5\32
cd crypto\rc5\asm
perl rc5-586.pl gaswin > r5-win32.s
cd ..\..\..
echo CPUID
cd crypto
perl x86cpuid.pl gaswin > cpu-win32.s
cd ..
:noasm

View File

@ -413,6 +413,8 @@ SHA1_ASM_OBJ=$sha1_asm_obj
SHA1_ASM_SRC=$sha1_asm_src
RMD160_ASM_OBJ=$rmd160_asm_obj
RMD160_ASM_SRC=$rmd160_asm_src
CPUID_ASM_OBJ=$cpuid_asm_obj
CPUID_ASM_SRC=$cpuid_asm_src
# The output directory for everything intersting
OUT_D=$out_dir
@ -656,6 +658,11 @@ foreach (values %lib_nam)
$lib_obj =~ s/\s(\S*\/rmd_dgst\S*)/ $1 \$(RMD160_ASM_OBJ)/;
$rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src);
}
if (($cpuid_asm_obj ne "") && ($_ eq "CRYPTO"))
{
$lib_obj =~ s/\s(\S*\/cversion\S*)/ $1 \$(CPUID_ASM_OBJ)/;
$rules.=&do_asm_rule($cpuid_asm_obj,$cpuid_asm_src);
}
$defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj);
$lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)";
$rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib);
@ -838,6 +845,7 @@ sub do_defs
elsif ($_ =~ /MD5_ASM/) { $t="$_ "; }
elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; }
elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; }
elsif ($_ =~ /CPUID_ASM/){ $t="$_ "; }
else { $t="$location${o}$_$pf "; }
$Vars{$var}.="$t ";

View File

@ -19,7 +19,7 @@ $cc='gcc';
if ($debug)
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
else
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -march=i486 -Wall"; }
if ($gaswin and !$no_asm)
{
@ -43,6 +43,8 @@ if ($gaswin and !$no_asm)
$rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
$sha1_asm_obj='$(OBJ_D)\s1-win32.o';
$sha1_asm_src='crypto/sha/asm/s1-win32.s';
$cpuid_asm_obj='$(OBJ_D)\cpu-win32.o';
$cpuid_asm_src='crypto/cpu-win32.s';
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
}