From b18e1a0b4a56d7f2bfe4265ca9d0e70cd234e1cf Mon Sep 17 00:00:00 2001 From: knu Date: Tue, 31 Dec 2002 11:13:44 +0000 Subject: * 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 --- ext/tcltklib/extconf.rb | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'ext') 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 -- cgit v1.2.3