llvm.org GIT mirror llvm / 8212002
Add a configure option to pass -std=c++11 on the command line. rdar://11366674 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161251 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
4 changed file(s) with 44 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
217217 #ENABLE_LIBCPP = 0
218218 ENABLE_LIBCPP = @ENABLE_LIBCPP@
219219
220 # When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build.
221 ENABLE_CXX11 = @ENABLE_CXX11@
222
220223 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
221224 # into the "Release" directories. Otherwise, LLVM code is not optimized and
222225 # output is put in the "Debug" directories.
314314 ifeq ($(ENABLE_LIBCPP),1)
315315 CXX.Flags += -stdlib=libc++
316316 LD.Flags += -stdlib=libc++
317 endif
318
319 ifeq ($(ENABLE_CXX11),1)
320 CXX.Flags += -std=c++11
317321 endif
318322
319323 ifeq ($(ENABLE_PROFILING),1)
462462 *) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
463463 esac
464464
465 dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
466 AC_ARG_ENABLE(cxx11,
467 AS_HELP_STRING([--enable-cxx11],
468 [Use c++11 if available (default is NO)]),,
469 enableval=default)
470 case "$enableval" in
471 yes) AC_SUBST(ENABLE_CXX11,[1]) ;;
472 no) AC_SUBST(ENABLE_CXX11,[0]) ;;
473 default) AC_SUBST(ENABLE_CXX11,[0]);;
474 *) AC_MSG_ERROR([Invalid setting for --enable-cxx11. Use "yes" or "no"]) ;;
475 esac
476
465477 dnl --enable-optimized : check whether they want to do an optimized build:
466478 AC_ARG_ENABLE(optimized, AS_HELP_STRING(
467479 --enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
683683 BUILD_CXX
684684 CVSBUILD
685685 ENABLE_LIBCPP
686 ENABLE_CXX11
686687 ENABLE_OPTIMIZED
687688 ENABLE_PROFILING
688689 DISABLE_ASSERTIONS
13891390 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
13901391 --enable-polly Use polly if available (default is YES)
13911392 --enable-libcpp Use libc++ if available (default is NO)
1393 --enable-cxx11 Use c++11 if available (default is NO)
13921394 --enable-optimized Compile with optimizations enabled (default is NO)
13931395 --enable-profiling Compile with profiling enabled (default is NO)
13941396 --enable-assertions Compile with assertion checks enabled (default is
50155017 { (exit 1); exit 1; }; } ;;
50165018 esac
50175019
5020 # Check whether --enable-cxx11 was given.
5021 if test "${enable_cxx11+set}" = set; then
5022 enableval=$enable_cxx11;
5023 else
5024 enableval=default
5025 fi
5026
5027 case "$enableval" in
5028 yes) ENABLE_CXX11=1
5029 ;;
5030 no) ENABLE_CXX11=0
5031 ;;
5032 default) ENABLE_CXX11=0
5033 ;;
5034 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&5
5035 echo "$as_me: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&2;}
5036 { (exit 1); exit 1; }; } ;;
5037 esac
5038
50185039 # Check whether --enable-optimized was given.
50195040 if test "${enable_optimized+set}" = set; then
50205041 enableval=$enable_optimized;
1020910230 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1021010231 lt_status=$lt_dlunknown
1021110232 cat > conftest.$ac_ext <
10212 #line 10213 "configure"
10233 #line 10234 "configure"
1021310234 #include "confdefs.h"
1021410235
1021510236 #if HAVE_DLFCN_H
2193621957 BUILD_CXX!$BUILD_CXX$ac_delim
2193721958 CVSBUILD!$CVSBUILD$ac_delim
2193821959 ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
21960 ENABLE_CXX11!$ENABLE_CXX11$ac_delim
2193921961 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
2194021962 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
2194121963 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
2195021972 LLVM_ENABLE_THREADS!$LLVM_ENABLE_THREADS$ac_delim
2195121973 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
2195221974 ENABLE_PIC!$ENABLE_PIC$ac_delim
21953 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2195421975 _ACEOF
2195521976
2195621977 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2199222013 ac_delim='%!_!# '
2199322014 for ac_last_try in false false false false false :; do
2199422015 cat >conf$$subs.sed <<_ACEOF
22016 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2199522017 ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
2199622018 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
2199722019 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
2208322105 LTLIBOBJS!$LTLIBOBJS$ac_delim
2208422106 _ACEOF
2208522107
22086 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
22108 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
2208722109 break
2208822110 elif $ac_last_try; then
2208922111 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5