summaryrefslogtreecommitdiff
path: root/lib
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
commit09d3587650488063f06647bd7269fcde15078d94 (patch)
tree07eb815750b2e0499d10b509290b1918284677e9 /lib
parentb47e9619f7262f8fe61457f75eed8e37567e822e (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/branches/ruby_1_8@25964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 378c158c86..ee995bab4b 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1003,10 +1003,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']
@@ -1017,7 +1019,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