aboutsummaryrefslogtreecommitdiff
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
commitf9f87d2ca62abfc2102be8574167cb6aa6928a9e (patch)
tree086f18a2fce845c903ec18f35cf6afabbbea6467
parent43259571aca0944565543698d044240ecfef4689 (diff)
downloadgdb-f9f87d2ca62abfc2102be8574167cb6aa6928a9e.zip
gdb-f9f87d2ca62abfc2102be8574167cb6aa6928a9e.tar.gz
gdb-f9f87d2ca62abfc2102be8574167cb6aa6928a9e.tar.bz2
* ser-tcp.c: Tewak comment.
[!HAVE_SOCKLEN_T]: Typedef socklen_t. * configure.ac: Add check for socklen_t. * configure, config.in: Regenerate.
-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 41d7c99..257dec2 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 a15478e..2e91e99 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 368cb04..be710de 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 02611b2..0032d41 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 6b19c31..5b0b431 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);