From 69310faab2b555c71e919fd27f711ede25cdb3a2 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 May 2010 00:16:19 +0000 Subject: * 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 --- ext/tk/extconf.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ext') 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 -- cgit v1.2.3