Don't unnecessarily redefine 'socklen_t' type in MinGW builds.
The original configure-time tests in gdb/ and gdbserver/ failed to detect that 'socklen_t' is defined in MinGW headers because the test program included only sys/socket.h, which is absent in MinGW system headers. However on MS-Windows this data type is declared in another header, ws2tcpip.h. The modified test programs try using ws2tcpip.h if sys/socket.h is unavailable. Thanks to Joel Brobecker who helped me regenerate the configure scripts and the config.in files. gdb/ChangeLog: 2020-07-26 Eli Zaretskii <eliz@gnu.org> * configure.ac (AC_CHECK_HEADERS): Check for sys/socket.h and ws2tcpip.h. When checking whether socklen_t type is defined, use ws2tcpip.h if it is available and sys/socket.h isn't. * configure: Regenerate. * config.in: Regenerate. gdbserver/ChangeLog: 2020-07-26 Eli Zaretskii <eliz@gnu.org> * configure.ac (AC_CHECK_HEADERS): Add ws2tcpip.h. When checking whether socklen_t type is defined, use ws2tcpip.h if it is available and sys/socket.h isn't. * configure: Regenerate. * config.in: Regenerate.
This commit is contained in:
parent
3abf975826
commit
05a6b8c28b
8 changed files with 75 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2020-07-26 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* configure.ac (AC_CHECK_HEADERS): Check for sys/socket.h and
|
||||||
|
ws2tcpip.h. When checking whether socklen_t type is defined, use
|
||||||
|
ws2tcpip.h if it is available and sys/socket.h isn't.
|
||||||
|
* configure: Regenerate.
|
||||||
|
* config.in: Regenerate.
|
||||||
|
|
||||||
2020-07-25 Andrew Burgess <andrew.burgess@embecosm.com>
|
2020-07-25 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
PR fortran/23051
|
PR fortran/23051
|
||||||
|
|
|
@ -505,6 +505,9 @@
|
||||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||||
#undef HAVE_SYS_SELECT_H
|
#undef HAVE_SYS_SELECT_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/sockets.h> header file. */
|
||||||
|
#undef HAVE_SYS_SOCKETS_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||||
#undef HAVE_SYS_SOCKET_H
|
#undef HAVE_SYS_SOCKET_H
|
||||||
|
|
||||||
|
@ -568,6 +571,9 @@
|
||||||
/* Define to 1 if you have the `wresize' function. */
|
/* Define to 1 if you have the `wresize' function. */
|
||||||
#undef HAVE_WRESIZE
|
#undef HAVE_WRESIZE
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
||||||
|
#undef HAVE_WS2TCPIP_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `XML_StopParser' function. */
|
/* Define to 1 if you have the `XML_StopParser' function. */
|
||||||
#undef HAVE_XML_STOPPARSER
|
#undef HAVE_XML_STOPPARSER
|
||||||
|
|
||||||
|
|
31
gdb/configure
vendored
31
gdb/configure
vendored
|
@ -11844,6 +11844,31 @@ fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
for ac_header in sys/sockets.h
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "sys/sockets.h" "ac_cv_header_sys_sockets_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_sys_sockets_h" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_SYS_SOCKETS_H 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
for ac_header in ws2tcpip.h
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_WS2TCPIP_H 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
# Checks for declarations. #
|
# Checks for declarations. #
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
|
@ -12059,7 +12084,11 @@ $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
|
||||||
# ------------------ #
|
# ------------------ #
|
||||||
|
|
||||||
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
|
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#if HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#elif HAVE_WS2TCPIP_H
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
"
|
"
|
||||||
if test "x$ac_cv_type_socklen_t" = xyes; then :
|
if test "x$ac_cv_type_socklen_t" = xyes; then :
|
||||||
|
|
|
@ -1248,6 +1248,9 @@ AC_CHECK_HEADERS(term.h, [], [],
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([sys/sockets.h])
|
||||||
|
AC_CHECK_HEADERS([ws2tcpip.h])
|
||||||
|
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
# Checks for declarations. #
|
# Checks for declarations. #
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
|
@ -1263,7 +1266,11 @@ AM_LC_MESSAGES
|
||||||
|
|
||||||
AC_CHECK_TYPES(socklen_t, [], [],
|
AC_CHECK_TYPES(socklen_t, [], [],
|
||||||
[#include <sys/types.h>
|
[#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#if HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#elif HAVE_WS2TCPIP_H
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
# ------------------------------------- #
|
# ------------------------------------- #
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2020-07-26 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* configure.ac (AC_CHECK_HEADERS): Add ws2tcpip.h.
|
||||||
|
When checking whether socklen_t type is defined, use ws2tcpip.h if
|
||||||
|
it is available and sys/socket.h isn't.
|
||||||
|
* configure: Regenerate.
|
||||||
|
* config.in: Regenerate.
|
||||||
|
|
||||||
2020-07-22 Pedro Alves <pedro@palves.net>
|
2020-07-22 Pedro Alves <pedro@palves.net>
|
||||||
|
|
||||||
* inferiors.cc (switch_to_process): New, moved here from
|
* inferiors.cc (switch_to_process): New, moved here from
|
||||||
|
|
|
@ -378,6 +378,9 @@
|
||||||
/* Define to 1 if `vfork' works. */
|
/* Define to 1 if `vfork' works. */
|
||||||
#undef HAVE_WORKING_VFORK
|
#undef HAVE_WORKING_VFORK
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
||||||
|
#undef HAVE_WS2TCPIP_H
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
#undef PACKAGE_BUGREPORT
|
#undef PACKAGE_BUGREPORT
|
||||||
|
|
||||||
|
|
8
gdbserver/configure
vendored
8
gdbserver/configure
vendored
|
@ -9148,7 +9148,7 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
|
||||||
fi
|
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
|
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 ws2tcpip.h
|
||||||
do :
|
do :
|
||||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
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"
|
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||||
|
@ -10044,7 +10044,11 @@ _ACEOF
|
||||||
|
|
||||||
|
|
||||||
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
|
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#if HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#elif HAVE_WS2TCPIP_H
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
"
|
"
|
||||||
if test "x$ac_cv_type_socklen_t" = xyes; then :
|
if test "x$ac_cv_type_socklen_t" = xyes; then :
|
||||||
|
|
|
@ -75,7 +75,7 @@ AC_CHECK_HEADERS(termios.h sys/reg.h string.h dnl
|
||||||
sys/procfs.h linux/elf.h dnl
|
sys/procfs.h linux/elf.h dnl
|
||||||
fcntl.h signal.h sys/file.h dnl
|
fcntl.h signal.h sys/file.h dnl
|
||||||
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
|
sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
|
||||||
netinet/tcp.h arpa/inet.h)
|
netinet/tcp.h arpa/inet.h ws2tcpip.h)
|
||||||
AC_FUNC_FORK
|
AC_FUNC_FORK
|
||||||
AC_CHECK_FUNCS(pread pwrite pread64)
|
AC_CHECK_FUNCS(pread pwrite pread64)
|
||||||
|
|
||||||
|
@ -147,7 +147,11 @@ AC_CHECK_DECLS([perror, vasprintf, vsnprintf])
|
||||||
|
|
||||||
AC_CHECK_TYPES(socklen_t, [], [],
|
AC_CHECK_TYPES(socklen_t, [], [],
|
||||||
[#include <sys/types.h>
|
[#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#if HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#elif HAVE_WS2TCPIP_H
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
case "${target}" in
|
case "${target}" in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue