llvm.org GIT mirror llvm / 8ee3963
Add --enable-werror and --enable-cxx11 to projects/sample/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167716 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 7 years ago
3 changed file(s) with 75 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
183183 #ENABLE_LIBCPP = 0
184184 ENABLE_LIBCPP = @ENABLE_LIBCPP@
185185
186 # When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build.
187 ENABLE_CXX11 = @ENABLE_CXX11@
188
189 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
190 ENABLE_WERROR = @ENABLE_WERROR@
191
186192 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
187193 # into the "Release" directories. Otherwise, LLVM code is not optimized and
188194 # output is put in the "Debug" directories.
379379 *) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
380380 esac
381381
382 dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
383 AC_ARG_ENABLE(cxx11,
384 AS_HELP_STRING([--enable-cxx11],
385 [Use c++11 if available (default is NO)]),,
386 enableval=default)
387 case "$enableval" in
388 yes) AC_SUBST(ENABLE_CXX11,[1]) ;;
389 no) AC_SUBST(ENABLE_CXX11,[0]) ;;
390 default) AC_SUBST(ENABLE_CXX11,[0]);;
391 *) AC_MSG_ERROR([Invalid setting for --enable-cxx11. Use "yes" or "no"]) ;;
392 esac
393
382394 dnl --enable-optimized : check whether they want to do an optimized build:
383395 AC_ARG_ENABLE(optimized, AS_HELP_STRING(
384396 --enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
405417 else
406418 AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
407419 fi
420
421 dnl --enable-werror : check whether we want Werror on by default
422 AC_ARG_ENABLE(werror,AS_HELP_STRING(
423 --enable-werror,[Compile with -Werror enabled (default is NO)]),, enableval="no")
424 case "$enableval" in
425 yes) AC_SUBST(ENABLE_WERROR,[1]) ;;
426 no) AC_SUBST(ENABLE_WERROR,[0]) ;;
427 default) AC_SUBST(ENABLE_WERROR,[0]);;
428 *) AC_MSG_ERROR([Invalid setting for --enable-werror. Use "yes" or "no"]) ;;
429 esac
408430
409431 dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
410432 AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
682682 BUILD_CXX
683683 CVSBUILD
684684 ENABLE_LIBCPP
685 ENABLE_CXX11
685686 ENABLE_OPTIMIZED
686687 ENABLE_PROFILING
687688 DISABLE_ASSERTIONS
689 ENABLE_WERROR
688690 ENABLE_EXPENSIVE_CHECKS
689691 EXPENSIVE_CHECKS
690692 DEBUG_RUNTIME
13741376 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
13751377 --enable-polly Use polly if available (default is YES)
13761378 --enable-libcpp Use libc++ if available (default is NO)
1379 --enable-cxx11 Use c++11 if available (default is NO)
13771380 --enable-optimized Compile with optimizations enabled (default is NO)
13781381 --enable-profiling Compile with profiling enabled (default is NO)
13791382 --enable-assertions Compile with assertion checks enabled (default is
13801383 YES)
1384 --enable-werror Compile with -Werror enabled (default is NO)
13811385 --enable-expensive-checks
13821386 Compile with expensive debug checks enabled (default
13831387 is NO)
49414945 { (exit 1); exit 1; }; } ;;
49424946 esac
49434947
4948 # Check whether --enable-cxx11 was given.
4949 if test "${enable_cxx11+set}" = set; then
4950 enableval=$enable_cxx11;
4951 else
4952 enableval=default
4953 fi
4954
4955 case "$enableval" in
4956 yes) ENABLE_CXX11=1
4957 ;;
4958 no) ENABLE_CXX11=0
4959 ;;
4960 default) ENABLE_CXX11=0
4961 ;;
4962 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&5
4963 echo "$as_me: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&2;}
4964 { (exit 1); exit 1; }; } ;;
4965 esac
4966
49444967 # Check whether --enable-optimized was given.
49454968 if test "${enable_optimized+set}" = set; then
49464969 enableval=$enable_optimized;
49855008 DISABLE_ASSERTIONS=DISABLE_ASSERTIONS=1
49865009
49875010 fi
5011
5012 # Check whether --enable-werror was given.
5013 if test "${enable_werror+set}" = set; then
5014 enableval=$enable_werror;
5015 else
5016 enableval="no"
5017 fi
5018
5019 case "$enableval" in
5020 yes) ENABLE_WERROR=1
5021 ;;
5022 no) ENABLE_WERROR=0
5023 ;;
5024 default) ENABLE_WERROR=0
5025 ;;
5026 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&5
5027 echo "$as_me: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&2;}
5028 { (exit 1); exit 1; }; } ;;
5029 esac
49885030
49895031 # Check whether --enable-expensive-checks was given.
49905032 if test "${enable_expensive_checks+set}" = set; then
2164021682 BUILD_CXX!$BUILD_CXX$ac_delim
2164121683 CVSBUILD!$CVSBUILD$ac_delim
2164221684 ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
21685 ENABLE_CXX11!$ENABLE_CXX11$ac_delim
2164321686 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
2164421687 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
2164521688 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
21689 ENABLE_WERROR!$ENABLE_WERROR$ac_delim
2164621690 ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
2164721691 EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
2164821692 DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
2165221696 ENABLE_DOCS!$ENABLE_DOCS$ac_delim
2165321697 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2165421698 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
21655 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
21656 ENABLE_PIC!$ENABLE_PIC$ac_delim
2165721699 _ACEOF
2165821700
2165921701 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2169521737 ac_delim='%!_!# '
2169621738 for ac_last_try in false false false false false :; do
2169721739 cat >conf$$subs.sed <<_ACEOF
21740 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
21741 ENABLE_PIC!$ENABLE_PIC$ac_delim
2169821742 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2169921743 ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
2170021744 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
2178621830 LTLIBOBJS!$LTLIBOBJS$ac_delim
2178721831 _ACEOF
2178821832
21789 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
21833 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
2179021834 break
2179121835 elif $ac_last_try; then
2179221836 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5