summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-24 09:37:06 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-24 09:37:06 +0000
commit26c72fecb930b0792493ec7e66b8a66b50b9b14c (patch)
treed200273c6c685b15cb6a2210e4850deee6f2ecb9
parent21a268e2ab223d4792effe7f2b547a9a337e9545 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--ext/socket/extconf.rb47
-rw-r--r--version.h2
3 files changed, 35 insertions, 19 deletions
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 <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
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(<<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,11 +254,33 @@ Fatal: invalid value for --with-lookup-order-hack (expected INET, INET6 or UNSPE
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}"]
@@ -264,19 +288,6 @@ unless getaddr_info_ok and have_func("getnameinfo", "netdb.h") and have_func("ge
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
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