From 8149f70e13fb2f2577bb9d0666f9f86a13777041 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 26 Jun 2013 07:57:49 +0000 Subject: merge revision(s) 41347: [Backport #8319] * ext/tk/extconf.rb: support s390x (Thanks to bkabrda) [ruby-trunk - Bug #5465] * ext/tk/extconf.rb: apply [Backport87 - Backport #5048] * ext/tk/lib/tk/canvas.rb, ext/tk/sample/demos-{en,jp}/{tree.rb,widget}: fix bug (Thanks to zzak) [ruby-trunk - Bug #8319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@41651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/extconf.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/tk/extconf.rb') diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 2f68d01e7f..2b5c8c4674 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -114,7 +114,7 @@ def is_macosx? end def maybe_64bit? - /64|universal/ =~ RUBY_PLATFORM + /64|universal|s390x/ =~ RUBY_PLATFORM end def check_tcltk_version(version) @@ -313,7 +313,9 @@ def find_macosx_framework paths.reverse! unless TkLib_Config["ActiveTcl"] # system has higher priority paths.map{|dir| dir.strip.chomp('/')}.each{|dir| + next unless File.exist?(File.join(dir, "Tcl.framework", "Headers")) next unless File.directory?(tcldir = File.join(dir, "Tcl.framework")) + next unless File.exist?(File.join(dir, "Tk.framework"), "Headers") next unless File.directory?(tkdir = File.join(dir, "Tk.framework")) TkLib_Config["tcltk-framework"] = dir return [tcldir, tkdir] -- cgit v1.2.1 From 3eb55f283ee16b8a705d9599b2ef775e4f50d183 Mon Sep 17 00:00:00 2001 From: nagai Date: Sun, 4 Aug 2013 01:21:18 +0000 Subject: * ext/tk/extconf.rb: Default search_versions are set 8.5 and 8.4 only. At present, Tcl/Tk8.6 is not supported. * ext/tk/extconf.rb: Fix typo. [ruby-core:56084] [Bug #8656] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@42368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/extconf.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/tk/extconf.rb') diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 2b5c8c4674..0bc0e7016a 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -8,7 +8,8 @@ TkLib_Config = {} TkLib_Config['search_versions'] = # %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2] # %w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0] - %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps + # %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps + %w[8.5 8.4] # At present, Tcl/Tk8.6 is not supported. TkLib_Config['major_nums'] = '87' @@ -315,7 +316,7 @@ def find_macosx_framework paths.map{|dir| dir.strip.chomp('/')}.each{|dir| next unless File.exist?(File.join(dir, "Tcl.framework", "Headers")) next unless File.directory?(tcldir = File.join(dir, "Tcl.framework")) - next unless File.exist?(File.join(dir, "Tk.framework"), "Headers") + next unless File.exist?(File.join(dir, "Tk.framework", "Headers")) next unless File.directory?(tkdir = File.join(dir, "Tk.framework")) TkLib_Config["tcltk-framework"] = dir return [tcldir, tkdir] @@ -2031,4 +2032,6 @@ if (TkLib_Config["tcltk-framework"] || puts "\nFind Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk." else puts "\nCan't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk." + puts "If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib)." + puts "At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4." end -- cgit v1.2.1 From cfbdfc796ac58453ca548c7ba23540a181c42a03 Mon Sep 17 00:00:00 2001 From: usa Date: Sun, 22 Dec 2013 04:53:40 +0000 Subject: merge revision(s) 43923,43925: [Backport #9182] * ext/tk/lib/tkextlib/tktable/tktable.rb: fix bug on arguments for Proc object. * ext/tk/sample/scrollframe.rb: forgot a Module definition. * ext/tk/extconf.rb: check unsupported version of tclConfig.sh/tkConfig.sh. It is because current Ruby/Tk doesn't support Tcl/Tk8.6. * ext/tk/extconf.rb: change search step of Tcl/Tk libraries. * ext/tk/lib/tk/namespace.rb: instance_exec() cannot accept a script string. * ext/tk/lib/tk/msgcat.rb: bug fix on treating encodings. Now, ext/tk/sample/tkmsgcat-load_rb*.rb will work. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/extconf.rb | 59 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 8 deletions(-) (limited to 'ext/tk/extconf.rb') diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 0bc0e7016a..3f8c50ff6d 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -11,9 +11,17 @@ TkLib_Config['search_versions'] = # %w[8.7 8.6 8.5 8.4 8.0] # to shorten search steps %w[8.5 8.4] # At present, Tcl/Tk8.6 is not supported. +TkLib_Config['unsupported_versions'] = + %w[8.8 8.7 8.6] # At present, Tcl/Tk8.6 is not supported. + TkLib_Config['major_nums'] = '87' +############################################################## + +TkLib_Config['enable-shared'] = enable_config("shared") + + ############################################################## # use old extconf.rb ? ############################################################## @@ -543,13 +551,13 @@ end def get_ext_list() exts = [CONFIG['DLEXT']] - exts.concat %w(dll lib) if is_win32? + exts.concat %w(dll) if is_win32? exts.concat %w(bundle dylib) if is_macosx? || /nextstep|openstep|rhapsody/ =~ RUBY_PLATFORM - if enable_config("shared") == false - [CONFIG['LIBEXT'], "a"].concat exts - else - exts.concat [CONFIG['LIBEXT'], "a"] + if TkLib_Config["tcltk-stubs"] || TkLib_Config['enable-shared'] == false + exts.unshift "lib" if is_win32? + exts.unshift "a" + exts.unshift CONFIG['LIBEXT'] end if is_win32? @@ -737,6 +745,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file] end conf = nil + progress_flag = false config_dir.uniq! config_dir.map{|dir| @@ -747,7 +756,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file] dir.strip.chomp('/') end }.each{|dir| - print(".") # progress + print("."); progress_flag = true # progress # print("check #{dir} ==>"); if dir.kind_of? Array tcldir, tkdir = dir @@ -786,10 +795,36 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file] # parse tclConfig.sh/tkConfig.sh tclconf = (tclpath)? parse_tclConfig(tclpath): nil - next if tclconf && tclver && ((tclver_major && tclver_major != tclconf['TCL_MAJOR_VERSION']) || (tclver_minor && tclver_minor != tclconf['TCL_MINOR_VERSION'])) + if tclconf + if tclver && ((tclver_major && tclver_major != tclconf['TCL_MAJOR_VERSION']) || (tclver_minor && tclver_minor != tclconf['TCL_MINOR_VERSION'])) + print("\n") if progress_flag + puts "Ignore \"#{tclpath}\" (unmatch with configured version)." + progress_flag = false + next + end + if TkLib_Config['unsupported_versions'].find{|ver| ver == "#{tclconf['TCL_MAJOR_VERSION']}.#{tclconf['TCL_MINOR_VERSION']}"} + print("\n") if progress_flag + puts "Ignore \"#{tclpath}\" (unsupported version of Tcl/Tk)." + progress_flag = false + next + end + end tkconf = (tkpath)? parse_tclConfig(tkpath): nil - next if tkconf && tkver && ((tkver_major && tkver_major != tkconf['TK_MAJOR_VERSION']) || (tkver_minor && tkver_minor != tkconf['TK_MINOR_VERSION'])) + if tkconf + if tkver && ((tkver_major && tkver_major != tkconf['TK_MAJOR_VERSION']) || (tkver_minor && tkver_minor != tkconf['TK_MINOR_VERSION'])) + print("\n") if progress_flag + puts "Ignore \"#{tkpath}\" (unmatch with configured version)." + progress_flag = false + next + end + if TkLib_Config['unsupported_versions'].find{|ver| ver == "#{tkconf['TK_MAJOR_VERSION']}.#{tkconf['TK_MINOR_VERSION']}"} + print("\n") if progress_flag + puts "Ignore \"#{tkpath}\" (unsupported version of Tcl/Tk)." + progress_flag = false + next + end + end # nativethread check if !TkLib_Config["ruby_with_thread"] @@ -1292,6 +1327,10 @@ end def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion, tcl_opt_paths, tk_opt_paths) st,path,lib,libs,*inc = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths) + if !st && TkLib_Config['enable-shared'] == nil + TkLib_Config['enable-shared'] = false + st,path,lib,libs,*inc = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths) + end unless st puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.") return false @@ -1304,6 +1343,10 @@ def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion, end st,path,lib,libs,*inc = find_tk(tklib, stubs, tkversion, *tk_opt_paths) + if !st && TkLib_Config['enable-shared'] == nil + TkLib_Config['enable-shared'] = false + st,path,lib,libs,*inc = find_tk(tklib, stubs, tkversion, *tk_opt_paths) + end unless st puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.") return false -- cgit v1.2.1