Prevent configure from adding the -g flag unless in devel mode

This commit is contained in:
Todd C. Miller
2010-07-28 09:24:55 -04:00
parent 1ae6145d47
commit 5c7335e23e
2 changed files with 52 additions and 57 deletions

75
configure vendored
View File

@@ -907,6 +907,7 @@ ac_user_opts='
enable_option_checking
with_otp_only
with_alertmail
with_devel
with_CC
with_rpath
with_blibpath
@@ -915,7 +916,6 @@ with_linux_audit
with_incpath
with_libpath
with_libraries
with_devel
with_efence
with_csops
with_passwd
@@ -1662,6 +1662,7 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-otp-only deprecated
--with-alertmail deprecated
--with-devel add development options
--with-CC C compiler to use
--with-rpath pass -R flag in addition to -L for lib paths
--with-blibpath=PATH pass -blibpath flag to ld for additional lib paths
@@ -1670,7 +1671,6 @@ Optional Packages:
--with-incpath additional places to look for include files
--with-libpath additional places to look for libraries
--with-libraries additional libraries to link with
--with-devel add development options
--with-efence link with -lefence for malloc() debugging
--with-csops add CSOps standard options
--without-passwd don't use passwd/shadow file for authentication
@@ -2879,6 +2879,27 @@ fi
# Check whether --with-devel was given.
if test "${with_devel+set}" = set; then :
withval=$with_devel; case $with_devel in
yes) { $as_echo "$as_me:${as_lineno-$LINENO}: Setting up for development: -Wall, flex, yacc" >&5
$as_echo "$as_me: Setting up for development: -Wall, flex, yacc" >&6;}
OSDEFS="${OSDEFS} -DSUDO_DEVEL"
DEV=""
devdir=.
;;
no) ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unknown argument to --with-devel: $with_devel" >&5
$as_echo "$as_me: WARNING: Ignoring unknown argument to --with-devel: $with_devel" >&2;}
;;
esac
fi
if test X"$with_devel" != X"yes"; then
ac_cv_prog_cc_g=no
fi
# Check whether --with-CC was given.
if test "${with_CC+set}" = set; then :
withval=$with_CC; case $with_CC in
@@ -3808,24 +3829,6 @@ fi
# Check whether --with-devel was given.
if test "${with_devel+set}" = set; then :
withval=$with_devel; case $with_devel in
yes) { $as_echo "$as_me:${as_lineno-$LINENO}: Setting up for development: -Wall, flex, yacc" >&5
$as_echo "$as_me: Setting up for development: -Wall, flex, yacc" >&6;}
OSDEFS="${OSDEFS} -DSUDO_DEVEL"
DEV=""
devdir=.
;;
no) ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring unknown argument to --with-devel: $with_devel" >&5
$as_echo "$as_me: WARNING: Ignoring unknown argument to --with-devel: $with_devel" >&2;}
;;
esac
fi
# Check whether --with-efence was given.
if test "${with_efence+set}" = set; then :
withval=$with_efence; case $with_efence in
@@ -5463,10 +5466,6 @@ else
fi
if test X"$with_devel" != X"yes"; then
ac_cv_prog_cc_g=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
$as_echo_n "checking for library containing strerror... " >&6; }
if test "${ac_cv_search_strerror+set}" = set; then :
@@ -6554,13 +6553,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:6557: $ac_compile\"" >&5)
(eval echo "\"\$as_me:6556: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:6560: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:6559: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:6563: output\"" >&5)
(eval echo "\"\$as_me:6562: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -7765,7 +7764,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 7768 "configure"' > conftest.$ac_ext
echo '#line 7767 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -9157,11 +9156,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:9160: $lt_compile\"" >&5)
(eval echo "\"\$as_me:9159: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:9164: \$? = $ac_status" >&5
echo "$as_me:9163: \$? = $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.
@@ -9496,11 +9495,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:9499: $lt_compile\"" >&5)
(eval echo "\"\$as_me:9498: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:9503: \$? = $ac_status" >&5
echo "$as_me:9502: \$? = $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.
@@ -9601,11 +9600,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:9604: $lt_compile\"" >&5)
(eval echo "\"\$as_me:9603: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:9608: \$? = $ac_status" >&5
echo "$as_me:9607: \$? = $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
@@ -9656,11 +9655,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:9659: $lt_compile\"" >&5)
(eval echo "\"\$as_me:9658: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:9663: \$? = $ac_status" >&5
echo "$as_me:9662: \$? = $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
@@ -12023,7 +12022,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12026 "configure"
#line 12025 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12119,7 +12118,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12122 "configure"
#line 12121 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H

View File

@@ -198,6 +198,21 @@ dnl
dnl Options for --with
dnl
AC_ARG_WITH(devel, [AS_HELP_STRING([--with-devel], [add development options])],
[case $with_devel in
yes) AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
OSDEFS="${OSDEFS} -DSUDO_DEVEL"
DEV=""
devdir=.
;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
;;
esac])
if test X"$with_devel" != X"yes"; then
ac_cv_prog_cc_g=no
fi
AC_ARG_WITH(CC, [AS_HELP_STRING([--with-CC], [C compiler to use])],
[case $with_CC in
yes) AC_MSG_ERROR(["must give --with-CC an argument."])
@@ -287,18 +302,6 @@ AC_ARG_WITH(libraries, [AS_HELP_STRING([--with-libraries], [additional libraries
;;
esac])
AC_ARG_WITH(devel, [AS_HELP_STRING([--with-devel], [add development options])],
[case $with_devel in
yes) AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
OSDEFS="${OSDEFS} -DSUDO_DEVEL"
DEV=""
devdir=.
;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
;;
esac])
AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence], [link with -lefence for malloc() debugging])],
[case $with_efence in
yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
@@ -1297,13 +1300,6 @@ AC_ARG_ENABLE(gss_krb5_ccache_name,
[AS_HELP_STRING([--enable-gss-krb5-ccache-name], [Use GSS-API to set the Kerberos V cred cache name])],
[check_gss_krb5_ccache_name=$enableval], [check_gss_krb5_ccache_name=no])
dnl
dnl Prevent configure from adding the -g flag unless in devel mode
dnl
if test X"$with_devel" != X"yes"; then
ac_cv_prog_cc_g=no
fi
dnl
dnl C compiler checks
dnl