From 0ff5af080d0457364326d6948829b94c4c432aec Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 30 Nov 2009 07:54:26 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/trunk@25964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 7635b4b7a..895bca0be 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 -- cgit