* Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>
@ 2006-07-18 18:23 Claes Wallin
2006-07-18 19:51 ` CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>) Claes Wallin
0 siblings, 1 reply; 4+ messages in thread
From: Claes Wallin @ 2006-07-18 18:23 UTC (permalink / raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 591 bytes --]
On Mac OS X 10.4, socklen_t is only defined if <sys/socket.h> is
included. The config script doesn't do this, so socklen_t is #define:d
to int, which creates a conflict in <sys/socket.h> when compiling
libguile/socket.c.
The attached diff patches this and also changes the #define to a
typedef, which feels cleaner but is not necessary for the patch to work.
Simply changing the default includes of AC_CHECK_TYPE(socklen_t) would
also work.
With this patch applied, guile compiles for me, but does not yet work
due to other problems. Not tested on any other platform.
/c
[-- Attachment #1.1.2: guile-1.8.0.socklen_t.diff --]
[-- Type: text/plain, Size: 2288 bytes --]
diff -ur ../guile-1.8.0.orig/ChangeLog ./ChangeLog
--- ../guile-1.8.0.orig/ChangeLog 2006-02-20 22:18:40.000000000 +0100
+++ ./ChangeLog 2006-07-18 20:12:27.000000000 +0200
@@ -1,3 +1,15 @@
+2006-07-18 Claes Wallin <clacke+guile@lysator.liu.se>
+
+ Now compiles on Mac OS X 10.4.
+
+ * configure.in: Added sys/socket.h test
+ Added sys/socket.h to socklen_t test
+ Changed AC_CHECK_TYPE -> AC_CHECK_TYPES
+
+ * config.h.in: Changed socklen_t -> HAVE_SOCKLEN_T
+
+ * libguile/socket.c: typedef if not HAVE_SOCKLEN_T
+
2006-02-20 Marius Vollmer <mvo@zagadka.de>
Released 1.8.0.
diff -ur ../guile-1.8.0.orig/config.h.in ./config.h.in
--- ../guile-1.8.0.orig/config.h.in 2006-02-20 22:32:48.000000000 +0100
+++ ./config.h.in 2006-07-18 20:03:57.000000000 +0200
@@ -817,8 +817,8 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef mode_t
-/* Define to `int' if <sys/types.h> does not define. */
-#undef socklen_t
+/* Needs to be typedef'd if <sys/types.h> or <sys/socket.h> does not define. */
+#undef HAVE_SOCKLEN_T
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
diff -ur ../guile-1.8.0.orig/configure.in ./configure.in
--- ../guile-1.8.0.orig/configure.in 2006-02-12 14:29:08.000000000 +0100
+++ ./configure.in 2006-07-18 20:03:57.000000000 +0200
@@ -515,7 +515,19 @@
AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
-AC_CHECK_TYPE(socklen_t, int)
+AC_CHECK_HEADERS(sys/socket.h,,,[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+])
+AC_CHECK_TYPES(socklen_t,,,[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+])
AC_CHECK_TYPE(struct ip_mreq)
AC_HEADER_STDC
diff -ur ../guile-1.8.0.orig/libguile/socket.c ./libguile/socket.c
--- ../guile-1.8.0.orig/libguile/socket.c 2006-02-12 14:29:12.000000000 +0100
+++ ./libguile/socket.c 2006-07-18 20:03:57.000000000 +0200
@@ -62,6 +62,10 @@
#include <arpa/inet.h>
#endif
+#ifndef HAVE_SOCKLEN_T
+typedef socklen_t int;
+#endif
+
#if defined (HAVE_UNIX_DOMAIN_SOCKETS) && !defined (SUN_LEN)
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
[-- Attachment #2: Type: text/plain, Size: 137 bytes --]
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 4+ messages in thread
* CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>)
2006-07-18 18:23 Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h> Claes Wallin
@ 2006-07-18 19:51 ` Claes Wallin
2006-07-19 0:03 ` Kevin Ryde
0 siblings, 1 reply; 4+ messages in thread
From: Claes Wallin @ 2006-07-18 19:51 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 473 bytes --]
Claes Wallin wrote:
> On Mac OS X 10.4, socklen_t is only defined if <sys/socket.h> is
> included. The config script doesn't do this, so socklen_t is #define:d
> to int, which creates a conflict in <sys/socket.h> when compiling
> libguile/socket.c.
Fixed in CVS. Sorry about that.
However, the CVS fix doesn't check for the presence of <sys/socket.h>,
which means that the socklen_t test now probably fails on e.g. SunOS 4,
which lacks this header.
/c
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
[-- Attachment #2: Type: text/plain, Size: 137 bytes --]
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>)
2006-07-18 19:51 ` CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>) Claes Wallin
@ 2006-07-19 0:03 ` Kevin Ryde
2006-07-19 0:39 ` Claes Wallin
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2006-07-19 0:03 UTC (permalink / raw)
Cc: bug-guile
Claes Wallin <clawa570+gmane@student.liu.se> writes:
>
> SunOS 4
Does anything else work there? :-) It's diabolically old isn't it?
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>)
2006-07-19 0:03 ` Kevin Ryde
@ 2006-07-19 0:39 ` Claes Wallin
0 siblings, 0 replies; 4+ messages in thread
From: Claes Wallin @ 2006-07-19 0:39 UTC (permalink / raw)
Cc: bug-guile
[-- Attachment #1.1: Type: text/plain, Size: 522 bytes --]
Kevin Ryde wrote:
> Claes Wallin <clawa570+gmane@student.liu.se> writes:
>> SunOS 4
>
> Does anything else work there? :-) It's diabolically old isn't it?
Well... Yes. :-)
Just an example I picked out of thin air, because I'd seen earlier today
that it lacks this file. Unfortunately our SO4 machine at the computer
club is down at the moment, so I haven't been able to test if anything
at all works.
It can probably stay the way it is until someone complains.
Guessing it will be me. ;-)
/c
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
[-- Attachment #2: Type: text/plain, Size: 137 bytes --]
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-19 0:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-18 18:23 Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h> Claes Wallin
2006-07-18 19:51 ` CVS FIXED, but probably lacking (Re: Compilation failure on Mac OS X 10.4, socklen_t needs <sys/socket.h>) Claes Wallin
2006-07-19 0:03 ` Kevin Ryde
2006-07-19 0:39 ` Claes Wallin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).