summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-03 13:10:04 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-03 13:10:04 +0000
commit7181490def5ad5670e2503e91c526eab1039b008 (patch)
tree439c20473667166349b8aace7e363ca11180105b /ext/socket/extconf.rb
parent694207c73745eddae910c4239fe76b654c980eff (diff)
* ext/socket/extconf.rb: Test functions and libraries after headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb42
1 files changed, 21 insertions, 21 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index e9cf750..b25775c 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -2,27 +2,6 @@ require 'mkmf'
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
-case RUBY_PLATFORM
-when /(ms|bcc)win(32|64)|mingw/
- test_func = "WSACleanup"
- have_library("ws2_32", "WSACleanup")
-when /cygwin/
- test_func = "socket"
-when /beos/
- test_func = "socket"
- have_library("net", "socket")
-when /haiku/
- test_func = "socket"
- have_library("network", "socket")
-when /i386-os2_emx/
- test_func = "socket"
- have_library("socket", "socket")
-else
- test_func = "socket"
- have_library("nsl", "t_open") # SunOS
- have_library("socket", "socket") # SunOS
-end
-
headers = []
unless $mswin or $bccwin or $mingw
headers = %w<sys/types.h netdb.h string.h sys/socket.h netinet/in.h>
@@ -83,6 +62,27 @@ have_type("struct ipv6_mreq", headers) # RFC 3493
have_struct_member('struct msghdr', 'msg_control', headers) unless $mswin or $mingw
have_struct_member('struct msghdr', 'msg_accrights', headers)
+case RUBY_PLATFORM
+when /(ms|bcc)win(32|64)|mingw/
+ test_func = "WSACleanup"
+ have_library("ws2_32", "WSACleanup", headers)
+when /cygwin/
+ test_func = "socket"
+when /beos/
+ test_func = "socket"
+ have_library("net", "socket", headers)
+when /haiku/
+ test_func = "socket"
+ have_library("network", "socket", headers)
+when /i386-os2_emx/
+ test_func = "socket"
+ have_library("socket", "socket", headers)
+else
+ test_func = "socket"
+ have_library("nsl", "t_open", headers) # SunOS
+ have_library("socket", "socket", headers) # SunOS
+end
+
if have_func(test_func, headers)
have_func("sendmsg", headers)