Trying to build nginx with njs module on Windows

Geoff Bache geoff.bache at
Wed Aug 31 14:59:40 UTC 2022

Hi all,

I'm having trouble building from source with the njs module included (which
seems to be the only way to get this module on Windows, right?)

I am following the advice on


All seems to go fine with the build in msys2, using nmake from VS Build
Tools as indicated above, until it gets around to the njs module, when I get

cd /home/SEGEBAC1/src/njs/nginx/..  && if [ -f build/Makefile ]; then
"C:\Program Files (x86)\Microsoft Visual
clean; fi  && CFLAGS="-O2  -W4 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb
-DFD_SETSIZE=1024 -DNO_SYS_TYPES_H" CC="cl" ./configure --no-openssl
--no-pcre  && "C:\Program Files (x86)\Microsoft Visual
-f was unexpected at this time.
NMAKE : fatal error U1077: 'cd' : return code '0x1'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
: return code '0x2'

Any ideas? I tried executing these command separately, but then I get

MSYS ~/src/njs
$  CFLAGS="-O2  -W4 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb -DFD_SETSIZE=1024
-DNO_SYS_TYPES_H" CC="cl" ./configure --no-openssl --no-pcre
configuring for MSYS_NT-10.0-19042 3.3.5-341.x86_64 unknown
checking for C compiler: cl
auto/cc: line 16: [: too many arguments
auto/cc: line 62: NJS_CC_NAME: unbound variable

which seems to indicate that the njs module does not handle the Visual
Studio compiler, which seems odd in combination with the suggestions above
to use nmake. Providing gcc does not help either, as then I get

MSYS ~/src/njs
$  CFLAGS="-O2  -W4 -WX -nologo -MT -Zi -Fdobjs/nginx.pdb -DFD_SETSIZE=1024
-DNO_SYS_TYPES_H" CC="gcc" ./configure --no-openssl --no-pcre
configuring for MSYS_NT-10.0-19042 3.3.5-341.x86_64 unknown
checking for C compiler: gcc
 + using GNU C compiler
 + gcc version 8.3.0 (x86_64-posix-seh, Built by project)
checking for sizeof(int) ... not found
checking for sizeof(u_int) ... not found
checking for sizeof(void *) ... not found
checking for sizeof(uintptr_t) ... not found
checking for sizeof(size_t) ... not found
checking for sizeof(off_t) ... not found
checking for sizeof(time_t) ... not found
checking for system byte ordering ... not found

./configure: error: cannot detect system byte ordering

Grateful for any help and suggestions.

Geoff Bache
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list