<div dir="ltr">Some day ago, I made it. Just share.<br><br>Ready<br>Step 1: Install cygwin.<br><br>    <a href="https://cygwin.com/install.html">https://cygwin.com/install.html</a><br><br>Step 2: Get squid-3.3.3-2 src by cygwin setup-x86.exe or setup-x86_64.exe. They are GUI package manager of cygwin.<br><br>    HDM@HDM-PC /usr/src/squid-3.3.3-2.src<br>    $ ls<br>    3.3.3-cygwin.patch squid.cygport squid-3.3.3.tar.bz2 squid-3.3.3.tar.bz2.asc<br><br>    3.3.3-cygwin.patch is used to patch squid-3.3.3-2 src.<br>    squid.cygprot. we will introduce it later.<br><br>Step 3: Install cygport by setup-x86.exe or setup-x86_64.exe. We will use cygport to unpack sources, apply patches and compile squid-3.3.3.-2. squid.cygprot tell cygport how to compile squid-3.3.3-3. Please look the content of it.<br><br>Compile eCAP<br>Step 1: compile ecap-0.2.0 as before.<br><br>    HDM@HDM-PC /usr/src/ecap-0.2.0<br>    $ ./configure && make<br><br>Now, We get libcommon.a, libadapter.a and libhost.a<br><br>Step 2: link it by runing command as following.<br><br>    HDM@HDM-PC /usr/src/libecap-0.2.0/src/libecap<br>    $ g++ -shared -o cygecap.dll -Wl,--out-implib=libecap.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive common/.libs/libcommon.a adapter/.libs/libadapter.a host/.libs/libhost.a -Wl,--no-whole-archive -lstdc++ -lm -lc<br><br>    HDM@HDM-PC /usr/src/libecap-0.2.0/src/libecap<br>        $ ls | grep dll || a<br>        cygecap.dll<br>        libecap.dll.a<br><br>Compile Squid-3.3.3-2<br>Step 1: copy libecap.dll.a to /usr/lib and copy cygecap.dll to /usr/bin<br><br>    HDM@HDM-PC /usr/lib<br>    $ ls | grep libecap<br>    libecap.dll.a<br>    HDM@HDM-PC /usr/bin<br>    $ ls | grep cygecap<br>    cygecap.dll<br><br>Step 2: Add --enable-ecap option by editing squid.cygport file<br>////////////////////////squid.cygport/////////////////////////<br>.<br>.<br>.<br>src_compile() {<br>        cd ${S}<br>        ./bootstrap.sh<br>        lndirs<br>        cd ${B}<br>        cygconf \<br>          --sysconfdir=/etc/squid \<br>          --datadir=/usr/share/squid \<br>          --libexecdir=/usr/lib/squid \<br>          --disable-strict-error-checking \<br>          --with-logdir=/var/log/squid \<br>          --with-swapdir=/var/cache/squid \<br>          --with-pidfile=/var/run/squid.pid \<br>          --enable-ecap \<br>          --enable-ssl \<br>          --enable-esi \<br>          --enable-disk-io="AIO,Blocking,DiskThreads,IpcIo,Mmapped" \<br>          --enable-auth-basic="DB,LDAP,MSNT,MSNT-multi-domain,NCSA,POP3,RADIUS,SASL,SMB,fake,getpwnam" \<br>          --enable-auth-ntlm='fake,smb_lm' \<br>          --enable-auth-negotiate='kerberos,wrapper' \<br>          --enable-external-acl-helpers='LDAP_group,SQL_session,eDirectory_userip,file_userip,kerberos_ldap_group,session,time_quota,unix_group,wbinfo_group' \<br>          --with-filedescriptors=3072<br><br>        # FIXME: error: 'snprintf' was not declared in this scope<br>        for fn in `find . -name Makefile`<br>        do<br>          sed -i -e "s#c++0x#gnu++0x#" ${fn}<br>        done<br><br>        make<br>}<br>.<br>.<br>.<br>///////////////////////////////////squid.cygport////////////////////////////<br><br>Step 3: compile squid-3.3.3-2 src. Then we can get .o files.<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src<br>  $ ls<br>  3.3.3-cygwin.patch squid.cygport squid-3.3.3.tar.bz2 squid-3.3.3.tar.bz2.asc squid-3.3.3-2.i686<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src<br>  $ cygport --32 squid.cygport prep compile install<br><br>Step 4: link it by runing command as following.<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src/squid-3.3.3-2.i686/src/squid-3.3.3/src<br>  $ g++ -Wall -Wpointer-arith -Wwrite-strings -Wcomments -pipe -D_REENTRANT -g -O2 -std=gnu++0x .libs/squid.exeS.o -g -o squid.exe AclRegs.o AuthReg.o AccessLogEntry.o AsyncEngine.o YesNoNone.o cache_cf.o CacheDigest.o cache_manager.o carp.o cbdata.o ChunkedCodingParser.o client_db.o client_side.o client_side_reply.o client_side_request.o BodyPipe.o clientStream.o CompletionDispatcher.o ConfigOption.o ConfigParser.o CpuAffinity.o CpuAffinityMap.o CpuAffinitySet.o debug.o disk.o DiskIO/DiskIOModule.o DiskIO/ReadRequest.o DiskIO/WriteRequest.o dlink.o dns_internal.o DnsLookupDetails.o errorpage.o ETag.o event.o EventLoop.o external_acl.o ExternalACLEntry.o FadingCounter.o fatal.o fd.o fde.o filemap.o forward.o fqdncache.o ftp.o gopher.o helper.o HelperChildConfig.o htcp.o http.o HttpStatusLine.o HttpHdrCc.o HttpHdrRange.o HttpHdrSc.o HttpHdrScTarget.o HttpHdrContRange.o HttpHeader.o HttpHeaderTools.o HttpBody.o HttpMsg.o HttpParser.o HttpReply.o RequestFlags.o HttpRequest.o HttpRequestMethod.o icp_v2.o icp_v3.o int.o internal.o ipc.o ipcache.o SquidList.o main.o mem.o mem_node.o MemBuf.o MemObject.o mime.o mime_header.o multicast.o neighbors.o Packer.o Parsing.o pconn.o peer_digest.o peer_proxy_negotiate_auth.o peer_select.o peer_sourcehash.o peer_userhash.o redirect.o refresh.o RemovalPolicy.o send-announce.o MemBlob.o snmp_core.o snmp_agent.o SquidMath.o SquidNew.o stat.o StatCounters.o StatHist.o String.o StrList.o stmem.o store.o StoreFileSystem.o store_io.o StoreIOState.o store_client.o store_digest.o store_dir.o store_key_md5.o store_log.o store_rebuild.o store_swapin.o store_swapmeta.o store_swapout.o StoreMeta.o StoreMetaMD5.o StoreMetaSTD.o StoreMetaSTDLFS.o StoreMetaUnpacker.o StoreMetaURL.o StoreMetaVary.o StoreStats.o StoreSwapLogData.o Server.o SwapDir.o MemStore.o time.o tools.o tunnel.o unlinkd.o url.o URLScheme.o urn.o wccp.o wccp2.o whois.o wordlist.o LoadableModule.o LoadableModules.o DiskIO/DiskIOModules_gen.o err_type.o err_detail_type.o globals.o hier_code.o icp_opcode.o lookup_t.o repl_modules.o swap_log_op.o DiskIO/Blocking/BlockingDiskIOModule.o DiskIO/DiskThreads/DiskThreadsDiskIOModule.o DiskIO/IpcIo/IpcIoDiskIOModule.o DiskIO/Mmapped/MmappedDiskIOModule.o -Wl,--export-all-symbols auth/.libs/libacls.a ident/.libs/libident.a acl/.libs/libacls.a acl/.libs/libstate.a auth/.libs/libauth.a libBlocking.a libDiskThreads.a libIpcIo.a libMmapped.a acl/.libs/libapi.a base/.libs/libbase.a ./.libs/libsquid.a ip/.libs/libip.a fs/.libs/libfs.a ipc/.libs/libipc.a mgr/.libs/libmgr.a anyp/.libs/libanyp.a comm/.libs/libcomm.a eui/.libs/libeui.a icmp/.libs/libicmp.a icmp/.libs/libicmp-core.a log/.libs/liblog.a format/.libs/libformat.a repl/liblru.a -lpthread -lcrypt adaptation/.libs/libadaptation.a -L/usr/local/lib esi/.libs/libesi.a ../lib/libTrie/src/libTrie.a /usr/lib/libexpat.dll.a ssl/.libs/libsslsquid.a ssl/.libs/libsslutil.a snmp/.libs/libsnmp.a ../snmplib/libsnmplib.a ../lib/.libs/libmisccontainers.a ../lib/.libs/libmiscencoding.a ../lib/.libs/libmiscutil.a -lssl -lcrypto -L../compat -lcompat-squid -L.. /usr/lib/libltdl.dll.a /usr/lib/libecap.dll.a<br><br>  Now,we can get the new squid.exe.<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src/squid-3.3.3-2.i686/src/squid-3.3.3/src<br>  $ find . -name squid.exe<br>  ./.libs/squid.exe<br>  ./squid.exe<br><br>Compile ecap_adapter_sample-0.2.1<br>Step 1: compile ecap-0.2.0 as usually.<br>  HDM@HDM-PC /usr/src/ecap_adapter_sample-0.2.1<br>  $ ./configure && make<br><br>Step 2: link it by runing command as following.<br>  HDM@HDM-PC /usr/src/ecap_adapter_sample-0.2.1/src<br>  $ g++ -shared -o cygmodifying.dll -Wl,--out-implib=libmodifying.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive adapter_modifying.o -Wl,--no-whole-archive /usr/lib/libecap.dll.a<br><br>  HDM@HDM-PC /usr/src/ecap_adapter_sample-0.2.1/src<br>  $ g++ -shared -o cygrecord.dll -Wl,--out-implib=librecord.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive adapter_passthru.o -Wl,--no-whole-archive /usr/lib/libecap.dll.a<br><br>  HDM@HDM-PC /usr/src/ecap_adapter_sample-0.2.1/src<br>  $ g++ -shared -o cygminimal.dll -Wl,--out-implib=librecord.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive adapter_minimal.o -Wl,--no-whole-archive /usr/lib/libecap.dll.a<br><br>Ok. It' over.<br><br>Other<br>As you see, we compile squid-3.3.3-2 by cygport in the above steps. We also can compile by ourself by parsing squid.cygprot. So, we can control the install dir option etc. Here are my method.<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src/squid-3.3.3-2.i686/src/squid-3.3.3<br>  $ ./configure --prefix=/cygdrive/c/squid --disable-strict-error-checking --enable-ecap --enable-ssl --enable-esi --enable-disk-io="AIO,Blocking,DiskThreads,IpcIo,Mmapped" --enable-auth-basic="DB,LDAP,MSNT,MSNT-multi-domain,NCSA,POP3,RADIUS,SASL,SMB,fake,getpwnam" --enable-auth-ntlm='fake,smb_lm' --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-filedescriptors=3072<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src/squid-3.3.3-2.i686/src/squid-3.3.3<br>  $ ./test.sh<br><br>  HDM@HDM-PC /usr/src/squid-3.3.3-2.src/squid-3.3.3-2.i686/src/squid-3.3.3<br>  $ make && make install<br><br>  -------------------------test.sh----------------------------------------<br>  #!/bin/bash<br><br>  for fn in `find . -name Makefile`<br>  do<br>    sed -i -e "s#c++0x#gnu++0x#" ${fn}<br>  done<br>  -------------------------test.sh end ----------------------------------------<br><br>Morely, I write link command by myself because I don't know well about g++, automake, autoconf. So, maybe someone else can improve it. Thank you.<br><br></div>