diff --git a/ChangeLog b/ChangeLog index 71a944283a..d8925b3650 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 24 18:24:26 2010 NAKAMURA Usaku + + * 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 * mkconfig.rb (patchlevel): config.status may not contain diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 2022467f14..23003637e0 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -43,6 +43,7 @@ if enable_config("ipv6", default_ipv6) if checking_for("ipv6") {try_link(< #include +int main() { socket(AF_INET6, SOCK_STREAM, 0); @@ -119,8 +120,9 @@ if have_func("sendmsg") | have_func("recvmsg") 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(< @@ -135,6 +137,7 @@ getaddr_info_ok = enable_config("wide-getaddrinfo") do #define AF_LOCAL AF_UNIX #endif +int main() { int passive, gaierr, inet4 = 0, inet6 = 0; @@ -227,7 +230,6 @@ main() exit(EXIT_FAILURE); } EOF -end if ipv6 and not getaddr_info_ok abort < void @@ -274,9 +268,26 @@ conftest_gai_strerror_is_const() *gai_strerror(0) = 0; } EOF - $defs << "-DGAI_STRERROR_CONST" - end + $defs << "-DGAI_STRERROR_CONST" end +end + +$objs = ["socket.#{$OBJEXT}"] + +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] = "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") have_header("arpa/nameser.h") have_header("resolv.h") end diff --git a/version.h b/version.h index deb152152b..79b8291b83 100644 --- a/version.h +++ b/version.h @@ -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