[squid-users] Compile install Squid, configure default options.

Mike mcsnv96 at afo.net
Tue Jan 12 20:19:47 UTC 2016


When I used CentOS 7 (a variation of it), this is what I had to use:

  *

    yum -y install perl gcc gcc-c++ autoconf automake make

  *

    *yum -**y **install epel-release*

      o

        (has a few packages we need below)

  *

    yum -y install libxml2-devel libcap-devel avr-gcc-c++

  *

    yum -y install libtool-ltdl-devel openssl-devel

  *

    yum -y install ksh perl-Crypt-OpenSSL-X509

I prefer separate lines with only a few to be installed since if theres 
a problem with one, it is more likely to show an error rather than be 
buried.


With 3.5.5 they made some changes so for 3.5.5 and newer, certain 
configure options no longer work that previously did as far back as 
3.1.x. This is for 64bit, there are a few small differences for 32 bit OS.

  *

    ./configure '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
    '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
    '--datadir=/usr/share' '--includedir=/usr/include'
    '--libdir=/usr/lib64' '--libexecdir=/usr/libexec'
    '--sharedstatedir=/var/lib' '--mandir=/usr/share/man'
    '--infodir=/usr/share/info' '--exec_prefix=/usr'
    '--libexecdir=/usr/lib64/squid' '--localstatedir=/var'
    '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid'
    '--with-logdir=$(localstatedir)/log/squid'
    '--with-pidfile=$(localstatedir)/run/squid.pid'
    '--disable-dependency-tracking' '--enable-follow-x-forwarded-for'
    '--enable-cache-digests' '--enable-cachemgr-hostname=localhost'
    '--enable-delay-pools' '--enable-epoll' '--enable-icap-client'
    '--enable-ident-lookups' '--enable-linux-netfilter'
    '--enable-removal-policies=heap,lru' '--enable-snmp'
    '--enable-storeio=aufs,diskd,ufs,rock' '--enable-wccpv2'
    '--enable-esi' '--enable-ssl' '--enable-ssl-crtd' '--enable-icmp'
    '--with-aio' '--with-default-user=squid'
    '--with-filedescriptors=1024' '--with-dl' '--with-openssl'
    '--with-pthreads' '--with-included-ltdl' '--disable-arch-native'
    'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
    -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
    'CXXFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
    -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
    -fPIC' 'PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig'



There are small variations in CentOS that make it different from other 
linux operating systems, so when I've had issues with missing configure 
options, I installed the available version from yum, then went through 
one by one and found what I needed, mirrored it to an extent for 
building from source. I also added my ssl based options.
I have 2 different CentOS 7 based systems running squid with no problems 
using this setup.

Mike





On 1/12/2016 13:34 PM, Billy.Zheng(zw963) wrote:
>>> Or, just tell me, this worked, it is fine, and I will very happy to use.
>>>
>>> btw: When I first install, ./configure is passed, but make is failed.
>>> because I am not install gcc-c++. I have to install gcc-c++, reconfigure
>>> again, make is passed. I thought if ./configure could detect gcc-c++
>>> is not installed, will more good.
>> What C++ compiler did you have installed instead of gcc-c++ ?
> I use CentOS 7.0 in VPS.
>
> I just follow squid document from here: http://wiki.squid-cache.org/SquidFaq/CompilingSquid
>
> with following operation:
>
> [root at vultr squid-3.5.12]# yum install -y perl gcc autoconf automake make sudo wget
> [root at vultr squid-3.5.12]# yum install openssl-devel
> [root at vultr squid-3.5.12]# g++
> -bash: g++: command not found
>
> and then run my new config, Thanks for guide.
>
>      ./configure --build=x86_64-linux-gnu \
>          --prefix=/usr \
>          --exec-prefix=/usr \
>          '--bindir=${prefix}/bin' \
>          '--sbindir=${prefix}/sbin' \
>          '--libdir=${prefix}/lib64' \
>          '--libexecdir=${prefix}/lib64/squid' \
>          '--includedir=${prefix}/include' \
>          '--datadir=${prefix}/share/squid' \
>          '--mandir=${prefix}/share/man' \
>          '--infodir=${prefix}/share/info' \
>          --localstatedir=/var \
>          '--with-logdir=${localstatedir}/log/squid' \
>          '--with-pidfile=${localstatedir}/run/squid.pid' \
>          '--with-swapdir=${localstatedir}/spool/squid' \
>          --sysconfdir=/etc/squid \
>          --with-openssl \
>          --with-default-user=squid \
>          --with-filedescriptors=16384
>
> it worked. and end with Makefile created.
>
> It seem like not c++ compile included initially, ./configure is not detect out
> for it for this OS, so no any error occur.
>
> when I run make, it told me `g++: command not found'
>
> [root at vultr squid-3.5.12]# make
> Making all in compat
> make[1]: Entering directory `/root/squid-3.5.12/compat'
> source='assert.cc' object='assert.lo' libtool=yes \
> DEPDIR=.deps depmode=none /bin/sh ../cfgaux/depcomp \
> /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H   -I.. -I../include -I../lib -I../src -I../include   -I../libltdl    -c -o assert.lo assert.cc
> libtool: compile:  g++ -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include -I../libltdl -c assert.cc  -o .libs/assert.o
> ../libtool: line 1125: g++: command not found
> make[1]: *** [assert.lo] Error 1
> make[1]: Leaving directory `/root/squid-3.5.12/compat'
> make: *** [all-recursive] Error 1
>
> following is a part of ./configure output:
>
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether make supports nested variables... yes
> checking whether UID '0' is supported by ustar format... yes
> checking whether GID '0' is supported by ustar format... yes
> checking how to create a ustar tar archive... gnutar
> checking whether to enable maintainer-specific portions of Makefiles... no
> 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 whether gcc understands -c and -o together... yes
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking for g++... no
> checking for c++... no
> checking for gpp... no
> checking for aCC... no
> checking for CC... no
> checking for cxx... no
> checking for cc++... no
> checking for cl.exe... no
> checking for FCC... no
> checking for KCC... no
> checking for RCC... no
> checking for xlC_r... no
> checking for xlC... no
> checking whether we are using the GNU C++ compiler... no
> checking whether g++ accepts -g... no
> checking dependency style of g++... none
> checking build system type... x86_64-pc-linux-gnu
> checking host system type... x86_64-pc-linux-gnu
> configure: CPU arch native optimization enabled: auto
> checking whether compiler accepts -march=native... no
> checking simplified host os... linux (version )
> checking what kind of compiler we're using... none
> checking whether g++ supports C++11 features by default... no
> checking whether g++ supports C++11 features with -std=c++11... no
> checking whether g++ supports C++11 features with -std=c++0x... no
> configure: No compiler with C++11 support was found
> checking for ranlib... ranlib
> checking how to run the C preprocessor... gcc -E
> checking whether ln -s works... yes
> checking for egrep... /usr/bin/egrep
> checking for sh... /usr/bin/sh
> checking for false... /usr/bin/false
> checking for true... /usr/bin/true
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160112/8673a49d/attachment.html>


More information about the squid-users mailing list