llvm.org GIT mirror llvm / f38b536
[C++11] Replace autoconf --enable-cxx11 with --enable-cxx1y. The baseline is now C++11, and we unconditionally add -std=c++11 to the flags. This has the dim potential to break some non-GNU-compatible compiler (in terms of -std flags) using the makefiles, but those makefiles are littered with GNU-style compile flags so it would be very surprising to me for it to actually happen in practice. As always, do let me know if there is a toolchain you're using where this doesn't work, and I'll be watching the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202569 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 5 years ago
4 changed file(s) with 26 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
243243 #ENABLE_LIBCPP = 0
244244 ENABLE_LIBCPP = @ENABLE_LIBCPP@
245245
246 # When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build.
247 ENABLE_CXX11 = @ENABLE_CXX11@
246 # When ENABLE_CXX1Y is enabled, LLVM uses c++1y mode by default to build.
247 # Otherwise it uses the baseline c++11.
248 ENABLE_CXX1Y = @ENABLE_CXX1Y@
248249
249250 # When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode.
250251 ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@
318318 LD.Flags += -stdlib=libc++
319319 endif
320320
321 ifeq ($(ENABLE_CXX11),1)
322 CXX.Flags += -std=c++11
321 ifeq ($(ENABLE_CXX1Y),1)
322 CXX.Flags += -std=c++1y
323 else
324 CXX.Flags += -std=c++11
323325 endif
324326
325327 ifeq ($(ENABLE_WERROR),1)
588588 ;;
589589 esac
590590
591 dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
592 AC_ARG_ENABLE(cxx11,
593 AS_HELP_STRING([--enable-cxx11],
594 [Use c++11 if available (default is YES)]),,
591 dnl --enable-cxx1y : check whether or not to use -std=c++1y on the command line
592 AC_ARG_ENABLE(cxx1y,
593 AS_HELP_STRING([--enable-cxx1y],
594 [Use c++1y if available (default is NO)]),,
595595 enableval=default)
596596 case "$enableval" in
597 yes) AC_SUBST(ENABLE_CXX11,[1]) ;;
598 no) AC_SUBST(ENABLE_CXX11,[0]) ;;
599 default) AC_SUBST(ENABLE_CXX11,[1]);;
600 *) AC_MSG_ERROR([Invalid setting for --enable-cxx11. Use "yes" or "no"]) ;;
597 yes) AC_SUBST(ENABLE_CXX1Y,[1]) ;;
598 no) AC_SUBST(ENABLE_CXX1Y,[0]) ;;
599 default) AC_SUBST(ENABLE_CXX1Y,[0]);;
600 *) AC_MSG_ERROR([Invalid setting for --enable-cxx1y. Use "yes" or "no"]) ;;
601601 esac
602602
603603 dnl --enable-fission : check whether or not to use -gsplit-dwarf on the command
683683 BUILD_CXX
684684 CVSBUILD
685685 ENABLE_LIBCPP
686 ENABLE_CXX11
686 ENABLE_CXX1Y
687687 ENABLE_SPLIT_DWARF
688688 ENABLE_CLANG_ARCMT
689689 ENABLE_CLANG_STATIC_ANALYZER
14011401 --enable-compiler-version-checks
14021402 Check the version of the host compiler (default is
14031403 YES)
1404 --enable-cxx11 Use c++11 if available (default is YES)
1404 --enable-cxx1y Use c++1y if available (default is NO)
14051405 --enable-split-dwarf Use split-dwarf if available (default is NO)
14061406 --enable-clang-arcmt Enable building of clang ARCMT (default is YES)
14071407 --enable-clang-static-analyzer
48034803 ;;
48044804 esac
48054805
4806 # Check whether --enable-cxx11 was given.
4807 if test "${enable_cxx11+set}" = set; then
4808 enableval=$enable_cxx11;
4806 # Check whether --enable-cxx1y was given.
4807 if test "${enable_cxx1y+set}" = set; then
4808 enableval=$enable_cxx1y;
48094809 else
48104810 enableval=default
48114811 fi
48124812
48134813 case "$enableval" in
4814 yes) ENABLE_CXX11=1
4814 yes) ENABLE_CXX1Y=1
48154815 ;;
4816 no) ENABLE_CXX11=0
4816 no) ENABLE_CXX1Y=0
48174817 ;;
4818 default) ENABLE_CXX11=1
4818 default) ENABLE_CXX1Y=0
48194819 ;;
4820 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&5
4821 echo "$as_me: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&2;}
4820 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cxx1y. Use \"yes\" or \"no\"" >&5
4821 echo "$as_me: error: Invalid setting for --enable-cxx1y. Use \"yes\" or \"no\"" >&2;}
48224822 { (exit 1); exit 1; }; } ;;
48234823 esac
48244824
2016420164 BUILD_CXX!$BUILD_CXX$ac_delim
2016520165 CVSBUILD!$CVSBUILD$ac_delim
2016620166 ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
20167 ENABLE_CXX11!$ENABLE_CXX11$ac_delim
20167 ENABLE_CXX1Y!$ENABLE_CXX1Y$ac_delim
2016820168 ENABLE_SPLIT_DWARF!$ENABLE_SPLIT_DWARF$ac_delim
2016920169 ENABLE_CLANG_ARCMT!$ENABLE_CLANG_ARCMT$ac_delim
2017020170 ENABLE_CLANG_STATIC_ANALYZER!$ENABLE_CLANG_STATIC_ANALYZER$ac_delim