diff options
author | Todd Short <tshort@akamai.com> | 2021-08-09 16:56:29 -0400 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-10-18 09:30:18 -0400 |
commit | 12e96a23604a7aa1cd8f83486b02f1bcab6d468f (patch) | |
tree | 0b6be9589eaab31798122128c1237d40bff9bfe2 /Configurations/00-base-templates.conf | |
parent | 846975f367f75f3503b44c12e49d980dca181647 (diff) |
Add brotli compression support (RFC7924)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18186)
Diffstat (limited to 'Configurations/00-base-templates.conf')
-rw-r--r-- | Configurations/00-base-templates.conf | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 0e5d38d5a6..4bc1915906 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -48,6 +48,8 @@ my %targets=( defines => sub { my @defs = ( 'OPENSSL_BUILDING_OPENSSL' ); + push @defs, "BROTLI" unless $disabled{brotli}; + push @defs, "BROTLI_SHARED" unless $disabled{"brotli-dynamic"}; push @defs, "ZLIB" unless $disabled{zlib}; push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"}; return [ @defs ]; @@ -55,6 +57,8 @@ my %targets=( includes => sub { my @incs = (); + push @incs, $withargs{brotli_include} + if !$disabled{brotli} && $withargs{brotli_include}; push @incs, $withargs{zlib_include} if !$disabled{zlib} && $withargs{zlib_include}; return [ @incs ]; @@ -69,11 +73,24 @@ my %targets=( ARFLAGS => "qc", CC => "cc", lflags => - sub { $withargs{zlib_lib} ? "-L".$withargs{zlib_lib} : () }, + sub { + my @libs = (); + push(@libs, "-L".$withargs{zlib_lib}) if $withargs{zlib_lib}; + push(@libs, "-L".$withargs{brotli_lib}) if $withargs{brotli_lib}; + return join(" ", @libs); + }, ex_libs => - sub { !defined($disabled{zlib}) - && defined($disabled{"zlib-dynamic"}) - ? "-lz" : () }, + sub { + my @libs = (); + push(@libs, "-lz") if !defined($disabled{zlib}) && defined($disabled{"zlib-dynamic"}); + if (!defined($disabled{brotli}) && defined($disabled{"brotli-dynamic"})) { + push(@libs, "-lbrotlienc"); + push(@libs, "-lbrotlidec"); + push(@libs, "-lbrotlicommon"); + push(@libs, "-lm"); + } + return join(" ", @libs); + }, HASHBANGPERL => "/usr/bin/env perl", # Only Unix actually cares RANLIB => sub { which("$config{cross_compile_prefix}ranlib") ? "ranlib" : "" }, @@ -100,12 +117,24 @@ my %targets=( }, ex_libs => sub { + my @libs = (); unless ($disabled{zlib}) { if (defined($disabled{"zlib-dynamic"})) { - return $withargs{zlib_lib} // "ZLIB1"; + push(@libs, $withargs{zlib_lib} // "ZLIB1"); + } + } + unless ($disabled{brotli}) { + if (defined($disabled{"brotli-dynamic"})) { + my $path = ""; + if (defined($withargs{brotli_lib})) { + $path = $withargs{brotli_lib} . "\\"; + } + push(@libs, $path . "brotlicommon.lib"); + push(@libs, $path . "brotlidec.lib"); + push(@libs, $path . "brotlienc.lib"); } } - return (); + return join(" ", @libs); }, MT => "mt", |