* ext/extmk.rb (extract_makefile): remove no longer existing installed
files. * lib/mkmf.rb (install_dirs): return installation directory list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c1ed63a4c4
commit
9648e68d88
@ -1,3 +1,10 @@
|
|||||||
|
Sat Feb 19 10:43:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/extmk.rb (extract_makefile): remove no longer existing installed
|
||||||
|
files.
|
||||||
|
|
||||||
|
* lib/mkmf.rb (install_dirs): return installation directory list.
|
||||||
|
|
||||||
Sat Feb 19 01:28:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
Sat Feb 19 01:28:56 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
* ext/bigdecimal/lib/bigdecimal/newton.rb: resolve LoadError.
|
* ext/bigdecimal/lib/bigdecimal/newton.rb: resolve LoadError.
|
||||||
|
10
ext/extmk.rb
10
ext/extmk.rb
@ -56,9 +56,15 @@ def extract_makefile(makefile, keep = true)
|
|||||||
newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort
|
newrb = install_rb(nil, "").collect {|d, *f| f}.flatten.sort
|
||||||
if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
|
if target_prefix = m[/^target_prefix[ \t]*=[ \t]*\/(.*)/, 1]
|
||||||
target = "#{target_prefix}/#{target}"
|
target = "#{target_prefix}/#{target}"
|
||||||
unless (oldrb -= newrb).empty?
|
end
|
||||||
return false
|
unless oldrb == newrb
|
||||||
|
if $extout
|
||||||
|
newrb.each {|f| installrb.delete(f)}
|
||||||
|
config = CONFIG.dup
|
||||||
|
install_dirs(target_prefix).each {|var, val| config[var] = val}
|
||||||
|
FileUtils.rm_f(installrb.values.collect {|f| Config.expand(f, config)}, verbose: true)
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
$target = target
|
$target = target
|
||||||
/^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil
|
/^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil
|
||||||
|
50
lib/mkmf.rb
50
lib/mkmf.rb
@ -74,6 +74,32 @@ INSTALL_DIRS = [
|
|||||||
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"]
|
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def install_dirs(target_prefix = nil)
|
||||||
|
if $extout
|
||||||
|
dirs = [
|
||||||
|
['RUBYCOMMONDIR', '$(extout)'],
|
||||||
|
['RUBYLIBDIR', '$(extout)$(target_prefix)'],
|
||||||
|
['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
|
||||||
|
['extout', "#$extout"],
|
||||||
|
['extout_prefix', "#$extout_prefix"],
|
||||||
|
]
|
||||||
|
elsif $extmk
|
||||||
|
dirs = [
|
||||||
|
['RUBYCOMMONDIR', '$(rubylibdir)'],
|
||||||
|
['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
|
||||||
|
['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
|
||||||
|
]
|
||||||
|
else
|
||||||
|
dirs = [
|
||||||
|
['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
|
||||||
|
['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
|
||||||
|
['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
|
||||||
|
]
|
||||||
|
end
|
||||||
|
dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
|
||||||
|
dirs
|
||||||
|
end
|
||||||
|
|
||||||
def map_dir(dir, map = nil)
|
def map_dir(dir, map = nil)
|
||||||
map ||= INSTALL_DIRS
|
map ||= INSTALL_DIRS
|
||||||
map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)}
|
map.inject(dir) {|dir, (orig, new)| dir.gsub(orig, new)}
|
||||||
@ -896,9 +922,6 @@ def create_makefile(target, srcprefix = nil)
|
|||||||
|
|
||||||
if target.include?('/')
|
if target.include?('/')
|
||||||
target_prefix, target = File.split(target)
|
target_prefix, target = File.split(target)
|
||||||
target_prefix[0,0] = '/'
|
|
||||||
else
|
|
||||||
target_prefix = ""
|
|
||||||
end
|
end
|
||||||
|
|
||||||
srcprefix ||= '$(srcdir)'
|
srcprefix ||= '$(srcdir)'
|
||||||
@ -961,26 +984,9 @@ OBJS = #{$objs}
|
|||||||
TARGET = #{target}
|
TARGET = #{target}
|
||||||
DLLIB = #{dllib}
|
DLLIB = #{dllib}
|
||||||
STATIC_LIB = #{staticlib unless $static.nil?}
|
STATIC_LIB = #{staticlib unless $static.nil?}
|
||||||
|
|
||||||
}
|
}
|
||||||
if $extout
|
install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
|
||||||
mfile.print %{
|
|
||||||
RUBYCOMMONDIR = $(extout)
|
|
||||||
RUBYLIBDIR = $(extout)$(target_prefix)
|
|
||||||
RUBYARCHDIR = $(extout)/$(arch)$(target_prefix)
|
|
||||||
}
|
|
||||||
elsif $extmk
|
|
||||||
mfile.print %{
|
|
||||||
RUBYCOMMONDIR = $(rubylibdir)
|
|
||||||
RUBYLIBDIR = $(rubylibdir)$(target_prefix)
|
|
||||||
RUBYARCHDIR = $(archdir)$(target_prefix)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mfile.print %{
|
|
||||||
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
|
||||||
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
||||||
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
|
||||||
}
|
|
||||||
end
|
|
||||||
n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).'
|
n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET).'
|
||||||
mfile.print %{
|
mfile.print %{
|
||||||
TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
|
TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user