From patchwork Thu Mar 5 19:30:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 38438 Received: (qmail 64377 invoked by alias); 5 Mar 2020 19:30:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 64160 invoked by uid 89); 5 Mar 2020 19:30:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LINEPADDING, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy= X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Mar 2020 19:30:22 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id VzPqT0JkpkR1wl99 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 05 Mar 2020 14:30:12 -0500 (EST) Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 875A5441B21; Thu, 5 Mar 2020 14:30:12 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 2/4] Move sourcing of development.sh to GDB_AC_COMMON Date: Thu, 5 Mar 2020 14:30:09 -0500 Message-Id: <20200305193011.25939-2-simon.marchi@efficios.com> In-Reply-To: <20200305193011.25939-1-simon.marchi@efficios.com> References: <20200305193011.25939-1-simon.marchi@efficios.com> MIME-Version: 1.0 The same is done for gdb, gdbserver and gdbsupport. I therefore think it makes sense to move that to GDB_AC_COMMON. It is required to move the call to GDB_AC_COMMON so it is before GDB_AC_SELFTEST in gdbserver/configure.ac, otherwise the $development variable isn't set when the code behind GDB_AC_SELFTEST executes. gdb/ChangeLog: * configure.ac: Don't source bfd/development.sh. * selftest.m4: Modify comment. * configure: Re-generate. gdbserver/ChangeLog: * configure.ac: Don't source bfd/development.sh, move GDB_AC_COMMON higher. * configure: Re-generate. gdbsupport/ChangeLog: * configure.ac: Don't source bfd/development.sh. * common.m4: Source bfd/development.sh. * configure: Re-generate. --- gdb/configure | 9 +- gdb/configure.ac | 3 - gdb/selftest.m4 | 3 +- gdbserver/configure | 1287 ++++++++++++++++++++------------------- gdbserver/configure.ac | 5 +- gdbsupport/common.m4 | 3 + gdbsupport/configure | 9 +- gdbsupport/configure.ac | 3 - 8 files changed, 660 insertions(+), 662 deletions(-) diff --git a/gdb/configure b/gdb/configure index d885b94b8b..a8a1419326 100755 --- a/gdb/configure +++ b/gdb/configure @@ -2988,9 +2988,6 @@ fi -# Set the 'development' global. -. $srcdir/../bfd/development.sh - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -12434,6 +12431,9 @@ $as_echo "$ac_cv_path_SED" >&6; } rm -f conftest.sed + # 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 : @@ -19185,7 +19185,8 @@ $as_echo "#define GDB_DEFAULT_HOST_CHARSET \"UTF-8\"" >>confdefs.h # # 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 diff --git a/gdb/configure.ac b/gdb/configure.ac index 1cba1e832b..76c396c6eb 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -24,9 +24,6 @@ AC_INIT(main.c) AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h]) AM_MAINTAINER_MODE -# Set the 'development' global. -. $srcdir/../bfd/development.sh - AC_PROG_CC AC_PROG_CXX diff --git a/gdb/selftest.m4 b/gdb/selftest.m4 index a88aa96171..3624f25f24 100644 --- a/gdb/selftest.m4 +++ b/gdb/selftest.m4 @@ -26,7 +26,8 @@ AC_DEFUN([GDB_AC_SELFTEST],[ # # 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. AS_IF([test "x$development" != xtrue && test "x$development" != xfalse], [AC_MSG_ERROR([Invalid value for \$development, got "$development", expecting "true" or "false".])]) diff --git a/gdbserver/configure b/gdbserver/configure index 06b25ba2b6..3092314c58 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -637,6 +637,12 @@ WERROR_CFLAGS WARN_CFLAGS ustinc ustlibs +CCDEPMODE +CONFIG_SRC_SUBDIR +DEPDIR +am__leading_dot +host_noncanonical +target_noncanonical LTLIBIPT LIBIPT HAVE_LIBIPT @@ -646,12 +652,6 @@ PTHREAD_CC ax_pthread_config SED ALLOCA -CCDEPMODE -CONFIG_SRC_SUBDIR -DEPDIR -am__leading_dot -host_noncanonical -target_noncanonical CXX_DIALECT HAVE_CXX11 RANLIB @@ -733,12 +733,12 @@ ac_user_opts=' enable_option_checking enable_maintainer_mode enable_largefile -enable_unit_tests with_intel_pt with_gnu_ld enable_rpath with_libipt_prefix with_libipt_type +enable_unit_tests with_ust with_ust_include with_ust_lib @@ -1383,9 +1383,9 @@ Optional Features: enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-largefile omit support for large files + --disable-rpath do not hardcode runtime library paths --enable-unit-tests Enable the inclusion of unit tests when compiling GDB - --disable-rpath do not hardcode runtime library paths --enable-werror treat compile warnings as errors --enable-build-warnings enable build-time compiler warnings if gcc is used --enable-gdb-build-warnings @@ -6073,551 +6073,135 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -# Set the 'development' global. -. $srcdir/../bfd/development.sh - +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : -# Check whether we will enable the inclusion of unit tests when -# compiling GDB. -# -# 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"). +else -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 +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF -# Check whether --enable-unit-tests was given. -if test "${enable_unit_tests+set}" = set; then : - enableval=$enable_unit_tests; case "${enableval}" in - yes) enable_unittests=true ;; - no) enable_unittests=false ;; - *) as_fn_error $? "bad value ${enableval} for --{enable,disable}-unit-tests option" "$LINENO" 5 ;; -esac -else - enable_unittests=$development fi -if $enable_unittests; then - -$as_echo "#define GDB_SELF_TEST 1" >>confdefs.h - srv_selftest_objs="gdbsupport/selftest.o" + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi +done - case ${build_alias} in - "") build_noncanonical=${build} ;; - *) build_noncanonical=${build_alias} ;; -esac - - case ${host_alias} in - "") host_noncanonical=${build_noncanonical} ;; - *) host_noncanonical=${host_alias} ;; -esac - case ${target_alias} in - "") target_noncanonical=${host_noncanonical} ;; - *) target_noncanonical=${target_alias} ;; -esac +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : -# Dependency checking. -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depdir" - - - -# Create sub-directories for objects and dependencies. -CONFIG_SRC_SUBDIR="arch gdbsupport nat target" - - -ac_config_commands="$ac_config_commands gdbdepdir" +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF -depcc="$CC" am_compiler_list= +fi -am_depcomp=$ac_aux_dir/depcomp -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else - if test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - if test $depmode = none; then break; fi - - $as_echo "$as_me:$LINENO: trying $depmode" >&5 - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "include sub/conftest.Po" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - depcmd="depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c" - echo "| $depcmd" | sed -e 's/ */ /g' >&5 - if env $depcmd > conftest.err 2>&1 && - grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 && - ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - $as_echo "$as_me:$LINENO: success" >&5 - break - fi + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count fi - $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5 - sed -e 's/^/| /' < conftest.err >&5 + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - cd .. - rm -rf conftest.dir + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - am_cv_CC_dependencies_compiler_type=none + ac_cv_path_SED=$SED fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -if test x${am_cv_CC_dependencies_compiler_type-none} = xnone -then as_fn_error $? "no usable dependency style found" "$LINENO" 5 -else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed -fi - - -for ac_header in termios.h sys/reg.h string.h sys/procfs.h linux/elf.h fcntl.h signal.h sys/file.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.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" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -for ac_header in vfork.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_VFORK_H 1 -_ACEOF - -fi - -done - -for ac_func in fork vfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -if test "x$ac_cv_func_fork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 -$as_echo_n "checking for working fork... " >&6; } -if ${ac_cv_func_fork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_fork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* By Ruediger Kuhlmann. */ - return fork () < 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_fork_works=yes -else - ac_cv_func_fork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 -$as_echo "$ac_cv_func_fork_works" >&6; } - -else - ac_cv_func_fork_works=$ac_cv_func_fork -fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 -$as_echo_n "checking for working vfork... " >&6; } -if ${ac_cv_func_vfork_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_vfork_works=cross -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Thanks to Paul Eggert for this test. */ -$ac_includes_default -#include -#ifdef HAVE_VFORK_H -# include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include , but some compilers - (e.g. gcc -O) don't grok . Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static void -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} - -int -main () -{ - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (0); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - return ( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_vfork_works=yes -else - ac_cv_func_vfork_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 -$as_echo "$ac_cv_func_vfork_works" >&6; } - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=$ac_cv_func_vfork - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 -$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} -fi - -if test "x$ac_cv_func_vfork_works" = xyes; then - -$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h - -else - -$as_echo "#define vfork fork" >>confdefs.h - -fi -if test "x$ac_cv_func_fork_works" = xyes; then - -$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h - -fi - -for ac_func in pread pwrite pread64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. @@ -6762,6 +6346,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 : @@ -9061,25 +8648,173 @@ fpregset_t avar } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_fpregset_t=yes + bfd_cv_have_sys_procfs_type_fpregset_t=yes +else + bfd_cv_have_sys_procfs_type_fpregset_t=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then + +$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h + + fi + { $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_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 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include +int +main () +{ +prgregset_t avar + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_prgregset_t=yes +else + bfd_cv_have_sys_procfs_type_prgregset_t=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then + +$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h + + fi + { $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_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 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include +int +main () +{ +prfpregset_t avar + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_prfpregset_t=yes +else + bfd_cv_have_sys_procfs_type_prfpregset_t=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + +$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h + + fi + { $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_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 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include +int +main () +{ +prgregset32_t avar + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_prgregset32_t=yes +else + bfd_cv_have_sys_procfs_type_prgregset32_t=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then + +$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h + + fi + { $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_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 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _SYSCALL32 +/* Needed for new procfs interface on sparc-solaris. */ +#define _STRUCTURED_PROC 1 +#include +int +main () +{ +lwpid_t avar + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + bfd_cv_have_sys_procfs_type_lwpid_t=yes else - bfd_cv_have_sys_procfs_type_fpregset_t=no + bfd_cv_have_sys_procfs_type_lwpid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then + if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then -$as_echo "#define HAVE_FPREGSET_T 1" >>confdefs.h +$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h fi - { $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}: 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 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 "$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 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9092,31 +8827,31 @@ else int main () { -prgregset_t avar +psaddr_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prgregset_t=yes + bfd_cv_have_sys_procfs_type_psaddr_t=yes else - bfd_cv_have_sys_procfs_type_prgregset_t=no + bfd_cv_have_sys_procfs_type_psaddr_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then + if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then -$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h +$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h fi - { $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}: 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 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 "$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 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9129,177 +8864,443 @@ else int main () { -prfpregset_t avar +elf_fpregset_t avar ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prfpregset_t=yes + bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes else - bfd_cv_have_sys_procfs_type_prfpregset_t=no + bfd_cv_have_sys_procfs_type_elf_fpregset_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then -$as_echo "#define HAVE_PRFPREGSET_T 1" >>confdefs.h +$as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h fi - { $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}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5 +$as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } - { $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 : + fi + + + +# Check whether we will enable the inclusion of unit tests when +# compiling GDB. +# +# 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"). 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 + yes) enable_unittests=true ;; + no) enable_unittests=false ;; + *) as_fn_error $? "bad value ${enableval} for --{enable,disable}-unit-tests option" "$LINENO" 5 ;; +esac +else + enable_unittests=$development +fi + + +if $enable_unittests; then + +$as_echo "#define GDB_SELF_TEST 1" >>confdefs.h + + + srv_selftest_objs="gdbsupport/selftest.o" + +fi + + + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac + + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac + + + + + + +# Dependency checking. +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depdir" + + + +# Create sub-directories for objects and dependencies. +CONFIG_SRC_SUBDIR="arch gdbsupport nat target" + + +ac_config_commands="$ac_config_commands gdbdepdir" + + +depcc="$CC" am_compiler_list= + +am_depcomp=$ac_aux_dir/depcomp +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -prgregset32_t avar - ; - return 0; -} + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + if test $depmode = none; then break; fi + + $as_echo "$as_me:$LINENO: trying $depmode" >&5 + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "include sub/conftest.Po" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + depcmd="depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c" + echo "| $depcmd" | sed -e 's/ */ /g' >&5 + if env $depcmd > conftest.err 2>&1 && + grep sub/conftst6.h sub/conftest.Po >>conftest.err 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po >>conftest.err 2>&1 && + ${MAKE-make} -s -f confmf >>conftest.err 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + $as_echo "$as_me:$LINENO: success" >&5 + break + fi + fi + $as_echo "$as_me:$LINENO: failure, diagnostics are:" >&5 + sed -e 's/^/| /' < conftest.err >&5 + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +if test x${am_cv_CC_dependencies_compiler_type-none} = xnone +then as_fn_error $? "no usable dependency style found" "$LINENO" 5 +else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +fi + + +for ac_header in termios.h sys/reg.h string.h sys/procfs.h linux/elf.h fcntl.h signal.h sys/file.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.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" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in vfork.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" +if test "x$ac_cv_header_vfork_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VFORK_H 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prgregset32_t=yes -else - bfd_cv_have_sys_procfs_type_prgregset32_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then +done -$as_echo "#define HAVE_PRGREGSET32_T 1" >>confdefs.h +for ac_func in fork vfork +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - fi - { $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; } +fi +done - { $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 : +if test "x$ac_cv_func_fork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 +$as_echo_n "checking for working fork... " >&6; } +if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include +$ac_includes_default int main () { -lwpid_t avar + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_lwpid_t=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_fork_works=yes else - bfd_cv_have_sys_procfs_type_lwpid_t=no - + ac_cv_func_fork_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then - -$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h - - fi - { $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; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 +$as_echo "$ac_cv_func_fork_works" >&6; } - { $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 : +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 +$as_echo_n "checking for working vfork... " >&6; } +if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include int main () { -psaddr_t avar - ; - return 0; + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_psaddr_t=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_vfork_works=yes else - bfd_cv_have_sys_procfs_type_psaddr_t=no - + ac_cv_func_vfork_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 +$as_echo "$ac_cv_func_vfork_works" >&6; } -$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi - fi - { $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; } +if test "x$ac_cv_func_vfork_works" = xyes; then - { $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 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include -int -main () -{ -elf_fpregset_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes else - bfd_cv_have_sys_procfs_type_elf_fpregset_t=no + +$as_echo "#define vfork fork" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi +if test "x$ac_cv_func_fork_works" = xyes; then - if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then +$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h -$as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h +fi - fi - { $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; } +for ac_func in pread pwrite pread64 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - fi +fi +done # Check the return and argument types of ptrace. diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac index be2284b26c..db9d45715e 100644 --- a/gdbserver/configure.ac +++ b/gdbserver/configure.ac @@ -43,8 +43,7 @@ AX_CXX_COMPILE_STDCXX(11, , mandatory) AC_HEADER_STDC -# Set the 'development' global. -. $srcdir/../bfd/development.sh +GDB_AC_COMMON GDB_AC_SELFTEST([ srv_selftest_objs="gdbsupport/selftest.o" @@ -77,8 +76,6 @@ AC_CHECK_HEADERS(termios.h sys/reg.h string.h dnl AC_FUNC_FORK AC_CHECK_FUNCS(pread pwrite pread64) -GDB_AC_COMMON - # Check the return and argument types of ptrace. GDB_AC_PTRACE diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index 68a354551a..e67058632c 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -18,6 +18,9 @@ dnl along with this program. If not, see . dnl Invoke configury needed by the files in 'common'. AC_DEFUN([GDB_AC_COMMON], [ + # Set the 'development' global. + . $srcdir/../bfd/development.sh + AC_HEADER_STDC AC_FUNC_ALLOCA diff --git a/gdbsupport/configure b/gdbsupport/configure index 8d25380ec8..265cb420af 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -3538,9 +3538,6 @@ fi AM_BACKSLASH='\' -# Set the 'development' global. -. $srcdir/../bfd/development.sh - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8060,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 : @@ -10605,7 +10605,8 @@ $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } # # 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 diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac index 0b2f2415d5..401e16f821 100644 --- a/gdbsupport/configure.ac +++ b/gdbsupport/configure.ac @@ -25,9 +25,6 @@ AC_CONFIG_AUX_DIR(..) AM_INIT_AUTOMAKE AM_SILENT_RULES([yes]) -# Set the 'development' global. -. $srcdir/../bfd/development.sh - AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB