diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-29 15:44:25 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-29 15:44:25 +0000 |
commit | b72256f91c7ad0be9d6d33b22b0781f181163380 (patch) | |
tree | 931db106145f512cff609091a0caf115d29a8c9a /ext/tk/extconf.rb | |
parent | 2fd4dec977ec87e418b18da6586b51513d6e81e7 (diff) | |
download | ruby-b72256f91c7ad0be9d6d33b22b0781f181163380.tar.gz |
* 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/trunk@43923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/extconf.rb')
-rw-r--r-- | ext/tk/extconf.rb | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 1a44eccb31..0ef4104fc3 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -11,10 +11,18 @@ 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 ? ############################################################## if with_config('tk-old-extconf') @@ -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? - 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? @@ -786,10 +794,20 @@ 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 + next if tclver && ((tclver_major && tclver_major != tclconf['TCL_MAJOR_VERSION']) || (tclver_minor && tclver_minor != tclconf['TCL_MINOR_VERSION'])) + next if TkLib_Config['unsupported_versions'].find{|ver| + ver == "#{tclconf['TCL_MAJOR_VERSION']}.#{tclconf['TCL_MINOR_VERSION']}" + } + 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 + next if tkver && ((tkver_major && tkver_major != tkconf['TK_MAJOR_VERSION']) || (tkver_minor && tkver_minor != tkconf['TK_MINOR_VERSION'])) + next if TkLib_Config['unsupported_versions'].find{|ver| + ver == "#{tkconf['TK_MAJOR_VERSION']}.#{tkconf['TK_MINOR_VERSION']}" + } + end # nativethread check if !TkLib_Config["ruby_with_thread"] @@ -1292,6 +1310,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 +1326,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 |