summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ext/tcltklib/extconf.rb38
2 files changed, 18 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ec02aeb4a..3f4eb0da25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Dec 31 20:07:49 2002 Akinori MUSHA <knu@iDaemons.org>
+
+ * 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.
+
Tue Dec 31 19:48:21 2002 Akinori MUSHA <knu@iDaemons.org>
* configure.in: Improve OpenBSD support. [obtained from: OpenBSD
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