diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-18 02:14:52 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-18 10:15:15 -0400 |
commit | 982c3a65ca5dbea8d6de3afd934f0a06fef54383 (patch) | |
tree | 416ece9ed53e3350c23a09b381139bdc4cc9c6d7 /sim/m32r | |
parent | 3f8414df7a533cccd39bf19c0e311975d9ededde (diff) | |
download | gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.zip gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.tar.gz gdb-982c3a65ca5dbea8d6de3afd934f0a06fef54383.tar.bz2 |
sim: move -Werror disabling to Makefile
For the ports that still don't build with -Werror, rather than disable
the flag at configure time, do it at make time. This will allow us to
unify these tests in the common sim configure script.
Diffstat (limited to 'sim/m32r')
-rw-r--r-- | sim/m32r/ChangeLog | 6 | ||||
-rw-r--r-- | sim/m32r/Makefile.in | 3 | ||||
-rwxr-xr-x | sim/m32r/configure | 206 | ||||
-rw-r--r-- | sim/m32r/configure.ac | 1 |
4 files changed, 113 insertions, 103 deletions
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog index f660050..bdf8490 100644 --- a/sim/m32r/ChangeLog +++ b/sim/m32r/ChangeLog @@ -1,5 +1,11 @@ 2021-06-18 Mike Frysinger <vapier@gentoo.org> + * Makefile.in (SIM_WERROR_CFLAGS): New variable. + * configure.ac: Delete call to SIM_AC_OPTION_WARNINGS. + * configure: Regenerate. + +2021-06-18 Mike Frysinger <vapier@gentoo.org> + * traps-linux.c: Include sim-signal.h. * traps.c: diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in index 2bb246d..2729745 100644 --- a/sim/m32r/Makefile.in +++ b/sim/m32r/Makefile.in @@ -44,6 +44,9 @@ SIM_EXTRA_CFLAGS = @sim_extra_cflags@ SIM_EXTRA_CLEAN = m32r-clean +# Code doesn't build cleanly yet. +SIM_WERROR_CFLAGS = + ## COMMON_POST_CONFIG_FRAG arch = m32r diff --git a/sim/m32r/configure b/sim/m32r/configure index 1f12c92..b144a15 100755 --- a/sim/m32r/configure +++ b/sim/m32r/configure @@ -773,11 +773,11 @@ enable_maintainer_mode enable_sim_inline enable_sim_scache enable_sim_default_model +enable_cgen_maint +enable_sim_hardware enable_werror enable_build_warnings enable_sim_build_warnings -enable_cgen_maint -enable_sim_hardware ' ac_precious_vars='build_alias host_alias @@ -1420,14 +1420,14 @@ Optional Features: Specify simulator execution cache size --enable-sim-default-model=model Specify default model to simulate + --enable-cgen-maint=DIR build cgen generated files + --enable-sim-hardware=LIST + Specify the hardware to be included in the build. --enable-werror treat compile warnings as errors --enable-build-warnings enable build-time compiler warnings if gcc is used --enable-sim-build-warnings enable SIM specific build-time compiler warnings if gcc is used - --enable-cgen-maint=DIR build cgen generated files - --enable-sim-hardware=LIST - Specify the hardware to be included in the build. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11187,103 +11187,6 @@ fi -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; - esac -fi - - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -WERROR_CFLAGS="" - -build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wpointer-sign \ --Wno-unused -Wunused-value -Wunused-function \ --Wno-switch -Wno-char-subscripts -Wmissing-prototypes --Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \ --Wold-style-declaration -Wold-style-definition" - -# Enable -Wno-format by default when using gcc on mingw since many -# GCC versions complain about %I64. -case "${host}" in - *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; - *) build_warnings="$build_warnings -Wformat-nonliteral" ;; -esac - -# Check whether --enable-build-warnings was given. -if test "${enable_build_warnings+set}" = set; then : - enableval=$enable_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting compiler warning flags = $build_warnings" 6>&1 -fi -fi -# Check whether --enable-sim-build-warnings was given. -if test "${enable_sim_build_warnings+set}" = set; then : - enableval=$enable_sim_build_warnings; case "${enableval}" in - yes) ;; - no) build_warnings="-w";; - ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${build_warnings} ${t}";; - *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` - build_warnings="${t} ${build_warnings}";; - *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; -esac -if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 -fi -fi -WARN_CFLAGS="" -if test "x${build_warnings}" != x -a "x$GCC" = xyes -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 -$as_echo_n "checking compiler warning flags... " >&6; } - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) # Check that GCC accepts it - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror $w" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - WARN_CFLAGS="${WARN_CFLAGS} $w" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" - esac - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 -$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } -fi - - cgen_maint=no cgen=guile cgendir='$(srcdir)/../../cgen' @@ -11429,6 +11332,105 @@ fi +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; case "${enableval}" in + yes | y) ERROR_ON_WARNING="yes" ;; + no | n) ERROR_ON_WARNING="no" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; + esac +fi + + +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then + ERROR_ON_WARNING=yes +fi + +WERROR_CFLAGS="" +if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" +fi + +build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ +-Wpointer-sign \ +-Wno-unused -Wunused-value -Wunused-function \ +-Wno-switch -Wno-char-subscripts -Wmissing-prototypes +-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \ +-Wold-style-declaration -Wold-style-definition" + +# Enable -Wno-format by default when using gcc on mingw since many +# GCC versions complain about %I64. +case "${host}" in + *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;; + *) build_warnings="$build_warnings -Wformat-nonliteral" ;; +esac + +# Check whether --enable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then : + enableval=$enable_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting compiler warning flags = $build_warnings" 6>&1 +fi +fi +# Check whether --enable-sim-build-warnings was given. +if test "${enable_sim_build_warnings+set}" = set; then : + enableval=$enable_sim_build_warnings; case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 +fi +fi +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 +$as_echo_n "checking compiler warning flags... " >&6; } + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) # Check that GCC accepts it + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror $w" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + WARN_CFLAGS="${WARN_CFLAGS} $w" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$saved_CFLAGS" + esac + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 +$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } +fi + + cgen_breaks="" if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then cgen_breaks="break cgen_rtx_error"; diff --git a/sim/m32r/configure.ac b/sim/m32r/configure.ac index 9377081..3146fee 100644 --- a/sim/m32r/configure.ac +++ b/sim/m32r/configure.ac @@ -6,7 +6,6 @@ SIM_AC_COMMON SIM_AC_OPTION_SCACHE(16384) SIM_AC_OPTION_DEFAULT_MODEL(m32r/d) -SIM_AC_OPTION_WARNINGS(no) SIM_AC_OPTION_CGEN_MAINT case "${target_alias}" in |