Update lib/buildit and test/testit to both pay attention to an env flag CXX_LANG, which people can set to 'c++03', 'c++11' or 'c++1y' to build/test using that language variant. If you don't set this env variable, you get c++11, just like today. Drive-by fix; remove duplicate -nostdinc++.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199222 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/buildit b/lib/buildit
index af6b466..00f0adf 100755
--- a/lib/buildit
+++ b/lib/buildit
@@ -17,6 +17,11 @@
     CXX=clang++
 fi
 
+if [ -z "$CXX_LANG" ]
+then
+    CXX_LANG=c++1y
+fi
+
 if [ -z "$CC" ]
 then
     CC=clang
@@ -35,7 +40,7 @@
   RC_ProjectSourceVersion=1
 fi
 
-EXTRA_FLAGS="-nostdinc++ -std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
+EXTRA_FLAGS="-nostdinc++ -std=${CXX_LANG} -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
              -Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4 "
 
 case $TRIPLE in
@@ -58,7 +63,7 @@
     else
         if [ -n "$SDKROOT" ]
         then
-            EXTRA_FLAGS+="-nostdinc++ -isysroot ${SDKROOT}"
+            EXTRA_FLAGS+="-isysroot ${SDKROOT} "
             if echo "${RC_ARCHS}" | grep -q "armv7"  
             then
                 RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"