* 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:
nobu 2004-02-17 10:34:31 +00:00
parent 919fc002eb
commit bab1372a33
3 changed files with 31 additions and 11 deletions

View File

@ -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>
* ext/strscan/strscan.c: ScanError may be (wrongly) garbage

View File

@ -51,10 +51,8 @@ def extmake(target)
init_mkmf
begin
dir = Dir.pwd
FileUtils.mkpath target unless File.directory?(target)
Dir.chdir target
Dir.chdir(target) do
$target = target
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
@ -95,7 +93,7 @@ def extmake(target)
f.print dummy_makefile($srcdir)
return true
end
args = sysquote($mflags.map {|m| /\Aextout_prefix=\z/ =~ m ? m + $extout_prefix : m})
args = sysquote($mflags)
if $static
args += ["static"]
$extlist.push [$static, $target, File.basename($target), $preload]
@ -114,9 +112,13 @@ def extmake(target)
$extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split)
$extpath |= $LIBPATH
end
ensure
Dir.chdir dir
end
begin
Dir.rmdir target
target = File.dirname(target)
rescue SystemCallError
break
end while true
true
end
@ -185,7 +187,8 @@ def parse_args()
unless Config::expand($extout.dup) == $absextout
$extout = $absextout
end
$mflags << ("extout=" << $extout) << "extout_prefix="
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
$mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
end
$message = $OPT['message']
@ -199,6 +202,7 @@ if target = ARGV.shift and /^[a-z-]+$/ =~ target
case target
when /clean/
$ignore ||= true
$clean = true
when /^install\b/
$install = true
$ignore ||= true
@ -292,6 +296,10 @@ end
if $ignore
Dir.chdir ".."
if $clean
Dir.rmdir('ext') rescue nil
FileUtils.rm_rf($absextout) if $extout
end
exit
end

View File

@ -819,8 +819,6 @@ def create_makefile(target, srcprefix = nil)
target_prefix = ""
end
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
srcprefix ||= '$(srcdir)'
Config::expand(srcdir = srcprefix.dup)
@ -898,7 +896,7 @@ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
}
end
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
all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}
@ -1025,6 +1023,7 @@ def init_mkmf(config = CONFIG)
$distcleanfiles = []
$extout ||= nil
$extout_prefix ||= nil
dir_config("opt")
end