summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-30 08:20:49 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-30 08:20:49 +0000
commit9885381a0771545278095bb5b3e6c8b24bb97ffc (patch)
treeb8aec97e5c2cd89188adf365524c704fa896180a
parentb8669fe321c6f5e81d071d5790e51b9611fde860 (diff)
downloadruby-9885381a0771545278095bb5b3e6c8b24bb97ffc.tar.gz
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/extmk.rb.in51
-rw-r--r--ext/socket/extconf.rb13
-rw-r--r--ext/socket/socket.c2
-rw-r--r--lib/mkmf.rb2
4 files changed, 27 insertions, 41 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index e02194f15f..19e94a8ae3 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -103,8 +103,6 @@ def try_link(src, opt="")
cfile.close
begin
xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
- ensure
- system "rm -f conftest*"
end
end
@@ -133,8 +131,6 @@ def try_run(src, opt="")
else
nil
end
- ensure
- system "rm -f conftest*"
end
end
@@ -171,22 +167,18 @@ def have_library(lib, func="main")
end
if func && func != ""
- begin
- if $libs
- libs = "-l" + lib + " " + $libs
- else
- libs = "-l" + lib
- end
- unless try_link(<<"SRC", libs)
+ if $libs
+ libs = "-l" + lib + " " + $libs
+ else
+ libs = "-l" + lib
+ end
+ unless try_link(<<"SRC", libs)
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
- $lib_cache[lib] = 'no'
- $cache_mod = TRUE
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $lib_cache[lib] = 'no'
+ $cache_mod = TRUE
+ return FALSE
end
else
if $libs
@@ -215,18 +207,14 @@ def have_func(func)
libs = $libs
libs = "" if libs == nil
- begin
- unless try_link(<<"SRC", libs)
+ unless try_link(<<"SRC", libs)
char #{func}();
int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
- $func_cache[func] = 'no'
- $cache_mod = TRUE
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $func_cache[func] = 'no'
+ $cache_mod = TRUE
+ return FALSE
end
$defs.push(format("-DHAVE_%s", func.upcase))
$func_cache[func] = 'yes'
@@ -245,16 +233,12 @@ def have_header(header)
end
end
- begin
- unless try_cpp(<<"SRC")
+ unless try_cpp(<<"SRC")
#include <#{header}>
SRC
- $hdr_cache[header] = 'no'
- $cache_mod = TRUE
- return FALSE
- end
- ensure
- system "rm -f conftest*"
+ $hdr_cache[header] = 'no'
+ $cache_mod = TRUE
+ return FALSE
end
$hdr_cache[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
@@ -515,6 +499,7 @@ def extmake(target)
$extlibs += " " + $local_libs unless $local_libs == ""
end
ensure
+ system "rm -f conftest*"
Dir.chdir ".."
end
end
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 0fc5042b7d..c83c65cc47 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -21,12 +21,13 @@ else
end
$ipv6 = false
-if enable_config("ipv6", "yes")
+if enable_config("ipv6", true)
if try_run(<<EOF)
#include <sys/types.h>
#include <sys/socket.h>
main()
{
+ exit(0);
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
@@ -38,6 +39,7 @@ EOF
end
end
+
$ipv6type = nil
$ipv6lib = nil
$ipv6libdir = nil
@@ -252,9 +254,10 @@ int
main()
{
struct sockaddr_storage storage;
- struct sockaddr_storage *addr;
+ struct sockaddr_storage *addr = 0;
- addr = &storage;
+ addr->_ss_family = &storage.__ss_family;
+ addr->_ss_len = &storage.__ss_len;
return 0;
}
EOF
@@ -268,11 +271,9 @@ else
end
if sockaddr_storage
- $CFLAGS="-DSOCKADDR_STORAGE "+$CFLAGS
+ $CFLAGS="-DSOCKADDR_STORAGE=sockaddr_storage "+$CFLAGS
end
-p $ipv6
-
have_header("sys/un.h")
if have_func(test_func)
have_func("hsterror")
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 840d1fad3a..067c6d3ada 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -49,7 +49,7 @@ extern int rb_thread_select(int, fd_set*, fd_set*, fd_set*, struct timeval*); /*
#endif
#ifdef SOCKADDR_STORAGE
-# define ss_falily __ss_family
+# define ss_family __ss_family
# define SS_LEN(ss) (ss)->__ss_len
#else
# define SOCKADDR_STORAGE sockaddr
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index fd2a3c4dc5..396e2c8a81 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -86,7 +86,7 @@ def try_link(src, opt="")
begin
xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt))
ensure
- system "rm -f conftest*"
+ system "rm -f conftest.*"
end
end