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

modifications for the difference of mkmf.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@29911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2010-11-24 09:37:06 +00:00
parent 21a268e2ab
commit 26c72fecb9
3 changed files with 36 additions and 20 deletions

View file

@ -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 file

@ -43,6 +43,7 @@ if enable_config("ipv6", default_ipv6)
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 @@ 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(<<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 @@ 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 <<EOS
@ -252,20 +254,12 @@ Fatal: invalid value for --with-lookup-order-hack (expected INET, INET6 or UNSPE
EOS
end
$objs = ["socket.#{$OBJEXT}"]
unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("getaddrinfo", "netdb.h")
if have_struct_member("struct in6_addr", "s6_addr8", headers)
$defs[-1] = "-DHAVE_ADDR8"
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)}
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
@ -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

View file

@ -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