From: Todd C. Miller Date: Thu, 3 Jun 2010 16:00:54 +0000 (-0400) Subject: Add --enable-warnings configure option X-Git-Tag: SUDO_1_7_3~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f76dea7e9ddf15a3fb7180cbe15f08b7885f565;p=sudo Add --enable-warnings configure option --HG-- branch : 1.7 --- diff --git a/INSTALL b/INSTALL index 23852b46c..350d4bda0 100644 --- a/INSTALL +++ b/INSTALL @@ -619,6 +619,9 @@ The following options are also configurable at runtime: zlib is used if it is found on the system and transcript support is not disabled. + --enable-warnings + Enable compiler warnings when building sudo with gcc. + Shadow password and C2 support ============================== diff --git a/configure b/configure index b3d9112e4..420fd1b84 100755 --- a/configure +++ b/configure @@ -981,6 +981,7 @@ enable_shell_sets_home enable_path_info enable_env_debug enable_transcript +enable_warnings with_selinux enable_gss_krb5_ccache_name enable_shared @@ -1636,6 +1637,7 @@ Optional Features: --enable-transcript[=DIR] Enable Sudo's transcript support, storing them in DIR + --enable-warnings Whether to enable compiler warnings --enable-gss-krb5-ccache-name Use GSS-API to set the Kerberos V cred cache name --enable-shared[=PKGS] build shared libraries [default=yes] @@ -5348,6 +5350,22 @@ if test "${enable_transcript+set}" = set; then : fi +# 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 + ;; + 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;} + ;; + esac + +fi + + # Check whether --with-selinux was given. if test "${with_selinux+set}" = set; then : @@ -6503,13 +6521,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6506: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6524: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6509: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6527: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6512: output\"" >&5) + (eval echo "\"\$as_me:6530: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7714,7 +7732,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7717 "configure"' > conftest.$ac_ext + echo '#line 7735 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9107,11 +9125,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9110: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9128: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9114: \$? = $ac_status" >&5 + echo "$as_me:9132: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9446,11 +9464,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9449: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9467: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9453: \$? = $ac_status" >&5 + echo "$as_me:9471: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9551,11 +9569,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9554: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9572: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9558: \$? = $ac_status" >&5 + echo "$as_me:9576: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9606,11 +9624,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9609: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9627: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9613: \$? = $ac_status" >&5 + echo "$as_me:9631: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11973,7 +11991,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11976 "configure" +#line 11994 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12069,7 +12087,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12072 "configure" +#line 12090 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/configure.in b/configure.in index 447e63614..9f1e0c447 100644 --- a/configure.in +++ b/configure.in @@ -1228,6 +1228,19 @@ dnl we check enable_transcript later AC_ARG_ENABLE(transcript, [AS_HELP_STRING([--enable-transcript[[=DIR]]], [Enable Sudo's transcript support, storing them in DIR])]) +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 + ;; + no) ;; + *) AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval]) + ;; + esac +]) + AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])], [case $with_selinux in yes) SELINUX_USAGE="[[-r role]] [[-t type]] "