]> git.ipfire.org Git - thirdparty/openssl.git/blob - util/pl/VC-CE.pl
WinCE patches
[thirdparty/openssl.git] / util / pl / VC-CE.pl
1 #!/usr/local/bin/perl
2 # VC-CE.pl - the file for eMbedded Visual C++ 3.0 for windows CE, static libraries
3 #
4
5 $ssl= "ssleay32";
6 $crypto="libeay32";
7 $RSAref="RSAref32";
8
9 $o='\\';
10 $cp='copy nul+'; # Timestamps get stuffed otherwise
11 $rm='del';
12
13 # C compiler stuff
14 $cc='$(CC)';
15 $cflags=' /W3 /WX /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -D$(TARGETCPU) -D_$(TARGETCPU)_ -DUNDER_CE=300 -D_WIN32_CE=300 -DWIN32_PLATFORM_PSPC -DUNICODE -D_UNICODE -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include';
16 $lflags="/nologo /subsystem:windowsce,3.00 /machine:$(TARGETCPU) /opt:ref";
17 $mlflags='';
18
19 $out_def="out32";
20 $tmp_def="tmp32";
21 $inc_def="inc32";
22
23 if ($debug)
24 {
25 $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG -DDSO_WIN32";
26 $lflags.=" /debug";
27 $mlflags.=' /debug';
28 }
29
30 $obj='.obj';
31 $ofile="/Fo";
32
33 # EXE linking stuff
34 $link="link";
35 $efile="/out:";
36 $exep='.exe';
37 if ($no_sock)
38 { $ex_libs=""; }
39 else { $ex_libs='winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib'; }
40 #else { $ex_libs='winsock.lib coredll.lib $(WCECOMPAT)/lib/wcecompatex.lib'; }
41
42 # static library stuff
43 $mklib='lib';
44 $ranlib='';
45 $plib="";
46 $libp=".lib";
47 $shlibp=($shlib)?".dll":".lib";
48 $lfile='/out:';
49
50 $shlib_ex_obj="";
51 #$app_ex_obj="setargv.obj";
52 $app_ex_obj="";
53
54 $bn_asm_obj='';
55 $bn_asm_src='';
56 $des_enc_obj='';
57 $des_enc_src='';
58 $bf_enc_obj='';
59 $bf_enc_src='';
60
61 if ($shlib)
62 {
63 $mlflags.=" $lflags /dll";
64 # $cflags =~ s| /MD| /MT|;
65 $lib_cflag=" -D_WINDLL -D_DLL";
66 $out_def="out32dll";
67 $tmp_def="tmp32dll";
68 }
69
70 $cflags.=" /Fd$out_def";
71
72 sub do_lib_rule
73 {
74 local($objs,$target,$name,$shlib)=@_;
75 local($ret,$Name);
76
77 $taget =~ s/\//$o/g if $o ne '/';
78 ($Name=$name) =~ tr/a-z/A-Z/;
79
80 # $target="\$(LIB_D)$o$target";
81 $ret.="$target: $objs\n";
82 if (!$shlib)
83 {
84 # $ret.="\t\$(RM) \$(O_$Name)\n";
85 $ex =' ';
86 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n";
87 }
88 else
89 {
90 local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
91 # $ex.=' winsock.lib coredll.lib $(WCECOMPAT)/lib/wcecompatex.lib';
92 $ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib';
93 $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
94 }
95 $ret.="\n";
96 return($ret);
97 }
98
99 sub do_link_rule
100 {
101 local($target,$files,$dep_libs,$libs)=@_;
102 local($ret,$_);
103
104 $file =~ s/\//$o/g if $o ne '/';
105 $n=&bname($targer);
106 $ret.="$target: $files $dep_libs\n";
107 $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n";
108 $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n\n";
109 return($ret);
110 }
111
112 1;