]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3613: relax standard-compliance strctness on clang to enable build
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 24 Aug 2012 10:54:03 +0000 (12:54 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 24 Aug 2012 10:54:03 +0000 (12:54 +0200)
When clang is invoked with the -std=c++0x option, it won't make available some system functions
defined in c99. For some reason configure fails to detect this, and so the built-in implementation is
not invoked. This change prevents enabling the -std=c++0x option for clang.

configure.ac

index 175eda783a3e3cd71545f96a25fa770322292301..033c3776e2cf039b57a572ce106d1b45c2f81a81 100644 (file)
@@ -67,7 +67,13 @@ fi
 AX_CXX_COMPILE_STDCXX_0X
 if test "x$ax_cv_cxx_compile_cxx0x_cxx" = "xyes" -a \
   "x$squid_host_os" != "xmingw" ; then
-    CXXFLAGS="$CXXFLAGS -std=c++0x"
+    #BUG 3613: when clang -std=c++0x is used, it activates a "strict mode"
+    # in the system libraries, which makes some c99 methods unavailable
+    # (e.g. strtoll), yet configure detects them as avilable.
+    case "$CXX" in
+      *clang++*) ;; #do nothing
+      *) CXXFLAGS="$CXXFLAGS -std=c++0x" ;;
+    esac
 fi
 
 # test for programs