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 #include #include + #include #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 );