提交 78a50c75 编写于 作者: A Andy Polyakov

Configurations/10-main.conf: VC-<target> cleanups.

Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5574)
上级 a23f0316
...@@ -109,6 +109,15 @@ my %targets=( ...@@ -109,6 +109,15 @@ my %targets=(
inherit_from => [ "BASE_common" ], inherit_from => [ "BASE_common" ],
template => 1, template => 1,
lib_defines =>
sub {
my @defs = ();
unless ($disabled{"zlib-dynamic"}) {
my $zlib = $withargs{zlib_lib} // "ZLIB1";
push @defs, quotify("perl", 'LIBZ="' . $zlib . '"');
}
return [ @defs ];
},
ex_libs => ex_libs =>
sub { sub {
unless ($disabled{zlib}) { unless ($disabled{zlib}) {
......
...@@ -13,7 +13,7 @@ sub vc_win64a_info { ...@@ -13,7 +13,7 @@ sub vc_win64a_info {
} elsif ($disabled{asm}) { } elsif ($disabled{asm}) {
# assembler is still used to compile uplink shim # assembler is still used to compile uplink shim
$vc_win64a_info = { AS => "ml64", $vc_win64a_info = { AS => "ml64",
ASFLAGS => "/Zi", ASFLAGS => "/nologo /Zi",
asflags => "/c /Cp /Cx", asflags => "/c /Cp /Cx",
asoutflag => "/Fo" }; asoutflag => "/Fo" };
} else { } else {
...@@ -1346,46 +1346,45 @@ my %targets = ( ...@@ -1346,46 +1346,45 @@ my %targets = (
#### Visual C targets #### Visual C targets
# #
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 # Win64 targets, WIN64I denotes IA-64/Itanium and WIN64A - AMD64
# #
# Note about -wd4090, disable warning C4090. This warning returns false # Note about /wd4090, disable warning C4090. This warning returns false
# positives in some situations. Disabling it altogether masks both # positives in some situations. Disabling it altogether masks both
# legitimate and false cases, but as we compile on multiple platforms, # legitimate and false cases, but as we compile on multiple platforms,
# we rely on other compilers to catch legitimate cases. # we rely on other compilers to catch legitimate cases.
# #
# Also note that we force threads no matter what. Configuring "no-threads" # Also note that we force threads no matter what. Configuring "no-threads"
# is ignored. # is ignored.
#
# UNICODE is defined in VC-common and applies to all targets. It used to
# be an opt-in option for VC-WIN32, but not anymore. The original reason
# was because ANSI API was *native* system interface for no longer
# supported Windows 9x. Keep in mind that UNICODE only affects how
# OpenSSL libraries interact with underlying OS, it doesn't affect API
# that OpenSSL presents to application.
"VC-common" => { "VC-common" => {
inherit_from => [ "BASE_Windows" ], inherit_from => [ "BASE_Windows" ],
template => 1, template => 1,
CC => "cl", CC => "cl",
CPP => '$(CC) /EP /C', CPP => '$(CC) /EP /C',
CFLAGS => "-W3 -wd4090 -nologo", CFLAGS => "/W3 /wd4090 /nologo",
LDFLAGS => add("/debug"), LDFLAGS => add("/debug"),
coutflag => "/Fo", coutflag => "/Fo",
cflags => '-Gs0 -GF -Gy',
defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN", defines => add("OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN",
"UNICODE", "_UNICODE",
"_CRT_SECURE_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE",
"_WINSOCK_DEPRECATED_NO_WARNINGS"), "_WINSOCK_DEPRECATED_NO_WARNINGS"),
lib_cflags => add("/Zi /Fdossl_static"), lib_cflags => add("/Zi /Fdossl_static.pdb"),
lib_defines => add([ "L_ENDIAN" ], lib_defines => add("L_ENDIAN"),
sub { my @defs = (); dso_cflags => "/Zi /Fddso.pdb",
unless ($disabled{"zlib-dynamic"}) { bin_cflags => "/Zi /Fdapp.pdb",
my $zlib =
$withargs{zlib_lib} // "ZLIB1";
push @defs,
quotify("perl",
'LIBZ="' . $zlib . '"');
}
return [ @defs ];
}),
dso_cflags => "/Zi /Fddso",
bin_cflags => "/Zi /Fdapp",
shared_ldflag => "/dll", shared_ldflag => "/dll",
shared_target => "win-shared", # meaningless except it gives Configure a hint shared_target => "win-shared", # meaningless except it gives Configure a hint
thread_scheme => "winthreads", thread_scheme => "winthreads",
dso_scheme => "win32", dso_scheme => "win32",
apps_aux_src => add("win32_init.c"), apps_aux_src => add("win32_init.c"),
bn_ops => "EXPORT_VAR_AS_FN",
# additional parameter to build_scheme denotes install-path "flavour" # additional parameter to build_scheme denotes install-path "flavour"
build_scheme => add("VC-common", { separator => undef }), build_scheme => add("VC-common", { separator => undef }),
}, },
...@@ -1394,7 +1393,8 @@ my %targets = ( ...@@ -1394,7 +1393,8 @@ my %targets = (
template => 1, template => 1,
CFLAGS => add(picker(debug => '/Od', CFLAGS => add(picker(debug => '/Od',
release => '/O2')), release => '/O2')),
cflags => add(picker(debug => cflags => add(picker(default => '/Gs0 /GF /Gy',
debug =>
sub { sub {
($disabled{shared} ? "" : "/MDd"); ($disabled{shared} ? "" : "/MDd");
}, },
...@@ -1402,8 +1402,7 @@ my %targets = ( ...@@ -1402,8 +1402,7 @@ my %targets = (
sub { sub {
($disabled{shared} ? "" : "/MD"); ($disabled{shared} ? "" : "/MD");
})), })),
defines => add(picker(default => [ "UNICODE", "_UNICODE" ], defines => add(picker(debug => [ "DEBUG", "_DEBUG" ])),
debug => [ "DEBUG", "_DEBUG" ])),
lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }), lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
# Following might/should appears controversial, i.e. defining # Following might/should appears controversial, i.e. defining
# /MDd without evaluating $disabled{shared}. It works in # /MDd without evaluating $disabled{shared}. It works in
...@@ -1435,14 +1434,14 @@ my %targets = ( ...@@ -1435,14 +1434,14 @@ my %targets = (
push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./); push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
return join(" ", @_, @ex_libs); return join(" ", @_, @ex_libs);
}), }),
bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN", bn_ops => add("SIXTY_FOUR_BIT"),
}, },
"VC-WIN64I" => { "VC-WIN64I" => {
inherit_from => [ "VC-WIN64-common", asm("ia64_asm"), inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
sub { $disabled{shared} ? () : "ia64_uplink" } ], sub { $disabled{shared} ? () : "ia64_uplink" } ],
AS => "ias", AS => "ias",
ASFLAGS => "-d debug", ASFLAGS => "-d debug",
asoutflag => "-o", asoutflag => "-o ",
sys_id => "WIN64I", sys_id => "WIN64I",
bn_asm_src => sub { return undef unless @_; bn_asm_src => sub { return undef unless @_;
my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; }, my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
...@@ -1463,27 +1462,15 @@ my %targets = ( ...@@ -1463,27 +1462,15 @@ my %targets = (
multilib => "-x64", multilib => "-x64",
}, },
"VC-WIN32" => { "VC-WIN32" => {
# x86 Win32 target used to default to ANSI API, but not anymore,
# UNICODE is the only option. The original reason for providing
# UNICODE as opt-in option was because ANSI API was *native*
# system interface for [no longer supported] Windows 9x.
inherit_from => [ "VC-noCE-common", asm("x86_asm"), inherit_from => [ "VC-noCE-common", asm("x86_asm"),
sub { $disabled{shared} ? () : "uplink_common" } ], sub { $disabled{shared} ? () : "uplink_common" } ],
CFLAGS => add("-WX"), CFLAGS => add("/WX"),
AS => sub { vc_win32_info()->{AS} }, AS => sub { vc_win32_info()->{AS} },
ASFLAGS => sub { vc_win32_info()->{ASFLAGS} }, ASFLAGS => sub { vc_win32_info()->{ASFLAGS} },
asoutflag => sub { vc_win32_info()->{asoutflag} }, asoutflag => sub { vc_win32_info()->{asoutflag} },
asflags => sub { vc_win32_info()->{asflags} }, asflags => sub { vc_win32_info()->{asflags} },
ex_libs => add(sub {
my @ex_libs = ();
# WIN32 UNICODE build gets linked with unicows.lib for
# backward compatibility with Win9x.
push @ex_libs, 'unicows.lib'
if (grep { $_ eq "UNICODE" } @{$user{CPPDEFINES}});
return join(" ", @ex_libs, @_);
}),
sys_id => "WIN32", sys_id => "WIN32",
bn_ops => "BN_LLONG EXPORT_VAR_AS_FN", bn_ops => add("BN_LLONG"),
perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} }, perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
# "WOW" stands for "Windows on Windows", and "VC-WOW" engages # "WOW" stands for "Windows on Windows", and "VC-WOW" engages
# some installation path heuristics in windows-makefile.tmpl... # some installation path heuristics in windows-makefile.tmpl...
...@@ -1491,14 +1478,8 @@ my %targets = ( ...@@ -1491,14 +1478,8 @@ my %targets = (
}, },
"VC-CE" => { "VC-CE" => {
inherit_from => [ "VC-common" ], inherit_from => [ "VC-common" ],
AS => "ml", CFLAGS => add(picker(debug => "/Od",
ASFLAGS => "/nologo", release => "/O1i")),
asoutflag => "/Fo",
asflags => "/Cp /coff /c /Cx /Zi",
CC => "cl",
CFLAGS => picker(default => '/W3 /WX /nologo',
debug => "/Od",
release => "/O1i"),
CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]), CPPDEFINES => picker(debug => [ "DEBUG", "_DEBUG" ]),
LDFLAGS => add("/nologo /opt:ref"), LDFLAGS => add("/nologo /opt:ref"),
cflags => cflags =>
...@@ -1508,9 +1489,7 @@ my %targets = ( ...@@ -1508,9 +1489,7 @@ my %targets = (
? ($disabled{shared} ? " /MT" : " /MD") ? ($disabled{shared} ? " /MT" : " /MD")
: " /MC"; }), : " /MC"; }),
cppflags => sub { vc_wince_info()->{cppflags}; }, cppflags => sub { vc_wince_info()->{cppflags}; },
defines => [ "WIN32_LEAN_AND_MEAN" ], lib_defines => add("NO_CHMOD", "OPENSSL_SMALL_FOOTPRINT"),
lib_defines => [ "L_ENDIAN", "DSO_WIN32", "NO_CHMOD",
"OPENSSL_SMALL_FOOTPRINT" ],
lib_cppflags => sub { vc_wince_info()->{cppflags}; }, lib_cppflags => sub { vc_wince_info()->{cppflags}; },
includes => includes =>
add(combine(sub { defined(env('WCECOMPAT')) add(combine(sub { defined(env('WCECOMPAT'))
...@@ -1522,7 +1501,7 @@ my %targets = ( ...@@ -1522,7 +1501,7 @@ my %targets = (
sub { defined(env('PORTSDK_LIBPATH')) sub { defined(env('PORTSDK_LIBPATH'))
? "/entry:mainCRTstartup" : (); })), ? "/entry:mainCRTstartup" : (); })),
sys_id => "WINCE", sys_id => "WINCE",
bn_ops => "BN_LLONG EXPORT_VAR_AS_FN", bn_ops => add("BN_LLONG"),
ex_libs => add(sub { ex_libs => add(sub {
my @ex_libs = (); my @ex_libs = ();
push @ex_libs, 'ws2.lib' unless $disabled{sock}; push @ex_libs, 'ws2.lib' unless $disabled{sock};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册