* ext/tk/extconf.rb: revert. enbugged by last commit.
([ruby-dev:41133], [ruby-dev:41134], [ruby-core:30010]) * ext/tk/README.tcltklib: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
54062a76e7
commit
690e065bf8
11
ChangeLog
11
ChangeLog
@ -1,3 +1,10 @@
|
|||||||
|
Wed May 5 19:00:01 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/extconf.rb: revert. enbugged by last commit.
|
||||||
|
([ruby-dev:41133], [ruby-dev:41134], [ruby-core:30010])
|
||||||
|
|
||||||
|
* ext/tk/README.tcltklib: ditto.
|
||||||
|
|
||||||
Wed May 5 15:54:35 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed May 5 15:54:35 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (rb_stat): use STAT macro instead of calling stat() directly.
|
* file.c (rb_stat): use STAT macro instead of calling stat() directly.
|
||||||
@ -186,6 +193,10 @@ Fri Apr 30 21:40:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||||||
* test/test_open3.rb (TestOpen3#test_commandline): use simple
|
* test/test_open3.rb (TestOpen3#test_commandline): use simple
|
||||||
command via shell. [ruby-dev:41100]
|
command via shell. [ruby-dev:41100]
|
||||||
|
|
||||||
|
Fri Apr 30 15:38:45 2010 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/extconf.rb: better support for MinGW environment.
|
||||||
|
|
||||||
Fri Apr 30 12:05:20 2010 Tanaka Akira <akr@fsij.org>
|
Fri Apr 30 12:05:20 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* file.c (file_expand_path): call rb_str_set_len before BUFCHECK to
|
* file.c (file_expand_path): call rb_str_set_len before BUFCHECK to
|
||||||
|
@ -61,8 +61,6 @@ some or all of the following options.
|
|||||||
--with-tcl-lib=<dir> the directry contains 'libtcl<version>.so'
|
--with-tcl-lib=<dir> the directry contains 'libtcl<version>.so'
|
||||||
--with-tk-lib=<dir> the directry contains 'libtk<version>.so'
|
--with-tk-lib=<dir> the directry contains 'libtk<version>.so'
|
||||||
|
|
||||||
--with-tcltk-drive=<drive> (Windows) drive letter for Tcl/Tk libraries.
|
|
||||||
|
|
||||||
--enable-mac-tcltk-framework (MacOS X) use Tcl/Tk framework
|
--enable-mac-tcltk-framework (MacOS X) use Tcl/Tk framework
|
||||||
(Obsolete. Please use '--enable-tcltk-framework'.)
|
(Obsolete. Please use '--enable-tcltk-framework'.)
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
##############################################################
|
##############################################################
|
||||||
# extconf.rb for tcltklib
|
# extconf.rb for tcltklib
|
||||||
# release date: 2010-04-30
|
# release date: 2010-03-26
|
||||||
##############################################################
|
##############################################################
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
#$VERBOSE=true
|
|
||||||
|
|
||||||
TkLib_Config = {}
|
TkLib_Config = {}
|
||||||
TkLib_Config['search_versions'] =
|
TkLib_Config['search_versions'] =
|
||||||
# %w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 7.6 4.2]
|
%w[8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 4.2]
|
||||||
%w[8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0]
|
|
||||||
|
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
@ -107,16 +105,6 @@ def is_win32?
|
|||||||
/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
|
/mswin|mingw|cygwin|bccwin/ =~ RUBY_PLATFORM
|
||||||
end
|
end
|
||||||
|
|
||||||
def win_drive
|
|
||||||
drive = with_config("windows-tcltk-drive", "c")
|
|
||||||
case(RUBY_PLATFORM)
|
|
||||||
when /cygwin/
|
|
||||||
["/cygdrive/#{drive}", "/cygdrive/[A-Za-z]"]
|
|
||||||
else
|
|
||||||
["#{drive}:", "[A-Za-z]:"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_macosx?
|
def is_macosx?
|
||||||
/darwin/ =~ RUBY_PLATFORM
|
/darwin/ =~ RUBY_PLATFORM
|
||||||
end
|
end
|
||||||
@ -193,51 +181,14 @@ def get_shlib_path_head
|
|||||||
end
|
end
|
||||||
|
|
||||||
if is_win32?
|
if is_win32?
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
if TkLib_Config["ActiveTcl"]
|
if TkLib_Config["ActiveTcl"]
|
||||||
|
path_head.concat ["c:/ActiveTcl", "c:/Program Files/ActiveTcl"]
|
||||||
|
end
|
||||||
path_head.concat [
|
path_head.concat [
|
||||||
"#{drive}/ActiveTcl*", "#{drive}/Activetcl*",
|
"c:/Tcl", "c:/Program Files/Tcl",
|
||||||
"#{drive}/activeTcl*", "#{drive}/activetcl*",
|
"/Tcl", "/Program Files/Tcl"
|
||||||
"#{drive}/Program Files/ActiveTcl*",
|
|
||||||
"#{drive}/Program Files/Activetcl*",
|
|
||||||
"#{drive}/Program Files/activeTcl*",
|
|
||||||
"#{drive}/Program Files/activetcl*",
|
|
||||||
"/ActiveTcl*", "/Activetcl*", "/activeTcl*", "/activetcl*",
|
|
||||||
"/Program Files/ActiveTcl*", "/Program Files/Activetcl*",
|
|
||||||
"/Program Files/activeTcl*", "/Program Files/activetcl*"
|
|
||||||
]
|
]
|
||||||
end
|
path_head.each{|dir| path_dirs << "#{dir}"}
|
||||||
|
|
||||||
path_head.concat [
|
|
||||||
"#{drive}/Tcl*", "#{drive}/tcl*",
|
|
||||||
"#{drive}/Program Files/Tcl*", "#{drive}/Program Files/tcl*",
|
|
||||||
"/Tcl*", "/tcl*", "/Program Files/Tcl*", "/Program Files/tcl*"
|
|
||||||
]
|
|
||||||
|
|
||||||
path_head.map!{|d|
|
|
||||||
[Dir.glob(d).sort.reverse,
|
|
||||||
Dir.glob(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')).sort.reverse]
|
|
||||||
}.flatten!
|
|
||||||
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
|
||||||
path_head << dir
|
|
||||||
path_head << File.expand_path(File.join(dir, '..'))
|
|
||||||
if dir.gsub!(/\\/, '/')
|
|
||||||
path_head << dir
|
|
||||||
path_head << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
if dir.sub!(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')
|
|
||||||
path_head << dir
|
|
||||||
path_head << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
path_head |= path_head
|
|
||||||
path_head.each{|dir|
|
|
||||||
path_dirs << dir
|
|
||||||
dir = File.join(dir, "lib")
|
|
||||||
path_dirs << dir if File.directory?(dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
else
|
||||||
[
|
[
|
||||||
@ -414,7 +365,7 @@ def parse_tclConfig(file)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_libpath(lib_flag, lib_spec)
|
def get_libpath(lib_flag, lib_spec)
|
||||||
# get libpath from {TCL,Tk}_LIB_FLAG and {TCL,Tk}_LIB_SPEC
|
# get libpath fro {TCL,Tk}_LIB_FLAG and {TCL,Tk}_LIB_SPEC
|
||||||
libpath = lib_spec.gsub(/(#{lib_flag}|-L)/, "").strip
|
libpath = lib_spec.gsub(/(#{lib_flag}|-L)/, "").strip
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -422,21 +373,18 @@ def get_tclConfig_dirs
|
|||||||
config_dir = []
|
config_dir = []
|
||||||
|
|
||||||
if is_win32?
|
if is_win32?
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
if TkLib_Config["ActiveTcl"]
|
if TkLib_Config["ActiveTcl"]
|
||||||
dirs = []
|
dirs = []
|
||||||
if TkLib_Config["ActiveTcl"].kind_of?(String)
|
if TkLib_Config["ActiveTcl"].kind_of?(String)
|
||||||
dirs << TkLib_Config["ActiveTcl"]
|
dirs << TkLib_Config["ActiveTcl"]
|
||||||
end
|
end
|
||||||
dirs.concat [
|
dirs.concat [
|
||||||
"#{drive}/ActiveTcl*/lib", "#{drive}/Activetcl*/lib",
|
"c:/ActiveTcl*/lib", "c:/Activetcl*/lib",
|
||||||
"#{drive}/activeTcl*/lib", "#{drive}/activetcl*/lib",
|
"c:/activeTcl*/lib", "c:/activetcl*/lib",
|
||||||
"#{drive}/Tcl*/lib", "#{drive}/tcl*/lib",
|
"c:/Tcl*/lib", "c:/tcl*/lib",
|
||||||
"#{drive}/Program Files/ActiveTcl*/lib",
|
"c:/Program Files/ActiveTcl*/lib", "c:/Program Files/Activetcl*/lib",
|
||||||
"#{drive}/Program Files/Activetcl*/lib",
|
"c:/Program Files/activeTcl*/lib", "c:/Program Files/activetcl*/lib",
|
||||||
"#{drive}/Program Files/activeTcl*/lib",
|
"c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib",
|
||||||
"#{drive}/Program Files/activetcl*/lib",
|
|
||||||
"#{drive}/Program Files/Tcl*/lib", "#{drive}/Program Files/tcl*/lib",
|
|
||||||
"/ActiveTcl*/lib", "/Activetcl*/lib",
|
"/ActiveTcl*/lib", "/Activetcl*/lib",
|
||||||
"/activeTcl*/lib", "/activetcl*/lib",
|
"/activeTcl*/lib", "/activetcl*/lib",
|
||||||
"/Tcl*/lib", "/tcl*/lib",
|
"/Tcl*/lib", "/tcl*/lib",
|
||||||
@ -446,35 +394,21 @@ def get_tclConfig_dirs
|
|||||||
]
|
]
|
||||||
else
|
else
|
||||||
dirs = [
|
dirs = [
|
||||||
"#{drive}/Tcl*/lib", "#{drive}/tcl*/lib",
|
"c:/Tcl*/lib", "c:/tcl*/lib",
|
||||||
"#{drive}/Program Files/Tcl*/lib", "#{drive}/Program Files/tcl*/lib",
|
"c:/Program Files/Tcl*/lib", "c:/Program Files/tcl*/lib",
|
||||||
"/Tcl*/lib", "/tcl*/lib",
|
"/Tcl*/lib", "/tcl*/lib",
|
||||||
"/Program Files/Tcl*/lib", "/Program Files/tcl*/lib"
|
"/Program Files/Tcl*/lib", "/Program Files/tcl*/lib"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
dirs.map!{|d|
|
dirs.collect{|d| Dir.glob(d)}.flatten!
|
||||||
[Dir.glob(d).sort.reverse,
|
|
||||||
Dir.glob(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')).sort.reverse]
|
|
||||||
}.flatten!
|
|
||||||
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
|
||||||
dirs << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
dirs << dir
|
|
||||||
dirs << File.expand_path(File.join(dir, '..'))
|
|
||||||
if dir.gsub!(/\\/, '/')
|
|
||||||
dirs << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
dirs << dir
|
|
||||||
dirs << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
if dir.sub!(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')
|
|
||||||
dirs << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
dirs << dir
|
|
||||||
dirs << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
dirs |= dirs
|
dirs |= dirs
|
||||||
|
|
||||||
|
ENV['PATH'].split(';').each{|dir|
|
||||||
|
dirs << File.expand_path(File.join(dir, '..', 'lib'))
|
||||||
|
dirs << dir
|
||||||
|
dirs << File.expand_path(File.join(dir, '..'))
|
||||||
|
}
|
||||||
|
|
||||||
unless TkLib_Config["space-on-tk-libpath"]
|
unless TkLib_Config["space-on-tk-libpath"]
|
||||||
dirs.delete_if{|path| path =~ / /}
|
dirs.delete_if{|path| path =~ / /}
|
||||||
end
|
end
|
||||||
@ -504,13 +438,13 @@ def get_tclConfig_dirs
|
|||||||
'/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
|
'/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
|
||||||
'/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
|
'/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
|
||||||
].map{|dir|
|
].map{|dir|
|
||||||
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[987]*/lib')
|
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[87]*/lib')
|
||||||
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[987]*')
|
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}[87]*')
|
||||||
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}/lib')
|
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}/lib')
|
||||||
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}')
|
Dir.glob(dir + '/{TclTk,tcltk,Tcl,tcl,Tk,tk}')
|
||||||
}.flatten!
|
}.flatten!
|
||||||
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
ENV['PATH'].split(':').each{|dir|
|
||||||
config_dir << File.expand_path(File.join(dir, '..', 'lib'))
|
config_dir << File.expand_path(File.join(dir, '..', 'lib'))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,11 +507,7 @@ def search_tclConfig(*paths) # libdir list or [tcl-libdir|file, tk-libdir|file]
|
|||||||
tcldir = tkdir = dir
|
tcldir = tkdir = dir
|
||||||
end
|
end
|
||||||
|
|
||||||
if enable_config("shared") == false
|
|
||||||
tails = ['Config.sh', 'config.sh', 'Config-shared.sh', 'config-shared.sh']
|
|
||||||
else
|
|
||||||
tails = ['Config-shared.sh', 'config-shared.sh', 'Config.sh', 'config.sh']
|
tails = ['Config-shared.sh', 'config-shared.sh', 'Config.sh', 'config.sh']
|
||||||
end
|
|
||||||
|
|
||||||
if File.file?(tcldir)
|
if File.file?(tcldir)
|
||||||
tclcfg_files = [tcldir] * tails.length
|
tclcfg_files = [tcldir] * tails.length
|
||||||
@ -762,15 +692,15 @@ def check_shlib_search_path(paths)
|
|||||||
dirs = []
|
dirs = []
|
||||||
|
|
||||||
if !Dir.glob(head + "-*").empty?
|
if !Dir.glob(head + "-*").empty?
|
||||||
dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[987].*").empty?
|
dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty?
|
||||||
dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[987][0-9]*").empty?
|
dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
if !Dir.glob(head + "[_-]*").empty?
|
if !Dir.glob(head + "[_-]*").empty?
|
||||||
dirs << head + "_#{ver}/lib" if !Dir.glob(head + "_[987].*").empty?
|
dirs << head + "_#{ver}/lib" if !Dir.glob(head + "_[89].*").empty?
|
||||||
dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[987].*").empty?
|
dirs << head + "-#{ver}/lib" if !Dir.glob(head + "-[89].*").empty?
|
||||||
dirs << head + "_#{ver.delete('.')}/lib" if !Dir.glob(head + "_[987][0-9]*").empty?
|
dirs << head + "_#{ver.delete('.')}/lib" if !Dir.glob(head + "_[89][0-9]*").empty?
|
||||||
dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[987][0-9]*").empty?
|
dirs << head + "-#{ver.delete('.')}/lib" if !Dir.glob(head + "-[89][0-9]*").empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
dirs
|
dirs
|
||||||
@ -782,22 +712,17 @@ def check_shlib_search_path(paths)
|
|||||||
|
|
||||||
else
|
else
|
||||||
# paths is a string with PATH environment style
|
# paths is a string with PATH environment style
|
||||||
path_list = paths.split(File::PATH_SEPARATOR)
|
path_list = paths.split((is_win32?)? ';': ':')
|
||||||
#path_list = paths.split((is_win32?)? ';': ':')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
path_list = check_NG_path(path_list)
|
path_list = check_NG_path(path_list)
|
||||||
|
|
||||||
if is_win32?
|
if is_win32?
|
||||||
# exist-dir only
|
# exist-dir only
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
path_list.each{|path|
|
path_list.each{|path|
|
||||||
path = path.strip;
|
path = path.strip; $LIBPATH |= [path] if File.directory?(path)
|
||||||
#$LIBPATH |= [path] if File.directory?(path)
|
|
||||||
$LIBPATH |= [path.sub(%r|^(#{drv_regexp})?//|, '\1/')] unless Dir.glob(File.join(path, "*.{a,so,dll,lib}")).empty?
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# keep paths for searching dynamic libs
|
|
||||||
path_list.each{|path| $LIBPATH |= [path.strip] }
|
path_list.each{|path| $LIBPATH |= [path.strip] }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -805,15 +730,12 @@ end
|
|||||||
def search_vers_on_path(vers, path, *heads)
|
def search_vers_on_path(vers, path, *heads)
|
||||||
if enable_config("shared") == false
|
if enable_config("shared") == false
|
||||||
exts = CONFIG['LIBEXT'] + ',' + CONFIG['DLEXT']
|
exts = CONFIG['LIBEXT'] + ',' + CONFIG['DLEXT']
|
||||||
exts << ",lib,dll" if is_win32?
|
|
||||||
exts << ",bundle,dylib" if is_macosx? || /nextstep|openstep|rhapsody/ =~ RUBY_PLATFORM
|
|
||||||
else
|
else
|
||||||
exts = CONFIG['DLEXT'] + ',' + CONFIG['LIBEXT']
|
exts = CONFIG['DLEXT'] + ',' + CONFIG['LIBEXT']
|
||||||
exts << ",dll,lib" if is_win32?
|
|
||||||
exts << ",dylib,bundle" if is_macosx? || /nextstep|openstep|rhapsody/ =~ RUBY_PLATFORM
|
|
||||||
end
|
end
|
||||||
|
exts << ",dll,lib" if is_win32?
|
||||||
|
exts << ",bundle,dylib" if is_macosx? || /nextstep|openstep|rhapsody/ =~ RUBY_PLATFORM
|
||||||
files = Dir.glob(File.join(path, "*{#{heads.join(',')}}*.{#{exts}}"))
|
files = Dir.glob(File.join(path, "*{#{heads.join(',')}}*.{#{exts}}"))
|
||||||
files |= files
|
|
||||||
vers.find_all{|ver| files.find{|f| f =~ /(#{ver}|#{ver.delete('.')})/} }
|
vers.find_all{|ver| files.find{|f| f =~ /(#{ver}|#{ver.delete('.')})/} }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -843,68 +765,10 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
|
|||||||
"/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
|
"/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
|
||||||
].find_all{|dir| File.directory?(dir)}
|
].find_all{|dir| File.directory?(dir)}
|
||||||
|
|
||||||
if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
|
|
||||||
default_paths.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse.map{|d| d << "/lib"}
|
|
||||||
end
|
|
||||||
|
|
||||||
if is_win32?
|
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
if TkLib_Config["ActiveTcl"]
|
|
||||||
default_paths.concat [
|
default_paths.concat [
|
||||||
"#{drive}/ActiveTcl*", "#{drive}/Activetcl*",
|
"c:/Tcl/lib", "c:/Program Files/Tcl/lib",
|
||||||
"#{drive}/activeTcl*", "#{drive}/activetcl*",
|
"/Tcl/lib", "/Program Files/Tcl/lib"
|
||||||
"#{drive}/Program Files/ActiveTcl*",
|
].find_all{|dir| File.directory?(dir)}
|
||||||
"#{drive}/Program Files/Activetcl*",
|
|
||||||
"#{drive}/Program Files/activeTcl*",
|
|
||||||
"#{drive}/Program Files/activetcl*",
|
|
||||||
"/ActiveTcl*", "/Activetcl*", "/activeTcl*", "/activetcl*",
|
|
||||||
"/Program Files/ActiveTcl*", "/Program Files/Activetcl*",
|
|
||||||
"/Program Files/activeTcl*", "/Program Files/activetcl*"
|
|
||||||
].map{|d| d << "/lib"}
|
|
||||||
end
|
|
||||||
default_paths.concat [
|
|
||||||
"#{drive}/Tcl*", "#{drive}/tcl*",
|
|
||||||
"#{drive}/Program Files/Tcl*", "#{drive}/Program Files/tcl*",
|
|
||||||
"/Tcl*", "/tcl*", "/Program Files/Tcl*", "/Program Files/tcl*",
|
|
||||||
].map{|d| d << "/lib"}
|
|
||||||
default_paths.map{|d|
|
|
||||||
[Dir.glob(d).sort.reverse,
|
|
||||||
Dir.glob(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')).sort.reverse]
|
|
||||||
}.flatten.find_all{|dir| File.directory?(dir)}
|
|
||||||
end
|
|
||||||
|
|
||||||
env_paths = []
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
if is_win32?
|
|
||||||
if dir.gsub!(/\\/, '/')
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
if dir.sub!(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_win32?
|
|
||||||
env_paths = env_paths.find_all{|d|
|
|
||||||
not (Dir.glob(File.join(d, "*[Tt]cl*")) | Dir.glob(File.join(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2'), "*[Tt]cl*"))).empty?
|
|
||||||
}
|
|
||||||
else
|
|
||||||
env_paths = env_paths.find_all{|d|
|
|
||||||
not (Dir.glob(File.join(d, "*[Tt]cl*"))).empty?
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
default_paths.concat env_paths
|
|
||||||
|
|
||||||
default_paths |= default_paths
|
|
||||||
|
|
||||||
unless TkLib_Config["space-on-tk-libpath"]
|
unless TkLib_Config["space-on-tk-libpath"]
|
||||||
default_paths.delete_if{|path| path =~ / /}
|
default_paths.delete_if{|path| path =~ / /}
|
||||||
@ -947,12 +811,12 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ret = paths.find{|path|
|
ret = paths.map{|path|
|
||||||
if tcllib
|
if tcllib
|
||||||
print(".")
|
print(".")
|
||||||
find_library(tcllib, func, path)
|
[path, find_library(tcllib, func, path)]
|
||||||
else
|
else
|
||||||
search_vers_on_path(versions, path, lib, 'tcl').find{|ver|
|
st = search_vers_on_path(versions, path, lib, 'tcl').find{|ver|
|
||||||
(print(".");find_library("#{lib}#{ver}", func, path)) or
|
(print(".");find_library("#{lib}#{ver}", func, path)) or
|
||||||
(print(".");find_library("#{lib}#{ver.delete('.')}", func, path)) or
|
(print(".");find_library("#{lib}#{ver.delete('.')}", func, path)) or
|
||||||
(print(".");find_library("#{lib}#{ver}g", func, path)) or
|
(print(".");find_library("#{lib}#{ver}g", func, path)) or
|
||||||
@ -962,11 +826,11 @@ def find_tcl(tcllib, stubs, version, *opt_paths)
|
|||||||
(print(".");find_library("tcl#{ver}g", func, path)) or
|
(print(".");find_library("tcl#{ver}g", func, path)) or
|
||||||
(print(".");find_library("tcl#{ver.delete('.')}g", func, path))
|
(print(".");find_library("tcl#{ver.delete('.')}g", func, path))
|
||||||
} || (!version && (print(".");find_library(lib, func, path)))
|
} || (!version && (print(".");find_library(lib, func, path)))
|
||||||
|
[path, st]
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
print("\n") # progress
|
print("\n") # progress
|
||||||
print("Found a Tcl library at #{ret}.\n") if ret
|
|
||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1011,68 +875,10 @@ def find_tk(tklib, stubs, version, *opt_paths)
|
|||||||
"/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
|
"/usr/local/lib", "/usr/pkg/lib", "/usr/contrib/lib", "/usr/lib"
|
||||||
].find_all{|dir| File.directory?(dir)}
|
].find_all{|dir| File.directory?(dir)}
|
||||||
|
|
||||||
if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
|
|
||||||
default_paths.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse.map{|d| d << "/lib"}
|
|
||||||
end
|
|
||||||
|
|
||||||
if is_win32?
|
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
if TkLib_Config["ActiveTcl"]
|
|
||||||
default_paths.concat [
|
default_paths.concat [
|
||||||
"#{drive}/ActiveTcl*", "#{drive}/Activetcl*",
|
"c:/Tcl/lib", "c:/Program Files/Tcl/lib",
|
||||||
"#{drive}/activeTcl*", "#{drive}/activetcl*",
|
"/Tcl/lib", "/Program Files/Tcl/lib"
|
||||||
"#{drive}/Program Files/ActiveTcl*",
|
].find_all{|dir| File.directory?(dir)}
|
||||||
"#{drive}/Program Files/Activetcl*",
|
|
||||||
"#{drive}/Program Files/activeTcl*",
|
|
||||||
"#{drive}/Program Files/activetcl*",
|
|
||||||
"/ActiveTcl*", "/Activetcl*", "/activeTcl*", "/activetcl*",
|
|
||||||
"/Program Files/ActiveTcl*", "/Program Files/Activetcl*",
|
|
||||||
"/Program Files/activeTcl*", "/Program Files/activetcl*"
|
|
||||||
].map{|d| d << "/lib"}
|
|
||||||
end
|
|
||||||
default_paths.concat [
|
|
||||||
"#{drive}/Tcl*", "#{drive}/tcl*",
|
|
||||||
"#{drive}/Program Files/Tcl*", "#{drive}/Program Files/tcl*",
|
|
||||||
"/Tcl*", "/tcl*", "/Program Files/Tcl*", "/Program Files/tcl*",
|
|
||||||
].map{|d| d << "/lib"}
|
|
||||||
default_paths.map{|d|
|
|
||||||
[Dir.glob(d).sort.reverse,
|
|
||||||
Dir.glob(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')).sort.reverse]
|
|
||||||
}.flatten.find_all{|dir| File.directory?(dir)}
|
|
||||||
end
|
|
||||||
|
|
||||||
env_paths = []
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
if is_win32?
|
|
||||||
if dir.gsub!(/\\/, '/')
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
if dir.sub!(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..', 'lib'))
|
|
||||||
env_paths << dir
|
|
||||||
env_paths << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
if is_win32?
|
|
||||||
env_paths = env_paths.find_all{|d|
|
|
||||||
not (Dir.glob(File.join(d, "*[Tt]k*")) | Dir.glob(File.join(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2'), "*[Tt]k*"))).empty?
|
|
||||||
}
|
|
||||||
else
|
|
||||||
env_paths = env_paths.find_all{|d|
|
|
||||||
not (Dir.glob(File.join(d, "*[Tt]k*"))).empty?
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
default_paths.concat env_paths
|
|
||||||
|
|
||||||
default_paths |= default_paths
|
|
||||||
|
|
||||||
unless TkLib_Config["space-on-tk-libpath"]
|
unless TkLib_Config["space-on-tk-libpath"]
|
||||||
default_paths.delete_if{|path| path =~ / /}
|
default_paths.delete_if{|path| path =~ / /}
|
||||||
@ -1114,12 +920,12 @@ def find_tk(tklib, stubs, version, *opt_paths)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ret = paths.find{|path|
|
ret = paths.map{|path|
|
||||||
if tklib
|
if tklib
|
||||||
print(".")
|
print(".")
|
||||||
find_library(tklib, func, path)
|
[path, find_library(tklib, func, path)]
|
||||||
else
|
else
|
||||||
search_vers_on_path(versions, path, lib, 'tk').find{|ver|
|
st = search_vers_on_path(versions, path, lib, 'tk').find{|ver|
|
||||||
(print(".");find_library("#{lib}#{ver}", func, path)) or
|
(print(".");find_library("#{lib}#{ver}", func, path)) or
|
||||||
(print(".");find_library("#{lib}#{ver.delete('.')}", func, path)) or
|
(print(".");find_library("#{lib}#{ver.delete('.')}", func, path)) or
|
||||||
(print(".");find_library("#{lib}#{ver}g", func, path)) or
|
(print(".");find_library("#{lib}#{ver}g", func, path)) or
|
||||||
@ -1129,22 +935,24 @@ def find_tk(tklib, stubs, version, *opt_paths)
|
|||||||
(print(".");find_library("tk#{ver}g", func, path)) or
|
(print(".");find_library("tk#{ver}g", func, path)) or
|
||||||
(print(".");find_library("tk#{ver.delete('.')}g", func, path))
|
(print(".");find_library("tk#{ver.delete('.')}g", func, path))
|
||||||
} || (!version && (print(".");find_library(lib, func, path)))
|
} || (!version && (print(".");find_library(lib, func, path)))
|
||||||
|
[path, st]
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
print("\n") # progress
|
print("\n") # progress
|
||||||
print("Found a Tk library at #{ret}.\n") if ret
|
|
||||||
ret
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion,
|
def find_tcltk_library(tcllib, tklib, stubs, tclversion, tkversion,
|
||||||
tcl_opt_paths, tk_opt_paths)
|
tcl_opt_paths, tk_opt_paths)
|
||||||
unless find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths)
|
ret = find_tcl(tcllib, stubs, tclversion, *tcl_opt_paths)
|
||||||
|
unless ret && ret.find{|path, val| val}
|
||||||
puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
puts("Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
unless find_tk(tklib, stubs, tkversion, *tk_opt_paths)
|
ret = find_tk(tklib, stubs, tkversion, *tk_opt_paths)
|
||||||
|
unless ret && ret.find{|path, val| val}
|
||||||
puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
puts("Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -1161,57 +969,10 @@ def find_tcltk_header(tclver, tkver)
|
|||||||
"/usr/include"
|
"/usr/include"
|
||||||
].find_all{|dir| File.directory?(dir)}
|
].find_all{|dir| File.directory?(dir)}
|
||||||
|
|
||||||
if TkLib_Config["ActiveTcl"].kind_of?(String) # glob path
|
|
||||||
base_dir.concat Dir.glob(TkLib_Config["ActiveTcl"]).sort.reverse.map{|d| d << "/include"}
|
|
||||||
end
|
|
||||||
|
|
||||||
if is_win32?
|
|
||||||
drive, drv_regexp = win_drive
|
|
||||||
if TkLib_Config["ActiveTcl"]
|
|
||||||
base_dir.concat [
|
base_dir.concat [
|
||||||
"#{drive}/ActiveTcl*", "#{drive}/Activetcl*",
|
"c:/Tcl/include", "c:/Program Files/Tcl/include",
|
||||||
"#{drive}/activeTcl*", "#{drive}/activetcl*",
|
"/Tcl/include", "/Program Files/Tcl/include"
|
||||||
"#{drive}/Program Files/ActiveTcl*",
|
].find_all{|dir| File.directory?(dir)}
|
||||||
"#{drive}/Program Files/Activetcl*",
|
|
||||||
"#{drive}/Program Files/activeTcl*",
|
|
||||||
"#{drive}/Program Files/activetcl*",
|
|
||||||
"/ActiveTcl*", "/Activetcl*", "/activeTcl*", "/activetcl*",
|
|
||||||
"/Program Files/ActiveTcl*", "/Program Files/Activetcl*",
|
|
||||||
"/Program Files/activeTcl*", "/Program Files/activetcl*"
|
|
||||||
].map{|d| d << "/include"}
|
|
||||||
end
|
|
||||||
|
|
||||||
base_dir.concat [
|
|
||||||
"#{drive}/Tcl*/include", "#{drive}/tcl*/include",
|
|
||||||
"#{drive}/Program Files/Tcl*/include",
|
|
||||||
"#{drive}/Program Files/tcl*/include",
|
|
||||||
"/Tcl*/include", "/tcl*/include",
|
|
||||||
"/Program Files/Tcl*/include", "/Program Files/tcl*/include",
|
|
||||||
]
|
|
||||||
|
|
||||||
base_dir.map{|d|
|
|
||||||
[Dir.glob(d).sort.reverse,
|
|
||||||
Dir.glob(d.sub(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')).sort.reverse]
|
|
||||||
}.flatten.find_all{|dir| File.directory?(dir)}
|
|
||||||
|
|
||||||
ENV['PATH'].split(File::PATH_SEPARATOR).each{|dir|
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..', 'include'))
|
|
||||||
base_dir << dir
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..'))
|
|
||||||
if dir.gsub!(/\\/, '/')
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..', 'include'))
|
|
||||||
base_dir << dir
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
if dir.sub!(%r|^(#{drv_regexp})?/([^/])|, '\1//\2')
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..', 'include'))
|
|
||||||
base_dir << dir
|
|
||||||
base_dir << File.expand_path(File.join(dir, '..'))
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
base_dir |= base_dir
|
|
||||||
|
|
||||||
unless TkLib_Config["space-on-tk-libpath"]
|
unless TkLib_Config["space-on-tk-libpath"]
|
||||||
base_dir.delete_if{|path| path =~ / /}
|
base_dir.delete_if{|path| path =~ / /}
|
||||||
@ -1607,6 +1368,7 @@ tcl_cfg_dir = File.dirname(TclConfig_Info['config_file_path']) rescue nil
|
|||||||
tk_ldir_list = [tk_ldir, tk_cfg_dir]
|
tk_ldir_list = [tk_ldir, tk_cfg_dir]
|
||||||
tcl_ldir_list = [tcl_ldir, tcl_cfg_dir]
|
tcl_ldir_list = [tcl_ldir, tcl_cfg_dir]
|
||||||
|
|
||||||
|
|
||||||
# check tk_shlib_search_path
|
# check tk_shlib_search_path
|
||||||
check_shlib_search_path(with_config('tk-shlib-search-path'))
|
check_shlib_search_path(with_config('tk-shlib-search-path'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user