Package: icedove / 1:52.3.0-4~deb8u2

porting-kfreebsd-hurd/LDAP-support-building-on-GNU-kFreeBSD-and-GNU-Hurd.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
From: Mike Hommey <glandium@debian.org>
Date: Tue, 11 Mar 2008 08:29:25 +0100
Subject: LDAP: support building on GNU/kFreeBSD and GNU/Hurd

https://bugzilla.mozilla.org/show_bug.cgi?id=356011

Squashed kFreeBSD/Hurd related fixes:
- Fix FTBFS on Hurd-i386
- Build fixes for GNU/kFreeBSD in directory/
- Missing bits for Hurd support
---
 ldap/c-sdk/include/portable.h                 | 32 +++++++++++++++++----------
 ldap/c-sdk/libraries/libldap/compat.c         |  2 +-
 ldap/c-sdk/libraries/libprldap/ldappr-error.c |  2 +-
 mozilla/nsprpub/config/nsinstall.c            | 25 +++++++++++++++++++++
 4 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/ldap/c-sdk/include/portable.h b/ldap/c-sdk/include/portable.h
index 5269886..ab2c7fa 100644
--- a/ldap/c-sdk/include/portable.h
+++ b/ldap/c-sdk/include/portable.h
@@ -122,7 +122,7 @@
  * some systems don't have the BSD re_comp and re_exec routines
  */
 #ifndef NEED_BSDREGEX
-#if ( defined( SYSV ) || defined( NETBSD ) || defined( FREEBSD ) || defined(__OpenBSD__) || defined( linux ) || defined( DARWIN )) && !defined(sgi)
+#if ( defined( SYSV ) || defined( NETBSD ) || defined( FREEBSD ) || defined(__OpenBSD__) || defined( linux ) || defined(__GNU__) || defined(__GLIBC__) || defined( DARWIN )) && !defined(sgi)
 #define NEED_BSDREGEX
 #endif
 #endif
@@ -150,10 +150,14 @@
 /*
  * Is snprintf() part of the standard C runtime library?
  */
+#if !defined(HAVE_SNPRINTF)
+#if defined(SOLARIS) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(HPUX) || defined(AIX)
+#define HAVE_SNPRINTF
+#endif
 #if defined(_WINDOWS)
 #define snprintf _snprintf
 #endif
-
+#endif
 
 /*
  * Async IO.  Use a non blocking implementation of connect() and 
@@ -169,7 +173,7 @@
  * for select()
  */
 #if !defined(WINSOCK) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
-#if defined(hpux) || defined(LINUX) || defined(SUNOS4) || defined(XP_BEOS)
+#if defined(hpux) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(SUNOS4) || defined(XP_BEOS)
 #include <sys/time.h>
 #else
 #include <sys/select.h>
@@ -241,15 +245,14 @@
 #define HAVE_TIME_R
 #endif
 
-#if defined(SNI) || defined(LINUX1_2)
+#if defined(SNI) || defined(LINUX1_2) || defined(__GNU__) || defined(__GLIBC__)
 int strcasecmp(const char *, const char *);
 #ifdef SNI
 int strncasecmp(const char *, const char *, int);
-#endif /* SNI */
-#ifdef LINUX1_2
+#else /* SNI */
 int strncasecmp(const char *, const char *, size_t);
-#endif /* LINUX1_2 */
-#endif /* SNI || LINUX1_2 */
+#endif
+#endif /* SNI || LINUX1_2 || __GNU__ || __GLIBC__ */
 
 #if defined(_WINDOWS) || defined(macintosh) || defined(XP_OS2) || defined(DARWIN)
 #define GETHOSTBYNAME( n, r, b, l, e )  gethostbyname( n )
@@ -267,7 +270,12 @@ int strncasecmp(const char *, const char *, size_t);
 #define NSLDAPI_NETDB_BUF_SIZE	1024
 #endif
 
-#if defined(sgi) || defined(HPUX9) || defined(SCOOS) || \
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE];
+#define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
+#define GETHOSTBYNAME( n, r, b, l, rp, e )  gethostbyname_r( n, r, b, l, rp, e )
+#define GETHOSTBYNAME_R_RETURNS_INT
+#elif defined(sgi) || defined(HPUX9) || defined(SCOOS) || \
     defined(UNIXWARE) || defined(SUNOS4) || defined(SNI) || defined(BSDI) || \
     defined(NCR) || defined(OSF1) || defined(NEC) || defined(VMS) || \
     ( defined(HPUX10) && !defined(_REENTRANT)) || defined(HPUX11) || \
@@ -289,7 +297,7 @@ typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE];
 #elif defined(HPUX10)
 #define GETHOSTBYNAME_BUF_T struct hostent_data
 #define GETHOSTBYNAME( n, r, b, l, e )	nsldapi_compat_gethostbyname_r( n, r, (char *)&b, l, e )
-#elif defined(LINUX) || defined(DRAGONFLY)
+#elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(DRAGONFLY)
 typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE];
 #define GETHOSTBYNAME_BUF_T GETHOSTBYNAME_buf_t
 #define GETHOSTBYNAME( n, r, b, l, rp, e )  gethostbyname_r( n, r, b, l, rp, e )
@@ -311,7 +319,7 @@ typedef char GETHOSTBYNAME_buf_t [NSLDAPI_NETDB_BUF_SIZE];
 	|| defined(OSF1V4) || defined(AIX) || defined(UnixWare) \
         || defined(hpux) || defined(HPUX11) || defined(NETBSD) \
         || defined(IRIX6) || defined(FREEBSD) || defined(VMS) \
-        || defined(NTO) || defined(OPENBSD) || defined(DRAGONFLY)
+        || defined(NTO) || defined(OPENBSD) || defined(__GLIBC__) || defined(DRAGONFLY)
 #define NSLDAPI_CTIME( c, b, l )        ctime_r( c, b )
 #elif defined( OSF1V3 )
 #define NSLDAPI_CTIME( c, b, l )	(ctime_r( c, b, l ) ? NULL : b)
@@ -452,7 +460,7 @@ int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
 #define NSLDAPI_FOPEN( filename, mode )	fopen( filename, mode )
 #endif
 
-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
+#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
 size_t nsldapi_compat_strlcpy(char *dst, const char *src, size_t len);
 #define STRLCPY nsldapi_compat_strlcpy
 #else
diff --git a/ldap/c-sdk/libraries/libldap/compat.c b/ldap/c-sdk/libraries/libldap/compat.c
index 94e58ca7..8cc1a71 100644
--- a/ldap/c-sdk/libraries/libldap/compat.c
+++ b/ldap/c-sdk/libraries/libldap/compat.c
@@ -83,7 +83,7 @@ nsldapi_compat_ctime_r( const time_t *clock, char *buf, int buflen )
 }
 #endif /* HPUX10 && _REENTRANT && !HPUX11 */
 
-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
+#if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) || defined(AIX) || defined(HPUX) || defined(_WINDOWS)
 /* 
  * Copies src to the dstsize buffer at dst. The copy will never 
  * overflow the destination buffer and the buffer will always be null 
diff --git a/ldap/c-sdk/libraries/libprldap/ldappr-error.c b/ldap/c-sdk/libraries/libprldap/ldappr-error.c
index b0cb6ed..16e9d59 100644
--- a/ldap/c-sdk/libraries/libprldap/ldappr-error.c
+++ b/ldap/c-sdk/libraries/libprldap/ldappr-error.c
@@ -231,7 +231,7 @@ struct prldap_errormap_entry {
 
 #if defined(__hpux) || defined(_AIX) || defined(OSF1) || defined(DARWIN) || \
   defined(BEOS) || defined(FREEBSD) || defined(BSDI) || defined(VMS) || \
-  defined(OPENBSD) || defined(NETBSD)
+  defined(OPENBSD) || defined(NETBSD) || defined(__FreeBSD_kernel__)
 #define EDEADLOCK       -1
 #endif
 
diff --git a/mozilla/nsprpub/config/nsinstall.c b/mozilla/nsprpub/config/nsinstall.c
index f1d2cff..1b857d9 100644
--- a/mozilla/nsprpub/config/nsinstall.c
+++ b/mozilla/nsprpub/config/nsinstall.c
@@ -43,6 +43,31 @@
 #endif
 
 #if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
+#ifdef NEXTSTEP
+#include <bsd/libc.h>
+
+/*
+** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0),
+** when called on a mounted fs. Did anyone notice this? Here's an ugly
+** workaround ...
+*/
+#define getcwd(b,s)   my_getcwd(b,s)
+
+static char *
+my_getcwd (char *buf, size_t size)
+{
+    FILE *pwd = popen("pwd", "r");
+    char *result = fgets(buf, size, pwd);
+
+    if (result) {
+        buf[strlen(buf)-1] = '\0';
+    }
+    pclose (pwd);
+    return buf;
+}
+#endif /* NEXTSTEP */
+
+#if defined(LINUX) || defined(__GLIBC__) || defined(__GNU__)
 #include <getopt.h>
 #endif