# Check whether --enable-warnings was given.
if test "${enable_warnings+set}" = set; then :
enableval=$enable_warnings; case "$enableval" in
- yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
- fi
- ;;
+ yes) ;;
no) ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unknown argument to --enable-warnings: $enableval" >&5
$as_echo "$as_me: WARNING: Ignoring unknown argument to --enable-warnings: $enableval" >&2;}
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; case "$enableval" in
- yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Werror"
- fi
- ;;
+ yes) ;;
no) ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unknown argument to --enable-werror: $enableval" >&5
$as_echo "$as_me: WARNING: Ignoring unknown argument to --enable-werror: $enableval" >&2;}
NOEXECFILE="sudo_noexec$_shrext"
NOEXECDIR="`echo $with_noexec|sed 's:^\(.*\)/[^/]*:\1:'`"
-if test X"$with_devel" = X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
-fi
-
# Extract the first word of "uname", so it can be a program name with args.
set dummy uname; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
done
fi
+if test -n "$GCC"; then
+ if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
+ CFLAGS="${CFLAGS} -Wall"
+ fi
+ if test X"$enable_werror" = X"yes"; then
+ CFLAGS="${CFLAGS} -Werror"
+ fi
+fi
+
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
AC_ARG_ENABLE(warnings,
[AS_HELP_STRING([--enable-warnings], [Whether to enable compiler warnings])],
[ case "$enableval" in
- yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
- fi
- ;;
+ yes) ;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval])
;;
AC_ARG_ENABLE(werror,
[AS_HELP_STRING([--enable-werror], [Whether to enable the -Werror compiler option])],
[ case "$enableval" in
- yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Werror"
- fi
- ;;
+ yes) ;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-werror: $enableval])
;;
NOEXECFILE="sudo_noexec$_shrext"
NOEXECDIR="`echo $with_noexec|sed 's:^\(.*\)/[[^/]]*:\1:'`"
-dnl
-dnl It is now safe to modify CFLAGS and CPPFLAGS
-dnl
-if test X"$with_devel" = X"yes" -a -n "$GCC"; then
- CFLAGS="${CFLAGS} -Wall"
-fi
-
dnl
dnl Find programs we use
dnl
done
fi
+dnl
+dnl We add -Wall and -Werror after all tests so they don't cause failures
+dnl
+if test -n "$GCC"; then
+ if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
+ CFLAGS="${CFLAGS} -Wall"
+ fi
+ if test X"$enable_werror" = X"yes"; then
+ CFLAGS="${CFLAGS} -Werror"
+ fi
+fi
+
dnl
dnl Set exec_prefix
dnl