aboutsummaryrefslogtreecommitdiff
path: root/build/cxx/gnu/configure
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-23 15:21:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-23 15:21:15 +0200
commit90b0c577bc2f368b62e05211062af72d15f0d5c4 (patch)
tree4247adb3bac79901894114574a579a87cff2cac3 /build/cxx/gnu/configure
parent7dbc1fda18fef05d3c5a8008c54ee5cd871633b8 (diff)
Add support for detecting C++ standard
Diffstat (limited to 'build/cxx/gnu/configure')
-rwxr-xr-xbuild/cxx/gnu/configure13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/cxx/gnu/configure b/build/cxx/gnu/configure
index 81848f7..c551713 100755
--- a/build/cxx/gnu/configure
+++ b/build/cxx/gnu/configure
@@ -29,6 +29,18 @@ $echo
cxx_gnu=`read_path --command g++`
+# Determine the C++ standard.
+#
+cxx_gnu_standard=`echo "$3" | sed -e 's/.*-std=\([^ ]*\).*/\1/' -e t -e d`
+
+if [ -z "$cxx_gnu_standard" ]; then
+ cxx_gnu_standard="gnu++98"
+elif [ "$cxx_gnu_standard" = "c++0x" ]; then
+ cxx_gnu_standard="c++11"
+elif [ "$cxx_gnu_standard" = "gnu++0x" ]; then
+ cxx_gnu_standard="gnu++11"
+fi
+
# Pass cxx_extra_options and cxx_ld_extra_options since those
# can affect the search paths (e.g., -m32) and target.
#
@@ -76,6 +88,7 @@ if [ "$2" == "y" ]; then
fi
echo "cxx_gnu := $cxx_gnu" > $1
+echo "cxx_gnu_standard := $cxx_gnu_standard" >> $1
echo "cxx_gnu_libraries := $cxx_gnu_libraries" >> $1
echo "cxx_gnu_optimization_options := $optimization" >> $1
echo "cxx_gnu_target := $cxx_gnu_target" >> $1