[RFC 03/17] Move event-loop configury to common.m4

Tom Tromey
2019-02-24T16:52:09Z

gdb_select.h and the event loop require some configure checks, so this
moves the needed checks to common.m4 and updates the configure
scripts.

gdb/ChangeLog
2019-02-24 Tom Tromey <tom@tromey.com>

* common/common.m4 (GDB_AC_COMMON): Check for poll.h, sys/poll.h,
sys/select.h, and poll.
* configure: Rebuild.
* configure.ac: Remove checks that are now in GDB_AC_COMMON.

gdb/gdbserver/ChangeLog
2019-02-24 Tom Tromey <tom@tromey.com>

* configure: Rebuild.
* config.in: Rebuild.
---
gdb/ChangeLog | 7 +++++++
gdb/common/common.m4 | 5 +++--
gdb/configure | 14 +++++++-------
gdb/configure.ac | 6 +++---
gdb/gdbserver/ChangeLog | 5 +++++
gdb/gdbserver/config.in | 12 ++++++++++++
gdb/gdbserver/configure | 4 ++--
7 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/gdb/common/common.m4 b/gdb/common/common.m4
index 5701dd98293..4461a44c036 100644
--- a/gdb/common/common.m4
+++ b/gdb/common/common.m4
@@ -26,12 +26,13 @@ AC_DEFUN([GDB_AC_COMMON], [
AM_LANGINFO_CODESET

AC_CHECK_HEADERS(linux/perf_event.h locale.h memory.h signal.h dnl
- sys/resource.h sys/socket.h dnl
+ poll.h sys/poll.h dnl
+ sys/resource.h sys/select.h sys/socket.h dnl
sys/un.h sys/wait.h dnl
thread_db.h wait.h dnl
termios.h)

- AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair sigaction])
+ AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 poll socketpair sigaction])

AC_CHECK_DECLS([strerror, strstr])

diff --git a/gdb/configure b/gdb/configure
index 9c99213a168..5bf25045025 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -11477,8 +11477,8 @@ fi

SRCHIGH_LIBS=
SRCHIGH_CFLAGS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for source highlight" >&5
-$as_echo_n "checking for source highlight... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the source-highlight library" >&5
+$as_echo_n "checking for the source-highlight library... " >&6; }
if test "${pkg_config_prog_path}" = "missing"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no - pkg-config not found" >&5
$as_echo "no - pkg-config not found" >&6; }
@@ -12245,11 +12245,11 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi

# elf_hp.h is for HP/UX 64-bit shared library support.
-for ac_header in nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
+for ac_header in nlist.h machine/reg.h proc_service.h \
thread_db.h linux/elf.h \
sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
- sys/reg.h sys/debugreg.h sys/select.h \
+ sys/reg.h sys/debugreg.h \
termios.h elf_hp.h \
dlfcn.h
do :
@@ -13345,7 +13345,7 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
fi

for ac_func in getauxval getrusage getuid getgid \
- pipe poll pread pread64 pwrite resize_term \
+ pipe pread pread64 pwrite resize_term \
sbrk getpgid setpgid setpgrp setsid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
@@ -13742,7 +13742,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
+ for ac_header in linux/perf_event.h locale.h memory.h signal.h poll.h sys/poll.h sys/resource.h sys/select.h sys/socket.h sys/un.h sys/wait.h thread_db.h wait.h termios.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"
@@ -13756,7 +13756,7 @@ fi
done

- for ac_func in fdwalk getrlimit pipe pipe2 socketpair sigaction
+ for ac_func in fdwalk getrlimit pipe pipe2 poll socketpair sigaction
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"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f63507ff74e..9b37858affe 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1318,11 +1318,11 @@ fi

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 \
+AC_CHECK_HEADERS([nlist.h machine/reg.h proc_service.h \
thread_db.h linux/elf.h \
sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
- sys/reg.h sys/debugreg.h sys/select.h \
+ sys/reg.h sys/debugreg.h \
termios.h elf_hp.h \
dlfcn.h])
AC_CHECK_HEADERS(sys/user.h, [], [],
@@ -1377,7 +1377,7 @@ AC_C_BIGENDIAN
AC_FUNC_MMAP
AC_FUNC_VFORK
AC_CHECK_FUNCS([getauxval getrusage getuid getgid \
- pipe poll pread pread64 pwrite resize_term \
+ pipe pread pread64 pwrite resize_term \
sbrk getpgid setpgid setpgrp setsid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 05537df81e3..8b35d20a4b4 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -171,6 +171,12 @@
/* Define to 1 if you have the `pipe2' function. */
#undef HAVE_PIPE2

+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <poll.h> header file. */
+#undef HAVE_POLL_H
+
/* Define to 1 if you have the `pread' function. */
#undef HAVE_PREAD

@@ -253,6 +259,9 @@
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H

+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
/* Define to 1 if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H

@@ -265,6 +274,9 @@
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H

+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H

diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 1ddbd6b27e0..ed43b7f50ca 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -6874,7 +6874,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
+ for ac_header in linux/perf_event.h locale.h memory.h signal.h poll.h sys/poll.h sys/resource.h sys/select.h sys/socket.h sys/un.h sys/wait.h thread_db.h wait.h termios.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"
@@ -6888,7 +6888,7 @@ fi
done

- for ac_func in fdwalk getrlimit pipe pipe2 socketpair sigaction
+ for ac_func in fdwalk getrlimit pipe pipe2 poll socketpair sigaction
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"
--
2.17.2