Subject: pkg/35356: [patch] net/libtorrent does not build on Solaris
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 01/04/2007 00:50:00
>Number:         35356
>Category:       pkg
>Synopsis:       [patch] net/libtorrent does not build on Solaris
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 04 00:50:00 +0000 2007
>Originator:     Peter Schuller
>Release:        Solaris nvb54
SunOS hostname 5.11 snv_54 i86pc i386 i86pc

The following issues cause build problems on solaris:

* mincore() is not declared in mman.h even with -D__EXTENSIONS__, when using _POSIX_C_SOURCE > 2. Instead one has to include <unistd.h>. This breaks the configure script trying to detect mincore() signedness.

* Solaris does not have AF_LOCAL, only AF_UNIX.

* madvise() suffers from the same problem as mincore(), except it is not declared by unistd.h, or any other header file in /usr/include.

Some related discussion:



This patch fixes these issues:


* patches configure to include <unistd.h> when compiling on Solaris.
* patches rak/socket_address.h to use AF_UNIX instead of AF_LOCAL for the af_local constant
* patches to include an inline declaration of madvise()

The third item is just ugly, but I could not see a better way to do this until Solaris is fixed (if it's a bug; it is my current understanding of the issue but perhaps I am wrong).