summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-06-13 21:32:01 +0000
committerMark Kettenis <kettenis@gnu.org>2005-06-13 21:32:01 +0000
commitb1f04a4aa3b68543a93cf2ba805fed26304bd27b (patch)
tree054df5a66663c168500ecd14a33b02c0c60ab6e9 /gdb
parent64ae9317675db40bd09005bf45413044bc57692d (diff)
downloadgdb-b1f04a4aa3b68543a93cf2ba805fed26304bd27b.tar.gz
* ser-tcp.c: Tewak comment.
[!HAVE_SOCKLEN_T]: Typedef socklen_t. * configure.ac: Add check for socklen_t. * configure, config.in: Regenerate.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/config.in3
-rwxr-xr-xgdb/configure68
-rw-r--r--gdb/configure.ac4
-rw-r--r--gdb/ser-tcp.c9
5 files changed, 89 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 41d7c9925da..257dec26efc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-13 Mark Kettenis <kettenis@gnu.org>
+
+ * ser-tcp.c: Tewak comment.
+ [!HAVE_SOCKLEN_T]: Typedef socklen_t.
+ * configure.ac: Add check for socklen_t.
+ * configure, config.in: Regenerate.
+
2005-06-13 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/linux64.mt (TDEPFILES): Add symfile-mem.o.
diff --git a/gdb/config.in b/gdb/config.in
index a15478e1021..2e91e990e32 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -435,6 +435,9 @@
/* Define to 1 if you have the `socketpair' function. */
#undef HAVE_SOCKETPAIR
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
diff --git a/gdb/configure b/gdb/configure
index 368cb04f7a4..be710deefbc 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13796,6 +13796,74 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
+if test "${ac_cv_type_socklen_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+
+int
+main ()
+{
+if ((socklen_t *) 0)
+ return 0;
+if (sizeof (socklen_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_socklen_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_socklen_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
+if test $ac_cv_type_socklen_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKLEN_T 1
+_ACEOF
+
+
+fi
+
# ------------------------------------- #
# Checks for compiler characteristics. #
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 02611b2d413..0032d41e9c7 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -432,6 +432,10 @@ AC_CHECK_MEMBERS([struct stat.st_blksize])
# ------------------ #
AC_TYPE_SIGNAL
+AC_CHECK_TYPES(socklen_t, [], [],
+[#include <sys/types.h>
+#include <sys/socket.h>
+])
# ------------------------------------- #
# Checks for compiler characteristics. #
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 6b19c31aa4b..5b0b4311d47 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -1,5 +1,6 @@
-/* Serial interface for raw TCP connections on Un*x like systems
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+/* Serial interface for raw TCP connections on Un*x like systems.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2005
Free Software Foundation, Inc.
This file is part of GDB.
@@ -51,6 +52,10 @@
#include <signal.h>
#include "gdb_string.h"
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
static int net_open (struct serial *scb, const char *name);
static void net_close (struct serial *scb);
void _initialize_ser_tcp (void);