X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdbsupport%2Fconfigure;h=51caeeb180f175f80e47c0d5666dc5d545d89f59;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=a0df06bbd533902ec057c40ddd7b53a7225053a5;hpb=05ea2a051030a452bb1f4710dafeb1054cf38c17;p=deliverable%2Fbinutils-gdb.git diff --git a/gdbsupport/configure b/gdbsupport/configure index a0df06bbd5..51caeeb180 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -624,6 +624,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +WERROR_CFLAGS +WARN_CFLAGS SELFTEST_FALSE SELFTEST_TRUE LTLIBIPT @@ -768,7 +770,11 @@ with_intel_pt with_gnu_ld enable_rpath with_libipt_prefix +with_libipt_type enable_unit_tests +enable_werror +enable_build_warnings +enable_gdb_build_warnings ' ac_precious_vars='build_alias host_alias @@ -1415,6 +1421,11 @@ Optional Features: --disable-rpath do not hardcode runtime library paths --enable-unit-tests Enable the inclusion of unit tests when compiling GDB + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings if gcc is used + --enable-gdb-build-warnings + enable GDB specific build-time compiler warnings if + gcc is used Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1423,6 +1434,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libipt-prefix[=DIR] search for libipt in DIR/include and DIR/lib --without-libipt-prefix don't search for libipt in includedir and libdir + --with-libipt-type=TYPE type of library to search for (auto/static/shared) Some influential environment variables: CC C compiler command @@ -2713,7 +2725,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_config_headers="$ac_config_headers support-config.h:config.in" +ac_config_headers="$ac_config_headers config.h:config.in" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -8045,6 +8057,9 @@ fi + # Set the 'development' global. + . $srcdir/../bfd/development.sh + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : @@ -8389,7 +8404,7 @@ $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h fi - for ac_header in linux/perf_event.h locale.h memory.h signal.h sys/resource.h sys/socket.h sys/un.h sys/wait.h thread_db.h wait.h termios.h dlfcn.h linux/elf.h sys/procfs.h proc_service.h + for ac_header in linux/perf_event.h locale.h memory.h signal.h sys/resource.h sys/socket.h sys/un.h sys/wait.h thread_db.h wait.h termios.h dlfcn.h linux/elf.h sys/procfs.h proc_service.h poll.h sys/poll.h sys/select.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -8794,7 +8809,7 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi - for ac_func in fdwalk getrlimit pipe pipe2 socketpair sigaction \ + for ac_func in fdwalk getrlimit pipe pipe2 poll socketpair sigaction \ ptrace64 sbrk setns sigaltstack sigprocmask \ setpgid setpgrp getrusage getauxval do : @@ -9687,7 +9702,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 $as_echo_n "checking for sigsetjmp... " >&6; } if ${gdb_cv_func_sigsetjmp+:} false; then : $as_echo_n "(cached) " >&6 @@ -9695,7 +9710,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + #include int main () @@ -9714,11 +9729,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5 $as_echo "$gdb_cv_func_sigsetjmp" >&6; } -if test "$gdb_cv_func_sigsetjmp" = "yes"; then + if test "$gdb_cv_func_sigsetjmp" = "yes"; then $as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h -fi + fi # Check whether --with-intel_pt was given. @@ -9728,23 +9743,23 @@ else with_intel_pt=auto fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use intel pt" >&5 $as_echo_n "checking whether to use intel pt... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_intel_pt" >&5 $as_echo "$with_intel_pt" >&6; } -if test "${with_intel_pt}" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5 + if test "${with_intel_pt}" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&5 $as_echo "$as_me: WARNING: Intel Processor Trace support disabled; some features may be unavailable." >&2;} - HAVE_LIBIPT=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + HAVE_LIBIPT=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#ifndef PERF_ATTR_SIZE_VER5 -# error -#endif + #include + #ifndef PERF_ATTR_SIZE_VER5 + # error + #endif _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : @@ -9753,14 +9768,14 @@ else perf_event=no fi rm -f conftest.err conftest.i conftest.$ac_ext - if test "$perf_event" != yes; then - if test "$with_intel_pt" = yes; then - as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5 + if test "$perf_event" != yes; then + if test "$with_intel_pt" = yes; then + as_fn_error $? "linux/perf_event.h missing or too old" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5 $as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;} + fi fi - fi @@ -9811,6 +9826,16 @@ if test "${with_libipt_prefix+set}" = set; then : fi + +# Check whether --with-libipt-type was given. +if test "${with_libipt_type+set}" = set; then : + withval=$with_libipt_type; with_libipt_type=$withval +else + with_libipt_type=auto +fi + + lib_type=`eval echo \$with_libipt_type` + LIBIPT= LTLIBIPT= INCIPT= @@ -9848,13 +9873,13 @@ fi found_so= found_a= if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext" && test x$lib_type != xstatic; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi - else + elif test x$lib_type != xshared; then if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" @@ -9878,13 +9903,13 @@ fi case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext" && test x$lib_type != xstatic; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi - else + elif test x$lib_type != xshared; then if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" @@ -10112,8 +10137,13 @@ fi done fi else - LIBIPT="${LIBIPT}${LIBIPT:+ }-l$name" - LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-l$name" + if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then + LIBIPT="${LIBIPT}${LIBIPT:+ }-l$name" + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-l$name" + else + LIBIPT="${LIBIPT}${LIBIPT:+ }-l:lib$name.$libext" + LTLIBIPT="${LTLIBIPT}${LTLIBIPT:+ }-l:lib$name.$libext" + fi fi fi fi @@ -10224,17 +10254,17 @@ $as_echo "$LIBIPT" >&6; } - if test "$HAVE_LIBIPT" != yes; then - if test "$with_intel_pt" = yes; then - as_fn_error $? "libipt is missing or unusable" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5 + if test "$HAVE_LIBIPT" != yes; then + if test "$with_intel_pt" = yes; then + as_fn_error $? "libipt is missing or unusable" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libipt is missing or unusable; some features may be unavailable." >&5 $as_echo "$as_me: WARNING: libipt is missing or unusable; some features may be unavailable." >&2;} - fi - else - save_LIBS=$LIBS - LIBS="$LIBS $LIBIPT" - for ac_func in pt_insn_event + fi + else + save_LIBS=$LIBS + LIBS="$LIBS $LIBIPT" + for ac_func in pt_insn_event do : ac_fn_c_check_func "$LINENO" "pt_insn_event" "ac_cv_func_pt_insn_event" if test "x$ac_cv_func_pt_insn_event" = xyes; then : @@ -10245,7 +10275,7 @@ _ACEOF fi done - ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include + ac_fn_c_check_member "$LINENO" "struct pt_insn" "enabled" "ac_cv_member_struct_pt_insn_enabled" "#include " if test "x$ac_cv_member_struct_pt_insn_enabled" = xyes; then : @@ -10266,12 +10296,12 @@ _ACEOF fi - LIBS=$save_LIBS + LIBS=$save_LIBS + fi fi -fi -if test "$ac_cv_header_sys_procfs_h" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5 + if test "$ac_cv_header_sys_procfs_h" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gregset_t in sys/procfs.h" >&5 $as_echo_n "checking for gregset_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_gregset_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10308,7 +10338,7 @@ $as_echo "#define HAVE_GREGSET_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_gregset_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_gregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpregset_t in sys/procfs.h" >&5 $as_echo_n "checking for fpregset_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_fpregset_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10345,7 +10375,7 @@ $as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_fpregset_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_fpregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5 $as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_prgregset_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10382,7 +10412,7 @@ $as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prfpregset_t in sys/procfs.h" >&5 $as_echo_n "checking for prfpregset_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_prfpregset_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10419,7 +10449,7 @@ $as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset32_t in sys/procfs.h" >&5 $as_echo_n "checking for prgregset32_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_prgregset32_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10456,7 +10486,7 @@ $as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset32_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_prgregset32_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5 $as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_lwpid_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10493,7 +10523,7 @@ $as_echo "#define HAVE_LWPID_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5 $as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_psaddr_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10530,7 +10560,7 @@ $as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5 $as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; } if ${bfd_cv_have_sys_procfs_type_elf_fpregset_t+:} false; then : $as_echo_n "(cached) " >&6 @@ -10567,7 +10597,7 @@ $as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5 $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } -fi + fi # Check whether we will enable the inclusion of unit tests when @@ -10575,7 +10605,13 @@ fi # # The default value of this option changes depending whether we're on # development mode (in which case it's "true") or not (in which case -# it's "false"). +# it's "false"). The $development variable is set by the GDB_AC_COMMON +# macro, which must therefore be used before GDB_AC_SELFTEST. + +if test "x$development" != xtrue && test "x$development" != xfalse; then : + as_fn_error $? "Invalid value for \$development, got \"$development\", expecting \"true\" or \"false\"." "$LINENO" 5 +fi + # Check whether --enable-unit-tests was given. if test "${enable_unit_tests+set}" = set; then : enableval=$enable_unit_tests; case "${enableval}" in @@ -10630,26 +10666,6 @@ gdb_ptrace_headers=' # include #endif ' -# There is no point in checking if we don't have a prototype. -ac_fn_c_check_decl "$LINENO" "ptrace" "ac_cv_have_decl_ptrace" "$gdb_ptrace_headers -" -if test "x$ac_cv_have_decl_ptrace" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE $ac_have_decl -_ACEOF -if test $ac_have_decl = 1; then : - -else - - : ${gdb_cv_func_ptrace_ret='int'} - : ${gdb_cv_func_ptrace_args='int,int,long,long'} - -fi # Check return type. Varargs (used on GNU/Linux) conflict with the # empty argument list, so check for that explicitly. @@ -10806,6 +10822,193 @@ _ACEOF fi +# Detect support warning flags. + +# 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. Turn it off for releases. +if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then + ERROR_ON_WARNING=yes +fi + +WERROR_CFLAGS="" +if test "${ERROR_ON_WARNING}" = yes ; then + WERROR_CFLAGS="-Werror" +fi + +# The options we'll try to enable. +build_warnings="-Wall -Wpointer-arith \ +-Wno-unused -Wunused-value -Wunused-variable -Wunused-function \ +-Wno-switch -Wno-char-subscripts \ +-Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \ +-Wno-sign-compare -Wno-error=maybe-uninitialized \ +-Wno-mismatched-tags \ +-Wno-error=deprecated-register \ +-Wsuggest-override \ +-Wimplicit-fallthrough=3 \ +-Wduplicated-cond \ +-Wshadow=local \ +-Wdeprecated-copy \ +-Wdeprecated-copy-dtor \ +-Wredundant-move \ +-Wmissing-declarations \ +-Wmissing-prototypes \ +-Wstrict-null-sentinel \ +" + +case "${host}" in + *-*-mingw32*) + # Enable -Wno-format by default when using gcc on mingw since many + # GCC versions complain about %I64. + build_warnings="$build_warnings -Wno-format" ;; + *-*-solaris*) + # Solaris 11.4 uses #pragma no_inline that GCC + # doesn't understand. + build_warnings="$build_warnings -Wno-unknown-pragmas" + # Solaris 11 marks vfork deprecated. + build_warnings="$build_warnings -Wno-deprecated-declarations" ;; + *) + # Note that gcc requires -Wformat for -Wformat-nonliteral to work, + # but there's a special case for this below. + 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-gdb-build-warnings was given. +if test "${enable_gdb_build_warnings+set}" = set; then : + enableval=$enable_gdb_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 + +# The set of warnings supported by a C++ compiler is not the same as +# of the C compiler. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +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 + # GCC does not complain about -Wno-unknown-warning. Invert + # and test -Wunknown-warning instead. + case $w in + -Wno-*) + wtest=`echo $w | sed 's/-Wno-/-W/g'` ;; + -Wformat-nonliteral) + # gcc requires -Wformat before -Wformat-nonliteral + # will work, so stick them together. + w="-Wformat $w" + wtest="$w" + ;; + *) + wtest=$w ;; + esac + + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) + # Check whether GCC accepts it. + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror $wtest" + saved_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -Werror $wtest" + if test "x$w" = "x-Wunused-variable"; then + # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958, + # fixed in GCC 4.9. This test is derived from the gdb + # source code that triggered this bug in GCC. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +struct scoped_restore_base {}; + struct scoped_restore_tmpl : public scoped_restore_base { + ~scoped_restore_tmpl() {} + }; +int +main () +{ +const scoped_restore_base &b = scoped_restore_tmpl(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + WARN_CFLAGS="${WARN_CFLAGS} $w" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + WARN_CFLAGS="${WARN_CFLAGS} $w" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + CFLAGS="$saved_CFLAGS" + CXXFLAGS="$saved_CXXFLAGS" + esac + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 +$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h` cat >>confdefs.h <<_ACEOF @@ -11563,7 +11766,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 for ac_config_target in $ac_config_targets do case $ac_config_target in - "support-config.h") CONFIG_HEADERS="$CONFIG_HEADERS support-config.h:config.in" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;