Add missing funtions from non ANSI section of header files and add missing
[openssl.git] / util / pl / BC-16.pl
1 #!/usr/local/bin/perl
2 # VCw16lib.pl - the file for Visual C++ 1.52b for windows, static libraries
3 #
4
5 $o='\\';
6 $cp='copy';
7 $rm='del';
8
9 # C compiler stuff
10 $cc='bcc';
11
12 if ($debug)
13         { $op="-v "; }
14 else    { $op="-O "; }
15
16 $cflags="-d -ml $op -DL_ENDIAN";
17 # I add the stack opt
18 $base_lflags="/c /C";
19 $lflags="$base_lflags";
20
21 if ($win16)
22         {
23         $shlib=1;
24         $cflags.=" -DWINDOWS -DWIN16";
25         $app_cflag="-W";
26         $lib_cflag="-WD";
27         $lflags.="/Twe";
28         }
29 else
30         {
31         $cflags.=" -DMSDOS";
32         $lflags.=" /Tde";
33         }
34
35 if ($shlib)
36         {
37         $mlflags=" /Twd $base_lflags"; # stack if defined in .def file
38         $libs="libw ldllcew";
39         $no_asm=1;
40         }
41 else
42         { $mlflags=''; }
43
44 $obj='.obj';
45 $ofile="-o";
46
47 # EXE linking stuff
48 $link="tlink";
49 $efile="";
50 $exep='.exe';
51 $ex_libs="CL";
52 $ex_libs.=$no_sock?"":" winsock.lib";
53
54 $app_ex_obj="C0L.obj ";
55 $shlib_ex_obj="" if ($shlib);
56
57 # static library stuff
58 $mklib='tlib';
59 $ranlib='echo no ranlib';
60 $plib="";
61 $libp=".lib";
62 $shlibp=($shlib)?".dll":".lib";
63 $lfile='';
64
65 $asm='bcc -c -B -Tml';
66 $afile='/o';
67 if ($no_asm)
68         {
69         $bn_asm_obj='';
70         $bn_asm_src='';
71         }
72 elsif ($asmbits == 32)
73         {
74         $bn_asm_obj='crypto\bn\asm\x86w32.obj';
75         $bn_asm_src='crypto\bn\asm\x86w32.asm';
76         }
77 else
78         {
79         $bn_asm_obj='crypto\bn\asm\x86w16.obj';
80         $bn_asm_src='crypto\bn\asm\x86w16.asm';
81         }
82
83 sub do_lib_rule
84         {
85         local($target,$name,$shlib)=@_;
86         local($ret,$Name);
87
88         $taget =~ s/\//$o/g if $o ne '/';
89         ($Name=$name) =~ tr/a-z/A-Z/;
90
91         $ret.="$target: \$(${Name}OBJ)\n";
92         $ret.="\t\$(RM) \$(O_$Name)\n";
93
94         # Due to a pathetic line length limit, I unwrap the args.
95         local($lib_names)="";
96         local($dll_names)="";
97         foreach $_ (sort split(/\s+/,$Vars{"${Name}OBJ"}))
98                 {
99                 $lib_names.="  +$_ &\n";
100                 $dll_names.="  $_\n";
101                 }
102
103         if (!$shlib)
104                 {
105                 $ret.="\t\$(MKLIB) $target & <<|\n$lib_names\n,\n|\n";
106                 }
107         else
108                 {
109                 local($ex)=($Name eq "SSL")?' $(L_CRYPTO) winsock':"";
110                 $ret.="\t\$(LINK) \$(MLFLAGS) @&&|\n";
111                 $ret.=$dll_names;
112                 $ret.="\n  $target\n\n  $ex $libs\nms$o${name}16.def;\n|\n";
113                 ($out_lib=$target) =~ s/O_/L_/;
114                 $ret.="\timplib /nowep $out_lib $target\n\n";
115                 }
116         $ret.="\n";
117         return($ret);
118         }
119
120 sub do_link_rule
121         {
122         local($target,$files,$dep_libs,$libs)=@_;
123         local($ret,$f,$_,@f);
124         
125         $file =~ s/\//$o/g if $o ne '/';
126         $n=&bname($targer);
127         $ret.="$target: $files $dep_libs\n";
128         $ret.="  \$(LINK) @&&|";
129         
130         # Due to a pathetic line length limit, I have to unwrap the args.
131         $ret.=" \$(LFLAGS) ";
132         if ($files =~ /\(([^)]*)\)$/)
133                 {
134                 $ret.=" \$(APP_EX_OBJ)";
135                 foreach $_ (sort split(/\s+/,$Vars{$1}))
136                         { $ret.="\n  $r $_ +"; }
137                 chop($ret);
138                 $ret.="\n";
139                 }
140         else
141                 { $ret.="\n $r \$(APP_EX_OBJ) $files\n"; }
142         $ret.="  $target\n\n  $libs\n\n|\n\n";
143         return($ret);
144         }
145
146 1;