[squid-dev] [PATCH] support clang3.5+/libc++on FreeBSD 9.3 and MacOS

Kinkie gkinkie at gmail.com
Wed Apr 15 16:11:36 UTC 2015


Hi,
   the following patch enables using libc++ in place of libstdc++.
This is necessary with recent clang++ on some platforms, such as
FreeBSD 9.3 and reportedly newer MacOS.
With this patch squid builds using clang-3.5 and libc++; the make
check still fails due to libcppunit having a different c++ ABI


=== modified file 'configure.ac'
--- configure.ac        2015-03-23 14:13:16 +0000
+++ configure.ac        2015-04-15 12:12:42 +0000
@@ -95,6 +95,17 @@
 # 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




-- 
    Francesco


More information about the squid-dev mailing list