Hi all,
I'm trying to build the latest squid 5.0.5 on the latest Fedora, but still
without success. Initially, I had
compilation errors like this:
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
-DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\"
-DDEFAULT_SQUID_CONFIG_DIR=\"/etc/squid\" -I../.. -I../../include -I../../lib
-I../../src -I../../include-I/usr/include/libxml2 -Wall -Wpointer-arith
-Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -pipe -D_REENTRANT
-I/usr/include/libxml2 -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o
Parser.lo Parser.cc
libtool: compile: g++ -DHAVE_CONFIG_H
-DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\"
-DDEFAULT_SQUID_CONFIG_DIR=\"/etc/squid\" -I../.. -I../../include -I../../lib
-I../../src -I../../include -I/usr/include/libxml2 -Wall -Wpointer-arith
-Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -pipe -D_REENTRANT
-I/usr/include/libxml2 -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c
Parser.cc -fPIC -DPIC -o .libs/Parser.o
Parser.cc: In function 'void
ProxyProtocol::One::ExtractPort(Parser::Tokenizer&, Ip::Address&, bool)':
Parser.cc:81:21: error: 'numeric_limits' is not a member of 'std'
81 | if (port > std::numeric_limits::max())
| ^~
Parser.cc:81:44: error: expected primary-expression before '>' token
81 | if (port > std::numeric_limits::max())
|^
Parser.cc:81:51: error: no matching function for call to 'max()'
81 | if (port > std::numeric_limits::max())
| ^
In file included from ../../compat/compat.h:87,
from ../../include/squid.h:37,
from Parser.cc:9:
../../compat/compat_shared.h:142:1: note: candidate: 'template const
A& max(const A&, const A&)'
142 | max(A const & lhs, A const & rhs)
| ^~~
../../compat/compat_shared.h:142:1: note: template argument
deduction/substitution failed:
Parser.cc:81:51: note: candidate expects 2 arguments, 0 provided
81 | if (port > std::numeric_limits::max())
| ^
make[3]: *** [Makefile:836: Parser.lo] Error 1
make[3]: Leaving directory '/builddir/build/BUILD/squid-5.0.5/src/proxyp'
make[2]: *** [Makefile:6851: all-recursive] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/squid-5.0.5/src'
make[1]: *** [Makefile:5840: all] Error 2
make[1]: Leaving directory '/builddir/build/BUILD/squid-5.0.5/src'
make: *** [Makefile:593: all-recursive] Error 1
So I created patch which includes needed header files.
Patch (I can fill PR, if needed):
diff --git a/src/proxyp/Parser.cc b/src/proxyp/Parser.cc
index c9ef588..3a25d44 100644
--- a/src/proxyp/Parser.cc
+++ b/src/proxyp/Parser.cc
@@ -15,6 +15,7 @@
#include "sbuf/Stream.h"
.
#include
+#include
.
#if HAVE_SYS_SOCKET_H
#include
diff --git a/src/security/ServerOptions.cc b/src/security/ServerOptions.cc
index d655665..7072874 100644
--- a/src/security/ServerOptions.cc
+++ b/src/security/ServerOptions.cc
@@ -18,6 +18,7 @@
#if USE_OPENSSL
#include "compat/openssl.h"
#include "ssl/support.h"
+#include
.
#if HAVE_OPENSSL_ERR_H
#include
After applying patch, errors with unknown Squid fails with the following
compilation error (build log snippet):
g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\"
-DDEFAULT_SQUID_CONFIG_DIR=\"/etc/squid\" -I../.. -I../../include -I../../lib
-I../../src -I../../include-I/usr/include/libxml2 -Wall -Wpointer-arith
-Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -pipe -D_REENTRANT
-I/usr/include/libxml2 -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o
time.o time.cc
g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\"
-DDEFAULT_SQUID_CONFIG_DIR=\"/etc/squid\" -I../.. -I../../include -I../../lib