Hi all, 

I'm actually trying to compile nginx to use modsecurity, my compilation fails at modesecurity level with following output:

gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/apache2 -I /usr/include/apr-1.0 -I ../mod_security/nginx/modsecurity/../../standalone -I ../mod_security/nginx/modsecurity/../../apache2 -I /usr/include/libxml2 -I ../pcre-8.31 -I ../zlib-1.2.7 -I objs -I src/http -I src/http/modules -I src/mail \
                -o objs/addon/modsecurity/ngx_http_modsecurity.o \
                ../mod_security/nginx/modsecurity/ngx_http_modsecurity.c
../mod_security/nginx/modsecurity/ngx_http_modsecurity.c: In function ‘ngx_http_do_read_upload_client_request_body’:
../mod_security/nginx/modsecurity/ngx_http_modsecurity.c:471:33: error: variable ‘rc’ set but not used [-Werror=unused-but-set-variable]
../mod_security/nginx/modsecurity/ngx_http_modsecurity.c: In function ‘modsecurity_read_body_cb’:
../mod_security/nginx/modsecurity/ngx_http_modsecurity.c:782:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/modsecurity/ngx_http_modsecurity.o] Erreur 1
make[1]: quittant le répertoire « /root/modsecurity_nginx/nginx-1.2.4 »
make: *** [build] Erreur 2

Using versions:

modsecurity-apache_2.7.0.tar.gz
nginx-1.2.4.tar.gz
pcre-8.31.tar.gz
zlib-1.2.7.tar.gz

Also tried with modsecurity apache 2.7.1 with same result, i had no error when configuring and compilating modsec.

Options i used to configure nginx:

./configure --add-module=../mod_security/nginx/modsecurity --with-http_ssl_module --with-pcre=../pcre-8.31 --with-zlib=../zlib-1.2.7 --pid-path=/var/run --error-log-path=/var/log/nginx --http-log-path=/var/log/nginx

output configure for modsecurity:

./configure --enable-standalone-module
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... armv6l-unknown-linux-gnueabi
checking host system type... armv6l-unknown-linux-gnueabi
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gawk... (cached) gawk
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for perl... /usr/bin/perl
checking for env... /usr/bin/env
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for C/C++ restrict keyword... __restrict
checking for pid_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for atexit... yes
checking for getcwd... yes
checking for memmove... yes
checking for memset... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strrchr... yes
checking for strstr... yes
checking for strtol... yes
checking for fchmod... yes
checking for strcasestr... yes
Checking plataform... Identified as Linux
configure: looking for Apache module support via DSO through APXS
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
configure: found apxs at /usr/bin/apxs2
configure: checking httpd version
configure: httpd is recent enough
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
Use of uninitialized value $includedir in concatenation (.) or string at (eval 9) line 1.
checking for libpcre config script... /usr/bin/pcre-config
configure: using pcre v8.30
checking for libapr config script... /usr/bin/apr-1-config
configure: using apr v1.4.6
checking for libapu config script... /usr/bin/apu-1-config
configure: using apu v1.4.1
checking for libxml2 config script... /usr/bin/xml2-config
checking if libxml2 is at least v2.6.29... yes, 2.8.0
configure: using libxml2 v2.8.0
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for liblua config script... no
checking for lua install... no
configure: optional lua library not found
checking for libcurl config script... /usr/bin/curl-config
checking if libcurl is at least v... yes, 7.26.0
checking if libcurl is linked with gnutls... no
configure: using curl v7.26.0
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tools/Makefile
config.status: creating apache2/Makefile
config.status: creating standalone/Makefile
config.status: creating build/apxs-wrapper
config.status: creating mlogc/mlogc-batch-load.pl
config.status: creating tests/run-unit-tests.pl
config.status: creating tests/run-regression-tests.pl
config.status: creating tests/gen_rx-pm.pl
config.status: creating tests/csv_rx-pm.pl
config.status: creating tests/regression/server_root/conf/httpd.conf
config.status: creating tools/rules-updater.pl
config.status: creating mlogc/Makefile
config.status: creating tests/Makefile
config.status: creating apache2/modsecurity_config_auto.h
config.status: apache2/modsecurity_config_auto.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands


output configure for nginx:

checking for OS
 + Linux 3.2.27+ armv6l
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.6.3 (Debian 4.6.3-8+rpi1) 
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... not found
checking for nogroup group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 4 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 4 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
configuring additional modules
adding module in ../mod_security/nginx/modsecurity
 + ngx_http_modsecurity was configured
checking for OpenSSL library ... found
creating objs/Makefile

Configuration summary
  + using PCRE library: ../pcre-8.31
  + using system OpenSSL library
  + md5: using OpenSSL library
  + sha1: using OpenSSL library
  + using zlib library: ../zlib-1.2.7

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/var/run"
  nginx error log file: "/var/log/nginx"
  nginx http access log file: "/var/log/nginx"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

 
Have i missed something ? Any help would be very appreciated ^^

Thanks!

Guilhem