diff options
| author | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2012-07-13 17:49:56 +0000 |
| commit | ee04221ea8063435416c7e6369e6eae76843aa71 (patch) | |
| tree | 821921a1dd0a5a3cece91121e121cc63c4b68128 /src/lib/libcrypto/util/pl/VC-32.pl | |
| parent | adf6731f6e1d04718aee00cb93435143046aee9a (diff) | |
| download | openbsd-eric_g2k12.tar.gz openbsd-eric_g2k12.tar.bz2 openbsd-eric_g2k12.zip | |
This commit was manufactured by cvs2git to create tag 'eric_g2k12'.eric_g2k12
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/util/pl/VC-32.pl | 338 |
1 files changed, 0 insertions, 338 deletions
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl deleted file mode 100644 index 5f25fc41bf..0000000000 --- a/src/lib/libcrypto/util/pl/VC-32.pl +++ /dev/null | |||
| @@ -1,338 +0,0 @@ | |||
| 1 | #!/usr/local/bin/perl | ||
| 2 | # VC-32.pl - unified script for Microsoft Visual C++, covering Win32, | ||
| 3 | # Win64 and WinCE [follow $FLAVOR variable to trace the differences]. | ||
| 4 | # | ||
| 5 | |||
| 6 | $ssl= "ssleay32"; | ||
| 7 | $crypto="libeay32"; | ||
| 8 | |||
| 9 | $o='\\'; | ||
| 10 | $cp='$(PERL) util/copy.pl'; | ||
| 11 | $mkdir='$(PERL) util/mkdir-p.pl'; | ||
| 12 | $rm='del /Q'; | ||
| 13 | |||
| 14 | $zlib_lib="zlib1.lib"; | ||
| 15 | |||
| 16 | # Santize -L options for ms link | ||
| 17 | $l_flags =~ s/-L("\[^"]+")/\/libpath:$1/g; | ||
| 18 | $l_flags =~ s/-L(\S+)/\/libpath:$1/g; | ||
| 19 | |||
| 20 | # C compiler stuff | ||
| 21 | $cc='cl'; | ||
| 22 | if ($FLAVOR =~ /WIN64/) | ||
| 23 | { | ||
| 24 | # Note that we currently don't have /WX on Win64! There is a lot of | ||
| 25 | # warnings, but only of two types: | ||
| 26 | # | ||
| 27 | # C4344: conversion from '__int64' to 'int/long', possible loss of data | ||
| 28 | # C4267: conversion from 'size_t' to 'int/long', possible loss of data | ||
| 29 | # | ||
| 30 | # Amount of latter type is minimized by aliasing strlen to function of | ||
| 31 | # own desing and limiting its return value to 2GB-1 (see e_os.h). As | ||
| 32 | # per 0.9.8 release remaining warnings were explicitly examined and | ||
| 33 | # considered safe to ignore. | ||
| 34 | # | ||
| 35 | $base_cflags= " $mf_cflag"; | ||
| 36 | my $f = $shlib?' /MD':' /MT'; | ||
| 37 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | ||
| 38 | $opt_cflags=$f.' /Ox'; | ||
| 39 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | ||
| 40 | $lflags="/nologo /subsystem:console /opt:ref"; | ||
| 41 | |||
| 42 | *::perlasm_compile_target = sub { | ||
| 43 | my ($target,$source,$bname)=@_; | ||
| 44 | my $ret; | ||
| 45 | |||
| 46 | $bname =~ s/(.*)\.[^\.]$/$1/; | ||
| 47 | $ret=<<___; | ||
| 48 | \$(TMP_D)$o$bname.asm: $source | ||
| 49 | set ASM=\$(ASM) | ||
| 50 | \$(PERL) $source \$\@ | ||
| 51 | |||
| 52 | $target: \$(TMP_D)$o$bname.asm | ||
| 53 | \$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm | ||
| 54 | |||
| 55 | ___ | ||
| 56 | } | ||
| 57 | } | ||
| 58 | elsif ($FLAVOR =~ /CE/) | ||
| 59 | { | ||
| 60 | # sanity check | ||
| 61 | die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'})); | ||
| 62 | die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'})); | ||
| 63 | die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'})); | ||
| 64 | |||
| 65 | # | ||
| 66 | # Idea behind this is to mimic flags set by eVC++ IDE... | ||
| 67 | # | ||
| 68 | $wcevers = $ENV{'OSVERSION'}; # WCENNN | ||
| 69 | die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/); | ||
| 70 | $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN | ||
| 71 | $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN | ||
| 72 | |||
| 73 | $wceplatf = $ENV{'PLATFORM'}; | ||
| 74 | $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d; | ||
| 75 | $wcecdefs .= " -DWCE_PLATFORM_$wceplatf"; | ||
| 76 | |||
| 77 | $wcetgt = $ENV{'TARGETCPU'}; # just shorter name... | ||
| 78 | SWITCH: for($wcetgt) { | ||
| 79 | /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_"; | ||
| 80 | $wcelflag.=" /machine:IX86"; last; }; | ||
| 81 | /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | ||
| 82 | $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/); | ||
| 83 | $wcecdefs.=" -QRarch4T -QRinterwork-return"; | ||
| 84 | $wcelflag.=" /machine:THUMB"; last; }; | ||
| 85 | /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt"; | ||
| 86 | $wcelflag.=" /machine:ARM"; last; }; | ||
| 87 | /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 88 | $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32"; | ||
| 89 | $wcelflag.=" /machine:MIPSFPU"; last; }; | ||
| 90 | /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 91 | $wcecdefs.=" -DMIPSII -QMmips16"; | ||
| 92 | $wcelflag.=" /machine:MIPS16"; last; }; | ||
| 93 | /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt"; | ||
| 94 | $wcecdefs.=" -QMmips2"; | ||
| 95 | $wcelflag.=" /machine:MIPS"; last; }; | ||
| 96 | /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000"; | ||
| 97 | $wcelflag.=" /machine:MIPS"; last; }; | ||
| 98 | /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx"; | ||
| 99 | $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/); | ||
| 100 | $wcelflag.=" /machine:$wcetgt"; last; }; | ||
| 101 | { $wcecdefs.=" -D$wcetgt -D_$wcetgt_"; | ||
| 102 | $wcelflag.=" /machine:$wcetgt"; last; }; | ||
| 103 | } | ||
| 104 | |||
| 105 | $cc='$(CC)'; | ||
| 106 | $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT'; | ||
| 107 | $base_cflags.=" $wcecdefs"; | ||
| 108 | $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); | ||
| 109 | $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 110 | $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics... | ||
| 111 | $dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG'; | ||
| 112 | $lflags="/nologo /opt:ref $wcelflag"; | ||
| 113 | } | ||
| 114 | else # Win32 | ||
| 115 | { | ||
| 116 | $base_cflags= " $mf_cflag"; | ||
| 117 | my $f = $shlib?' /MD':' /MT'; | ||
| 118 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | ||
| 119 | $opt_cflags=$f.' /Ox /O2 /Ob2'; | ||
| 120 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | ||
| 121 | $lflags="/nologo /subsystem:console /opt:ref"; | ||
| 122 | } | ||
| 123 | $mlflags=''; | ||
| 124 | |||
| 125 | $out_def ="out32"; $out_def.="dll" if ($shlib); | ||
| 126 | $out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); | ||
| 127 | $tmp_def ="tmp32"; $tmp_def.="dll" if ($shlib); | ||
| 128 | $tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/); | ||
| 129 | $inc_def="inc32"; | ||
| 130 | |||
| 131 | if ($debug) | ||
| 132 | { | ||
| 133 | $cflags=$dbg_cflags.$base_cflags; | ||
| 134 | } | ||
| 135 | else | ||
| 136 | { | ||
| 137 | $cflags=$opt_cflags.$base_cflags; | ||
| 138 | } | ||
| 139 | |||
| 140 | # generate symbols.pdb unconditionally | ||
| 141 | $app_cflag.=" /Zi /Fd\$(TMP_D)/app"; | ||
| 142 | $lib_cflag.=" /Zi /Fd\$(TMP_D)/lib"; | ||
| 143 | $lflags.=" /debug"; | ||
| 144 | |||
| 145 | $obj='.obj'; | ||
| 146 | $asm_suffix='.asm'; | ||
| 147 | $ofile="/Fo"; | ||
| 148 | |||
| 149 | # EXE linking stuff | ||
| 150 | $link="link"; | ||
| 151 | $rsc="rc"; | ||
| 152 | $efile="/out:"; | ||
| 153 | $exep='.exe'; | ||
| 154 | if ($no_sock) { $ex_libs=''; } | ||
| 155 | elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; } | ||
| 156 | else { $ex_libs='ws2_32.lib'; } | ||
| 157 | |||
| 158 | if ($FLAVOR =~ /CE/) | ||
| 159 | { | ||
| 160 | $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'})); | ||
| 161 | $ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 162 | $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86"); | ||
| 163 | } | ||
| 164 | else | ||
| 165 | { | ||
| 166 | $ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib'; | ||
| 167 | $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./); | ||
| 168 | # WIN32 UNICODE build gets linked with unicows.lib for | ||
| 169 | # backward compatibility with Win9x. | ||
| 170 | $ex_libs="unicows.lib $ex_libs" if ($FLAVOR =~ /WIN32/ and $cflags =~ /\-DUNICODE/); | ||
| 171 | } | ||
| 172 | |||
| 173 | # static library stuff | ||
| 174 | $mklib='lib /nologo'; | ||
| 175 | $ranlib=''; | ||
| 176 | $plib=""; | ||
| 177 | $libp=".lib"; | ||
| 178 | $shlibp=($shlib)?".dll":".lib"; | ||
| 179 | $lfile='/out:'; | ||
| 180 | |||
| 181 | $shlib_ex_obj=""; | ||
| 182 | $app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/); | ||
| 183 | if ($FLAVOR =~ /WIN64A/) { | ||
| 184 | if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) { | ||
| 185 | $asm='nasm -f win64 -DNEAR -Ox -g'; | ||
| 186 | $afile='-o '; | ||
| 187 | } else { | ||
| 188 | $asm='ml64 /c /Cp /Cx /Zi'; | ||
| 189 | $afile='/Fo'; | ||
| 190 | } | ||
| 191 | } elsif ($FLAVOR =~ /WIN64I/) { | ||
| 192 | $asm='ias -d debug'; | ||
| 193 | $afile="-o "; | ||
| 194 | } elsif ($nasm) { | ||
| 195 | my $ver=`nasm -v 2>NUL`; | ||
| 196 | my $vew=`nasmw -v 2>NUL`; | ||
| 197 | # pick newest version | ||
| 198 | $asm=($ver ge $vew?"nasm":"nasmw")." -f win32"; | ||
| 199 | $asmtype="win32n"; | ||
| 200 | $afile='-o '; | ||
| 201 | } else { | ||
| 202 | $asm='ml /nologo /Cp /coff /c /Cx /Zi'; | ||
| 203 | $afile='/Fo'; | ||
| 204 | $asmtype="win32"; | ||
| 205 | } | ||
| 206 | |||
| 207 | $bn_asm_obj=''; | ||
| 208 | $bn_asm_src=''; | ||
| 209 | $des_enc_obj=''; | ||
| 210 | $des_enc_src=''; | ||
| 211 | $bf_enc_obj=''; | ||
| 212 | $bf_enc_src=''; | ||
| 213 | |||
| 214 | if (!$no_asm) | ||
| 215 | { | ||
| 216 | win32_import_asm($mf_bn_asm, "bn", \$bn_asm_obj, \$bn_asm_src); | ||
| 217 | win32_import_asm($mf_aes_asm, "aes", \$aes_asm_obj, \$aes_asm_src); | ||
| 218 | win32_import_asm($mf_des_asm, "des", \$des_enc_obj, \$des_enc_src); | ||
| 219 | win32_import_asm($mf_bf_asm, "bf", \$bf_enc_obj, \$bf_enc_src); | ||
| 220 | win32_import_asm($mf_cast_asm, "cast", \$cast_enc_obj, \$cast_enc_src); | ||
| 221 | win32_import_asm($mf_rc4_asm, "rc4", \$rc4_enc_obj, \$rc4_enc_src); | ||
| 222 | win32_import_asm($mf_rc5_asm, "rc5", \$rc5_enc_obj, \$rc5_enc_src); | ||
| 223 | win32_import_asm($mf_md5_asm, "md5", \$md5_asm_obj, \$md5_asm_src); | ||
| 224 | win32_import_asm($mf_sha_asm, "sha", \$sha1_asm_obj, \$sha1_asm_src); | ||
| 225 | win32_import_asm($mf_rmd_asm, "ripemd", \$rmd160_asm_obj, \$rmd160_asm_src); | ||
| 226 | win32_import_asm($mf_wp_asm, "whrlpool", \$whirlpool_asm_obj, \$whirlpool_asm_src); | ||
| 227 | win32_import_asm($mf_cpuid_asm, "", \$cpuid_asm_obj, \$cpuid_asm_src); | ||
| 228 | $perl_asm = 1; | ||
| 229 | } | ||
| 230 | |||
| 231 | if ($shlib && $FLAVOR !~ /CE/) | ||
| 232 | { | ||
| 233 | $mlflags.=" $lflags /dll"; | ||
| 234 | $lib_cflag.=" -D_WINDLL"; | ||
| 235 | # | ||
| 236 | # Engage Applink... | ||
| 237 | # | ||
| 238 | $app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib"; | ||
| 239 | $cflags.=" -DOPENSSL_USE_APPLINK -I."; | ||
| 240 | # I'm open for better suggestions than overriding $banner... | ||
| 241 | $banner=<<'___'; | ||
| 242 | @echo Building OpenSSL | ||
| 243 | |||
| 244 | $(OBJ_D)\applink.obj: ms\applink.c | ||
| 245 | $(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c | ||
| 246 | $(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c | ||
| 247 | $(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c | ||
| 248 | $(INCO_D)\applink.c: ms\applink.c | ||
| 249 | $(CP) ms\applink.c $(INCO_D)\applink.c | ||
| 250 | |||
| 251 | EXHEADER= $(EXHEADER) $(INCO_D)\applink.c | ||
| 252 | |||
| 253 | LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj | ||
| 254 | CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ) | ||
| 255 | ___ | ||
| 256 | $banner.=<<'___' if ($FLAVOR =~ /WIN64/); | ||
| 257 | CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ) | ||
| 258 | ___ | ||
| 259 | } | ||
| 260 | elsif ($shlib && $FLAVOR =~ /CE/) | ||
| 261 | { | ||
| 262 | $mlflags.=" $lflags /dll"; | ||
| 263 | $lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'})); | ||
| 264 | $lib_cflag.=" -D_WINDLL -D_DLL"; | ||
| 265 | } | ||
| 266 | |||
| 267 | sub do_lib_rule | ||
| 268 | { | ||
| 269 | local($objs,$target,$name,$shlib)=@_; | ||
| 270 | local($ret); | ||
| 271 | |||
| 272 | $taget =~ s/\//$o/g if $o ne '/'; | ||
| 273 | if ($name ne "") | ||
| 274 | { | ||
| 275 | $name =~ tr/a-z/A-Z/; | ||
| 276 | $name = "/def:ms/${name}.def"; | ||
| 277 | } | ||
| 278 | |||
| 279 | # $target="\$(LIB_D)$o$target"; | ||
| 280 | $ret.="$target: $objs\n"; | ||
| 281 | if (!$shlib) | ||
| 282 | { | ||
| 283 | # $ret.="\t\$(RM) \$(O_$Name)\n"; | ||
| 284 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; | ||
| 285 | } | ||
| 286 | else | ||
| 287 | { | ||
| 288 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; | ||
| 289 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; | ||
| 290 | $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | ||
| 291 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; | ||
| 292 | } | ||
| 293 | $ret.="\n"; | ||
| 294 | return($ret); | ||
| 295 | } | ||
| 296 | |||
| 297 | sub do_link_rule | ||
| 298 | { | ||
| 299 | local($target,$files,$dep_libs,$libs)=@_; | ||
| 300 | local($ret,$_); | ||
| 301 | |||
| 302 | $file =~ s/\//$o/g if $o ne '/'; | ||
| 303 | $n=&bname($targer); | ||
| 304 | $ret.="$target: $files $dep_libs\n"; | ||
| 305 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | ||
| 306 | $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n"; | ||
| 307 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | ||
| 308 | return($ret); | ||
| 309 | } | ||
| 310 | |||
| 311 | sub win32_import_asm | ||
| 312 | { | ||
| 313 | my ($mf_var, $asm_name, $oref, $sref) = @_; | ||
| 314 | my $asm_dir; | ||
| 315 | if ($asm_name eq "") | ||
| 316 | { | ||
| 317 | $asm_dir = "crypto\\"; | ||
| 318 | } | ||
| 319 | else | ||
| 320 | { | ||
| 321 | $asm_dir = "crypto\\$asm_name\\asm\\"; | ||
| 322 | } | ||
| 323 | |||
| 324 | $$oref = ""; | ||
| 325 | $mf_var =~ s/\.o$/.obj/g; | ||
| 326 | |||
| 327 | foreach (split(/ /, $mf_var)) | ||
| 328 | { | ||
| 329 | $$oref .= $asm_dir . $_ . " "; | ||
| 330 | } | ||
| 331 | $$oref =~ s/ $//; | ||
| 332 | $$sref = $$oref; | ||
| 333 | $$sref =~ s/\.obj/.asm/g; | ||
| 334 | |||
| 335 | } | ||
| 336 | |||
| 337 | |||
| 338 | 1; | ||
