[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] RFC: checking for socklen_t
From: |
Christian Thalinger |
Subject: |
[cp-patches] RFC: checking for socklen_t |
Date: |
Sun, 01 Jan 2006 23:22:25 +0100 |
Hi!
I tried to compile classpath on a quite old system:
$ uname -a
OSF1 mips.complang.tuwien.ac.at V4.0 878 alpha
And on this system socklen_t isn't defined. This macro taken from
http://ac-archive.sourceforge.net/Miscellaneous/type_socklen_t.html
checks for socklen_t and define it to `int' if not found (Andrew Pinski
will surely complain here ;-)
TWISTI
2006-01-01 Christian Thalinger <address@hidden>
* configure.ac: Added TYPE_SOCKLEN_T call.
* m4/type_socklen_t: Added.
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.122
diff -u -3 -p -r1.122 configure.ac
--- configure.ac 1 Jan 2006 20:57:30 -0000 1.122
+++ configure.ac 1 Jan 2006 22:17:27 -0000
@@ -276,6 +276,8 @@ if test "x${COMPILE_JNI}" = xyes; then
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
+ TYPE_SOCKLEN_T
+
AC_MSG_CHECKING([for tm_gmtoff in struct tm])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim;
tim.tm_gmtoff = 0;]])],
[AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff
field.])
Index: m4/type_socklen_t.m4
===================================================================
RCS file: m4/type_socklen_t.m4
diff -N m4/type_socklen_t.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m4/type_socklen_t.m4 1 Jan 2006 22:17:27 -0000
@@ -0,0 +1,14 @@
+AC_DEFUN([TYPE_SOCKLEN_T],
+[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
+[
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+ #include <sys/socket.h>],
+ [socklen_t len = 42; return 0;],
+ ac_cv_type_socklen_t=yes,
+ ac_cv_type_socklen_t=no)
+])
+ if test $ac_cv_type_socklen_t != yes; then
+ AC_DEFINE(socklen_t, int, [Substitute for socklen_t])
+ fi
+])
- [cp-patches] RFC: checking for socklen_t,
Christian Thalinger <=