freebsd-nq/crypto/openssl/util/pl/Mingw32.pl

107 lines
2.4 KiB
Perl
Raw Normal View History

#!/usr/local/bin/perl
#
2003-10-01 12:32:41 +00:00
# Mingw32.pl -- Mingw
#
$o='/';
$cp='cp';
2003-10-01 12:32:41 +00:00
$rm='rm -f';
$mkdir='gmkdir';
2003-10-01 12:32:41 +00:00
$o='\\';
$cp='copy';
$rm='del';
$mkdir='mkdir';
# C compiler stuff
$cc='gcc';
if ($debug)
2000-11-13 01:03:58 +00:00
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
else
2006-10-01 07:38:44 +00:00
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -march=i486 -Wall"; }
2000-11-13 01:03:58 +00:00
2006-07-29 19:10:21 +00:00
if ($gaswin and !$no_asm)
2000-11-13 01:03:58 +00:00
{
2003-10-01 12:32:41 +00:00
$bn_asm_obj='$(OBJ_D)\bn-win32.o';
2000-11-13 01:03:58 +00:00
$bn_asm_src='crypto/bn/asm/bn-win32.s';
2003-10-01 12:32:41 +00:00
$bnco_asm_obj='$(OBJ_D)\co-win32.o';
$bnco_asm_src='crypto/bn/asm/co-win32.s';
2003-10-01 12:32:41 +00:00
$des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
2000-11-13 01:03:58 +00:00
$des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
2003-10-01 12:32:41 +00:00
$bf_enc_obj='$(OBJ_D)\b-win32.o';
2000-11-13 01:03:58 +00:00
$bf_enc_src='crypto/bf/asm/b-win32.s';
2003-10-01 12:32:41 +00:00
# $cast_enc_obj='$(OBJ_D)\c-win32.o';
2000-11-13 01:03:58 +00:00
# $cast_enc_src='crypto/cast/asm/c-win32.s';
2003-10-01 12:32:41 +00:00
$rc4_enc_obj='$(OBJ_D)\r4-win32.o';
2000-11-13 01:03:58 +00:00
$rc4_enc_src='crypto/rc4/asm/r4-win32.s';
2003-10-01 12:32:41 +00:00
$rc5_enc_obj='$(OBJ_D)\r5-win32.o';
2000-11-13 01:03:58 +00:00
$rc5_enc_src='crypto/rc5/asm/r5-win32.s';
2003-10-01 12:32:41 +00:00
$md5_asm_obj='$(OBJ_D)\m5-win32.o';
2000-11-13 01:03:58 +00:00
$md5_asm_src='crypto/md5/asm/m5-win32.s';
2003-10-01 12:32:41 +00:00
$rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
2000-11-13 01:03:58 +00:00
$rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
2003-10-01 12:32:41 +00:00
$sha1_asm_obj='$(OBJ_D)\s1-win32.o';
2000-11-13 01:03:58 +00:00
$sha1_asm_src='crypto/sha/asm/s1-win32.s';
2006-10-01 07:38:44 +00:00
$cpuid_asm_obj='$(OBJ_D)\cpu-win32.o';
$cpuid_asm_src='crypto/cpu-win32.s';
2006-07-29 19:10:21 +00:00
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
2000-11-13 01:03:58 +00:00
}
$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";
2003-10-01 12:32:41 +00:00
$ret.="\tif exist $target \$(RM) $target\n";
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
$ret.="\t\$(RANLIB) $target\n\n";
}
sub do_link_rule
{
2006-07-29 19:10:21 +00:00
local($target,$files,$dep_libs,$libs)=@_;
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
$ret.="$target: $files $dep_libs\n";
2006-07-29 19:10:21 +00:00
$ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
return($ret);
}
1;