xref: /OK3568_Linux_fs/buildroot/package/nginx/nginx.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# nginx
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunNGINX_VERSION = 1.20.1
8*4882a593SmuzhiyunNGINX_SITE = http://nginx.org/download
9*4882a593SmuzhiyunNGINX_LICENSE = BSD-2-Clause
10*4882a593SmuzhiyunNGINX_LICENSE_FILES = LICENSE
11*4882a593SmuzhiyunNGINX_CPE_ID_VENDOR = nginx
12*4882a593SmuzhiyunNGINX_DEPENDENCIES = \
13*4882a593Smuzhiyun	host-pkgconf \
14*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt)
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunNGINX_CONF_OPTS = \
17*4882a593Smuzhiyun	--crossbuild=Linux::$(BR2_ARCH) \
18*4882a593Smuzhiyun	--with-cc="$(TARGET_CC)" \
19*4882a593Smuzhiyun	--with-cpp="$(TARGET_CC)" \
20*4882a593Smuzhiyun	--with-ld-opt="$(TARGET_LDFLAGS)"
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun# www-data user and group are used for nginx. Because these user and group
23*4882a593Smuzhiyun# are already set by buildroot, it is not necessary to redefine them.
24*4882a593Smuzhiyun# See system/skeleton/etc/passwd
25*4882a593Smuzhiyun#   username: www-data    uid: 33
26*4882a593Smuzhiyun#   groupname: www-data   gid: 33
27*4882a593Smuzhiyun#
28*4882a593Smuzhiyun# So, we just need to create the directories used by nginx with the right
29*4882a593Smuzhiyun# ownership.
30*4882a593Smuzhiyundefine NGINX_PERMISSIONS
31*4882a593Smuzhiyun	/var/lib/nginx d 755 33 33 - - - - -
32*4882a593Smuzhiyunendef
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun# disable external libatomic_ops because its detection fails.
35*4882a593SmuzhiyunNGINX_CONF_ENV += \
36*4882a593Smuzhiyun	ngx_force_c_compiler=yes \
37*4882a593Smuzhiyun	ngx_force_c99_have_variadic_macros=yes \
38*4882a593Smuzhiyun	ngx_force_gcc_have_variadic_macros=yes \
39*4882a593Smuzhiyun	ngx_force_gcc_have_atomic=yes \
40*4882a593Smuzhiyun	ngx_force_have_epoll=yes \
41*4882a593Smuzhiyun	ngx_force_have_sendfile=yes \
42*4882a593Smuzhiyun	ngx_force_have_sendfile64=yes \
43*4882a593Smuzhiyun	ngx_force_have_pr_set_dumpable=yes \
44*4882a593Smuzhiyun	ngx_force_have_timer_event=yes \
45*4882a593Smuzhiyun	ngx_force_have_map_anon=yes \
46*4882a593Smuzhiyun	ngx_force_have_map_devzero=yes \
47*4882a593Smuzhiyun	ngx_force_have_sysvshm=yes \
48*4882a593Smuzhiyun	ngx_force_have_posix_sem=yes
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun# prefix: nginx root configuration location
51*4882a593SmuzhiyunNGINX_CONF_OPTS += \
52*4882a593Smuzhiyun	--force-endianness=$(call qstrip,$(call LOWERCASE,$(BR2_ENDIAN))) \
53*4882a593Smuzhiyun	--prefix=/usr \
54*4882a593Smuzhiyun	--conf-path=/etc/nginx/nginx.conf \
55*4882a593Smuzhiyun	--sbin-path=/usr/sbin/nginx \
56*4882a593Smuzhiyun	--pid-path=/run/nginx.pid \
57*4882a593Smuzhiyun	--lock-path=/run/lock/nginx.lock \
58*4882a593Smuzhiyun	--user=www-data \
59*4882a593Smuzhiyun	--group=www-data \
60*4882a593Smuzhiyun	--error-log-path=/var/log/nginx/error.log \
61*4882a593Smuzhiyun	--http-log-path=/var/log/nginx/access.log \
62*4882a593Smuzhiyun	--http-client-body-temp-path=/var/cache/nginx/client-body \
63*4882a593Smuzhiyun	--http-proxy-temp-path=/var/cache/nginx/proxy \
64*4882a593Smuzhiyun	--http-fastcgi-temp-path=/var/cache/nginx/fastcgi \
65*4882a593Smuzhiyun	--http-scgi-temp-path=/var/cache/nginx/scgi \
66*4882a593Smuzhiyun	--http-uwsgi-temp-path=/var/cache/nginx/uwsgi
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunNGINX_CONF_OPTS += \
69*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \
70*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_THREADS),--with-threads)
71*4882a593Smuzhiyun
72*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y)
73*4882a593SmuzhiyunNGINX_DEPENDENCIES += libatomic_ops
74*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-libatomic
75*4882a593SmuzhiyunNGINX_CONF_ENV += ngx_force_have_libatomic=yes
76*4882a593Smuzhiyunifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y)
77*4882a593SmuzhiyunNGINX_CFLAGS += "-DAO_NO_SPARC_V9"
78*4882a593Smuzhiyunendif
79*4882a593Smuzhiyunelse
80*4882a593SmuzhiyunNGINX_CONF_ENV += ngx_force_have_libatomic=no
81*4882a593Smuzhiyunendif
82*4882a593Smuzhiyun
83*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_PCRE),y)
84*4882a593SmuzhiyunNGINX_DEPENDENCIES += pcre
85*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-pcre
86*4882a593Smuzhiyunelse
87*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-pcre
88*4882a593Smuzhiyunendif
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun# modules disabled or not activated because of missing dependencies:
91*4882a593Smuzhiyun# - google_perftools  (googleperftools)
92*4882a593Smuzhiyun# - http_perl_module  (host-perl)
93*4882a593Smuzhiyun# - pcre-jit          (want to rebuild pcre)
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun# Notes:
96*4882a593Smuzhiyun# * Feature/module option are *not* symetric.
97*4882a593Smuzhiyun#   If a feature is on by default, only its --without-xxx option exists;
98*4882a593Smuzhiyun#   if a feature is off by default, only its --with-xxx option exists.
99*4882a593Smuzhiyun# * The configure script fails if unknown options are passed on the command
100*4882a593Smuzhiyun#   line.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun# misc. modules
103*4882a593SmuzhiyunNGINX_CONF_OPTS += \
104*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_SELECT_MODULE),--with-select_module,--without-select_module) \
105*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_POLL_MODULE),--with-poll_module,--without-poll_module)
106*4882a593Smuzhiyun
107*4882a593Smuzhiyunifneq ($(BR2_PACKAGE_NGINX_ADD_MODULES),)
108*4882a593SmuzhiyunNGINX_CONF_OPTS += \
109*4882a593Smuzhiyun	$(addprefix --add-module=,$(call qstrip,$(BR2_PACKAGE_NGINX_ADD_MODULES)))
110*4882a593Smuzhiyunendif
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun# http server modules
113*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP),y)
114*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_CACHE),y)
115*4882a593SmuzhiyunNGINX_DEPENDENCIES += openssl
116*4882a593Smuzhiyunelse
117*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-http-cache
118*4882a593Smuzhiyunendif
119*4882a593Smuzhiyun
120*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_V2_MODULE),y)
121*4882a593SmuzhiyunNGINX_DEPENDENCIES += zlib
122*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_v2_module
123*4882a593Smuzhiyunendif
124*4882a593Smuzhiyun
125*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_SSL_MODULE),y)
126*4882a593SmuzhiyunNGINX_DEPENDENCIES += openssl
127*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_ssl_module
128*4882a593Smuzhiyunendif
129*4882a593Smuzhiyun
130*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_XSLT_MODULE),y)
131*4882a593SmuzhiyunNGINX_DEPENDENCIES += libxml2 libxslt
132*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_xslt_module
133*4882a593Smuzhiyunendif
134*4882a593Smuzhiyun
135*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_IMAGE_FILTER_MODULE),y)
136*4882a593SmuzhiyunNGINX_DEPENDENCIES += gd jpeg libpng
137*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_image_filter_module
138*4882a593Smuzhiyunendif
139*4882a593Smuzhiyun
140*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_GEOIP_MODULE),y)
141*4882a593SmuzhiyunNGINX_DEPENDENCIES += geoip
142*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_geoip_module
143*4882a593Smuzhiyunendif
144*4882a593Smuzhiyun
145*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_GUNZIP_MODULE),y)
146*4882a593SmuzhiyunNGINX_DEPENDENCIES += zlib
147*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_gunzip_module
148*4882a593Smuzhiyunendif
149*4882a593Smuzhiyun
150*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_GZIP_STATIC_MODULE),y)
151*4882a593SmuzhiyunNGINX_DEPENDENCIES += zlib
152*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_gzip_static_module
153*4882a593Smuzhiyunendif
154*4882a593Smuzhiyun
155*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_SECURE_LINK_MODULE),y)
156*4882a593SmuzhiyunNGINX_DEPENDENCIES += openssl
157*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-http_secure_link_module
158*4882a593Smuzhiyunendif
159*4882a593Smuzhiyun
160*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_GZIP_MODULE),y)
161*4882a593SmuzhiyunNGINX_DEPENDENCIES += zlib
162*4882a593Smuzhiyunelse
163*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-http_gzip_module
164*4882a593Smuzhiyunendif
165*4882a593Smuzhiyun
166*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_HTTP_REWRITE_MODULE),y)
167*4882a593SmuzhiyunNGINX_DEPENDENCIES += pcre
168*4882a593Smuzhiyunelse
169*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-http_rewrite_module
170*4882a593Smuzhiyunendif
171*4882a593Smuzhiyun
172*4882a593SmuzhiyunNGINX_CONF_OPTS += \
173*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_REALIP_MODULE),--with-http_realip_module) \
174*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_ADDITION_MODULE),--with-http_addition_module) \
175*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_SUB_MODULE),--with-http_sub_module) \
176*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_DAV_MODULE),--with-http_dav_module) \
177*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_FLV_MODULE),--with-http_flv_module) \
178*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_MP4_MODULE),--with-http_mp4_module) \
179*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_AUTH_REQUEST_MODULE),--with-http_auth_request_module) \
180*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_RANDOM_INDEX_MODULE),--with-http_random_index_module) \
181*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_DEGRADATION_MODULE),--with-http_degradation_module) \
182*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_SLICE_MODULE),--with-http_slice_module) \
183*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_STUB_STATUS_MODULE),--with-http_stub_status_module) \
184*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_CHARSET_MODULE),,--without-http_charset_module) \
185*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_SSI_MODULE),,--without-http_ssi_module) \
186*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_USERID_MODULE),,--without-http_userid_module) \
187*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_ACCESS_MODULE),,--without-http_access_module) \
188*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_AUTH_BASIC_MODULE),,--without-http_auth_basic_module) \
189*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_AUTOINDEX_MODULE),,--without-http_autoindex_module) \
190*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_GEO_MODULE),,--without-http_geo_module) \
191*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_MAP_MODULE),,--without-http_map_module) \
192*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_SPLIT_CLIENTS_MODULE),,--without-http_split_clients_module) \
193*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_REFERER_MODULE),,--without-http_referer_module) \
194*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_PROXY_MODULE),,--without-http_proxy_module) \
195*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_FASTCGI_MODULE),,--without-http_fastcgi_module) \
196*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_UWSGI_MODULE),,--without-http_uwsgi_module) \
197*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_SCGI_MODULE),,--without-http_scgi_module) \
198*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_MEMCACHED_MODULE),,--without-http_memcached_module) \
199*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_LIMIT_CONN_MODULE),,--without-http_limit_conn_module) \
200*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_LIMIT_REQ_MODULE),,--without-http_limit_req_module) \
201*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_EMPTY_GIF_MODULE),,--without-http_empty_gif_module) \
202*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_BROWSER_MODULE),,--without-http_browser_module) \
203*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_IP_HASH_MODULE),,--without-http_upstream_ip_hash_module) \
204*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_LEAST_CONN_MODULE),,--without-http_upstream_least_conn_module) \
205*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_RANDOM_MODULE),,--without-http_upstream_random_module) \
206*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_KEEPALIVE_MODULE),,--without-http_upstream_keepalive_module)
207*4882a593Smuzhiyun
208*4882a593Smuzhiyunelse # !BR2_PACKAGE_NGINX_HTTP
209*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-http
210*4882a593Smuzhiyunendif # BR2_PACKAGE_NGINX_HTTP
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun# mail modules
213*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_MAIL),y)
214*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-mail
215*4882a593Smuzhiyun
216*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_MAIL_SSL_MODULE),y)
217*4882a593SmuzhiyunNGINX_DEPENDENCIES += openssl
218*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-mail_ssl_module
219*4882a593Smuzhiyunendif
220*4882a593Smuzhiyun
221*4882a593SmuzhiyunNGINX_CONF_OPTS += \
222*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_MAIL_POP3_MODULE),,--without-mail_pop3_module) \
223*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_MAIL_IMAP_MODULE),,--without-mail_imap_module) \
224*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_MAIL_SMTP_MODULE),,--without-mail_smtp_module)
225*4882a593Smuzhiyun
226*4882a593Smuzhiyunendif # BR2_PACKAGE_NGINX_MAIL
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun# stream modules
229*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM),y)
230*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-stream
231*4882a593Smuzhiyun
232*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM_REALIP_MODULE),y)
233*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-stream_realip_module
234*4882a593Smuzhiyunendif
235*4882a593Smuzhiyun
236*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM_SET_MODULE),)
237*4882a593SmuzhiyunNGINX_CONF_OPTS += --without-stream_set_module
238*4882a593Smuzhiyunendif
239*4882a593Smuzhiyun
240*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM_SSL_MODULE),y)
241*4882a593SmuzhiyunNGINX_DEPENDENCIES += openssl
242*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-stream_ssl_module
243*4882a593Smuzhiyunendif
244*4882a593Smuzhiyun
245*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM_GEOIP_MODULE),y)
246*4882a593SmuzhiyunNGINX_DEPENDENCIES += geoip
247*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-stream_geoip_module
248*4882a593Smuzhiyunendif
249*4882a593Smuzhiyun
250*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_STREAM_SSL_PREREAD_MODULE),y)
251*4882a593SmuzhiyunNGINX_CONF_OPTS += --with-stream_ssl_preread_module
252*4882a593Smuzhiyunendif
253*4882a593Smuzhiyun
254*4882a593SmuzhiyunNGINX_CONF_OPTS += \
255*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_LIMIT_CONN_MODULE),,--without-stream_limit_conn_module) \
256*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_ACCESS_MODULE),,--without-stream_access_module) \
257*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_GEO_MODULE),,--without-stream_geo_module) \
258*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_MAP_MODULE),,--without-stream_map_module) \
259*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_SPLIT_CLIENTS_MODULE),,--without-stream_split_clients_module) \
260*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_RETURN_MODULE),,--without-stream_return_module) \
261*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_HASH_MODULE),,--without-stream_upstream_hash_module) \
262*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_LEAST_CONN_MODULE),,--without-stream_upstream_least_conn_module) \
263*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_RANDOM_MODULE),,--without-stream_upstream_random_module) \
264*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_ZONE_MODULE),,--without-stream_upstream_zone_module)
265*4882a593Smuzhiyun
266*4882a593Smuzhiyunendif # BR2_PACKAGE_NGINX_STREAM
267*4882a593Smuzhiyun
268*4882a593Smuzhiyun# external modules
269*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_UPLOAD),y)
270*4882a593SmuzhiyunNGINX_CONF_OPTS += $(addprefix --add-module=,$(NGINX_UPLOAD_DIR))
271*4882a593SmuzhiyunNGINX_DEPENDENCIES += nginx-upload
272*4882a593Smuzhiyunendif
273*4882a593Smuzhiyun
274*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_DAV_EXT),y)
275*4882a593SmuzhiyunNGINX_CONF_OPTS += --add-module=$(NGINX_DAV_EXT_DIR)
276*4882a593SmuzhiyunNGINX_DEPENDENCIES += nginx-dav-ext
277*4882a593Smuzhiyunendif
278*4882a593Smuzhiyun
279*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_NAXSI),y)
280*4882a593SmuzhiyunNGINX_DEPENDENCIES += nginx-naxsi
281*4882a593SmuzhiyunNGINX_CONF_OPTS += --add-module=$(NGINX_NAXSI_DIR)/naxsi_src
282*4882a593Smuzhiyunendif
283*4882a593Smuzhiyun
284*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NGINX_MODSECURITY),y)
285*4882a593SmuzhiyunNGINX_DEPENDENCIES += nginx-modsecurity
286*4882a593SmuzhiyunNGINX_CONF_OPTS += --add-module=$(NGINX_MODSECURITY_DIR)
287*4882a593Smuzhiyunendif
288*4882a593Smuzhiyun
289*4882a593Smuzhiyun# Debug logging
290*4882a593SmuzhiyunNGINX_CONF_OPTS += $(if $(BR2_PACKAGE_NGINX_DEBUG),--with-debug)
291*4882a593Smuzhiyun
292*4882a593Smuzhiyundefine NGINX_DISABLE_WERROR
293*4882a593Smuzhiyun	$(SED) 's/-Werror//g' -i $(@D)/auto/cc/*
294*4882a593Smuzhiyunendef
295*4882a593Smuzhiyun
296*4882a593SmuzhiyunNGINX_PRE_CONFIGURE_HOOKS += NGINX_DISABLE_WERROR
297*4882a593Smuzhiyun
298*4882a593Smuzhiyundefine NGINX_CONFIGURE_CMDS
299*4882a593Smuzhiyun	cd $(@D) ; $(NGINX_CONF_ENV) \
300*4882a593Smuzhiyun		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
301*4882a593Smuzhiyun		./configure $(NGINX_CONF_OPTS) \
302*4882a593Smuzhiyun			--with-cc-opt="$(TARGET_CFLAGS) $(NGINX_CFLAGS)"
303*4882a593Smuzhiyunendef
304*4882a593Smuzhiyun
305*4882a593Smuzhiyundefine NGINX_BUILD_CMDS
306*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
307*4882a593Smuzhiyunendef
308*4882a593Smuzhiyun
309*4882a593Smuzhiyundefine NGINX_INSTALL_TARGET_CMDS
310*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
311*4882a593Smuzhiyun	$(RM) $(TARGET_DIR)/usr/sbin/nginx.old
312*4882a593Smuzhiyun	$(INSTALL) -D -m 0664 package/nginx/nginx.logrotate \
313*4882a593Smuzhiyun		$(TARGET_DIR)/etc/logrotate.d/nginx
314*4882a593Smuzhiyunendef
315*4882a593Smuzhiyun
316*4882a593Smuzhiyundefine NGINX_INSTALL_INIT_SYSTEMD
317*4882a593Smuzhiyun	$(INSTALL) -D -m 0644 package/nginx/nginx.service \
318*4882a593Smuzhiyun		$(TARGET_DIR)/usr/lib/systemd/system/nginx.service
319*4882a593Smuzhiyunendef
320*4882a593Smuzhiyun
321*4882a593Smuzhiyundefine NGINX_INSTALL_INIT_SYSV
322*4882a593Smuzhiyun	$(INSTALL) -D -m 0755 package/nginx/S50nginx \
323*4882a593Smuzhiyun		$(TARGET_DIR)/etc/init.d/S50nginx
324*4882a593Smuzhiyunendef
325*4882a593Smuzhiyun
326*4882a593Smuzhiyun$(eval $(generic-package))
327