Skip to content

Build adapter on *BSD

Yuri Voinov edited this page Jan 15, 2020 · 1 revision

Build adapter on *BSD

On modern *BSD (FreeBSD/OpenBSD) default compiler is Clang, which not contain TR1.

Due to compatibility reasons, Measurement Factory still not release new version of dependent library libecap (and, of course, still not modify Squid itself).

To workaround this issue, and build adapter on *BSD anyway, special steps requires.

Install GCC (not included in *BSD by default now):

pkg install lang/gcc

GCC contains TR1 for backward compatibility in STL and can build all.

Then set compiler environments and build zlib:

set CC=`which gcc`
set CXX=`which g++`

./configure && make && make install

Then build libecap (currently 1.0.1) as follows:

./configure 'CXX=/usr/local/bin/g++' 'CXXFLAGS=-O2 -m64 -pipe -fPIC'

make && make install-strip

It is important to explicity specify -fPIC.

Finally, build adapter as follows:

./configure 'CXX=/usr/local/bin/g++' 'CXXFLAGS=-m64 -std=c++11 -fPIC' 'CPPFLAGS=-I/usr/local/include' 'LDFLAGS=-L/usr/local/lib'

make && make install-strip

Configure additional features if requires.

Clone this wiki locally