Skip to content

Commit

Permalink
nginx: Always re-run rewriter when reconfiguring
Browse files Browse the repository at this point in the history
If we make nginx source changes we must re-run the rewriter. This change
ensures that we re-run the rewriter and provide it with the correct
compile_commands.json.
  • Loading branch information
rinon committed Sep 27, 2023
1 parent d25f9e5 commit 95e1c1e
Showing 1 changed file with 162 additions and 166 deletions.
328 changes: 162 additions & 166 deletions external/nginx/reconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -57,172 +57,168 @@ if [ ! -f $NGINX_ROOT/compile_commands.json ]; then
cp compile_commands.json $BUILD_DIR/
fi

if [ ! -f $BUILD_DIR/wrapper.c ] ||
[ ! -f $BUILD_DIR/wrapper.h ]
[ ! -f $BUILD_DIR/wrapper_2.ld ]; then
pushd $BUILD_DIR
$SRC_REWRITER --output-prefix=wrapper \
--root-directory=$EXTERNAL_ROOT \
--output-directory=$BUILD_DIR \
$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
fi
pushd $BUILD_DIR
$SRC_REWRITER --output-prefix=wrapper \
--root-directory=$EXTERNAL_ROOT \
--output-directory=$BUILD_DIR \
$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
Expand Down

0 comments on commit 95e1c1e

Please sign in to comment.