problem compiling nginx from svn source with http_push_module on windows

Maxim Dounin mdounin at mdounin.ru
Sun Jul 10 18:51:30 MSD 2011


Hello!

On Sat, Jul 09, 2011 at 03:34:43PM -0400, t0meck wrote:

> Hello everyone,
> 
> I'm new to using SVN and what I want to achieve is:
> custom compiled nginx web server with http push module on windows using
> either mingw, cygwin or Visual Studio compilers.
> 
> The problem lies in 2 things:
> 1) after I checked out the svn, it downloaded almost 2 gigabytes of data
> and I don't know how to compile it since in trunk directory there are no
> configure scripts i could run

In svn, configure script is located in auto/configure.  You may 
run as ./auto/configure.  Note there are also other minor layout 
differences from release tarballs (e.g.  building manpage will 
fail).

> 2) after downloading linux version of nginx from nginx.org and unpacking
> it, i tried to configure it but i get error on "checking int size" but
> if i run the configuration script with parameters the windows version of
> nginx from site was compiled with, configuration script finishes without
> problem but then i cannot "make" the source "no rule to make target
> src/os/win32/ngx_win32_config.h..."

There are no win32-related files in release tarballs.

> In this thread http://forum.nginx.org/read.php?2,192475,192511 the
> author of nginx mentions, that there are sources for window on svn so
> i've started to going that way but like i've said i don't know how to
> configure it since there are no configuration scripts there.
> 
> Please help me. I'm struggling with this for some time now and I don't
> know what else I could do.

Right now the only person who knows how to correctly compile 
native nginx for Windows is Igor, and in the message you've 
referenced he clearly states that he isn't going to support 
building procedure.

I was able to compile nginx binary using a combination of MSYS 
environment from MinGW and Visual C compiler, with something like 
this:

./auto/configure --with-cc="cl" --without-http_rewrite_module --without-http_gzip_module
nmake

No idea how it works though.

Attached patch shuts up some warnings as shown by msvc.

Maxim Dounin
-------------- next part --------------
diff -r c63485f64666 src/core/ngx_md5.c
--- a/src/core/ngx_md5.c	Tue Jun 28 13:26:08 2011 +0000
+++ b/src/core/ngx_md5.c	Sun Jul 10 18:48:39 2011 +0400
@@ -82,33 +82,33 @@ ngx_md5_final(u_char result[16], ngx_md5
     ngx_memzero(&ctx->buffer[used], free - 8);
 
     ctx->bytes <<= 3;
-    ctx->buffer[56] = ctx->bytes;
-    ctx->buffer[57] = ctx->bytes >> 8;
-    ctx->buffer[58] = ctx->bytes >> 16;
-    ctx->buffer[59] = ctx->bytes >> 24;
-    ctx->buffer[60] = ctx->bytes >> 32;
-    ctx->buffer[61] = ctx->bytes >> 40;
-    ctx->buffer[62] = ctx->bytes >> 48;
-    ctx->buffer[63] = ctx->bytes >> 56;
+    ctx->buffer[56] = (u_char) ctx->bytes;
+    ctx->buffer[57] = (u_char) (ctx->bytes >> 8);
+    ctx->buffer[58] = (u_char) (ctx->bytes >> 16);
+    ctx->buffer[59] = (u_char) (ctx->bytes >> 24);
+    ctx->buffer[60] = (u_char) (ctx->bytes >> 32);
+    ctx->buffer[61] = (u_char) (ctx->bytes >> 40);
+    ctx->buffer[62] = (u_char) (ctx->bytes >> 48);
+    ctx->buffer[63] = (u_char) (ctx->bytes >> 56);
 
     (void) ngx_md5_body(ctx, ctx->buffer, 64);
 
-    result[0] = ctx->a;
-    result[1] = ctx->a >> 8;
-    result[2] = ctx->a >> 16;
-    result[3] = ctx->a >> 24;
-    result[4] = ctx->b;
-    result[5] = ctx->b >> 8;
-    result[6] = ctx->b >> 16;
-    result[7] = ctx->b >> 24;
-    result[8] = ctx->c;
-    result[9] = ctx->c >> 8;
-    result[10] = ctx->c >> 16;
-    result[11] = ctx->c >> 24;
-    result[12] = ctx->d;
-    result[13] = ctx->d >> 8;
-    result[14] = ctx->d >> 16;
-    result[15] = ctx->d >> 24;
+    result[0] = (u_char) ctx->a;
+    result[1] = (u_char) (ctx->a >> 8);
+    result[2] = (u_char) (ctx->a >> 16);
+    result[3] = (u_char) (ctx->a >> 24);
+    result[4] = (u_char) ctx->b;
+    result[5] = (u_char) (ctx->b >> 8);
+    result[6] = (u_char) (ctx->b >> 16);
+    result[7] = (u_char) (ctx->b >> 24);
+    result[8] = (u_char) ctx->c;
+    result[9] = (u_char) (ctx->c >> 8);
+    result[10] = (u_char) (ctx->c >> 16);
+    result[11] = (u_char) (ctx->c >> 24);
+    result[12] = (u_char) ctx->d;
+    result[13] = (u_char) (ctx->d >> 8);
+    result[14] = (u_char) (ctx->d >> 16);
+    result[15] = (u_char) (ctx->d >> 24);
 
     ngx_memzero(ctx, sizeof(*ctx));
 }


More information about the nginx mailing list