summaryrefslogtreecommitdiffstats
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-21 08:30:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-21 08:30:09 +0000
commitacae1b4416f45a4f88aaef2d23e785a6b14087d9 (patch)
treeacec075393700c201efd71cc2e3356e43c13212f /lib/mkmf.rb
parenta06c4fd090f2517465572bb2245efd3c06e3a438 (diff)
downloadruby-acae1b4416f45a4f88aaef2d23e785a6b14087d9.tar.gz
ruby-acae1b4416f45a4f88aaef2d23e785a6b14087d9.tar.xz
ruby-acae1b4416f45a4f88aaef2d23e785a6b14087d9.zip
* eval.c (rb_thread_cleanup): should not modify the global
variable curr_thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 58201d02a..bdedce548 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