From 2978b11100a6318e05b8bc2d7923d9f735ef5c6e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 6 Nov 2013 07:28:57 -0700 Subject: [PATCH] remove gdb_dirent.h This removes gdb_dirent.h and updates the code to use dirent.h instead. It also removes the now-useless configure checks. 2013-11-18 Tom Tromey * common/common.m4 (GDB_AC_COMMON): Don't use AC_HEADER_DIRENT. * common/gdb_dirent.h: Remove. * common/filestuff.c: Use dirent.h. * common/linux-osdata.c: Use dirent.h. (NAMELEN): Define. * config.in: Rebuild. * configure: Rebuild. * configure.ac: Don't use AC_HEADER_DIRENT. * linux-fork.c: Use dirent.h * linux-nat.c: Use dirent.h. * nto-procfs.c: Use dirent.h. * procfs.c: Use dirent.h. 2013-11-18 Tom Tromey * config.in: Rebuild. * configure: Rebuild. * configure.ac: Don't use AC_HEADER_DIRENT. --- gdb/ChangeLog | 15 ++ gdb/common/common.m4 | 1 - gdb/common/filestuff.c | 2 +- gdb/common/gdb_dirent.h | 40 ----- gdb/common/linux-osdata.c | 4 +- gdb/config.in | 15 -- gdb/configure | 318 ------------------------------------- gdb/configure.ac | 1 - gdb/gdbserver/ChangeLog | 6 + gdb/gdbserver/config.in | 15 -- gdb/gdbserver/configure | 318 ------------------------------------- gdb/gdbserver/configure.ac | 1 - gdb/linux-fork.c | 2 +- gdb/linux-nat.c | 2 +- gdb/nto-procfs.c | 2 +- gdb/procfs.c | 2 +- 16 files changed, 29 insertions(+), 715 deletions(-) delete mode 100644 gdb/common/gdb_dirent.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43711479718..fc6336cef5f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,18 @@ +2013-11-18 Tom Tromey + + * common/common.m4 (GDB_AC_COMMON): Don't use AC_HEADER_DIRENT. + * common/gdb_dirent.h: Remove. + * common/filestuff.c: Use dirent.h. + * common/linux-osdata.c: Use dirent.h. + (NAMELEN): Define. + * config.in: Rebuild. + * configure: Rebuild. + * configure.ac: Don't use AC_HEADER_DIRENT. + * linux-fork.c: Use dirent.h + * linux-nat.c: Use dirent.h. + * nto-procfs.c: Use dirent.h. + * procfs.c: Use dirent.h. + 2013-11-18 Tom Tromey * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirent. diff --git a/gdb/common/common.m4 b/gdb/common/common.m4 index b1abc4df3f6..29debd1b8fb 100644 --- a/gdb/common/common.m4 +++ b/gdb/common/common.m4 @@ -19,7 +19,6 @@ dnl along with this program. If not, see . dnl Invoke configury needed by the files in 'common'. AC_DEFUN([GDB_AC_COMMON], [ AC_HEADER_STDC - AC_HEADER_DIRENT AC_FUNC_ALLOCA dnl Note that this requires codeset.m4, which is included diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index ff6d54fc20c..bbb60a7dcaa 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -58,7 +58,7 @@ #ifndef HAVE_FDWALK -#include "gdb_dirent.h" +#include /* Replacement for fdwalk, if the system doesn't define it. Walks all open file descriptors (though this implementation may walk closed diff --git a/gdb/common/gdb_dirent.h b/gdb/common/gdb_dirent.h deleted file mode 100644 index f86f128cd5a..00000000000 --- a/gdb/common/gdb_dirent.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Portable . - Copyright (C) 2000-2013 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef GDB_DIRENT_H -#define GDB_DIRENT_H 1 - -/* See description of `AC_HEADER_DIRENT' in the Autoconf manual. */ -#ifdef HAVE_DIRENT_H -# include /* ARI: dirent.h */ -# define NAMELEN(dirent) strlen ((dirent)->d_name) /* ARI: strlen d_name */ -#else -# define dirent direct -# define NAMELEN(dirent) (dirent)->d_namelen /* ARI: d_namelen */ -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -#endif - -#endif /* not GDB_DIRENT_H */ diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c index 37a31f280df..0ff10c66eb3 100644 --- a/gdb/common/linux-osdata.c +++ b/gdb/common/linux-osdata.c @@ -42,10 +42,12 @@ #include "xml-utils.h" #include "buffer.h" #include "gdb_assert.h" -#include "gdb_dirent.h" +#include #include "gdb_stat.h" #include "filestuff.h" +#define NAMELEN(dirent) strlen ((dirent)->d_name) + /* Define PID_T to be a fixed size that is at least as large as pid_t, so that reading pid values embedded in /proc works consistently. */ diff --git a/gdb/config.in b/gdb/config.in index 7dfb5c77b1f..4e3f6de5d0a 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -120,10 +120,6 @@ */ #undef HAVE_DECL_STRSTR -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -253,9 +249,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_TERM_H -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_NLIST_H @@ -430,10 +423,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DEBUGREG_H -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FAULT_H @@ -446,10 +435,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H diff --git a/gdb/configure b/gdb/configure index ae24ca5ce4e..b1a4d48a0b6 100755 --- a/gdb/configure +++ b/gdb/configure @@ -8642,165 +8642,6 @@ fi # Checks for header files. # # ------------------------- # -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - { $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 test "${ac_cv_header_stdc+set}" = set; then : @@ -10280,165 +10121,6 @@ if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi - - ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works diff --git a/gdb/configure.ac b/gdb/configure.ac index 88db73acad3..6025e8938e6 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1072,7 +1072,6 @@ fi # Checks for header files. # # ------------------------- # -AC_HEADER_DIRENT AC_HEADER_STDC # elf_hp.h is for HP/UX 64-bit shared library support. AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \ diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 96d598d010b..6e38797e05c 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2013-11-18 Tom Tromey + + * config.in: Rebuild. + * configure: Rebuild. + * configure.ac: Don't use AC_HEADER_DIRENT. + 2013-11-18 Tom Tromey * server.h: Don't check HAVE_STRING_H. diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index d0976c1c330..e33cdead3fb 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -42,10 +42,6 @@ don't. */ #undef HAVE_DECL_VSNPRINTF -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - /* Define to 1 if you have the `dladdr' function. */ #undef HAVE_DLADDR @@ -109,9 +105,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H @@ -185,20 +178,12 @@ /* Define to 1 if the target supports __sync_*_compare_and_swap */ #undef HAVE_SYNC_BUILTINS -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCFS_H diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 096c7b39214..d75ec1fa29e 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -4131,165 +4131,6 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! @@ -5033,165 +4874,6 @@ if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi - - ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 3bed8760e27..87146c1763f 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -37,7 +37,6 @@ AC_PROG_RANLIB AC_ARG_PROGRAM AC_HEADER_STDC -AC_HEADER_DIRENT AC_FUNC_ALLOCA diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 0f27d6823f4..1c325ef7a94 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -33,7 +33,7 @@ #include #include "gdb_wait.h" -#include "gdb_dirent.h" +#include #include struct fork_info *fork_list; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index bccd58318bf..e9613acb09d 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -54,7 +54,7 @@ #include "event-top.h" #include #include -#include "gdb_dirent.h" +#include #include "xml-support.h" #include "terminal.h" #include diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 424a91b9263..1c2f2989e8d 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -28,7 +28,7 @@ #include #include #include -#include "gdb_dirent.h" +#include #include #include "exceptions.h" diff --git a/gdb/procfs.c b/gdb/procfs.c index c0004f2d4a9..7a2aeb8a43e 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -89,7 +89,7 @@ #ifdef NEW_PROC_API #include -#include "gdb_dirent.h" /* opendir/readdir, for listing the LWP's */ +#include /* opendir/readdir, for listing the LWP's */ #endif #include /* for O_RDONLY */ -- 2.30.2