diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-21 08:30:09 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-08-21 08:30:09 +0000 |
commit | c7c1384e60a9f3dcc65b3516cdde6dcb7be17f60 (patch) | |
tree | acec075393700c201efd71cc2e3356e43c13212f /lib | |
parent | a7ed0fe4f939de5e0a35de57706c14dd1334d4d9 (diff) | |
download | ruby-c7c1384e60a9f3dcc65b3516cdde6dcb7be17f60.tar.gz |
* eval.c (rb_thread_cleanup): should not modify the global
variable curr_thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mkmf.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 58201d02a7..bdedce5482 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -351,6 +351,30 @@ SRC return true end +def find_executable(bin, path = nil) + printf "checking for %s... ", bin + STDOUT.flush + + if path.nil? + path = ENV['PATH'].split(Config::CONFIG['PATH_SEPARATOR']) + else + path = path.split(Config::CONFIG['PATH_SEPARATOR']) + end + + bin += Config::CONFIG['EXEEXT'] + for dir in path + file = File.join(dir, bin) + if FileTest.executable?(file) + print "yes\n" + return file + else + next + end + end + print "no\n" + return nil +end + def arg_config(config, default=nil) $configure_args.fetch(config, default) end |