Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

nginx compilation failing with 2.7.0

2012-10-22
2013-09-18
  • Richard Mott
    Richard Mott
    2012-10-22

    I am building modsecurity 2.7.0 with nginx 1.2.4 (latest stable) on up-to-date Centos 6.3. The standalone build works fine.
    Problem 1:
    Then the nginx configure appears to work but the following make show two mistakes in the "_I" includes. First apr-1.0 should be apr-1, and secondly /usr/include/httpd is missing. So I modified modsecurity-apache_2.7.0/nginx/modsecurity/config to be

    CORE_INCS="$CORE_INCS /usr/include/apache2 /usr/include/apr-1 /usr/include/httpd $ngx_addon_dir/../../standalone $ngx_addon_dir/../../apache2 /usr/include/libxml2"
    

    Problem 2:
    Now, after running nginx ./configure and make, all needed files are found, but compiling  ngx_http_modsecurity.c fails with this error

    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 -I /usr/include/httpd -I ../modsecurity-apache_2.7.0/nginx/modsecurity/../../standalone -I ../modsecurity-apache_2.7.0/nginx/modsecurity/../../apache2 -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/mail \
                    -o objs/addon/modsecurity/ngx_http_modsecurity.o \
                    ../modsecurity-apache_2.7.0/nginx/modsecurity/ngx_http_modsecurity.c
    cc1: warnings being treated as errors
    ../modsecurity-apache_2.7.0/nginx/modsecurity/ngx_http_modsecurity.c: In function modsecurity_read_body_cb:
    ../modsecurity-apache_2.7.0/nginx/modsecurity/ngx_http_modsecurity.c:782: error: comparison between signed and unsigned integer expressions
    make[1]: *** [objs/addon/modsecurity/ngx_http_modsecurity.o] Error 1
    

    Am I doing something wrong? Is this a known problem?