* ext/extmk.rb (extmake): $extout_prefix doesn't vary for libraries.
* ext/extmk.rb (extmake): remove compile directory if empty. * ext/extmk.rb (parse_args) lib/mkmf.rb (create_makefile): move initialization of $extout_prefix from lib/mkmf.rb. [ruby-dev:22928] * ext/extmk.rb: clear ext and extout directory when cleaning. * lib/mkmf.rb (CLEANLIBS): should be under $(arch) directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
919fc002eb
commit
bab1372a33
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
Tue Feb 17 19:34:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/extmk.rb (extmake): $extout_prefix doesn't vary for libraries.
|
||||||
|
|
||||||
|
* ext/extmk.rb (extmake): remove compile directory if empty.
|
||||||
|
|
||||||
|
* ext/extmk.rb (parse_args) lib/mkmf.rb (create_makefile): move
|
||||||
|
initialization of $extout_prefix from lib/mkmf.rb. [ruby-dev:22928]
|
||||||
|
|
||||||
|
* ext/extmk.rb: clear ext and extout directory when cleaning.
|
||||||
|
|
||||||
|
* lib/mkmf.rb (CLEANLIBS): should be under $(arch) directory.
|
||||||
|
|
||||||
Tue Feb 17 18:02:10 2004 Minero Aoki <aamine@loveruby.net>
|
Tue Feb 17 18:02:10 2004 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* ext/strscan/strscan.c: ScanError may be (wrongly) garbage
|
* ext/strscan/strscan.c: ScanError may be (wrongly) garbage
|
||||||
|
22
ext/extmk.rb
22
ext/extmk.rb
@ -51,10 +51,8 @@ def extmake(target)
|
|||||||
|
|
||||||
init_mkmf
|
init_mkmf
|
||||||
|
|
||||||
begin
|
|
||||||
dir = Dir.pwd
|
|
||||||
FileUtils.mkpath target unless File.directory?(target)
|
FileUtils.mkpath target unless File.directory?(target)
|
||||||
Dir.chdir target
|
Dir.chdir(target) do
|
||||||
$target = target
|
$target = target
|
||||||
$mdir = target
|
$mdir = target
|
||||||
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
||||||
@ -95,7 +93,7 @@ def extmake(target)
|
|||||||
f.print dummy_makefile($srcdir)
|
f.print dummy_makefile($srcdir)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
args = sysquote($mflags.map {|m| /\Aextout_prefix=\z/ =~ m ? m + $extout_prefix : m})
|
args = sysquote($mflags)
|
||||||
if $static
|
if $static
|
||||||
args += ["static"]
|
args += ["static"]
|
||||||
$extlist.push [$static, $target, File.basename($target), $preload]
|
$extlist.push [$static, $target, File.basename($target), $preload]
|
||||||
@ -114,9 +112,13 @@ def extmake(target)
|
|||||||
$extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split)
|
$extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split)
|
||||||
$extpath |= $LIBPATH
|
$extpath |= $LIBPATH
|
||||||
end
|
end
|
||||||
ensure
|
|
||||||
Dir.chdir dir
|
|
||||||
end
|
end
|
||||||
|
begin
|
||||||
|
Dir.rmdir target
|
||||||
|
target = File.dirname(target)
|
||||||
|
rescue SystemCallError
|
||||||
|
break
|
||||||
|
end while true
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -185,7 +187,8 @@ def parse_args()
|
|||||||
unless Config::expand($extout.dup) == $absextout
|
unless Config::expand($extout.dup) == $absextout
|
||||||
$extout = $absextout
|
$extout = $absextout
|
||||||
end
|
end
|
||||||
$mflags << ("extout=" << $extout) << "extout_prefix="
|
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
|
||||||
|
$mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
|
||||||
end
|
end
|
||||||
|
|
||||||
$message = $OPT['message']
|
$message = $OPT['message']
|
||||||
@ -199,6 +202,7 @@ if target = ARGV.shift and /^[a-z-]+$/ =~ target
|
|||||||
case target
|
case target
|
||||||
when /clean/
|
when /clean/
|
||||||
$ignore ||= true
|
$ignore ||= true
|
||||||
|
$clean = true
|
||||||
when /^install\b/
|
when /^install\b/
|
||||||
$install = true
|
$install = true
|
||||||
$ignore ||= true
|
$ignore ||= true
|
||||||
@ -292,6 +296,10 @@ end
|
|||||||
|
|
||||||
if $ignore
|
if $ignore
|
||||||
Dir.chdir ".."
|
Dir.chdir ".."
|
||||||
|
if $clean
|
||||||
|
Dir.rmdir('ext') rescue nil
|
||||||
|
FileUtils.rm_rf($absextout) if $extout
|
||||||
|
end
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -819,8 +819,6 @@ def create_makefile(target, srcprefix = nil)
|
|||||||
target_prefix = ""
|
target_prefix = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
|
|
||||||
|
|
||||||
srcprefix ||= '$(srcdir)'
|
srcprefix ||= '$(srcdir)'
|
||||||
Config::expand(srcdir = srcprefix.dup)
|
Config::expand(srcdir = srcprefix.dup)
|
||||||
|
|
||||||
@ -898,7 +896,7 @@ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
mfile.print %{
|
mfile.print %{
|
||||||
CLEANLIBS = #{$extout_prefix}$(TARGET).{#{CONFIG['DLEXT']},#{$LIBEXT},exp,il?,tds,map}
|
CLEANLIBS = #{$extout ? '$(RUBYARCHDIR)/' : ''}$(TARGET).{#{CONFIG['DLEXT']},exp,il?,tds,map}
|
||||||
CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.bak
|
CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.bak
|
||||||
|
|
||||||
all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}
|
all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}
|
||||||
@ -1025,6 +1023,7 @@ def init_mkmf(config = CONFIG)
|
|||||||
$distcleanfiles = []
|
$distcleanfiles = []
|
||||||
|
|
||||||
$extout ||= nil
|
$extout ||= nil
|
||||||
|
$extout_prefix ||= nil
|
||||||
|
|
||||||
dir_config("opt")
|
dir_config("opt")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user