* ext/tcltklib/extconf.rb (find_tcl, find_tk): find stub library.
* lib/mkmf.rb (arg_config, with_config): deal with '-' and '_' uniformly. [ruby-dev:24118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34fff376ff
commit
7e28ad63ff
@ -1,3 +1,10 @@
|
|||||||
|
Sat Aug 21 06:41:16 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/tcltklib/extconf.rb (find_tcl, find_tk): find stub library.
|
||||||
|
|
||||||
|
* lib/mkmf.rb (arg_config, with_config): deal with '-' and '_'
|
||||||
|
uniformly. [ruby-dev:24118]
|
||||||
|
|
||||||
Fri Aug 20 14:49:42 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Aug 20 14:49:42 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* io.c (rb_io_check_writable): no need to check read buffer if
|
* io.c (rb_io_check_writable): no need to check read buffer if
|
||||||
@ -9,7 +16,7 @@ Fri Aug 20 11:46:43 2004 UENO Katsuhiro <katsu@blue.sky.or.jp>
|
|||||||
|
|
||||||
Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Thu Aug 19 16:29:45 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
|
* ext/tk/lib/tk.rb: Fail to treat a hash value of 'font' option.
|
||||||
|
|
||||||
* ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
|
* ext/tk/lib/tk.rb: bindinfo cannot return '%' substiturion infomation.
|
||||||
|
|
||||||
|
@ -28,10 +28,16 @@ stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
|
|||||||
|
|
||||||
def find_tcl(tcllib, stubs)
|
def find_tcl(tcllib, stubs)
|
||||||
paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
||||||
func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable"
|
if stubs
|
||||||
|
func = "Tcl_InitStubs"
|
||||||
|
lib = "tclstub"
|
||||||
|
else
|
||||||
|
func = "Tcl_FindExecutable"
|
||||||
|
lib = "tcl"
|
||||||
|
end
|
||||||
if tcllib
|
if tcllib
|
||||||
find_library(tcllib, func, *paths)
|
find_library(tcllib, func, *paths)
|
||||||
elsif find_library("tcl", func, *paths)
|
elsif find_library(lib, func, *paths)
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
%w[8.5 8.4 8.3 8.2 8.1 8.0 7.6].find { |ver|
|
%w[8.5 8.4 8.3 8.2 8.1 8.0 7.6].find { |ver|
|
||||||
@ -43,10 +49,16 @@ end
|
|||||||
|
|
||||||
def find_tk(tklib, stubs)
|
def find_tk(tklib, stubs)
|
||||||
paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"]
|
||||||
func = stubs ? "Tk_InitStubs" : "Tk_Init"
|
if stubs
|
||||||
|
func = "Tk_InitStubs"
|
||||||
|
lib = "tkstub"
|
||||||
|
else
|
||||||
|
func = "Tk_Init"
|
||||||
|
lib = "tk"
|
||||||
|
end
|
||||||
if tklib
|
if tklib
|
||||||
find_library(tklib, func, *paths)
|
find_library(tklib, func, *paths)
|
||||||
elsif find_library("tk", func, *paths)
|
elsif find_library(lib, func, *paths)
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
%w[8.5 8.4 8.3 8.2 8.1 8.0 4.2].find { |ver|
|
%w[8.5 8.4 8.3 8.2 8.1 8.0 4.2].find { |ver|
|
||||||
@ -230,5 +242,5 @@ if mac_need_framework ||
|
|||||||
$LDFLAGS += ' -framework Tk -framework Tcl'
|
$LDFLAGS += ' -framework Tk -framework Tcl'
|
||||||
end
|
end
|
||||||
|
|
||||||
create_makefile("tcltklib") if pthread_check
|
create_makefile("tcltklib") if stubs or pthread_check
|
||||||
end
|
end
|
||||||
|
@ -20,6 +20,7 @@ unless defined? $configure_args
|
|||||||
for arg in Shellwords::shellwords(args)
|
for arg in Shellwords::shellwords(args)
|
||||||
arg, val = arg.split('=', 2)
|
arg, val = arg.split('=', 2)
|
||||||
next unless arg
|
next unless arg
|
||||||
|
arg.tr!('_', '-')
|
||||||
if arg.sub!(/^(?!--)/, '--')
|
if arg.sub!(/^(?!--)/, '--')
|
||||||
val or next
|
val or next
|
||||||
arg.downcase!
|
arg.downcase!
|
||||||
@ -30,6 +31,7 @@ unless defined? $configure_args
|
|||||||
for arg in ARGV
|
for arg in ARGV
|
||||||
arg, val = arg.split('=', 2)
|
arg, val = arg.split('=', 2)
|
||||||
next unless arg
|
next unless arg
|
||||||
|
arg.tr!('_', '-')
|
||||||
if arg.sub!(/^(?!--)/, '--')
|
if arg.sub!(/^(?!--)/, '--')
|
||||||
val or next
|
val or next
|
||||||
arg.downcase!
|
arg.downcase!
|
||||||
@ -623,11 +625,11 @@ def find_executable(bin, path = nil)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def arg_config(config, default=nil)
|
def arg_config(config, default=nil)
|
||||||
$configure_args.fetch(config, default)
|
$configure_args.fetch(config.tr('_', '-'), default)
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_config(config, default=nil)
|
def with_config(config, default=nil)
|
||||||
unless /^--with-/ =~ config
|
unless /^--with[-_]/ =~ config
|
||||||
config = '--with-' + config
|
config = '--with-' + config
|
||||||
end
|
end
|
||||||
arg_config(config, default)
|
arg_config(config, default)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user