OLD | NEW |
---|---|
1 diff --git a/configure b/configure | 1 diff --git a/configure b/configure |
2 --- a/configure | 2 --- a/configure |
3 +++ b/configure | 3 +++ b/configure |
Sam Clegg
2015/07/29 23:58:49
Sorry, can you remove this configure patch that is
zhitingzhu
2015/07/31 01:06:41
Done.
| |
4 @@ -13123,7 +13123,9 @@ else | 4 @@ -6048,7 +6048,8 @@ irix5* | irix6* | nonstopux*) |
5 ;; | |
6 | |
7 # This must be glibc/ELF. | |
8 -linux* | k*bsd*-gnu | kopensolaris*-gnu) | |
9 +# Patched by naclports using patch_configure.py | |
10 +linux* | k*bsd*-gnu | kopensolaris*-gnu | nacl*) | |
11 lt_cv_deplibs_check_method=pass_all | |
12 ;; | |
13 | |
14 @@ -11523,6 +11524,18 @@ uts4*) | |
15 shlibpath_var=LD_LIBRARY_PATH | |
16 ;; | |
17 | |
18 +nacl) | |
19 + # Patched by naclports using patch_configure.py | |
20 + if libc_so=`$CC -print-file-name=libc.so` && [ "$libc_so" != libc.so ]; then | |
21 + dynamic_linker="GNU/NaCl ld.so" | |
22 + version_type=linux | |
23 + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}$ {release}${shared_ext}${major} ${libname}${shared_ext}' | |
24 + soname_spec='${libname}${release}${shared_ext}$major' | |
25 + else | |
26 + dynamic_linker=no | |
27 + fi | |
28 + ;; | |
29 + | |
30 *) | |
31 dynamic_linker=no | |
32 ;; | |
33 @@ -13123,7 +13136,9 @@ else | |
5 $as_echo "yes" >&6; } | 34 $as_echo "yes" >&6; } |
6 | 35 |
7 fi | 36 fi |
8 -NEEDED="pthread-stubs xau >= 0.99.2" | 37 -NEEDED="pthread-stubs xau >= 0.99.2" |
9 +# Dropped pthread-stubs since for nacl we can always build against pthreads. | 38 +# Dropped pthread-stubs since for nacl we can always build against pthreads. |
10 +# This avoids an unused package. | 39 +# This avoids an unused package. |
11 +NEEDED="xau >= 0.99.2" | 40 +NEEDED="xau >= 0.99.2" |
12 | 41 |
13 pkg_failed=no | 42 pkg_failed=no |
14 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NEEDED" >&5 | 43 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NEEDED" >&5 |
(...skipping 20 matching lines...) Expand all Loading... | |
35 + va_end(ap); | 64 + va_end(ap); |
36 + return rtn; | 65 + return rtn; |
37 +} | 66 +} |
38 +#define fcntl nacl_fcntl | 67 +#define fcntl nacl_fcntl |
39 +#endif | 68 +#endif |
40 + | 69 + |
41 + | 70 + |
42 static int set_fd_flags(const int fd) | 71 static int set_fd_flags(const int fd) |
43 { | 72 { |
44 /* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */ | 73 /* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */ |
45 @@ -179,7 +199,8 @@ static int write_vec(xcb_connection_t *c, struct iovec **vec tor, int *count) | |
46 int n; | |
47 assert(!c->out.queue_len); | |
48 | |
49 -#ifdef _WIN32 | |
50 + /* Using writev emulation for nacl newlib. */ | |
51 +#if defined(_WIN32) || (defined(__native_client__) && defined(_NEWLIB_VERSION)) | |
52 int i = 0; | |
53 int ret = 0,err = 0; | |
54 struct iovec *vec; | |
55 @@ -190,11 +211,26 @@ static int write_vec(xcb_connection_t *c, struct iovec **v ector, int *count) | |
56 vec = *vector; | |
57 while(i < *count) | |
58 { | |
59 - ret = send(c->fd,vec->iov_base,vec->iov_len,0); | |
60 + /* | |
61 + * TODO(bradnelson): Drop if nacl_io supports zero length sends. | |
62 + * https://code.google.com/p/naclports/issues/detail?id=228 | |
63 + */ | |
64 + if (vec->iov_len != 0) { | |
65 + ret = send(c->fd,vec->iov_base,vec->iov_len,0); | |
66 + } else { | |
67 + ret = 0; | |
68 + } | |
69 + /* Generalize to posix so this can be used with nacl newlib. */ | |
70 +#if defined(__native_client__) && defined(_NEWLIB_VERSION) | |
71 + if(ret < 0) | |
72 + { | |
73 + if(errno == EWOULDBLOCK) | |
74 +#else | |
75 if(ret == SOCKET_ERROR) | |
76 { | |
77 err = WSAGetLastError(); | |
78 if(err == WSAEWOULDBLOCK) | |
79 +#endif | |
80 { | |
81 return 1; | |
82 } | |
OLD | NEW |