提交 62890f47 编写于 作者: R Richard Levitte

Fix zlib configuration options.

The macros ZLIB and ZLIB_SHARED weren't appropriately defined,
deviating wrongly from how they worked in earlier OpenSSL versions.
So, restore it so that ZLIB is defined if configured "enable-zlib" and
so that ZLIB and ZLIB_SHARED are defined if configured
"enable-zlib-dynamic".

Additionally, correct the interpretation of the --with-zlib-lib value
on Windows and VMS, where it's used to indicate the actual zlib
zlib library file / logical name, as that can differ depending on zlib
version and packaging on those platforms.

Finally for Windows and VMS, we also define the macro LIBZ with that
file name / logical name when configured "zlib-dynamic", so the
compression unit can pick it up and use it.
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 36d70ed5
...@@ -43,16 +43,12 @@ ...@@ -43,16 +43,12 @@
BASE_common => { BASE_common => {
template => 1, template => 1,
defines => defines =>
[ sub { sub {
unless ($disabled{zlib}) { my @defs = ();
if (defined($disabled{"zlib-dynamic"})) { push @defs, "ZLIB" unless $disabled{zlib};
return "ZLIB"; push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
} else { return [ @defs ];
return "ZLIB_SHARED"; },
}
}
return (); }
],
}, },
BASE_unix => { BASE_unix => {
...@@ -84,7 +80,7 @@ ...@@ -84,7 +80,7 @@
sub { sub {
unless ($disabled{zlib}) { unless ($disabled{zlib}) {
if (defined($disabled{"zlib-dynamic"})) { if (defined($disabled{"zlib-dynamic"})) {
return "zlib1.lib"; return $withargs{zlib_lib} || "zlib1.lib";
} }
} }
return (); }, return (); },
...@@ -104,19 +100,6 @@ ...@@ -104,19 +100,6 @@
inherit_from => [ "BASE_common" ], inherit_from => [ "BASE_common" ],
template => 1, template => 1,
ex_libs =>
sub {
unless ($disabled{zlib}) {
if (defined($disabled{"zlib-dynamic"})) {
if (defined($withargs{zlib_lib})) {
return $withargs{zlib_lib}.'GNV$LIBZSHR.EXE/SHARED'
} else {
return 'GNV$LIBZSHR/SHARE';
}
}
}
return (); },
build_file => "descrip.mms", build_file => "descrip.mms",
build_scheme => [ "unified", "VMS" ], build_scheme => [ "unified", "VMS" ],
}, },
......
...@@ -85,6 +85,18 @@ sub vms_info { ...@@ -85,6 +85,18 @@ sub vms_info {
if ($? == 0) { if ($? == 0) {
push @{$vms_info->{disable_warns_p64}}, "MAYLOSEDATA3"; push @{$vms_info->{disable_warns_p64}}, "MAYLOSEDATA3";
} }
unless ($disabled{zlib}) {
if (defined($disabled{"zlib-dynamic"})) {
$vms_info->{zlib} = $withargs{zlib_lib} || 'GNV$LIBZSHR/SHARE';
$vms_info->{zlib_p32} = $withargs{zlib_lib} || 'GNV$LIBZSHR32/SHARE';
$vms_info->{zlib_p64} = $withargs{zlib_lib} || 'GNV$LIBZSHR64/SHARE';
} else {
$vms_info->{def_zlib} = $withargs{zlib_lib} || 'GNV$LIBZSHR';
$vms_info->{def_zlib_p32} = $withargs{zlib_lib} || 'GNV$LIBZSHR32';
$vms_info->{def_zlib_p64} = $withargs{zlib_lib} || 'GNV$LIBZSHR64';
}
}
} }
return $vms_info; return $vms_info;
} }
...@@ -1755,6 +1767,12 @@ sub vms_info { ...@@ -1755,6 +1767,12 @@ sub vms_info {
@{vms_info()->{disable_warns}}; @{vms_info()->{disable_warns}};
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }), ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
defines =>
add(sub {
return vms_info()->{def_zlib}
? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib} || (); }),
#as => "???", #as => "???",
#debug_aflags => "/NOOPTIMIZE/DEBUG", #debug_aflags => "/NOOPTIMIZE/DEBUG",
#release_aflags => "/OPTIMIZE/NODEBUG", #release_aflags => "/OPTIMIZE/NODEBUG",
...@@ -1769,7 +1787,12 @@ sub vms_info { ...@@ -1769,7 +1787,12 @@ sub vms_info {
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
} ), } ),
ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) }, defines =>
add(sub {
return vms_info()->{def_zlib_p32}
? "LIBZ=\"\"\"".vms_info()->{def_zlib_p32}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib_p32} || (); }),
}, },
"vms-alpha-p64" => { "vms-alpha-p64" => {
inherit_from => [ "vms-alpha" ], inherit_from => [ "vms-alpha" ],
...@@ -1780,7 +1803,12 @@ sub vms_info { ...@@ -1780,7 +1803,12 @@ sub vms_info {
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
} ), } ),
ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) }, defines =>
add(sub {
return vms_info()->{def_zlib_p64}
? "LIBZ=\"\"\"".vms_info()->{def_zlib_p64}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib_p64} || (); }),
}, },
"vms-ia64" => { "vms-ia64" => {
inherit_from => [ "vms-generic" ], inherit_from => [ "vms-generic" ],
...@@ -1788,6 +1816,12 @@ sub vms_info { ...@@ -1788,6 +1816,12 @@ sub vms_info {
@{vms_info()->{disable_warns}}; @{vms_info()->{disable_warns}};
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }), ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
defines =>
add(sub {
return vms_info()->{def_zlib}
? "LIBZ=\"\"\"".vms_info()->{def_zlib}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib} || (); }),
#as => "I4S", #as => "I4S",
#debug_aflags => "/NOOPTIMIZE/DEBUG", #debug_aflags => "/NOOPTIMIZE/DEBUG",
#release_aflags => "/OPTIMIZE/NODEBUG", #release_aflags => "/OPTIMIZE/NODEBUG",
...@@ -1802,7 +1836,12 @@ sub vms_info { ...@@ -1802,7 +1836,12 @@ sub vms_info {
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
} ), } ),
ex_libs => sub { join(",", map { s|SHR([\./])|SHR32$1|g; $_ } @_) }, defines =>
add(sub {
return vms_info()->{def_zlib_p32}
? "LIBZ=\"\"\"".vms_info()->{def_zlib_p32}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib_p32} || (); }),
}, },
"vms-ia64-p64" => { "vms-ia64-p64" => {
inherit_from => [ "vms-ia64" ], inherit_from => [ "vms-ia64" ],
...@@ -1813,7 +1852,12 @@ sub vms_info { ...@@ -1813,7 +1852,12 @@ sub vms_info {
@warnings @warnings
? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
} ), } ),
ex_libs => sub { join(",", map { s|SHR([\./])|SHR64$1|g; $_ } @_) }, defines =>
add(sub {
return vms_info()->{def_zlib_p64}
? "LIBZ=\"\"\"".vms_info()->{def_zlib_p64}."\"\"\"" : ();
}),
ex_libs => add(sub { return vms_info()->{zlib_p64} || (); }),
}, },
); );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册