[squid-users] Compiling squid 3.5.4 with ecap enabled.

Amos Jeffries squid3 at treenet.co.nz
Thu May 21 10:01:20 UTC 2015


On 21/05/2015 7:58 p.m., Ashish Behl wrote:
> Hello All,
> I am trying to compile squid with ecap enabled (--enable-ecap)
> I have compiled ecap already and placed the install files in /opt/ecap-1.0
> 
> =========================================================
> curl -LOR http://www.measurement-factory.com/tmp/ecap/libecap-1.0.0.tar.gz
> tar -xzvf libecap-1.0.0.tar.gz && cd libecap-1.0.0.tar.gz
> ./configure --prefix=/opt/ecap-1.0 'CXXFLAGS=-O2 -pipe' 'CFLAGS=-O2 -pipe'
> make
> sudo make install
> =========================================================
> 
> I then try to compile squid in following ways (ommitted other options,
> thought they are non-relevant):
> 
> a)
> ./configure --prefix=/usr CFLAGS="-g -O2 -fPIC -Wall" LDFLAGS="-fPIC -pie
> -Wl,-z,relro -Wl,-z,now" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2
> -fPIC " --enable-ecap PKG_CONFIG_PATH=/opt/ecap-1.0/lib/pkgconfig
> 
> b)
> ./configure --prefix=/usr CFLAGS="-g -O2 -fPIC -Wall" LDFLAGS="-fPIC -pie
> -Wl,-z,relro -Wl,-z,now" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2
> -fPIC " --enable-ecap PKG_CONFIG=/opt/ecap-1.0/lib/pkgconfig/libecap.pc
> 
> c)
> ./configure --prefix=/usr CFLAGS="-g -O2 -fPIC -Wall" LDFLAGS="-fPIC -pie
> -Wl,-z,relro -Wl,-z,now" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2
> -fPIC " --enable-ecap PKG_CONFIG=/opt/ecap-1.0/lib/pkgconfig/libecap.pc
> EXT_LIBECAP_CFLAGS='-I/opt/ecap-1.0/include -L/opt/ecap-1.0/lib'
> EXT_LIBECAP_LIBS='/opt/ecap-1.0/lib/libecap.a'
> 

FYI:  PKG_CONFIG_PATH is the path to the pkg-config binary.

All you should need after the libecap "make install" is:
 ./configure --prefix=/usr --enable-ecap


> 
> I am not able to succeed and always get undefined references for libecap
> methods.
> Please let me know if anyone has tried it already, or there is a bug..
> 
> 
> compiling output:
> =========================================================
> adaptation/.libs/libadaptation.a(libsquid_ecap_la-Host.o): In function
> `Adaptation::Ecap::Host::Host()':

There is a bug. The libecap library headers do not support C++11
compilers properly.

The libecap authors referred me to the patch found at
<https://github.com/freebsd/freebsd-ports/blob/master/www/libecap/files/patch-src__libecap__common__area.h>
when I encountered this earlier. They are already working on a better
fix that will be in a future release of libecap.

Amos


More information about the squid-users mailing list