Features of ngx_wizard
:
- Bleading Edge ;
- Self Contained Package ;
- Compiled from scratch ;
- Based on shared libraries ;
- LibreSSL as SSL library ;
- PCRE Jit as RegEx library ;
- Brotli compression dynamic module ;
- Atomic & Jemalloc for internal purpose ;
Simple wizard for compiling nginx from scratch, independently from distros.
This script is provided AS IS & comes with ABSOLUTELY NO WARRANTY.
I may need help to tweak with-cc-opt
& with-ld-opt
.
You need to install git
, curl
, make
and gcc
(or clang
).
Then, run this command:
bash <(curl https://gist.githubusercontent.com/concatime/36d58b967c7ef7f66e7acee91aea973c/raw/.sh)
And…, that's it!
Note: You could specify which c compiler will be use by typing CC=gcc-X
or CC=clang
, followed by the command.
Why I used shared version of nginx?
- Inside builded Makefile are really crap. See this as a concrete example.
- Following the same vibe, nginx makefile requires a c++ compiler for PCRE. I tried
--with-pcre-opt=--disable-cpp
, in vain. - Upgrading parts seamlessly, without recompiling everything.
- Libatomic without docs.
- Jemalloc with pkgconfig.
- Brotli module needs a release.
Those are warnings I get usnig gcc-7.1.1
:
- FIXED in master,
but I'm waiting final releaseAPPLIED - ivmai/libatomic_ops#27
atomic_ops/sysdeps/standard_ao_double_t.h:35:37: warning: ‘-pedantic’ is not an option that controls warnings [-Wpragmas]
# pragma GCC diagnostic ignored "-pedantic"
^~~~~~~~~~~
- PENDING - libressl/portable#336
CC asn1/libcrypto_la-a_bitstr.lo
asn1/a_bitstr.c: In function 'i2c_ASN1_BIT_STRING':
asn1/a_bitstr.c:121:2: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
memcpy(p, d, len);
^~~~~~~~~~~~~~~~~
[…]
Making install in ssl
[…]
CC d1_both.lo
d1_both.c: In function 'dtls1_retransmit_message':
d1_both.c:1147:3: warning: 'save_write_sequence' may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(S3I(s)->write_sequence, save_write_sequence,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sizeof(S3I(s)->write_sequence));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[…]
CC s3_lib.lo
s3_lib.c: In function 'ssl3_handshake_msg_finish':
s3_lib.c:1516:17: warning: variable 'd' set but not used [-Wunused-but-set-variable]
unsigned char *d, *p;
- PENDING - Brotli module not using Brotli 0.6.0 API.
../ngx_brotli/src/ngx_http_brotli_filter_module.c:272:9: warning: ‘BrotliEncoderInputBlockSize’ is deprecated [-Wdeprecated-declarations]
ctx->brotli_ring = BrotliEncoderInputBlockSize(ctx->encoder);
^~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:220:41: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API size_t BrotliEncoderInputBlockSize(
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_create_encoder’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:427:16: warning: ‘kBrotliMinWindowBits’ is deprecated [-Wdeprecated-declarations]
&& wbits > kBrotliMinWindowBits)
^~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:39:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMinWindowBits =
^~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_add_data’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:498:5: warning: ‘BrotliEncoderCopyInputToRingBuffer’ is deprecated [-Wdeprecated-declarations]
BrotliEncoderCopyInputToRingBuffer(ctx->encoder, size, b->pos);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:224:39: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API void BrotliEncoderCopyInputToRingBuffer(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_filter_process’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:534:5: warning: ‘BrotliEncoderWriteData’ is deprecated [-Wdeprecated-declarations]
if (!BrotliEncoderWriteData(ctx->encoder, ctx->last, ctx->flush, &size,
^~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:229:46: note: declared here
BROTLI_DEPRECATED BROTLI_ENC_API BROTLI_BOOL BrotliEncoderWriteData(
^~~~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c: In function ‘ngx_http_brotli_window’:
../ngx_brotli/src/ngx_http_brotli_filter_module.c:903:5: warning: ‘kBrotliMaxWindowBits’ is deprecated [-Wdeprecated-declarations]
wbits = kBrotliMaxWindowBits;
^~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:41:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMaxWindowBits =
^~~~~~~~~~~~~~~~~~~~
../ngx_brotli/src/ngx_http_brotli_filter_module.c:904:5: warning: ‘kBrotliMinWindowBits’ is deprecated [-Wdeprecated-declarations]
mbits = kBrotliMinWindowBits;
^~~~~
In file included from ../ngx_brotli/src/ngx_http_brotli_filter_module.c:16:0:
../ngx_brotli/deps/brotli/include/brotli/encode.h:39:36: note: declared here
BROTLI_DEPRECATED static const int kBrotliMinWindowBits =
^~~~~~~~~~~~~~~~~~~~