-
@echo off
-SET ASMOPTS=-DOPENSSL_IA32_SSE2
-SET ASM=no-asm
+SET ASM=%1
if NOT X%PROCESSOR_ARCHITECTURE% == X goto defined
SET TARGET=VC-WIN32
-if NOT x%1% == xno-asm SET ASM=nasm
-
-goto compile
-
-:IA64
-
-echo Auto Configuring for IA64
-SET TARGET=VC-WIN64I
-perl ms\uplink.pl win64i > ms\uptable.asm
-if ERRORLEVEL 1 goto error
-ias -o ms\uptable.obj ms\uptable.asm
-if ERRORLEVEL 1 goto error
-
-goto compile
-
-:AMD64
-
-echo Auto Configuring for AMD64
-SET TARGET=VC-WIN64A
-perl ms\uplink.pl win64a > ms\uptable.asm
-if ERRORLEVEL 1 goto error
-ml64 -c -Foms\uptable.obj ms\uptable.asm
-if ERRORLEVEL 1 goto error
-
-
-:compile
-
-perl Configure %TARGET% fipscanisterbuild
-pause
-
-if %ASM% == no-asm goto skipasm
+if x%ASM% == xno-asm goto compile
echo Generating x86 for NASM assember
+SET ASM=nasm
+SET ASMOPTS=-DOPENSSL_IA32_SSE2
echo Bignum
cd crypto\bn\asm
if ERRORLEVEL 1 goto error
cd ..
-:skipasm
+goto compile
+
+:IA64
+
+echo Auto Configuring for IA64
+SET TARGET=VC-WIN64I
+perl ms\uplink.pl win64i > ms\uptable.asm
+if ERRORLEVEL 1 goto error
+ias -o ms\uptable.obj ms\uptable.asm
+if ERRORLEVEL 1 goto error
+
+goto compile
+
+:AMD64
+
+echo Auto Configuring for AMD64
+SET TARGET=VC-WIN64A
+perl ms\uplink.pl win64a > ms\uptable.asm
+if ERRORLEVEL 1 goto error
+ml64 -c -Foms\uptable.obj ms\uptable.asm
+if ERRORLEVEL 1 goto error
+
+if x%ASM% == xno-asm goto compile
+echo Generating x86_64 for ML64 assember
+SET ASM=ml64
+
+echo Bignum
+cd crypto\bn\asm
+perl x86_64-mont.pl x86_64-mont.asm
+if ERRORLEVEL 1 goto error
+cd ..\..\..
+
+echo AES
+cd crypto\aes\asm
+perl aes-x86_64.pl aes-x86_64.asm
+if ERRORLEVEL 1 goto error
+cd ..\..\..
+
+echo SHA
+cd crypto\sha\asm
+perl sha1-x86_64.pl sha1-x86_64.asm
+if ERRORLEVEL 1 goto error
+perl sha512-x86_64.pl sha256-x86_64.asm
+if ERRORLEVEL 1 goto error
+perl sha512-x86_64.pl sha512-x86_64.asm
+if ERRORLEVEL 1 goto error
+cd ..\..\..
+
+echo CPU-ID
+cd crypto
+perl x86_64cpuid.pl cpuid-x86_64.asm
+if ERRORLEVEL 1 goto error
+cd ..
+
+:compile
+
+perl Configure %TARGET% fipscanisterbuild
+pause
echo on
#################################################################
# rename segments in COFF modules according to %map table below #
%map=( ".text" => "fipstx$suffix", #
+ ".text\$"=> "fipstx$suffix", #
".rdata"=> "fipsrd$suffix", #
".data" => "fipsda$suffix" ); #
#################################################################
if ($nasm) {
$asm='nasmw -f win32';
$afile='-o ';
+} elsif ($ml64) {
+ $asm='ml64 /c /Cp /Cx';
+ $asm.=' /Zi' if $debug;
+ $afile='/Fo';
} else {
$asm='ml /Cp /coff /c /Cx';
$asm.=" /Zi" if $debug;
$bf_enc_src='';
if (!$no_asm)
+ {
+ if ($FLAVOR =~ "WIN32")
{
$aes_asm_obj='crypto\aes\asm\a_win32.obj';
$aes_asm_src='crypto\aes\asm\a_win32.asm';
$cpuid_asm_src='crypto\cpu_win32.asm';
$cflags.=" -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DAES_ASM -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
}
+ elsif ($FLAVOR =~ "WIN64A")
+ {
+ $aes_asm_obj='$(OBJ_D)\aes-x86_64.obj';
+ $aes_asm_src='crypto\aes\asm\aes-x86_64.asm';
+ $bn_asm_obj='$(OBJ_D)\x86_64-mont.obj $(OBJ_D)\bn_asm.obj';
+ $bn_asm_src='crypto\bn\asm\x86_64-mont.asm';
+ $sha1_asm_obj='$(OBJ_D)\sha1-x86_64.obj $(OBJ_D)\sha256-x86_64.obj $(OBJ_D)\sha512-x86_64.obj';
+ $sha1_asm_src='crypto\sha\asm\sha1-x86_64.asm crypto\sha\asm\sha256-x86_64.asm crypto\sha\asm\sha512-x86_64.asm';
+ $cpuid_asm_obj='$(OBJ_D)\cpuid-x86_64.obj';
+ $cpuid_asm_src='crypto\cpuid-x86_64.asm';
+ $cflags.=" -DOPENSSL_CPUID_OBJ -DAES_ASM -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM";
+ }
+ }
if ($shlib && $FLAVOR !~ /CE/)
{