summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/pl')
-rw-r--r--src/lib/libcrypto/util/pl/BC-32.pl13
-rw-r--r--src/lib/libcrypto/util/pl/Mingw32.pl17
-rw-r--r--src/lib/libcrypto/util/pl/OS2-EMX.pl11
-rw-r--r--src/lib/libcrypto/util/pl/VC-32.pl294
-rw-r--r--src/lib/libcrypto/util/pl/linux.pl11
-rw-r--r--src/lib/libcrypto/util/pl/ultrix.pl11
-rw-r--r--src/lib/libcrypto/util/pl/unix.pl9
7 files changed, 214 insertions, 152 deletions
diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl
index 28869c868d..99b8c058d2 100644
--- a/src/lib/libcrypto/util/pl/BC-32.pl
+++ b/src/lib/libcrypto/util/pl/BC-32.pl
@@ -62,7 +62,7 @@ $des_enc_src='';
62$bf_enc_obj=''; 62$bf_enc_obj='';
63$bf_enc_src=''; 63$bf_enc_src='';
64 64
65if (!$no_asm && !$fips) 65if (!$no_asm)
66 { 66 {
67 $bn_mulw_obj='crypto\bn\asm\bn_win32.obj'; 67 $bn_mulw_obj='crypto\bn\asm\bn_win32.obj';
68 $bn_mulw_src='crypto\bn\asm\bn_win32.asm'; 68 $bn_mulw_src='crypto\bn\asm\bn_win32.asm';
@@ -126,18 +126,13 @@ ___
126 126
127sub do_link_rule 127sub do_link_rule
128 { 128 {
129 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 129 local($target,$files,$dep_libs,$libs)=@_;
130 local($ret,$_); 130 local($ret,$_);
131 131
132 $file =~ s/\//$o/g if $o ne '/'; 132 $file =~ s/\//$o/g if $o ne '/';
133 $n=&bname($targer); 133 $n=&bname($targer);
134 $ret.="$target: $files $dep_libs\n"; 134 $ret.="$target: $files $dep_libs\n";
135 $ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n"; 135 $ret.="\t\$(LINK) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
136 if (defined $sha1file)
137 {
138 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
139 }
140 $ret.="\n";
141 return($ret); 136 return($ret);
142 } 137 }
143 138
diff --git a/src/lib/libcrypto/util/pl/Mingw32.pl b/src/lib/libcrypto/util/pl/Mingw32.pl
index b9bb24d21d..8f0483fb93 100644
--- a/src/lib/libcrypto/util/pl/Mingw32.pl
+++ b/src/lib/libcrypto/util/pl/Mingw32.pl
@@ -19,9 +19,9 @@ $cc='gcc';
19if ($debug) 19if ($debug)
20 { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; } 20 { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
21else 21else
22 { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; } 22 { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -march=i486 -Wall"; }
23 23
24if ($gaswin and !$no_asm and !$fips) 24if ($gaswin and !$no_asm)
25 { 25 {
26 $bn_asm_obj='$(OBJ_D)\bn-win32.o'; 26 $bn_asm_obj='$(OBJ_D)\bn-win32.o';
27 $bn_asm_src='crypto/bn/asm/bn-win32.s'; 27 $bn_asm_src='crypto/bn/asm/bn-win32.s';
@@ -43,7 +43,9 @@ if ($gaswin and !$no_asm and !$fips)
43 $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s'; 43 $rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
44 $sha1_asm_obj='$(OBJ_D)\s1-win32.o'; 44 $sha1_asm_obj='$(OBJ_D)\s1-win32.o';
45 $sha1_asm_src='crypto/sha/asm/s1-win32.s'; 45 $sha1_asm_src='crypto/sha/asm/s1-win32.s';
46 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; 46 $cpuid_asm_obj='$(OBJ_D)\cpu-win32.o';
47 $cpuid_asm_src='crypto/cpu-win32.s';
48 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
47 } 49 }
48 50
49 51
@@ -92,18 +94,13 @@ sub do_lib_rule
92 94
93sub do_link_rule 95sub do_link_rule
94 { 96 {
95 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 97 local($target,$files,$dep_libs,$libs)=@_;
96 local($ret,$_); 98 local($ret,$_);
97 99
98 $file =~ s/\//$o/g if $o ne '/'; 100 $file =~ s/\//$o/g if $o ne '/';
99 $n=&bname($target); 101 $n=&bname($target);
100 $ret.="$target: $files $dep_libs\n"; 102 $ret.="$target: $files $dep_libs\n";
101 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n"; 103 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
102 if (defined $sha1file)
103 {
104 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
105 }
106 $ret.="\n";
107 return($ret); 104 return($ret);
108 } 105 }
1091; 1061;
diff --git a/src/lib/libcrypto/util/pl/OS2-EMX.pl b/src/lib/libcrypto/util/pl/OS2-EMX.pl
index 8dbeaa7a08..28cd116907 100644
--- a/src/lib/libcrypto/util/pl/OS2-EMX.pl
+++ b/src/lib/libcrypto/util/pl/OS2-EMX.pl
@@ -48,7 +48,7 @@ $des_enc_src="";
48$bf_enc_obj=""; 48$bf_enc_obj="";
49$bf_enc_src=""; 49$bf_enc_src="";
50 50
51if (!$no_asm && !$fips) 51if (!$no_asm)
52 { 52 {
53 $bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj"; 53 $bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj";
54 $bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm"; 54 $bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm";
@@ -107,18 +107,13 @@ sub do_lib_rule
107 107
108sub do_link_rule 108sub do_link_rule
109 { 109 {
110 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 110 local($target,$files,$dep_libs,$libs)=@_;
111 local($ret,$_); 111 local($ret,$_);
112 112
113 $file =~ s/\//$o/g if $o ne '/'; 113 $file =~ s/\//$o/g if $o ne '/';
114 $n=&bname($target); 114 $n=&bname($target);
115 $ret.="$target: $files $dep_libs\n"; 115 $ret.="$target: $files $dep_libs\n";
116 $ret.="\t\$(LINK) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n"; 116 $ret.="\t\$(LINK) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n";
117 if (defined $sha1file)
118 {
119 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
120 }
121 $ret.="\n";
122 return($ret); 117 return($ret);
123 } 118 }
124 119
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl
index 4e97dfa9af..9cb2ab7e99 100644
--- a/src/lib/libcrypto/util/pl/VC-32.pl
+++ b/src/lib/libcrypto/util/pl/VC-32.pl
@@ -1,56 +1,154 @@
1#!/usr/local/bin/perl 1#!/usr/local/bin/perl
2# VCw32lib.pl - the file for Visual C++ 4.[01] for windows NT, static libraries 2# VC-32.pl - unified script for Microsoft Visual C++, covering Win32,
3# Win64 and WinCE [follow $FLAVOR variable to trace the differences].
3# 4#
4 5
5$ssl= "ssleay32"; 6$ssl= "ssleay32";
6 7$crypto="libeay32";
7if ($fips && !$shlib)
8 {
9 $crypto="libeayfips32";
10 $crypto_compat = "libeaycompat32.lib";
11 }
12else
13 {
14 $crypto="libeay32";
15 }
16 8
17$o='\\'; 9$o='\\';
18$cp='copy nul+'; # Timestamps get stuffed otherwise 10$cp='$(PERL) util/copy.pl';
11$mkdir='$(PERL) util/mkdir-p.pl';
19$rm='del'; 12$rm='del';
20 13
21$zlib_lib="zlib1.lib"; 14$zlib_lib="zlib1.lib";
22 15
23# C compiler stuff 16# C compiler stuff
24$cc='cl'; 17$cc='cl';
25$cflags=' /MD /W3 /WX /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32'; 18if ($FLAVOR =~ /WIN64/)
26$cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8 19 {
27$cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8 20 # Note that we currently don't have /WX on Win64! There is a lot of
28$lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; 21 # warnings, but only of two types:
22 #
23 # C4344: conversion from '__int64' to 'int/long', possible loss of data
24 # C4267: conversion from 'size_t' to 'int/long', possible loss of data
25 #
26 # Amount of latter type is minimized by aliasing strlen to function of
27 # own desing and limiting its return value to 2GB-1 (see e_os.h). As
28 # per 0.9.8 release remaining warnings were explicitly examined and
29 # considered safe to ignore.
30 #
31 $base_cflags=' /W3 /Gs0 /GF /Gy /nologo -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DOPENSSL_SYSNAME_WIN32 -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE';
32 $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8
33 $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8
34 my $f = $shlib?' /MD':' /MT';
35 $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
36 $opt_cflags=$f.' /Ox';
37 $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
38 $lflags="/nologo /subsystem:console /opt:ref";
39 }
40elsif ($FLAVOR =~ /CE/)
41 {
42 # sanity check
43 die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'}));
44 die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'}));
45 die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'}));
46
47 #
48 # Idea behind this is to mimic flags set by eVC++ IDE...
49 #
50 $wcevers = $ENV{'OSVERSION'}; # WCENNN
51 die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
52 $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
53 $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
54
55 $wceplatf = $ENV{'PLATFORM'};
56 $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d;
57 $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
58
59 $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
60 SWITCH: for($wcetgt) {
61 /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
62 $wcelflag.=" /machine:IX86"; last; };
63 /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
64 $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
65 $wcecdefs.=" -QRarch4T -QRinterwork-return";
66 $wcelflag.=" /machine:THUMB"; last; };
67 /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
68 $wcelflag.=" /machine:ARM"; last; };
69 /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
70 $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
71 $wcelflag.=" /machine:MIPSFPU"; last; };
72 /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
73 $wcecdefs.=" -DMIPSII -QMmips16";
74 $wcelflag.=" /machine:MIPS16"; last; };
75 /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
76 $wcecdefs.=" -QMmips2";
77 $wcelflag.=" /machine:MIPS"; last; };
78 /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
79 $wcelflag.=" /machine:MIPS"; last; };
80 /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx";
81 $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
82 $wcelflag.=" /machine:$wcetgt"; last; };
83 { $wcecdefs.=" -D$wcetgt -D_$wcetgt_";
84 $wcelflag.=" /machine:$wcetgt"; last; };
85 }
86
87 $cc='$(CC)';
88 $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include -DOPENSSL_SMALL_FOOTPRINT';
89 $base_cflags.=" $wcecdefs";
90 $opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
91 $dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
92 $lflags="/nologo /opt:ref $wcelflag";
93 }
94else # Win32
95 {
96 $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
97 $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8
98 $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8
99 my $f = $shlib?' /MD':' /MT';
100 $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
101 $opt_cflags=$f.' /Ox /O2 /Ob2';
102 $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
103 $lflags="/nologo /subsystem:console /opt:ref";
104 }
29$mlflags=''; 105$mlflags='';
30 106
31$out_def="out32"; 107$out_def="out32"; $out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
32$tmp_def="tmp32"; 108$tmp_def="tmp32"; $tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
33$inc_def="inc32"; 109$inc_def="inc32";
34 110
35if ($debug) 111if ($debug)
36 { 112 {
37 $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DOPENSSL_SYSNAME_WIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG -DDSO_WIN32"; 113 $cflags=$dbg_cflags.$base_cflags;
38 $lflags.=" /debug"; 114 $lflags.=" /debug";
39 $mlflags.=' /debug'; 115 $mlflags.=' /debug';
40 } 116 }
41$cflags .= " -DOPENSSL_SYSNAME_WINNT" if $NT == 1; 117else
118 {
119 $cflags=$opt_cflags.$base_cflags;
120 }
42 121
43$obj='.obj'; 122$obj='.obj';
44$ofile="/Fo"; 123$ofile="/Fo";
45 124
46# EXE linking stuff 125# EXE linking stuff
47$link="link"; 126$link="link";
127$rsc="rc";
48$efile="/out:"; 128$efile="/out:";
49$exep='.exe'; 129$exep='.exe';
50if ($no_sock) 130if ($no_sock) { $ex_libs=''; }
51 { $ex_libs=""; } 131elsif ($FLAVOR =~ /CE/) { $ex_libs='winsock.lib'; }
52else { $ex_libs="wsock32.lib user32.lib gdi32.lib"; } 132else { $ex_libs='wsock32.lib'; }
53 133
134if ($FLAVOR =~ /CE/)
135 {
136 $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib';
137 $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
138 }
139else
140 {
141 $ex_libs.=' gdi32.lib advapi32.lib user32.lib';
142 $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
143 }
144
145# As native NT API is pure UNICODE, our WIN-NT build defaults to UNICODE,
146# but gets linked with unicows.lib to ensure backward compatibility.
147if ($FLAVOR =~ /NT/)
148 {
149 $cflags.=" -DOPENSSL_SYSNAME_WINNT -DUNICODE -D_UNICODE";
150 $ex_libs="unicows.lib $ex_libs";
151 }
54# static library stuff 152# static library stuff
55$mklib='lib'; 153$mklib='lib';
56$ranlib=''; 154$ranlib='';
@@ -60,9 +158,12 @@ $shlibp=($shlib)?".dll":".lib";
60$lfile='/out:'; 158$lfile='/out:';
61 159
62$shlib_ex_obj=""; 160$shlib_ex_obj="";
63$app_ex_obj="setargv.obj"; 161$app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/);
64if ($nasm) { 162if ($nasm) {
65 $asm='nasmw -f win32'; 163 my $ver=`nasm -v 2>NUL`;
164 my $vew=`nasmw -v 2>NUL`;
165 # pick newest version
166 $asm=($ver gt $vew?"nasm":"nasmw")." -f win32";
66 $afile='-o '; 167 $afile='-o ';
67} else { 168} else {
68 $asm='ml /Cp /coff /c /Cx'; 169 $asm='ml /Cp /coff /c /Cx';
@@ -77,10 +178,14 @@ $des_enc_src='';
77$bf_enc_obj=''; 178$bf_enc_obj='';
78$bf_enc_src=''; 179$bf_enc_src='';
79 180
80if (!$no_asm && !$fips) 181if (!$no_asm)
81 { 182 {
183 $aes_asm_obj='crypto\aes\asm\a_win32.obj';
184 $aes_asm_src='crypto\aes\asm\a_win32.asm';
82 $bn_asm_obj='crypto\bn\asm\bn_win32.obj'; 185 $bn_asm_obj='crypto\bn\asm\bn_win32.obj';
83 $bn_asm_src='crypto\bn\asm\bn_win32.asm'; 186 $bn_asm_src='crypto\bn\asm\bn_win32.asm';
187 $bnco_asm_obj='crypto\bn\asm\co_win32.obj';
188 $bnco_asm_src='crypto\bn\asm\co_win32.asm';
84 $des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj'; 189 $des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj';
85 $des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm'; 190 $des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm';
86 $bf_enc_obj='crypto\bf\asm\b_win32.obj'; 191 $bf_enc_obj='crypto\bf\asm\b_win32.obj';
@@ -93,76 +198,96 @@ if (!$no_asm && !$fips)
93 $rc5_enc_src='crypto\rc5\asm\r5_win32.asm'; 198 $rc5_enc_src='crypto\rc5\asm\r5_win32.asm';
94 $md5_asm_obj='crypto\md5\asm\m5_win32.obj'; 199 $md5_asm_obj='crypto\md5\asm\m5_win32.obj';
95 $md5_asm_src='crypto\md5\asm\m5_win32.asm'; 200 $md5_asm_src='crypto\md5\asm\m5_win32.asm';
96 $sha1_asm_obj='crypto\sha\asm\s1_win32.obj'; 201 $sha1_asm_obj='crypto\sha\asm\s1_win32.obj crypto\sha\asm\sha512-sse2.obj';
97 $sha1_asm_src='crypto\sha\asm\s1_win32.asm'; 202 $sha1_asm_src='crypto\sha\asm\s1_win32.asm crypto\sha\asm\sha512-sse2.asm';
98 $rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj'; 203 $rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj';
99 $rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm'; 204 $rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm';
100 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM"; 205 $cpuid_asm_obj='crypto\cpu_win32.obj';
206 $cpuid_asm_src='crypto\cpu_win32.asm';
207 $cflags.=" -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DAES_ASM -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
101 } 208 }
102 209
103if ($shlib) 210if ($shlib && $FLAVOR !~ /CE/)
104 { 211 {
105 $mlflags.=" $lflags /dll"; 212 $mlflags.=" $lflags /dll";
106# $cflags =~ s| /MD| /MT|;
107 $lib_cflag=" -D_WINDLL"; 213 $lib_cflag=" -D_WINDLL";
108 $out_def="out32dll"; 214 $out_def="out32dll";
109 $tmp_def="tmp32dll"; 215 $tmp_def="tmp32dll";
216 #
217 # Engage Applink...
218 #
219 $app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib";
220 $cflags.=" -DOPENSSL_USE_APPLINK -I.";
221 # I'm open for better suggestions than overriding $banner...
222 $banner=<<'___';
223 @echo Building OpenSSL
224
225$(OBJ_D)\applink.obj: ms\applink.c
226 $(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c
227$(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c
228 $(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c
229$(INCO_D)\applink.c: ms\applink.c
230 $(CP) ms\applink.c $(INCO_D)\applink.c
231
232EXHEADER= $(EXHEADER) $(INCO_D)\applink.c
233
234LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj
235CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ)
236___
237 $banner.=<<'___' if ($FLAVOR =~ /WIN64/);
238CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ)
239___
240 }
241elsif ($shlib && $FLAVOR =~ /CE/)
242 {
243 $mlflags.=" $lflags /dll";
244 $lib_cflag=" -D_WINDLL -D_DLL";
245 $out_def='out32dll_$(TARGETCPU)';
246 $tmp_def='tmp32dll_$(TARGETCPU)';
110 } 247 }
111 248
112$cflags.=" /Fd$out_def"; 249$cflags.=" /Fd$out_def";
113 250
114sub do_lib_rule 251sub do_lib_rule
115 { 252 {
116 local($objs,$target,$name,$shlib,$ign,$base_addr) = @_; 253 local($objs,$target,$name,$shlib)=@_;
117 local($ret,$Name); 254 local($ret);
118 255
119 $taget =~ s/\//$o/g if $o ne '/'; 256 $taget =~ s/\//$o/g if $o ne '/';
120 ($Name=$name) =~ tr/a-z/A-Z/; 257 if ($name ne "")
121 my $base_arg;
122 if ($base_addr ne "")
123 {
124 $base_arg= " /base:$base_addr";
125 }
126 else
127 { 258 {
128 $base_arg = ""; 259 $name =~ tr/a-z/A-Z/;
260 $name = "/def:ms/${name}.def";
129 } 261 }
130 262
131
132# $target="\$(LIB_D)$o$target"; 263# $target="\$(LIB_D)$o$target";
264 $ret.="$target: $objs\n";
133 if (!$shlib) 265 if (!$shlib)
134 { 266 {
135# $ret.="\t\$(RM) \$(O_$Name)\n"; 267# $ret.="\t\$(RM) \$(O_$Name)\n";
136 $ret.="$target: $objs\n"; 268 $ex =' ';
137 $ex =' advapi32.lib';
138 $ex.=" \$(FIPSLIB_D)${o}_chkstk.o" if $fips && $target =~ /O_CRYPTO/;
139 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n"; 269 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n";
140 } 270 }
141 else 271 else
142 { 272 {
143 local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':''; 273 local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)';
144 $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib'; 274 if ($name eq "")
145 $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; 275 {
146 if ($fips && $target =~ /O_CRYPTO/) 276 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
277 }
278 elsif ($FLAVOR =~ /CE/)
147 { 279 {
148 $ex.=" \$(FIPSLIB_D)${o}_chkstk.o"; 280 $ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib';
149 $ret.="$target: $objs \$(PREMAIN_DSO_EXE)\n";
150 $ret.="\tSET FIPS_LINK=\$(LINK)\n";
151 $ret.="\tSET FIPS_CC=\$(CC)\n";
152 $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
153 $ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n";
154 $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
155 $ret.="\tSET FIPS_TARGET=$target\n";
156 $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
157 $ret.="\t\$(FIPSLINK) \$(MLFLAGS) $base_arg $efile$target ";
158 $ret.="/def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs ";
159 $ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n";
160 } 281 }
161 else 282 else
162 { 283 {
163 $ret.="$target: $objs\n"; 284 $ex.=' unicows.lib' if ($FLAVOR =~ /NT/);
164 $ret.="\t\$(LINK) \$(MLFLAGS) $base_arg $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n"; 285 $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib';
286 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
165 } 287 }
288 $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
289 $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
290 $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n";
166 } 291 }
167 $ret.="\n"; 292 $ret.="\n";
168 return($ret); 293 return($ret);
@@ -170,51 +295,16 @@ sub do_lib_rule
170 295
171sub do_link_rule 296sub do_link_rule
172 { 297 {
173 local($target,$files,$dep_libs,$libs,$standalone)=@_;
174 local($ret,$_);
175 $file =~ s/\//$o/g if $o ne '/';
176 $n=&bname($targer);
177 $ret.="$target: $files $dep_libs\n";
178 if ($standalone)
179 {
180 $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t";
181 $ret.="\$(FIPSLIB_D)${o}_chkstk.o " if ($files =~ /O_FIPSCANISTER/);
182 $ret.="$files $libs\n<<\n";
183 }
184 elsif ($fips && !$shlib)
185 {
186 $ret.="\tSET FIPS_LINK=\$(LINK)\n";
187 $ret.="\tSET FIPS_CC=\$(CC)\n";
188 $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
189 $ret.="\tSET PREMAIN_DSO_EXE=\n";
190 $ret.="\tSET FIPS_TARGET=$target\n";
191 $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
192 $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
193 $ret.=" \$(FIPSLINK) \$(LFLAGS) $efile$target @<<\n";
194 $ret.=" \$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n";
195 }
196 else
197 {
198 $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n";
199 $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n";
200 }
201 $ret.="\n";
202 return($ret);
203 }
204
205sub do_rlink_rule
206 {
207 local($target,$files,$dep_libs,$libs)=@_; 298 local($target,$files,$dep_libs,$libs)=@_;
208 local($ret,$_); 299 local($ret,$_);
209 300
210 $file =~ s/\//$o/g if $o ne '/'; 301 $file =~ s/\//$o/g if $o ne '/';
211 $n=&bname($targer); 302 $n=&bname($targer);
212 $ret.="$target: $files $dep_libs\n"; 303 $ret.="$target: $files $dep_libs\n";
213 $ret.=" \$(MKCANISTER) $target <<\n"; 304 $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n";
214 $ret.="INPUT($files)\n<<\n"; 305 $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n";
215 $ret.="\n"; 306 $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n";
216 return($ret); 307 return($ret);
217 } 308 }
218 309
219
2201; 3101;
diff --git a/src/lib/libcrypto/util/pl/linux.pl b/src/lib/libcrypto/util/pl/linux.pl
index df05c40526..d24f7b7291 100644
--- a/src/lib/libcrypto/util/pl/linux.pl
+++ b/src/lib/libcrypto/util/pl/linux.pl
@@ -39,7 +39,7 @@ if (!$no_asm)
39 $rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp'; 39 $rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp';
40 $sha1_asm_obj='$(OBJ_D)/sx86-elf.o'; 40 $sha1_asm_obj='$(OBJ_D)/sx86-elf.o';
41 $sha1_asm_src='crypto/sha/asm/sx86unix.cpp'; 41 $sha1_asm_src='crypto/sha/asm/sx86unix.cpp';
42 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM"; 42 $cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
43 } 43 }
44 44
45$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall"; 45$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall";
@@ -72,18 +72,13 @@ sub do_shlib_rule
72 72
73sub do_link_rule 73sub do_link_rule
74 { 74 {
75 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 75 local($target,$files,$dep_libs,$libs)=@_;
76 local($ret,$_); 76 local($ret,$_);
77 77
78 $file =~ s/\//$o/g if $o ne '/'; 78 $file =~ s/\//$o/g if $o ne '/';
79 $n=&bname($target); 79 $n=&bname($target);
80 $ret.="$target: $files $dep_libs\n"; 80 $ret.="$target: $files $dep_libs\n";
81 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n"; 81 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
82 if (defined $sha1file)
83 {
84 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
85 }
86 $ret.="\n";
87 return($ret); 82 return($ret);
88 } 83 }
89 84
diff --git a/src/lib/libcrypto/util/pl/ultrix.pl b/src/lib/libcrypto/util/pl/ultrix.pl
index 447b854708..ea370c71f9 100644
--- a/src/lib/libcrypto/util/pl/ultrix.pl
+++ b/src/lib/libcrypto/util/pl/ultrix.pl
@@ -17,7 +17,7 @@ else
17 17
18$cflags.=" -std1 -DL_ENDIAN"; 18$cflags.=" -std1 -DL_ENDIAN";
19 19
20if (!$no_asm && !$fips) 20if (!$no_asm)
21 { 21 {
22 $bn_asm_obj='$(OBJ_D)/mips1.o'; 22 $bn_asm_obj='$(OBJ_D)/mips1.o';
23 $bn_asm_src='crypto/bn/asm/mips1.s'; 23 $bn_asm_src='crypto/bn/asm/mips1.s';
@@ -25,18 +25,13 @@ if (!$no_asm && !$fips)
25 25
26sub do_link_rule 26sub do_link_rule
27 { 27 {
28 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 28 local($target,$files,$dep_libs,$libs)=@_;
29 local($ret,$_); 29 local($ret,$_);
30 30
31 $file =~ s/\//$o/g if $o ne '/'; 31 $file =~ s/\//$o/g if $o ne '/';
32 $n=&bname($target); 32 $n=&bname($target);
33 $ret.="$target: $files $dep_libs\n"; 33 $ret.="$target: $files $dep_libs\n";
34 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n"; 34 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
35 if (defined $sha1file)
36 {
37 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
38 }
39 $ret.="\n";
40 return($ret); 35 return($ret);
41 } 36 }
42 37
diff --git a/src/lib/libcrypto/util/pl/unix.pl b/src/lib/libcrypto/util/pl/unix.pl
index bbd1798a2e..146611ad99 100644
--- a/src/lib/libcrypto/util/pl/unix.pl
+++ b/src/lib/libcrypto/util/pl/unix.pl
@@ -70,18 +70,13 @@ sub do_lib_rule
70 70
71sub do_link_rule 71sub do_link_rule
72 { 72 {
73 local($target,$files,$dep_libs,$libs,$sha1file,$openssl)=@_; 73 local($target,$files,$dep_libs,$libs)=@_;
74 local($ret,$_); 74 local($ret,$_);
75 75
76 $file =~ s/\//$o/g if $o ne '/'; 76 $file =~ s/\//$o/g if $o ne '/';
77 $n=&bname($target); 77 $n=&bname($target);
78 $ret.="$target: $files $dep_libs\n"; 78 $ret.="$target: $files $dep_libs\n";
79 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n"; 79 $ret.="\t\$(LINK) ${efile}$target \$(LFLAGS) $files $libs\n\n";
80 if (defined $sha1file)
81 {
82 $ret.="\t$openssl sha1 -hmac etaonrishdlcupfm -binary $target > $sha1file";
83 }
84 $ret.="\n";
85 return($ret); 80 return($ret);
86 } 81 }
87 82