ruby-changes:17895
From: shyouhei <ko1@a...>
Date: Wed, 24 Nov 2010 18:37:17 +0900 (JST)
Subject: [ruby-changes:17895] Ruby:r29911 (ruby_1_8_7): * ext/socket/extconf.rb: backrorted entirely from ruby_1_8, with small
shyouhei 2010-11-24 18:37:06 +0900 (Wed, 24 Nov 2010) New Revision: 29911 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29911 Log: * ext/socket/extconf.rb: backrorted entirely from ruby_1_8, with small modifications for the difference of mkmf.rb. Modified files: branches/ruby_1_8_7/ChangeLog branches/ruby_1_8_7/ext/socket/extconf.rb branches/ruby_1_8_7/version.h Index: ruby_1_8_7/ext/socket/extconf.rb =================================================================== --- ruby_1_8_7/ext/socket/extconf.rb (revision 29910) +++ ruby_1_8_7/ext/socket/extconf.rb (revision 29911) @@ -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 @@ 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 @@ #define AF_LOCAL AF_UNIX #endif +int main() { int passive, gaierr, inet4 = 0, inet6 = 0; @@ -227,7 +230,6 @@ exit(EXIT_FAILURE); } EOF -end if ipv6 and not getaddr_info_ok abort <<EOS @@ -252,31 +254,40 @@ 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 Index: ruby_1_8_7/ChangeLog =================================================================== --- ruby_1_8_7/ChangeLog (revision 29910) +++ ruby_1_8_7/ChangeLog (revision 29911) @@ -1,3 +1,8 @@ +Wed Nov 24 18:24:26 2010 NAKAMURA Usaku <usa@r...> + + * 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@r...> * mkconfig.rb (patchlevel): config.status may not contain Index: ruby_1_8_7/version.h =================================================================== --- ruby_1_8_7/version.h (revision 29910) +++ ruby_1_8_7/version.h (revision 29911) @@ -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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/