Mercurial > hg > forks > yadex
changeset 112:9694eb987bf3
Add check int configure for C++11 support.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 06 Oct 2014 15:23:55 +0300 |
parents | 51d5549a1bdc |
children | 275ec0b8c4cd |
files | configure |
diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/configure Mon Oct 06 15:23:36 2014 +0300 +++ b/configure Mon Oct 06 15:23:55 2014 +0300 @@ -401,6 +401,31 @@ exit 1 fi + +# +# Does C++ compiler support -std=c++11 ? +# +printf "checking whether the C++ compiler supports C++11..." +cat > $cdir/$cbasename << _EOF_ +#include <memory> +int main(int argc, char *argv[]) +{ + std::shared_ptr<int> sp(new int(5)); + (void) argc; + (void) argv; + return 0; +} +_EOF_ +if (cd $cdir && $CXX -std=c++11 -c $cbasename >$cout 2>&1) +then + echo " yes" +else + echo " no" + sed 's/^/> /' $cdir/$cout + echo "error: looks like the C++ compiler does not support C++11" 1>&2 + exit 1 +fi + # # Create the directory where the build-specific files go #