From e4956d22e159c4e6829033b57c97cd94e8fea2e3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 23 Aug 2011 10:15:28 -0400 Subject: [PATCH] Add --enable-werror configure option. --- INSTALL | 3 +++ configure | 18 ++++++++++++++++++ configure.in | 13 +++++++++++++ 3 files changed, 34 insertions(+) diff --git a/INSTALL b/INSTALL index 44c29f796..d859abe9f 100644 --- a/INSTALL +++ b/INSTALL @@ -630,6 +630,9 @@ The following options are also configurable at runtime: --enable-warnings Enable compiler warnings when building sudo with gcc. + --enable-werror + Enable the -Werror compiler option when building sudo with gcc. + --enable-admin-flag Enable the creation of an Ubuntu-style admin flag file the first time sudo is run. diff --git a/configure b/configure index ca90c23b7..1c159548e 100755 --- a/configure +++ b/configure @@ -874,6 +874,7 @@ enable_env_debug enable_zlib enable_env_reset enable_warnings +enable_werror enable_admin_flag enable_nls with_selinux @@ -1534,6 +1535,7 @@ Optional Features: --enable-zlib[=PATH] Whether to enable or disable zlib --enable-env-reset Whether to enable environment resetting by default. --enable-warnings Whether to enable compiler warnings + --enable-werror Whether to enable the -Werror compiler option --enable-admin-flag Whether to create a Ubuntu-style admin flag file --disable-nls Disable natural language support using gettext --enable-gss-krb5-ccache-name @@ -5505,6 +5507,22 @@ $as_echo "$as_me: WARNING: Ignoring unknown argument to --enable-warnings: $enab fi +# 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 + ;; + 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;} + ;; + esac + +fi + + # Check whether --enable-admin-flag was given. if test "${enable_admin_flag+set}" = set; then : enableval=$enable_admin_flag; case "$enableval" in diff --git a/configure.in b/configure.in index 7a59b6a17..bfd8505a9 100644 --- a/configure.in +++ b/configure.in @@ -1304,6 +1304,19 @@ AC_ARG_ENABLE(warnings, esac ]) +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 + ;; + no) ;; + *) AC_MSG_WARN([Ignoring unknown argument to --enable-werror: $enableval]) + ;; + esac +]) + AC_ARG_ENABLE(admin-flag, [AS_HELP_STRING([--enable-admin-flag], [Whether to create a Ubuntu-style admin flag file])], [ case "$enableval" in -- 2.40.0