Skip to content

compiling modsecurity fails to find curl.h using --with-curl=  #2519

Closed
@amsnek

Description

@amsnek

Describe the bug

When compiling modsecurity with local compiled versions of curl/yajl/pcre, it fails to find the curl.h on make stage.

./configure --prefix=$MODSEC--disable-apache2-module --without-lua --with-pcre=$PCRE --with-yajl=$YAJL --with-curl=$CURL

ModSecurity - v3.0.4 for Linux

 Mandatory dependencies
   + libInjection                                  ....v3.9.2-30-gbf234eb
   + SecLang tests                                 ....c8cf2c5

 Optional dependencies
   + GeoIP/MaxMind                                 ....not found
   + LibCURL                                       ....found v7.75.0
      -L/builds/work/target/curl-7.75.0/lib -lcurl -lz -pthread, -DCURL_STATICLIB -I/builds/work/target/curl-7.75.0/include -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL
   + YAJL                                          ....found
      -lyajl, -DWITH_YAJL -I/builds/work/target/yajl-2.1.0/include
   + LMDB                                          ....not found
   + LibXML2                                       ....found v2.9.1
      -lxml2 -lz -lm -ldl, -I/usr/include/libxml2 -DWITH_LIBXML2
   + SSDEEP                                        ....not found
   + LUA                                           ....disabled

 Other Options
   + Test Utilities                                ....enabled
   + SecDebugLog                                   ....enabled
   + afl fuzzer                                    ....disabled
   + library examples                              ....enabled
   + Building parser                               ....disabled
   + Treating pm operations as critical section    ....disabled

looks good -> running make

$ make
Making all in others
make[1]: Entering directory `/builds/work/modsecurity-v3.0.4/others'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/builds/work/modsecurity-v3.0.4/others'
Making all in src
make[1]: Entering directory `/builds/work/modsecurity-v3.0.4/src'
make  all-recursive
make[2]: Entering directory `/builds/work/modsecurity-v3.0.4/src'
make[3]: Entering directory `/builds/work/modsecurity-v3.0.4/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers     -DWITH_YAJL -I/builds/work/target/yajl-2.1.0/include  -I/builds/work/target/pcre-8.44/include -DPCRE_STATIC -DPCRE_HAVE_JIT    -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT libmodsecurity_la-modsecurity.lo -MD -MP -MF .deps/libmodsecurity_la-modsecurity.Tpo -c -o libmodsecurity_la-modsecurity.lo `test -f 'modsecurity.cc' || echo './'`modsecurity.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_YAJL -I/builds/work/target/yajl-2.1.0/include -I/builds/work/target/pcre-8.44/include -DPCRE_STATIC -DPCRE_HAVE_JIT -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-modsecurity.lo -MD -MP -MF .deps/libmodsecurity_la-modsecurity.Tpo -c modsecurity.cc  -fPIC -DPIC -o .libs/libmodsecurity_la-modsecurity.o
modsecurity.cc:29:23: fatal error: curl/curl.h: No such file or directory
 #include <curl/curl.h>

but the file is there

$ ls -l /builds/work/target/curl-7.75.0/include/curl/
total 228
-rw-r--r--. 1 root root 118322 Feb 24 09:12 curl.h
-rw-r--r--. 1 root root   3035 Feb 24 09:12 curlver.h
-rw-r--r--. 1 root root   3980 Feb 24 09:12 easy.h
-rw-r--r--. 1 root root   2069 Feb 24 09:12 mprintf.h
-rw-r--r--. 1 root root  17207 Feb 24 09:12 multi.h
-rw-r--r--. 1 root root   2379 Feb 24 09:12 options.h
-rw-r--r--. 1 root root   1339 Feb 24 09:12 stdcheaders.h
-rw-r--r--. 1 root root  19028 Feb 24 09:12 system.h
-rw-r--r--. 1 root root  42738 Feb 24 09:12 typecheck-gcc.h
-rw-r--r--. 1 root root   4486 Feb 24 09:12 urlapi.h

curl-config knows it too

$ /builds/work/target/curl-7.75.0/bin/curl-config --cflags -DCURL_STATICLIB -I/builds/work/target/curl-7.75.0/include

Workaround: copy /builds/work/target/curl-7.75.0/include/curl/ to /usr/include -> it finds it.

Expected behavior
find curl.h if correctly provided with --with-curl=/path/to/self/compiled/curl
make succeeding

Server (please complete the following information):

  • Modsecurity 3.0.4
  • Curl 7.75.0
  • OS RHEL7

Metadata

Metadata

Assignees

Labels

3.xRelated to ModSecurity version 3.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions