llvm.org GIT mirror llvm / 09a8873
Add a configure flag for enabling -Werror on the command line while building as requested by Lang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161253 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
4 changed file(s) with 43 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
220220 # When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build.
221221 ENABLE_CXX11 = @ENABLE_CXX11@
222222
223 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
224 ENABLE_WERROR = @ENABLE_WERROR@
225
223226 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
224227 # into the "Release" directories. Otherwise, LLVM code is not optimized and
225228 # output is put in the "Debug" directories.
318318
319319 ifeq ($(ENABLE_CXX11),1)
320320 CXX.Flags += -std=c++11
321 endif
322
323 ifeq ($(ENABLE_WERROR),1)
324 CXX.Flags += -Werror
325 C.Flags += -Werror
321326 endif
322327
323328 ifeq ($(ENABLE_PROFILING),1)
501501 AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
502502 fi
503503
504 dnl --enable-werror : check whether we want Werror on by default
505 AC_ARG_ENABLE(werror,AS_HELP_STRING(
506 --enable-werror,[Compile with -Werror enabled (default is NO)]),, enableval="no")
507 case "$enableval" in
508 yes) AC_SUBST(ENABLE_WERROR,[1]) ;;
509 no) AC_SUBST(ENABLE_WERROR,[0]) ;;
510 default) AC_SUBST(ENABLE_WERROR,[0]);;
511 *) AC_MSG_ERROR([Invalid setting for --enable-werror. Use "yes" or "no"]) ;;
512 esac
513
504514 dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
505515 AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
506516 --enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
687687 ENABLE_OPTIMIZED
688688 ENABLE_PROFILING
689689 DISABLE_ASSERTIONS
690 ENABLE_WERROR
690691 ENABLE_EXPENSIVE_CHECKS
691692 EXPENSIVE_CHECKS
692693 DEBUG_RUNTIME
13981399 --enable-profiling Compile with profiling enabled (default is NO)
13991400 --enable-assertions Compile with assertion checks enabled (default is
14001401 YES)
1402 --enable-werror Compile with -Werror enabled (default is NO)
14011403 --enable-expensive-checks
14021404 Compile with expensive debug checks enabled (default
14031405 is NO)
50845086
50855087 fi
50865088
5089 # Check whether --enable-werror was given.
5090 if test "${enable_werror+set}" = set; then
5091 enableval=$enable_werror;
5092 else
5093 enableval="no"
5094 fi
5095
5096 case "$enableval" in
5097 yes) ENABLE_WERROR=1
5098 ;;
5099 no) ENABLE_WERROR=0
5100 ;;
5101 default) ENABLE_WERROR=0
5102 ;;
5103 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&5
5104 echo "$as_me: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&2;}
5105 { (exit 1); exit 1; }; } ;;
5106 esac
5107
50875108 # Check whether --enable-expensive-checks was given.
50885109 if test "${enable_expensive_checks+set}" = set; then
50895110 enableval=$enable_expensive_checks;
1023310254 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1023410255 lt_status=$lt_dlunknown
1023510256 cat > conftest.$ac_ext <
10236 #line 10237 "configure"
10257 #line 10258 "configure"
1023710258 #include "confdefs.h"
1023810259
1023910260 #if HAVE_DLFCN_H
2210622127 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
2210722128 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
2210822129 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
22130 ENABLE_WERROR!$ENABLE_WERROR$ac_delim
2210922131 ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
2211022132 EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
2211122133 DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
2211622138 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2211722139 LLVM_ENABLE_THREADS!$LLVM_ENABLE_THREADS$ac_delim
2211822140 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
22119 ENABLE_PIC!$ENABLE_PIC$ac_delim
2212022141 _ACEOF
2212122142
2212222143 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2215822179 ac_delim='%!_!# '
2215922180 for ac_last_try in false false false false false :; do
2216022181 cat >conf$$subs.sed <<_ACEOF
22182 ENABLE_PIC!$ENABLE_PIC$ac_delim
2216122183 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2216222184 ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
2216322185 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
2225322275 LTLIBOBJS!$LTLIBOBJS$ac_delim
2225422276 _ACEOF
2225522277
22256 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then
22278 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
2225722279 break
2225822280 elif $ac_last_try; then
2225922281 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5