From b8669fe321c6f5e81d071d5790e51b9611fde860 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 30 Apr 1999 07:55:47 +0000 Subject: glibc 2.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/extconf.rb | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'ext/socket/extconf.rb') diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 5e059a425f..0fc5042b7d 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -1,7 +1,6 @@ require 'mkmf' $LDFLAGS = "-L/usr/local/lib" if File.directory?("/usr/local/lib") $CFLAGS ||= "" -$CFLAGS+=" -Dss_family=__ss_family -Dss_len=__ss_len" case PLATFORM when /mswin32/ @@ -28,7 +27,6 @@ if enable_config("ipv6", "yes") #include main() { - exit(0); if (socket(AF_INET6, SOCK_STREAM, 0) < 0) exit(1); else @@ -236,17 +234,47 @@ end $objs = ["socket.o"] -if $getaddr_info_ok - have_func("getaddrinfo") - have_func("getnameinfo") +if $getaddr_info_ok or not $ipv6 + if have_func("getaddrinfo") and + have_func("getnameinfo") + have_getaddrinfo = true + end +end + +if have_getaddrinfo + if try_link(< +#include +#include +#include +#include +int +main() +{ + struct sockaddr_storage storage; + struct sockaddr_storage *addr; + + addr = &storage; + return 0; +} +EOF + sockaddr_storage=true + end else + sockaddr_storage=true + $CFLAGS="-I. "+$CFLAGS $objs += "getaddrinfo.o" $objs += "getnameinfo.o" end +if sockaddr_storage + $CFLAGS="-DSOCKADDR_STORAGE "+$CFLAGS +end + +p $ipv6 + have_header("sys/un.h") if have_func(test_func) - have_func("inet_aton") have_func("hsterror") unless have_func("gethostname") have_func("uname") -- cgit v1.2.3