From: Mike Frysinger Date: Tue, 5 Dec 2023 04:43:51 +0000 (-0500) Subject: sim: warnings: enable only for development builds X-Git-Tag: binutils-2_42~722 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab18008ed17e0b3ceb39c86562711b8834ed6178;p=thirdparty%2Fbinutils-gdb.git sim: warnings: enable only for development builds Reuse the bfd/development.sh script like most other project to determine whether the current source tree is a dev build (e.g. git) or a release build, and disable the warnings for releases. --- diff --git a/sim/Makefile.am b/sim/Makefile.am index 3693eb18d49..b42926070db 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -45,6 +45,8 @@ MOSTLYCLEANFILES = core ## make sure all objects in subdirs get cleaned up. MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o) +CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh + AM_CFLAGS = \ $(WERROR_CFLAGS) \ $(WARN_CFLAGS) \ diff --git a/sim/Makefile.in b/sim/Makefile.in index 3dd14543450..ec24aa196ac 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -1798,6 +1798,7 @@ MOSTLYCLEANFILES = core $(SIM_ENABLED_ARCHES:%=%/*.o) \ $(am__append_57) $(am__append_61) $(am__append_75) \ $(am__append_80) $(am__append_88) $(am__append_103) \ $(am__append_107) +CONFIG_STATUS_DEPENDENCIES = $(srcroot)/bfd/development.sh AM_CFLAGS = \ $(WERROR_CFLAGS) \ $(WARN_CFLAGS) \ diff --git a/sim/configure b/sim/configure index de67d95d4ab..32cd8fb051f 100755 --- a/sim/configure +++ b/sim/configure @@ -3009,6 +3009,8 @@ _ACEOF ac_config_headers="$ac_config_headers config.h" +. $srcdir/../bfd/development.sh + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -12288,7 +12290,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12291 "configure" +#line 12293 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12394,7 +12396,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12397 "configure" +#line 12399 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15811,7 +15813,7 @@ if test "${enable_werror+set}" = set; then : fi -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then ERROR_ON_WARNING=yes fi diff --git a/sim/configure.ac b/sim/configure.ac index ecda34a6b3f..84a7e0a249e 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -14,6 +14,9 @@ AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address AC_CONFIG_HEADERS([config.h]) +dnl Set the 'development' global before loading the SIM macros. +. $srcdir/../bfd/development.sh + SIM_AC_TOOLCHAIN SIM_AC_PLATFORM diff --git a/sim/m4/sim_ac_option_warnings.m4 b/sim/m4/sim_ac_option_warnings.m4 index 8ff94df0320..16d358b0bba 100644 --- a/sim/m4/sim_ac_option_warnings.m4 +++ b/sim/m4/sim_ac_option_warnings.m4 @@ -25,8 +25,8 @@ AC_ARG_ENABLE(werror, *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; esac]) -dnl Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then +dnl Enable -Werror by default when using gcc. Turn it off for releases. +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then ERROR_ON_WARNING=yes fi