diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-31 11:13:44 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-12-31 11:13:44 +0000 |
commit | b18e1a0b4a56d7f2bfe4265ca9d0e70cd234e1cf (patch) | |
tree | ab2b6b9a60ef60bbf21622a0af00da0fc96db229 /ext/tcltklib/extconf.rb | |
parent | 969bb67169be00b51533884b30376f7bcebefbf1 (diff) | |
download | ruby-b18e1a0b4a56d7f2bfe4265ca9d0e70cd234e1cf.tar.gz |
* ext/tcltklib/extconf.rb (find_tcl, find_tk): Look for both
lib{tcl,tk}M.N and lib{tcl,tk}MN on all platforms. *BSD have
Tcl/Tk libraries named this way.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib/extconf.rb')
-rw-r--r-- | ext/tcltklib/extconf.rb | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb index d58c8045a0..b4ecfad8fe 100644 --- a/ext/tcltklib/extconf.rb +++ b/ext/tcltklib/extconf.rb @@ -22,20 +22,13 @@ def find_tcl(tcllib, stubs) func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable" if tcllib find_library(tcllib, func, *paths) - elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ - find_library("tcl", func, *paths) or - find_library("tcl84", func, *paths) or - find_library("tcl83", func, *paths) or - find_library("tcl82", func, *paths) or - find_library("tcl80", func, *paths) or - find_library("tcl76", func, *paths) + elsif find_library("tcl", func, *paths) + # ok else - find_library("tcl", func, *paths) or - find_library("tcl8.4", func, *paths) or - find_library("tcl8.3", func, *paths) or - find_library("tcl8.2", func, *paths) or - find_library("tcl8.0", func, *paths) or - find_library("tcl7.6", func, *paths) + %w[8.4 8.3 8.2 8.0 7.6].find { |ver| + find_library("tcl#{ver}", func, *paths) or + find_library("tcl#{ver.delete('.')}", func, *paths) + } end end @@ -44,20 +37,13 @@ def find_tk(tklib, stubs) func = stubs ? "Tk_InitStubs" : "Tk_Init" if tklib find_library(tklib, func, *paths) - elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin|bccwin32/ - find_library("tk", func, *paths) or - find_library("tk84", func, *paths) or - find_library("tk83", func, *paths) or - find_library("tk82", func, *paths) or - find_library("tk80", func, *paths) or - find_library("tk42", func, *paths) + elsif find_library("tk", func, *paths) + # ok else - find_library("tk", func, *paths) or - find_library("tk8.4", func, *paths) or - find_library("tk8.3", func, *paths) or - find_library("tk8.2", func, *paths) or - find_library("tk8.0", func, *paths) or - find_library("tk4.2", func, *paths) + %w[8.4 8.3 8.2 8.0 4.2].find { |ver| + find_library("tk#{ver}", func, *paths) or + find_library("tk#{ver.delete('.')}", func, *paths) + } end end |