diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-04-30 07:55:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-04-30 07:55:47 +0000 |
commit | b8669fe321c6f5e81d071d5790e51b9611fde860 (patch) | |
tree | d19d4f3da2790c53b046a861714f6fc21728d7e1 /ext/socket/extconf.rb | |
parent | b87b7e3fc1499a9f56d1a49aff22838c2166950c (diff) |
glibc 2.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r-- | ext/socket/extconf.rb | 40 |
1 files changed, 34 insertions, 6 deletions
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 <sys/socket.h> 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(<<EOF) +#include <sys/types.h> +#include <netdb.h> +#include <string.h> +#include <sys/socket.h> +#include <netinet/in.h> +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") |