Skip to content

Commit

Permalink
Add --enable-werror and --enable-cxx11 to projects/sample/
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167716 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Nov 12, 2012
1 parent 08e9cb4 commit 8ee3963
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
6 changes: 6 additions & 0 deletions projects/sample/Makefile.llvm.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ RDYNAMIC := @RDYNAMIC@
#ENABLE_LIBCPP = 0
ENABLE_LIBCPP = @ENABLE_LIBCPP@

# When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build.
ENABLE_CXX11 = @ENABLE_CXX11@

# When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
ENABLE_WERROR = @ENABLE_WERROR@

# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
# into the "Release" directories. Otherwise, LLVM code is not optimized and
# output is put in the "Debug" directories.
Expand Down
22 changes: 22 additions & 0 deletions projects/sample/autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ case "$enableval" in
*) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
esac

dnl --enable-cxx11 : check whether or not to use -std=c++11 on the command line
AC_ARG_ENABLE(cxx11,
AS_HELP_STRING([--enable-cxx11],
[Use c++11 if available (default is NO)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_CXX11,[1]) ;;
no) AC_SUBST(ENABLE_CXX11,[0]) ;;
default) AC_SUBST(ENABLE_CXX11,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-cxx11. Use "yes" or "no"]) ;;
esac

dnl --enable-optimized : check whether they want to do an optimized build:
AC_ARG_ENABLE(optimized, AS_HELP_STRING(
--enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
Expand Down Expand Up @@ -407,6 +419,16 @@ else
AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
fi

dnl --enable-werror : check whether we want Werror on by default
AC_ARG_ENABLE(werror,AS_HELP_STRING(
--enable-werror,[Compile with -Werror enabled (default is NO)]),, enableval="no")
case "$enableval" in
yes) AC_SUBST(ENABLE_WERROR,[1]) ;;
no) AC_SUBST(ENABLE_WERROR,[0]) ;;
default) AC_SUBST(ENABLE_WERROR,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-werror. Use "yes" or "no"]) ;;
esac

dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
--enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
Expand Down
50 changes: 47 additions & 3 deletions projects/sample/configure
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,11 @@ BUILD_EXEEXT
BUILD_CXX
CVSBUILD
ENABLE_LIBCPP
ENABLE_CXX11
ENABLE_OPTIMIZED
ENABLE_PROFILING
DISABLE_ASSERTIONS
ENABLE_WERROR
ENABLE_EXPENSIVE_CHECKS
EXPENSIVE_CHECKS
DEBUG_RUNTIME
Expand Down Expand Up @@ -1375,10 +1377,12 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-polly Use polly if available (default is YES)
--enable-libcpp Use libc++ if available (default is NO)
--enable-cxx11 Use c++11 if available (default is NO)
--enable-optimized Compile with optimizations enabled (default is NO)
--enable-profiling Compile with profiling enabled (default is NO)
--enable-assertions Compile with assertion checks enabled (default is
YES)
--enable-werror Compile with -Werror enabled (default is NO)
--enable-expensive-checks
Compile with expensive debug checks enabled (default
is NO)
Expand Down Expand Up @@ -4942,6 +4946,25 @@ echo "$as_me: error: Invalid setting for --enable-libcpp. Use \"yes\" or \"no\""
{ (exit 1); exit 1; }; } ;;
esac

# Check whether --enable-cxx11 was given.
if test "${enable_cxx11+set}" = set; then
enableval=$enable_cxx11;
else
enableval=default
fi

case "$enableval" in
yes) ENABLE_CXX11=1
;;
no) ENABLE_CXX11=0
;;
default) ENABLE_CXX11=0
;;
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&5
echo "$as_me: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" >&2;}
{ (exit 1); exit 1; }; } ;;
esac

# Check whether --enable-optimized was given.
if test "${enable_optimized+set}" = set; then
enableval=$enable_optimized;
Expand Down Expand Up @@ -4987,6 +5010,25 @@ else

fi

# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then
enableval=$enable_werror;
else
enableval="no"
fi

case "$enableval" in
yes) ENABLE_WERROR=1
;;
no) ENABLE_WERROR=0
;;
default) ENABLE_WERROR=0
;;
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&5
echo "$as_me: error: Invalid setting for --enable-werror. Use \"yes\" or \"no\"" >&2;}
{ (exit 1); exit 1; }; } ;;
esac

# Check whether --enable-expensive-checks was given.
if test "${enable_expensive_checks+set}" = set; then
enableval=$enable_expensive_checks;
Expand Down Expand Up @@ -21641,9 +21683,11 @@ BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
BUILD_CXX!$BUILD_CXX$ac_delim
CVSBUILD!$CVSBUILD$ac_delim
ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
ENABLE_CXX11!$ENABLE_CXX11$ac_delim
ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
ENABLE_WERROR!$ENABLE_WERROR$ac_delim
ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
Expand All @@ -21653,8 +21697,6 @@ TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
ENABLE_DOCS!$ENABLE_DOCS$ac_delim
ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
ENABLE_THREADS!$ENABLE_THREADS$ac_delim
ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
ENABLE_PIC!$ENABLE_PIC$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
Expand Down Expand Up @@ -21696,6 +21738,8 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
ENABLE_PIC!$ENABLE_PIC$ac_delim
ENABLE_SHARED!$ENABLE_SHARED$ac_delim
ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
Expand Down Expand Up @@ -21787,7 +21831,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF

if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Expand Down

0 comments on commit 8ee3963

Please sign in to comment.