Permalink
Browse files

* ext/socket/extconf.rb: backrorted entirely from ruby_1_8, with small

	  modifications for the difference of mkmf.rb.



git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@29911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 896759c commit 5d0ca31f193f33333d65faf714e5e33381a1b9dc @shyouhei shyouhei committed Nov 24, 2010
Showing with 35 additions and 19 deletions.
  1. +5 −0 ChangeLog
  2. +29 −18 ext/socket/extconf.rb
  3. +1 −1 version.h
View
@@ -1,3 +1,8 @@
+Wed Nov 24 18:24:26 2010 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * ext/socket/extconf.rb: backrorted entirely from ruby_1_8, with small
+ modifications for the difference of mkmf.rb.
+
Wed Nov 24 16:24:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* mkconfig.rb (patchlevel): config.status may not contain
View
@@ -43,6 +43,7 @@
if checking_for("ipv6") {try_link(<<EOF)}
#include <sys/types.h>
#include <sys/socket.h>
+int
main()
{
socket(AF_INET6, SOCK_STREAM, 0);
@@ -119,8 +120,9 @@ def %(s) s || self end
have_struct_member('struct msghdr', 'msg_accrights', ['sys/types.h', 'sys/socket.h'])
end
-getaddr_info_ok = enable_config("wide-getaddrinfo") do
- checking_for("wide getaddrinfo") {try_run(<<EOF)}
+getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
+ (checking_for("wide getaddrinfo") {try_run(<<EOF)} && :os)
+#{COMMON_HEADERS}
#{cpp_include(headers)}
#include <stdlib.h>
@@ -135,6 +137,7 @@ def %(s) s || self end
#define AF_LOCAL AF_UNIX
#endif
+int
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
@@ -227,7 +230,6 @@ def %(s) s || self end
exit(EXIT_FAILURE);
}
EOF
-end
if ipv6 and not getaddr_info_ok
abort <<EOS
@@ -252,31 +254,40 @@ def %(s) s || self end
EOS
end
+have_type("struct addrinfo", headers)
+have_func("freehostent")
+have_func("freeaddrinfo")
+if have_func("gai_strerror")
+ if checking_for("gai_strerror() returns const pointer") {!try_compile(<<EOF)}
+#{COMMON_HEADERS}
+#{cpp_include(headers)}
+#include <stdlib.h>
+void
+conftest_gai_strerror_is_const()
+{
+ *gai_strerror(0) = 0;
+}
+EOF
+ $defs << "-DGAI_STRERROR_CONST"
+ end
+end
+
$objs = ["socket.#{$OBJEXT}"]
-unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("getaddrinfo", "netdb.h")
+if getaddr_info_ok == :wide or
+ !have_func("getnameinfo", headers) or !have_func("getaddrinfo", headers)
if have_struct_member("struct in6_addr", "s6_addr8", headers)
- $defs[-1] = "-DHAVE_ADDR8"
+ $defs[-1] = "s6_addr=s6_addr8"
+ end
+ if ipv6 == "kame" && have_struct_member("struct in6_addr", "s6_addr32", headers)
+ $defs[-1] = "-DFAITH"
end
$CPPFLAGS="-I. "+$CPPFLAGS
$objs += ["getaddrinfo.#{$OBJEXT}"]
$objs += ["getnameinfo.#{$OBJEXT}"]
have_func("inet_ntop") or have_func("inet_ntoa")
have_func("inet_pton") or have_func("inet_aton")
have_func("getservbyport")
- if have_func("gai_strerror")
- unless checking_for("gai_strerror() returns const pointer") {!try_compile(<<EOF)}
-#{cpp_include(headers)}
-#include <stdlib.h>
-void
-conftest_gai_strerror_is_const()
-{
- *gai_strerror(0) = 0;
-}
-EOF
- $defs << "-DGAI_STRERROR_CONST"
- end
- end
have_header("arpa/nameser.h")
have_header("resolv.h")
end
View
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2010-11-24"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20101124
-#define RUBY_PATCHLEVEL 325
+#define RUBY_PATCHLEVEL 326
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8

0 comments on commit 5d0ca31

Please sign in to comment.