summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/tcltklib/extconf.rb38
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