diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-17 10:34:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-17 10:34:31 +0000 |
commit | bab1372a33543eaf89b265197866cac3466e78da (patch) | |
tree | 9962347172d4dda4dde651d5a78c019b6f5383ab | |
parent | 919fc002ebaa2256d76ec25908918a8412a06ab1 (diff) | |
download | ruby-bab1372a33543eaf89b265197866cac3466e78da.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ext/extmk.rb | 24 | ||||
-rw-r--r-- | lib/mkmf.rb | 5 |
3 files changed, 31 insertions, 11 deletions
@@ -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 diff --git a/ext/extmk.rb b/ext/extmk.rb index 406e31e747..15dc1b3dc1 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -51,10 +51,8 @@ def extmake(target) init_mkmf - begin - dir = Dir.pwd - FileUtils.mkpath target unless File.directory?(target) - Dir.chdir target + FileUtils.mkpath target unless File.directory?(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 diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 189c496128..6f6592b5df 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -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 |