summaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-03-16 16:17:14 +0000
committerNick Clifton <nickc@redhat.com>2005-03-16 16:17:14 +0000
commit1ad12f975f8a2a0ce45569ea3f550ef25705ad37 (patch)
treed5cc4951369f37e674d91cba4892aaa87a487ab7 /gprof
parent9b265ec209d7dd38bd411cdd3bac4d705a244398 (diff)
downloadbinutils-gdb-1ad12f975f8a2a0ce45569ea3f550ef25705ad37.tar.gz
Enable -Werror by default
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog8
-rwxr-xr-xgprof/configure23
-rw-r--r--gprof/configure.in16
3 files changed, 46 insertions, 1 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 333e9528472..9a07866f333 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,11 @@
+2005-03-16 Nick Clifton <nickc@redhat.com>
+ Ben Elliston <bje@au.ibm.com>
+
+ * configure.in (error-on-warning): New switch: Add -Werror to the
+ compiler command line. Enabled by default. Disable via
+ --disable-error-on-warning.
+ * configure: Regenerate.
+
2005-03-15 Nick Clifton <nickc@redhat.com>
* basic_blocks.c (print_exec_counts): Step through sorted array of
diff --git a/gprof/configure b/gprof/configure
index 70bb404b6fb..d8df9412e36 100755
--- a/gprof/configure
+++ b/gprof/configure
@@ -859,6 +859,7 @@ Optional Features:
--disable-nls do not use Native Language Support
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --enable-error-on-warning treat compile warnings as errors
--enable-build-warnings Enable build-time compiler warnings if gcc is used
Optional Packages:
@@ -3809,7 +3810,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3812 "configure"' > conftest.$ac_ext
+ echo '#line 3813 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8287,6 +8288,26 @@ done
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+# Check whether --enable-error-on-warning or --disable-error-on-warning was given.
+if test "${enable_error_on_warning+set}" = set; then
+ enableval="$enable_error_on_warning"
+ case "${enableval}" in
+ yes | y) ERROR_ON_WARNING="yes" ;;
+ no | n) ERROR_ON_WARNING="no" ;;
+ *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-error-on-warning" >&5
+echo "$as_me: error: bad value ${enableval} for --enable-error-on-warning" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+fi;
+
+# Enable -Werror by default, suppressing it only for --disable-error-on-warning
+# or --disable-build-warnings.
+if test "${ERROR_ON_WARNING}" != no
+then
+ build_warnings="$build_warnings -Werror"
+fi
+
# Check whether --enable-build-warnings or --disable-build-warnings was given.
if test "${enable_build_warnings+set}" = set; then
enableval="$enable_build_warnings"
diff --git a/gprof/configure.in b/gprof/configure.in
index ae284bcdc43..de9d79128e2 100644
--- a/gprof/configure.in
+++ b/gprof/configure.in
@@ -33,6 +33,22 @@ AC_EXEEXT
AC_CHECK_HEADERS(sys/gmon_out.h)
build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+AC_ARG_ENABLE(error-on-warning,
+ [ --enable-error-on-warning treat compile warnings as errors],
+ [case "${enableval}" in
+ yes | y) ERROR_ON_WARNING="yes" ;;
+ no | n) ERROR_ON_WARNING="no" ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
+ esac])
+
+# Enable -Werror by default, suppressing it only for --disable-error-on-warning
+# or --disable-build-warnings.
+if test "${ERROR_ON_WARNING}" != no
+then
+ build_warnings="$build_warnings -Werror"
+fi
+
AC_ARG_ENABLE(build-warnings,
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
[case "${enableval}" in