-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreconfigure
executable file
·235 lines (227 loc) · 10 KB
/
reconfigure
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
#!/bin/bash
set -euo pipefail
REPO_ROOT=`realpath ${PWD}/../../`
EXTERNAL_ROOT=${REPO_ROOT}/external
BUILD_DIR=${PWD}/build
IA2_BUILD_DIR=${BUILD_DIR}/ia2
NGINX_BUILD_DIR=${BUILD_DIR}/nginx
NGINX_ROOT=${EXTERNAL_ROOT}/nginx
NGINX_RTMP_ROOT=${EXTERNAL_ROOT}/nginx-rtmp-module
SRC_REWRITER=$IA2_BUILD_DIR/tools/rewriter/ia2-rewriter
LIBIA2=$IA2_BUILD_DIR/runtime/libia2/liblibia2.a
PA_LIBRARY=runtime/partition-alloc/libpartition-alloc.so
TEMP_FILES=(
nginx.pid
err.log
http.log
client_body_temp
proxy_temp
fastcgi_temp
uwsgi_temp
scgi_temp
)
if ! command -v bear; then
echo "Bear is required for this demo. See https://github.com/rizsotto/Bear for installation details."
exit 1
fi
mkdir -p $IA2_BUILD_DIR
pushd $IA2_BUILD_DIR
cmake -GNinja $REPO_ROOT ${IA2_CMAKE_FLAGS:-}
ninja tools libia2 ${PA_LIBRARY}
popd
mkdir -p $NGINX_BUILD_DIR
for tmp in ${TEMP_FILES[@]}; do
touch $NGINX_BUILD_DIR/$tmp
done
if [ ! -f $NGINX_BUILD_DIR/Makefile ]; then
REPO_ROOT=$REPO_ROOT ./auto/configure --prefix=$NGINX_BUILD_DIR \
--builddir=$NGINX_BUILD_DIR \
--with-cc="gcc" \
--conf-path=$NGINX_ROOT/conf/nginx.conf \
--pid-path=$NGINX_BUILD_DIR/nginx.pid \
--error-log-path=$NGINX_BUILD_DIR/err.log \
--http-log-path=$NGINX_BUILD_DIR/http.log \
--http-client-body-temp-path=$NGINX_BUILD_DIR/client_body_temp \
--http-proxy-temp-path=$NGINX_BUILD_DIR/proxy_temp \
--http-fastcgi-temp-path=$NGINX_BUILD_DIR/fastcgi_temp \
--http-uwsgi-temp-path=$NGINX_BUILD_DIR/uwsgi_temp \
--http-scgi-temp-path=$NGINX_BUILD_DIR/scgi_temp \
--add-dynamic-module=../nginx-rtmp-module
fi
if [ ! -f $NGINX_ROOT/compile_commands.json ]; then
bear -- make -j8 IA2_LDFLAGS= IA2_MODULE_LDFLAGS= IA2_CALLGATES= IA2_EXTRA_CFLAGS= IA2_ENABLE=0 build
cp compile_commands.json $BUILD_DIR/
fi
pushd $BUILD_DIR
$SRC_REWRITER --output-prefix=wrapper \
--root-directory=$EXTERNAL_ROOT \
--output-directory=$BUILD_DIR \
-p compile_commands.json \
$NGINX_ROOT/src/core/ngx_palloc.c \
$NGINX_ROOT/src/core/ngx_log.c \
$NGINX_ROOT/src/core/ngx_array.c \
$NGINX_ROOT/src/core/ngx_buf.c \
$NGINX_ROOT/src/core/nginx.c \
$NGINX_ROOT/src/core/ngx_queue.c \
$NGINX_ROOT/src/core/ngx_list.c \
$NGINX_ROOT/src/core/ngx_hash.c \
$NGINX_ROOT/src/core/ngx_output_chain.c \
$NGINX_ROOT/src/core/ngx_string.c \
$NGINX_ROOT/src/core/ngx_parse.c \
$NGINX_ROOT/src/core/ngx_parse_time.c \
$NGINX_ROOT/src/core/ngx_inet.c \
$NGINX_ROOT/src/core/ngx_file.c \
$NGINX_ROOT/src/core/ngx_crc32.c \
$NGINX_ROOT/src/core/ngx_murmurhash.c \
$NGINX_ROOT/src/core/ngx_md5.c \
$NGINX_ROOT/src/core/ngx_sha1.c \
$NGINX_ROOT/src/core/ngx_rbtree.c \
$NGINX_ROOT/src/core/ngx_radix_tree.c \
$NGINX_ROOT/src/core/ngx_slab.c \
$NGINX_ROOT/src/core/ngx_times.c \
$NGINX_ROOT/src/core/ngx_shmtx.c \
$NGINX_ROOT/src/core/ngx_connection.c \
$NGINX_ROOT/src/core/ngx_cycle.c \
$NGINX_ROOT/src/core/ngx_spinlock.c \
$NGINX_ROOT/src/core/ngx_rwlock.c \
$NGINX_ROOT/src/core/ngx_cpuinfo.c \
$NGINX_ROOT/src/core/ngx_conf_file.c \
$NGINX_ROOT/src/core/ngx_module.c \
$NGINX_ROOT/src/core/ngx_resolver.c \
$NGINX_ROOT/src/core/ngx_open_file_cache.c \
$NGINX_ROOT/src/core/ngx_crypt.c \
$NGINX_ROOT/src/core/ngx_proxy_protocol.c \
$NGINX_ROOT/src/core/ngx_syslog.c \
$NGINX_ROOT/src/event/ngx_event.c \
$NGINX_ROOT/src/event/ngx_event_timer.c \
$NGINX_ROOT/src/event/ngx_event_posted.c \
$NGINX_ROOT/src/event/ngx_event_accept.c \
$NGINX_ROOT/src/event/ngx_event_udp.c \
$NGINX_ROOT/src/event/ngx_event_connect.c \
$NGINX_ROOT/src/event/ngx_event_pipe.c \
$NGINX_ROOT/src/os/unix/ngx_time.c \
$NGINX_ROOT/src/os/unix/ngx_errno.c \
$NGINX_ROOT/src/os/unix/ngx_files.c \
$NGINX_ROOT/src/os/unix/ngx_alloc.c \
$NGINX_ROOT/src/os/unix/ngx_socket.c \
$NGINX_ROOT/src/os/unix/ngx_recv.c \
$NGINX_ROOT/src/os/unix/ngx_readv_chain.c \
$NGINX_ROOT/src/os/unix/ngx_udp_recv.c \
$NGINX_ROOT/src/os/unix/ngx_send.c \
$NGINX_ROOT/src/os/unix/ngx_writev_chain.c \
$NGINX_ROOT/src/os/unix/ngx_udp_send.c \
$NGINX_ROOT/src/os/unix/ngx_udp_sendmsg_chain.c \
$NGINX_ROOT/src/os/unix/ngx_channel.c \
$NGINX_ROOT/src/os/unix/ngx_shmem.c \
$NGINX_ROOT/src/os/unix/ngx_process.c \
$NGINX_ROOT/src/os/unix/ngx_daemon.c \
$NGINX_ROOT/src/os/unix/ngx_setaffinity.c \
$NGINX_ROOT/src/os/unix/ngx_setproctitle.c \
$NGINX_ROOT/src/os/unix/ngx_posix_init.c \
$NGINX_ROOT/src/os/unix/ngx_user.c \
$NGINX_ROOT/src/os/unix/ngx_dlopen.c \
$NGINX_ROOT/src/os/unix/ngx_process_cycle.c \
$NGINX_ROOT/src/os/unix/ngx_linux_init.c \
$NGINX_ROOT/src/event/modules/ngx_epoll_module.c \
$NGINX_ROOT/src/os/unix/ngx_linux_sendfile_chain.c \
$NGINX_ROOT/src/event/ngx_event_openssl.c \
$NGINX_ROOT/src/core/ngx_regex.c \
$NGINX_ROOT/src/event/ngx_event_openssl_stapling.c \
$NGINX_ROOT/src/http/ngx_http.c \
$NGINX_ROOT/src/http/ngx_http_core_module.c \
$NGINX_ROOT/src/http/ngx_http_special_response.c \
$NGINX_ROOT/src/http/ngx_http_request.c \
$NGINX_ROOT/src/http/ngx_http_parse.c \
$NGINX_ROOT/src/http/modules/ngx_http_log_module.c \
$NGINX_ROOT/src/http/ngx_http_request_body.c \
$NGINX_ROOT/src/http/ngx_http_variables.c \
$NGINX_ROOT/src/http/ngx_http_script.c \
$NGINX_ROOT/src/http/ngx_http_upstream.c \
$NGINX_ROOT/src/http/ngx_http_upstream_round_robin.c \
$NGINX_ROOT/src/http/ngx_http_file_cache.c \
$NGINX_ROOT/src/http/ngx_http_write_filter_module.c \
$NGINX_ROOT/src/http/ngx_http_header_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_chunked_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_range_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_gzip_filter_module.c \
$NGINX_ROOT/src/http/ngx_http_postpone_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_ssi_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_charset_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_userid_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_headers_filter_module.c \
$NGINX_ROOT/src/http/ngx_http_copy_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_not_modified_filter_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_static_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_autoindex_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_index_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_mirror_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_try_files_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_access_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_auth_basic_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_limit_conn_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_limit_req_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_geo_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_map_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_split_clients_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_referer_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_rewrite_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_proxy_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_fastcgi_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_uwsgi_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_scgi_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_memcached_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_empty_gif_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_browser_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_hash_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_ip_hash_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_least_conn_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_random_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_keepalive_module.c \
$NGINX_ROOT/src/http/modules/ngx_http_upstream_zone_module.c \
$NGINX_BUILD_DIR/ngx_modules.c \
$NGINX_RTMP_ROOT/ngx_rtmp_init.c \
$NGINX_RTMP_ROOT/ngx_rtmp.c \
$NGINX_RTMP_ROOT/ngx_rtmp_handshake.c \
$NGINX_RTMP_ROOT/ngx_rtmp_handler.c \
$NGINX_RTMP_ROOT/ngx_rtmp_amf.c \
$NGINX_RTMP_ROOT/ngx_rtmp_send.c \
$NGINX_RTMP_ROOT/ngx_rtmp_shared.c \
$NGINX_RTMP_ROOT/ngx_rtmp_eval.c \
$NGINX_RTMP_ROOT/ngx_rtmp_receive.c \
$NGINX_RTMP_ROOT/ngx_rtmp_core_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_cmd_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_codec_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_access_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_record_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_play_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_live_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_flv_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_mp4_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_netcall_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_relay_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_bandwidth.c \
$NGINX_RTMP_ROOT/ngx_rtmp_exec_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_auto_push_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_notify_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_log_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_limit_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_bitop.c \
$NGINX_RTMP_ROOT/ngx_rtmp_proxy_protocol.c \
$NGINX_RTMP_ROOT/hls/ngx_rtmp_hls_module.c \
$NGINX_RTMP_ROOT/dash/ngx_rtmp_dash_module.c \
$NGINX_RTMP_ROOT/hls/ngx_rtmp_mpegts.c \
$NGINX_RTMP_ROOT/dash/ngx_rtmp_mp4.c \
$NGINX_RTMP_ROOT/ngx_rtmp_stat_module.c \
$NGINX_RTMP_ROOT/ngx_rtmp_control_module.c \
$NGINX_BUILD_DIR/ngx_rtmp_module_modules.c
popd
# The nginx makefile declares a dependency on this header even though it isn't
# part of any source file's AST so we have to copy it manually
if [ ! -f $NGINX_BUILD_DIR/src/os/unix/ngx_gcc_atomic_x86.h ]; then
cp $NGINX_ROOT/src/os/unix/ngx_gcc_atomic_x86.h $NGINX_BUILD_DIR/src/os/unix/ngx_gcc_atomic_x86.h
fi
# The makefile also makes the nginx binary depend on the docs so let's copy this
# directory
if [ ! -d $NGINX_BUILD_DIR/docs ]; then
cp -r $NGINX_ROOT/docs $NGINX_BUILD_DIR/docs
fi