summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index bbde1a0c35..f719723864 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -1,9 +1,18 @@
$LDFLAGS = "-L/usr/local/lib"
-have_library("wsock32", "cygwin32_socket") or have_library("socket", "socket")
-have_library("inet", "gethostbyname")
-have_library("nsl", "gethostbyname")
+case PLATFORM
+when /mswin32/
+ test_func = "WSACleanup"
+ have_library("wsock32", "WSACleanup")
+when /cygwin32/
+ test_func = "cygwin32_socket"
+else
+ test_func = "socket"
+ have_library("socket", "socket")
+ have_library("inet", "gethostbyname")
+ have_library("nsl", "gethostbyname")
+end
have_header("sys/un.h")
-if have_func("socket") or have_func("cygwin32_socket")
+if have_func(test_func)
have_func("hsterror")
unless have_func("gethostname")
have_func("uname")