summaryrefslogtreecommitdiff
path: root/ext/extmk.rb.in
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 /ext/extmk.rb.in
parentb8669fe321c6f5e81d071d5790e51b9611fde860 (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb.in')
-rw-r--r--ext/extmk.rb.in51
1 files changed, 18 insertions, 33 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