How to Build Squid 3.5 for Windows on Cygwin

Note

Please join our humble efforts to provide ready to run MSI installer for Squid on Microsoft Windows with all required dependencies at GitHub - https://github.com/diladele/squid3-windows. Please report all issues/bugs/feature requests at GitHub project. Issues about the MSI installer only can also be reported to support@diladele.com. The MSI for latest released Squid for Windows is available from http://squid.diladele.com

This post explains how to build latest Squid 3.5 for Microsoft Windows using Cygwin.

  1. Install Cygwin (tested with 64 bit) including:

    • gcc core
    • gcc g++
    • gcc tools epoch
    • gcc make dep
    • gdb (if you would like to debug squid in case of any problems)
    • make
    • automake (and automake last version)
    • autoconf
    • libtool
  2. For some of the advanced external modules consider also installing:

    • cppunit
    • libcom_err-devel
    • libcrypt-devel
    • libdb-devel
    • libexpat-devel
    • libkrb5-devel
    • libiconv-devel
    • openldap-devel
    • openssl-devel
    • libsasl2-devel
    • libxml2-devel
    • perl-DBI
  3. Download latest stable version of Squid from http://www.squid-cache.org/Versions/v3/3.5/, for example 3.5.11.tar.gz to the /usr/src

  4. Unpack squid: tar -xvf squid-3.5.11.tar.gz

  5. Download this patch and apply it inside the /usr/src/squid-3.5.11 (the patch allows increasing the number of file descriptors from 256 to 3200 on cygwin)

    • patch -p1 < 3-5-11.patch
  6. for configure we use this command (written as ONE line!)

    ./configure --bindir=/bin/squid --sbindir=/usr/sbin/squid --sysconfdir=/etc/squid
        --datadir=/usr/share/squid --libexecdir=/usr/lib/squid --disable-strict-error-checking
        --with-logdir=/var/log/squid --with-swapdir=/var/cache/squid
        --with-pidfile=/var/run/squid.pid --enable-ssl --enable-delay-pools
        --enable-ssl-crtd --enable-icap-client --enable-esi --disable-eui
        --localstatedir=/var/run/squid --sharedstatedir=/var/run/squid
        --datarootdir=/usr/share/squid --enable-disk-io="AIO,Blocking,DiskThreads,IpcIo,Mmapped"
        --enable-auth-basic="DB,LDAP,NCSA,POP3,RADIUS,SASL,SMB,fake,getpwnam"
        --enable-auth-ntlm='fake' --enable-auth-negotiate='kerberos,wrapper'
        --enable-external-acl-helpers='LDAP_group,SQL_session,eDirectory_userip,file_userip,kerberos_ldap_group,session,time_quota,unix_group,wbinfo_group'
        --with-openssl --with-filedescriptors=65536
        --enable-removal-policies="lru,heap"
    
  7. make

  8. make install

Wait until Squid is built and watch out for possible errors!