aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-07 00:16:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-07 00:16:19 +0000
commit69310faab2b555c71e919fd27f711ede25cdb3a2 (patch)
tree16f5d4cc0ff7ae69abf0f189da5c3a7263b45b58 /ext/tk/extconf.rb
parentcc9333b8407ff40a6328dcf19ae739258a59d918 (diff)
downloadruby-69310faab2b555c71e919fd27f711ede25cdb3a2.tar.gz
* ext/tk/extconf.rb (get_tclConfig_dirs): glob with EXEEXT.
* ext/tk/extconf.rb (search_tclConfig): fixed typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/extconf.rb')
-rw-r--r--ext/tk/extconf.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 2541e9e926..5b2878b30d 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -396,9 +396,10 @@ def get_tclConfig_dirs
dirs.collect{|d| Dir.glob(d, File::FNM_CASEFOLD)}.flatten!
dirs |= dirs
+ exeext = RbConfig::CONFIG['EXEEXT']
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
dir.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
- next if Dir.glob(File.join(dir, '{tclsh,wish}*'), File::FNM_CASEFOLD).empty?
+ next if Dir.glob(File.join(dir, "{tclsh,wish}*#{exeext}"), File::FNM_CASEFOLD).empty?
dirs << File.expand_path(File.join(dir, '..', 'lib'))
dirs << dir
# dirs << File.expand_path(File.join(dir, '..'))
@@ -439,9 +440,10 @@ def get_tclConfig_dirs
Dir.glob(dir + '/{tcltk,tcl,tk}', File::FNM_CASEFOLD)
}.flatten!
+ exeext = RbConfig::CONFIG['EXEEXT']
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
dir.tr!(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
- next if Dir.glob(File.join(dir, '{tclsh,wish}*'), File::FNM_CASEFOLD).empty?
+ next if Dir.glob(File.join(dir, "{tclsh,wish}*#{exeext}"), File::FNM_CASEFOLD).empty?
config_dir << File.expand_path(File.join(dir, '..', 'lib'))
}
@@ -489,7 +491,8 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
tclver, tkver = TkLib_Config['tcltkversion']
conf = nil
- (config_dir | config_dir).map{|dir|
+ config_dir.uniq!
+ config_dir.map{|dir|
if dir.kind_of? Array
[dir[0].strip.chomp('/'), dir[1].strip.chomp('/')]
else
@@ -529,7 +532,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
# nativethread check
if !TkLib_Config["ruby_with_thread"] && tclconf['TCL_THREADS'] == '1'
- puts "WARNIG: find #{tclpath.inspect}, but it WITH nativethread-support under ruby WITHOUT nativethread-support. So, ignore it."
+ puts "WARNING: found #{tclpath.inspect}, but it WITH nativethread-support under ruby WITHOUT nativethread-support. So, ignore it."
TkLib_Config["tcltk-NG-path"] << File.dirname(tclpath)
next
end
@@ -574,7 +577,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
end
unless tcllib_ok && tklib_ok
- puts "WARNIG: find #{tclpath.inspect}, but cannot find valid Tcl/Tk libraries on the same directory. So, ignore it."
+ puts "WARNING: found #{tclpath.inspect}, but cannot find valid Tcl/Tk libraries on the same directory. So, ignore it."
TkLib_Config["tcltk-NG-path"] << File.dirname(tclpath)
next
end