From e18a033b921d0d79fa8278f853548e6125b93e0c Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Tue, 31 Oct 2017 12:40:17 +0000 Subject: Integrate TLDK with NGINX Created a clone of nginx (from https://github.com/nginx/nginx) to demonstrate and benchmark TLDK library integrated with real world application. A new nginx module is created and and BSD socket-like API is implemented on top of native TLDK API. Note, that right now only minimalistic subset of socket-like API is provided: - accept - close - readv - recv - writev so only limited nginx functionality is available for a moment. Change-Id: Ie1efe9349a0538da4348a48fb8306cbf636b5a92 Signed-off-by: Mohammad Abdul Awal Signed-off-by: Reshma Pattan Signed-off-by: Remy Horton Signed-off-by: Konstantin Ananyev --- app/nginx/misc/GNUmakefile | 155 +++++++++++++++++++++++++++++++++++++++++++++ app/nginx/misc/README | 13 ++++ 2 files changed, 168 insertions(+) create mode 100644 app/nginx/misc/GNUmakefile create mode 100644 app/nginx/misc/README (limited to 'app/nginx/misc') diff --git a/app/nginx/misc/GNUmakefile b/app/nginx/misc/GNUmakefile new file mode 100644 index 0000000..bef4f0e --- /dev/null +++ b/app/nginx/misc/GNUmakefile @@ -0,0 +1,155 @@ + +VER = $(shell grep 'define NGINX_VERSION' src/core/nginx.h \ + | sed -e 's/^.*"\(.*\)".*/\1/') +NGINX = nginx-$(VER) +TEMP = tmp + +CC = cl +OBJS = objs.msvc8 +OPENSSL = openssl-1.0.2k +ZLIB = zlib-1.2.11 +PCRE = pcre-8.40 + + +release: export + + mv $(TEMP)/$(NGINX)/auto/configure $(TEMP)/$(NGINX) + + # delete incomplete sources + rm $(TEMP)/$(NGINX)/src/event/ngx_event_acceptex.c + rm $(TEMP)/$(NGINX)/src/event/ngx_event_connectex.c + rm $(TEMP)/$(NGINX)/src/event/modules/ngx_iocp_module.* + rm -r $(TEMP)/$(NGINX)/src/os/win32 + + mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX) + mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX) + mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX) + mv $(TEMP)/$(NGINX)/docs/man $(TEMP)/$(NGINX) + + $(MAKE) -f docs/GNUmakefile changes + + rm -r $(TEMP)/$(NGINX)/docs + rm -r $(TEMP)/$(NGINX)/misc + + tar -c -z -f $(NGINX).tar.gz --directory $(TEMP) $(NGINX) + + +export: + rm -rf $(TEMP) + hg archive -X '.hg*' $(TEMP)/$(NGINX) + + +RELEASE: + hg ci -m nginx-$(VER)-RELEASE + hg tag -m "release-$(VER) tag" release-$(VER) + + $(MAKE) -f misc/GNUmakefile release + + +win32: + ./auto/configure \ + --with-cc=$(CC) \ + --builddir=$(OBJS) \ + --with-debug \ + --prefix= \ + --conf-path=conf/nginx.conf \ + --pid-path=logs/nginx.pid \ + --http-log-path=logs/access.log \ + --error-log-path=logs/error.log \ + --sbin-path=nginx.exe \ + --http-client-body-temp-path=temp/client_body_temp \ + --http-proxy-temp-path=temp/proxy_temp \ + --http-fastcgi-temp-path=temp/fastcgi_temp \ + --http-scgi-temp-path=temp/scgi_temp \ + --http-uwsgi-temp-path=temp/uwsgi_temp \ + --with-cc-opt=-DFD_SETSIZE=1024 \ + --with-pcre=$(OBJS)/lib/$(PCRE) \ + --with-zlib=$(OBJS)/lib/$(ZLIB) \ + --with-select_module \ + --with-http_v2_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_stub_status_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_auth_request_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_slice_module \ + --with-mail \ + --with-stream \ + --with-openssl=$(OBJS)/lib/$(OPENSSL) \ + --with-openssl-opt=no-asm \ + --with-http_ssl_module \ + --with-mail_ssl_module \ + --with-stream_ssl_module + + +zip: export + rm -f $(NGINX).zip + + mkdir -p $(TEMP)/$(NGINX)/docs.new + mkdir -p $(TEMP)/$(NGINX)/logs + mkdir -p $(TEMP)/$(NGINX)/temp + + sed -i '' -e "s/$$/`printf '\r'`/" $(TEMP)/$(NGINX)/conf/* + + mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)/docs.new + mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)/docs.new + mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX) + + rm -r $(TEMP)/$(NGINX)/docs + mv $(TEMP)/$(NGINX)/docs.new $(TEMP)/$(NGINX)/docs + + cp -p $(OBJS)/nginx.exe $(TEMP)/$(NGINX) + + $(MAKE) -f docs/GNUmakefile changes + mv $(TEMP)/$(NGINX)/CHANGES* $(TEMP)/$(NGINX)/docs/ + + cp -p $(OBJS)/lib/$(OPENSSL)/LICENSE \ + $(TEMP)/$(NGINX)/docs/OpenSSL.LICENSE + + cp -p $(OBJS)/lib/$(PCRE)/LICENCE \ + $(TEMP)/$(NGINX)/docs/PCRE.LICENCE + + sed -ne '/^ (C) 1995-20/,/^ jloup@gzip\.org/p' \ + $(OBJS)/lib/$(ZLIB)/README \ + > $(TEMP)/$(NGINX)/docs/zlib.LICENSE + + touch -r $(OBJS)/lib/$(ZLIB)/README \ + $(TEMP)/$(NGINX)/docs/zlib.LICENSE + + rm -r $(TEMP)/$(NGINX)/auto + rm -r $(TEMP)/$(NGINX)/misc + rm -r $(TEMP)/$(NGINX)/src + + cd $(TEMP) && zip -r ../$(NGINX).zip $(NGINX) + + +icons: src/os/win32/nginx.ico + +# 48x48, 32x32 and 16x16 icons + +src/os/win32/nginx.ico: src/os/win32/nginx_icon48.xpm \ + src/os/win32/nginx_icon32.xpm \ + src/os/win32/nginx_icon16.xpm + + test -d $(TEMP) || mkdir $(TEMP) + + xpmtoppm --alphaout=$(TEMP)/nginx48.pbm \ + src/os/win32/nginx_icon48.xpm > $(TEMP)/nginx48.ppm + + xpmtoppm --alphaout=$(TEMP)/nginx32.pbm \ + src/os/win32/nginx_icon32.xpm > $(TEMP)/nginx32.ppm + + xpmtoppm --alphaout=$(TEMP)/nginx16.pbm \ + src/os/win32/nginx_icon16.xpm > $(TEMP)/nginx16.ppm + + ppmtowinicon -output src/os/win32/nginx.ico -andpgms \ + $(TEMP)/nginx48.ppm $(TEMP)/nginx48.pbm \ + $(TEMP)/nginx32.ppm $(TEMP)/nginx32.pbm \ + $(TEMP)/nginx16.ppm $(TEMP)/nginx16.pbm diff --git a/app/nginx/misc/README b/app/nginx/misc/README new file mode 100644 index 0000000..3f7b323 --- /dev/null +++ b/app/nginx/misc/README @@ -0,0 +1,13 @@ + +make -f misc/GNUmakefile release + +the required tools: +*) xsltproc to build CHANGES, +*) xslscript.pl ( http://hg.nginx.org/xslscript ) to build XSLTs + from XSLScript sources. + + +make -f misc/GNUmakefile icons + +the required tool: +*) netpbm to create Win32 icons from xpm sources. -- cgit 1.2.3-korg