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
|
link against required libraries
include sys/fcntl.h for F_[SG]ET constants
don't try to use an undefined constant
--- api/libsphinxclient/configure.in
+++ api/libsphinxclient/configure.in
@@ -33,6 +33,9 @@
dnl Checks for header files.
AC_CHECK_HEADERS(string.h strings.h unistd.h stdint.h)
+AC_CHECK_LIB([nsl], gethostbyname)
+AC_CHECK_LIB([socket], connect)
+
DEFAULT_INSTALL_PREFIX="/usr/local"
AC_ARG_ENABLE(debug,
--- api/libsphinxclient/sphinxclient.c
+++ api/libsphinxclient/sphinxclient.c
@@ -57,6 +57,7 @@
#include <netdb.h>
#include <errno.h>
#include <sys/un.h>
+ #include <sys/fcntl.h>
#endif
//////////////////////////////////////////////////////////////////////////
@@ -1280,7 +1281,7 @@
static sphinx_bool net_write ( int fd, const char * bytes, int len, sphinx_client * client )
{
int res;
-#if defined(_WIN32) || defined(SO_NOSIGPIPE)
+#if defined(_WIN32) || defined(SO_NOSIGPIPE) || !defined(MSG_NOSIGNAL)
res = send ( fd, bytes, len, 0 );
#else
res = send ( fd, bytes, len, MSG_NOSIGNAL );
|