Boost logo

Boost :

Subject: Re: [boost] clang++ isn't getting the BOOST_NO_CXX11_HDR_FUNCTIONAL flag that it needs
From: Beman Dawes (bdawes_at_[hidden])
Date: 2014-04-16 09:08:58


On Tue, Apr 15, 2014 at 3:48 PM, Chris Cooper <chris.cooper_at_[hidden]>
wrote:
>
> Trying to build & run the regression tests for boost 1.55 on my Mac using
the clang++ that comes with Xcode 5.1 ("Apple LLVM version 5.1
(clang-503.0.38) (based on LLVM 3.4svn)”), it can’t build config_test.cpp
because BOOST_NO_CXX11_HDR_FUNCTIONAL isn’t set, and
libs/config/test/boost_no_ccx_hdr_functional.ipp definitely doesn’t build
(after renaming it to .cpp of course).
>
> If I set CXXFLAGS to "-std=c++11 -stdlib=libc++” everything is fine, but
I also need a build of boost that _doesn’t_ use c++11, and it’s the
non-c++-11 version that is failing.
>
> I can get around this by manually setting CXXFLAGS to
“-DBOOST_NO_CXX11_HDR_FUNCTIONAL” but it seems like the correct way to do
this is to add a test to boost/config/compiler/clang.hpp that tests …
something… and then sets BOOST_NO_CXX11_HDR_FUNCTIONAL if appropriate.
>
>
> 1. Would you agree that’s the right place to set
BOOST_NO_CXX11_HDR_FUNCTIONAL (when appropriate)?

The right place is .../config/stdlib/libcpp.hpp since what header is
available is a function of the library rather than the compiler.

The current version of libcpp.hpp is pretty rudimentary and doesn't test
for specific versions of libc++. You might want to read "Best way to
detect libc++ at compile time?"

See
http://clang-developers.42468.n3.nabble.com/Best-way-to-detect-libc-at-compile-time-td4025578.html

It would certainly be nice to get a patch to update libcpp.hpp.

Thanks,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk