From 7181490def5ad5670e2503e91c526eab1039b008 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 3 Apr 2013 13:10:04 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ ext/socket/extconf.rb | 42 +++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c387194d5..36a7127736 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Apr 3 22:09:25 2013 Tanaka Akira + + * ext/socket/extconf.rb: Test functions and libraries after headers. + Wed Apr 3 21:23:29 2013 Tanaka Akira * io.c (rb_io_seek_m): Accept :CUR, :END, :SET as "whence" argument. diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index e9cf75033b..b25775c34d 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 @@ -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)