forked from google/ngx_brotli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig
174 lines (152 loc) · 6.43 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Copyright (C) 2015-2016 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
ngx_addon_name=ngx_brotli
if [ -z "$ngx_module_link" ]; then
cat << END
$0: error: Brotli module requires recent version of NGINX (1.9.11+).
END
exit 1
fi
#
# HTTP static module
#
ngx_module_type=HTTP
ngx_module_name=ngx_http_brotli_static_module
ngx_module_incs=
ngx_module_deps=
ngx_module_srcs="$ngx_addon_dir/src/ngx_http_brotli_static_module.c"
ngx_module_libs=
ngx_module_order=
. auto/module
have=NGX_HTTP_GZIP . auto/have
have=NGX_HTTP_BROTLI_STATIC . auto/have
have=NGX_HTTP_BROTLI_STATIC_MODULE . auto/have # deprecated
#
# HTTP filter module with Brotli library
#
brotli="$ngx_addon_dir/deps/brotli"
if [ ! -f "$brotli/include/brotli/encode.h" ]; then
cat << END
$0: error: \
Brotli library is missing from the $brotli directory.
Please make sure that the git submodule has been checked out:
cd $ngx_addon_dir && git submodule update --init && cd $PWD
END
exit 1
fi
ngx_module_type=HTTP_FILTER
ngx_module_name=ngx_http_brotli_filter_module
ngx_module_incs="$brotli/include"
ngx_module_deps="$brotli/common/constants.h \
$brotli/common/dictionary.h \
$brotli/common/version.h \
$brotli/enc/backward_references.h \
$brotli/enc/backward_references_inc.h \
$brotli/enc/bit_cost.h \
$brotli/enc/bit_cost_inc.h \
$brotli/enc/block_encoder_inc.h \
$brotli/enc/block_splitter.h \
$brotli/enc/block_splitter_inc.h \
$brotli/enc/brotli_bit_stream.h \
$brotli/enc/cluster.h \
$brotli/enc/cluster_inc.h \
$brotli/enc/command.h \
$brotli/enc/compress_fragment.h \
$brotli/enc/compress_fragment_two_pass.h \
$brotli/enc/context.h \
$brotli/enc/dictionary_hash.h \
$brotli/enc/entropy_encode.h \
$brotli/enc/entropy_encode_static.h \
$brotli/enc/fast_log.h \
$brotli/enc/find_match_length.h \
$brotli/enc/hash_forgetful_chain_inc.h \
$brotli/enc/hash.h \
$brotli/enc/hash_longest_match_inc.h \
$brotli/enc/hash_longest_match_quickly_inc.h \
$brotli/enc/histogram.h \
$brotli/enc/histogram_inc.h \
$brotli/enc/literal_cost.h \
$brotli/enc/memory.h \
$brotli/enc/metablock.h \
$brotli/enc/metablock_inc.h \
$brotli/enc/port.h \
$brotli/enc/prefix.h \
$brotli/enc/quality.h \
$brotli/enc/ringbuffer.h \
$brotli/enc/static_dict.h \
$brotli/enc/static_dict_lut.h \
$brotli/enc/utf8_util.h \
$brotli/enc/write_bits.h"
ngx_module_srcs="$brotli/common/dictionary.c \
$brotli/enc/backward_references.c \
$brotli/enc/bit_cost.c \
$brotli/enc/block_splitter.c \
$brotli/enc/brotli_bit_stream.c \
$brotli/enc/cluster.c \
$brotli/enc/compress_fragment.c \
$brotli/enc/compress_fragment_two_pass.c \
$brotli/enc/encode.c \
$brotli/enc/entropy_encode.c \
$brotli/enc/histogram.c \
$brotli/enc/literal_cost.c \
$brotli/enc/memory.c \
$brotli/enc/metablock.c \
$brotli/enc/static_dict.c \
$brotli/enc/utf8_util.c \
$ngx_addon_dir/src/ngx_http_brotli_filter_module.c"
ngx_module_libs="-lm"
ngx_module_order="$ngx_module_name \
ngx_pagespeed \
ngx_http_postpone_filter_module \
ngx_http_ssi_filter_module \
ngx_http_charset_filter_module \
ngx_http_xslt_filter_module \
ngx_http_image_filter_module \
ngx_http_sub_filter_module \
ngx_http_addition_filter_module \
ngx_http_gunzip_filter_module \
ngx_http_userid_filter_module \
ngx_http_headers_filter_module \
ngx_http_copy_filter_module \
ngx_http_range_body_filter_module \
ngx_http_not_modified_filter_module \
ngx_http_slice_filter_module"
. auto/module
if [ "$ngx_module_link" != DYNAMIC ]; then
# ngx_module_order doesn't work with static modules,
# so we must re-order filters here.
if [ "$HTTP_GZIP" = YES ]; then
next=ngx_http_gzip_filter_module
elif echo $HTTP_FILTER_MODULES | grep pagespeed_etag_filter >/dev/null; then
next=ngx_pagespeed_etag_filter
else
next=ngx_http_range_header_filter_module
fi
HTTP_FILTER_MODULES=`echo $HTTP_FILTER_MODULES \
| sed "s/$ngx_module_name//" \
| sed "s/$next/$next $ngx_module_name/"`
fi
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
have=NGX_HTTP_BROTLI_FILTER . auto/have
have=NGX_HTTP_BROTLI_FILTER_MODULE . auto/have # deprecated