summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-10 08:22:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-10 08:22:50 +0000
commit27e948fd458b06c3a018d46f04599a874f43fd92 (patch)
treee369ed2a78f4d5393074804b71f136c84e9dfca5 /ext/socket/extconf.rb
parent192463c7a5525008a7bf95065261877eff79cf74 (diff)
regexp,range,squeeze
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 12b24667b4..0526e319ec 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -21,17 +21,13 @@ else
end
$ipv6 = false
-if enable_config("ipv6", true)
- if try_run(<<EOF)
+if enable_config("ipv6", false)
+ if try_link(<<EOF)
#include <sys/types.h>
#include <sys/socket.h>
main()
{
- exit(0);
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
- exit(1);
- else
- exit(0);
+ socket(AF_INET6, SOCK_STREAM, 0);
}
EOF
$CFLAGS+=" -DENABLE_IPV6"
@@ -39,7 +35,6 @@ EOF
end
end
-
$ipv6type = nil
$ipv6lib = nil
$ipv6libdir = nil
@@ -101,9 +96,10 @@ EOF
if $ipv6lib
if File.directory? $ipv6libdir and File.exist? "#{$ipv6libdir}/lib#{$ipv6lib}.a"
- $LDFLAGS += " -L#$ipv6libdir -l#$ipv6lib"
+ $LOCAL_LIBS = " -L#$ipv6libdir -l#$ipv6lib"
else
print <<EOS
+
Fatal: no #$ipv6lib library found. cannot continue.
You need to fetch lib#{$ipv6lib}.a from appropriate
ipv6 kit and compile beforehand.
@@ -235,13 +231,21 @@ main()
EOF
$getaddr_info_ok = true
end
+if $ipv6 and not $getaddr_info_ok
+ print <<EOS
+
+Fatal: --enable-ipv6 is specified, and your OS seems to support IPv6 feature.
+But your getaddrinfo() and getnameinfo() are appeared to be broken. Sorry,
+you cannot compile IPv6 socket classes with broken these functions.
+EOS
+ exit
+end
+
$objs = ["socket.o"]
-if $getaddr_info_ok
- if have_func("getaddrinfo") and have_func("getnameinfo")
- have_getaddrinfo = true
- end
+if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo")
+ have_getaddrinfo = true
end
if have_getaddrinfo