summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-07 08:24:37 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-07 08:24:37 +0000
commit3376271d9e3c6b96acb63720eb4d59643abeb32c (patch)
tree9a9d174d90329951c082fb46e950a8edcdb001b8 /ext/socket/extconf.rb
parentc09a226803d177f2ab3426ec2c72a3186d789010 (diff)
990507
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb33
1 files changed, 4 insertions, 29 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 28a96f4b38..12b24667b4 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -239,45 +239,20 @@ end
$objs = ["socket.o"]
if $getaddr_info_ok
- if have_func("getaddrinfo") and
- have_func("getnameinfo")
+ if have_func("getaddrinfo") and have_func("getnameinfo")
have_getaddrinfo = true
end
end
if have_getaddrinfo
$CFLAGS="-DHAVE_GETADDRINFO "+$CFLAGS
- 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 = 0;
-
- addr->__ss_family = &storage.__ss_family;
- addr->__ss_len = &storage.__ss_len;
- return 0;
-}
-EOF
- sockaddr_storage=true
- $CFLAGS+=" -DHAVE_SS_LEN"
- end
else
sockaddr_storage=true
$CFLAGS="-I. "+$CFLAGS
$objs += "getaddrinfo.o"
$objs += "getnameinfo.o"
- have_func("inet_ntop")
- have_func("inet_pton")
-end
-
-if sockaddr_storage
- $CFLAGS="-DSOCKADDR_STORAGE=sockaddr_storage "+$CFLAGS
+ have_func("inet_ntop") or have_func("inet_ntoa")
+ have_func("inet_pton") or have_func("inet_aton")
end
have_header("sys/un.h")
@@ -287,7 +262,7 @@ if have_func(test_func)
unless have_func("gethostname")
have_func("uname")
end
- if ENV["SOCKS_SERVER"] # test if SOCKSsocket needed
+ if ENV["SOCKS_SERVER"] or enable_config("socks", false)
if have_library("socks", "Rconnect")
$CFLAGS="-DSOCKS"
end