use correct function name
[openssl.git] / util / pl / Mingw32.pl
1 #!/usr/local/bin/perl
2 #
3 # Mingw32.pl -- Mingw
4 #
5
6 $o='/';
7 $cp='cp';
8 $rm='rm -f';
9 $mkdir='gmkdir';
10
11 $o='\\';
12 $cp='copy';
13 $rm='del';
14 $mkdir='mkdir';
15
16 # C compiler stuff
17
18 $cc='gcc';
19 if ($debug)
20         { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
21 else
22         { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
23
24 if ($gaswin and !$no_asm)
25         {
26         $bn_asm_obj='$(OBJ_D)\bn-win32.o';
27         $bn_asm_src='crypto/bn/asm/bn-win32.s';
28         $bnco_asm_obj='$(OBJ_D)\co-win32.o';
29         $bnco_asm_src='crypto/bn/asm/co-win32.s';
30         $des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
31         $des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
32         $bf_enc_obj='$(OBJ_D)\b-win32.o';
33         $bf_enc_src='crypto/bf/asm/b-win32.s';
34 #       $cast_enc_obj='$(OBJ_D)\c-win32.o';
35 #       $cast_enc_src='crypto/cast/asm/c-win32.s';
36         $rc4_enc_obj='$(OBJ_D)\r4-win32.o';
37         $rc4_enc_src='crypto/rc4/asm/r4-win32.s';
38         $rc5_enc_obj='$(OBJ_D)\r5-win32.o';
39         $rc5_enc_src='crypto/rc5/asm/r5-win32.s';
40         $md5_asm_obj='$(OBJ_D)\m5-win32.o';
41         $md5_asm_src='crypto/md5/asm/m5-win32.s';
42         $rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
43         $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
44         $sha1_asm_obj='$(OBJ_D)\s1-win32.o';
45         $sha1_asm_src='crypto/sha/asm/s1-win32.s';
46         $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
47         }
48
49
50 $obj='.o';
51 $ofile='-o ';
52
53 # EXE linking stuff
54 $link='${CC}';
55 $lflags='${CFLAGS}';
56 $efile='-o ';
57 $exep='';
58 $ex_libs="-lws2_32 -lgdi32";
59
60 # static library stuff
61 $mklib='ar r';
62 $mlflags='';
63 $ranlib='ranlib';
64 $plib='lib';
65 $libp=".a";
66 $shlibp=".a";
67 $lfile='';
68
69 $asm='as';
70 $afile='-o ';
71 #$bn_asm_obj="";
72 #$bn_asm_src="";
73 #$des_enc_obj="";
74 #$des_enc_src="";
75 #$bf_enc_obj="";
76 #$bf_enc_src="";
77
78 sub do_lib_rule
79         {
80         local($obj,$target,$name,$shlib)=@_;
81         local($ret,$_,$Name);
82
83         $target =~ s/\//$o/g if $o ne '/';
84         $target="$target";
85         ($Name=$name) =~ tr/a-z/A-Z/;
86
87         $ret.="$target: \$(${Name}OBJ)\n";
88         $ret.="\tif exist $target \$(RM) $target\n";
89         $ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
90         $ret.="\t\$(RANLIB) $target\n\n";
91         }
92
93 sub do_link_rule
94         {
95         local($target,$files,$dep_libs,$libs)=@_;
96         local($ret,$_);
97         
98         $file =~ s/\//$o/g if $o ne '/';
99         $n=&bname($target);
100         $ret.="$target: $files $dep_libs\n";
101         $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
102         return($ret);
103         }
104 1;