summaryrefslogtreecommitdiff
path: root/ext/tk/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/extconf.rb')
-rw-r--r--ext/tk/extconf.rb40
1 files changed, 33 insertions, 7 deletions
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 1a44ecc..0ef4104 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