]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Detect and use libc++, needed for clang c++11 support
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 17 Apr 2015 07:15:52 +0000 (09:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 17 Apr 2015 07:15:52 +0000 (09:15 +0200)
configure.ac

index 076623db6501d14d53d09f3c9fe128b546b40931..11c3bce52a195574b058d7035332e4ad0cb41fb6 100644 (file)
@@ -95,6 +95,17 @@ fi
 # Check for C++11 compiler support
 AX_CXX_COMPILE_STDCXX_11([noext],[optional])
 
+# check whether libc++ is needed (required for clang on freebsd and MacOS)
+SQUID_CC_REQUIRE_ARGUMENT([squid_cv_stdlib_libcxx], [-stdlib=libc++],[[
+#include <iostream>
+]], [[
+std::cout << ""; return 0;
+]])
+if test "x$squid_cv_stdlib_libcxx" = "xyes" ; then
+   CXX="$CXX -stdlib=libc++"
+   BUILDCXX="$BUILDCXX -stdlib=libc++"
+fi
+
 # test for programs
 AC_PROG_RANLIB
 AC_PROG_CPP