2
dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
2
dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
47
47
*) REPLACE_SELECT=1 ;;
50
dnl On FreeBSD 8.2, select() doesn't always reject bad fds.
51
AC_CACHE_CHECK([whether select detects invalid fds],
52
[gl_cv_func_select_detects_ebadf],
54
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
55
#include <sys/types.h>
58
# include <sys/select.h>
68
struct timeval timeout;
71
return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
72
]])], [gl_cv_func_select_detects_ebadf=yes],
73
[gl_cv_func_select_detects_ebadf=no],
76
# Guess yes on glibc systems.
77
*-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
78
# If we don't know, assume the worst.
79
*) gl_cv_func_select_detects_ebadf="guessing no" ;;
83
case $gl_cv_func_select_detects_ebadf in
85
*) REPLACE_SELECT=1 ;;
89
dnl Determine the needed libraries.
90
LIB_SELECT="$LIBSOCKET"
91
if test $REPLACE_SELECT = 1; then
94
dnl On the MSVC platform, the function MsgWaitForMultipleObjects
95
dnl (used in lib/select.c) requires linking with -luser32. On mingw,
99
#define WIN32_LEAN_AND_MEAN
104
MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
108
[LIB_SELECT="$LIB_SELECT -luser32"])
112
AC_SUBST([LIB_SELECT])