OpenSSL: update to 1.0.2a
[tomato.git] / release / src-rt-6.x.4708 / router / openssl / util / pl / BC-32.pl
blobed28e65e661a644328cd7d3bec99ff82d369c31c
1 #!/usr/local/bin/perl
2 # Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si>
5 $ssl= "ssleay32";
6 $crypto="libeay32";
8 $o='\\';
9 $cp='copy';
10 $rm='del';
12 # C compiler stuff
13 $cc='bcc32';
14 $lflags="-ap -Tpe -x -Gn ";
15 $mlflags='';
17 $out_def="out32";
18 $tmp_def="tmp32";
19 $inc_def="inc32";
20 #enable max error messages, disable most common warnings
21 $cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp ";
22 if ($debug)
24 $cflags.="-Od -y -v -vi- -D_DEBUG";
25 $mlflags.=' ';
27 else
29 $cflags.="-O2 -ff -fp";
32 $obj='.obj';
33 $ofile="-o";
35 # EXE linking stuff
36 $link="ilink32";
37 $efile="";
38 $exep='.exe';
39 if ($no_sock)
40 { $ex_libs=""; }
41 else { $ex_libs="cw32mt.lib import32.lib crypt32.lib ws2_32.lib"; }
43 # static library stuff
44 $mklib='tlib /P64';
45 $ranlib='';
46 $plib="";
47 $libp=".lib";
48 $shlibp=($shlib)?".dll":".lib";
49 $lfile='';
51 $shlib_ex_obj="";
52 $app_ex_obj="c0x32.obj";
54 $asm=(`nasm -v 2>NUL` ge `nasmw -v 2>NUL`?"nasm":"nasmw")." -f obj -d__omf__";
55 $asm.=" -g" if $debug;
56 $afile='-o';
58 $bn_mulw_obj='';
59 $bn_mulw_src='';
60 $des_enc_obj='';
61 $des_enc_src='';
62 $bf_enc_obj='';
63 $bf_enc_src='';
65 if (!$no_asm)
67 $bn_mulw_obj='crypto\bn\asm\bn_win32.obj';
68 $bn_mulw_src='crypto\bn\asm\bn_win32.asm';
69 $des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj';
70 $des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm';
71 $bf_enc_obj='crypto\bf\asm\b_win32.obj';
72 $bf_enc_src='crypto\bf\asm\b_win32.asm';
73 $cast_enc_obj='crypto\cast\asm\c_win32.obj';
74 $cast_enc_src='crypto\cast\asm\c_win32.asm';
75 $rc4_enc_obj='crypto\rc4\asm\r4_win32.obj';
76 $rc4_enc_src='crypto\rc4\asm\r4_win32.asm';
77 $rc5_enc_obj='crypto\rc5\asm\r5_win32.obj';
78 $rc5_enc_src='crypto\rc5\asm\r5_win32.asm';
79 $md5_asm_obj='crypto\md5\asm\m5_win32.obj';
80 $md5_asm_src='crypto\md5\asm\m5_win32.asm';
81 $sha1_asm_obj='crypto\sha\asm\s1_win32.obj';
82 $sha1_asm_src='crypto\sha\asm\s1_win32.asm';
83 $rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj';
84 $rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm';
85 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
88 if ($shlib)
90 $mlflags.=" $lflags /dll";
91 # $cflags =~ s| /MD| /MT|;
92 $lib_cflag=" /GD -D_WINDLL -D_DLL";
93 $out_def="out32dll";
94 $tmp_def="tmp32dll";
97 sub do_lib_rule
99 local($objs,$target,$name,$shlib)=@_;
100 local($ret,$Name);
102 $taget =~ s/\//$o/g if $o ne '/';
103 ($Name=$name) =~ tr/a-z/A-Z/;
105 # $target="\$(LIB_D)$o$target";
106 $ret.="$target: $objs\n";
107 if (!$shlib)
109 $ret.=<<___;
110 -\$(RM) $lfile$target
111 \$(MKLIB) $lfile$target \@&&!
112 +\$(**: = &^
117 else
119 local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
120 $ex.=' ws2_32.lib gdi32.lib';
121 $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
123 $ret.="\n";
124 return($ret);
127 sub do_link_rule
129 local($target,$files,$dep_libs,$libs)=@_;
130 local($ret,$_);
132 $file =~ s/\//$o/g if $o ne '/';
133 $n=&bname($targer);
134 $ret.="$target: $files $dep_libs\n";
135 $ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
136 return($ret);