summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-30 07:54:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-30 07:54:26 +0000
commit7b5ea0ec2f6c4f016e14cf6b61544f9e58d07beb (patch)
treedfc921c6c63ae946b210f11a8335f14bf1069636 /lib/mkmf.rb
parent9713d84b5b0f248cdc9147a3b05d6749c28bfef8 (diff)
* configure.in, win32/Makefile.sub (EXECUTABLE_EXTS): moved from
dln.c:dln_find_1(). * lib/mkmf.rb (def find_executable0): use EXECUTABLE_EXTS, not only EXEEXT. [ruby-core:26821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 7635b4b7a3..895bca0bee 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1123,10 +1123,12 @@ end
# Internal use only.
#
def find_executable0(bin, path = nil)
- ext = config_string('EXEEXT')
+ exts = config_string('EXECUTABLE_EXTS') {|s| s.split} || config_string('EXEEXT') {|s| [s]}
if File.expand_path(bin) == bin
return bin if File.executable?(bin)
- ext and File.executable?(file = bin + ext) and return file
+ if exts
+ exts.each {|ext| File.executable?(file = bin + ext) and return file}
+ end
return nil
end
if path ||= ENV['PATH']
@@ -1137,7 +1139,9 @@ def find_executable0(bin, path = nil)
file = nil
path.each do |dir|
return file if File.executable?(file = File.join(dir, bin))
- return file if ext and File.executable?(file << ext)
+ if exts
+ exts.each {|ext| File.executable?(ext = file + ext) and return ext}
+ end
end
nil
end