aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/extmk.rb16
-rw-r--r--lib/mkmf.rb4
3 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 813ee940b9..0afc73c9d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Feb 17 12:12:47 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (parse_args): delay expanding $(extout) until invoking
+ make.
+
+ * lib/mkmf.rb (CLEANLIBS): should remove files have specific
+ extensions.
+
Tue Feb 17 11:33:30 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rss/rexmlparser.rb: REXML version may be 4 digits.
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 466dae23f3..406e31e747 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -95,7 +95,7 @@ def extmake(target)
f.print dummy_makefile($srcdir)
return true
end
- args = sysquote($mflags)
+ args = sysquote($mflags.map {|m| /\Aextout_prefix=\z/ =~ m ? m + $extout_prefix : m})
if $static
args += ["static"]
$extlist.push [$static, $target, File.basename($target), $preload]
@@ -146,7 +146,7 @@ def parse_args()
end
$destdir = $OPT['dest-dir'] || ''
if opt = $OPT['extout'] and !opt.empty?
- $extout = File.expand_path(opt, $topdir)
+ $extout = opt
end
$make = $OPT['make'] || $make || 'make'
mflags = ($OPT['make-flags'] || '').strip
@@ -180,8 +180,12 @@ def parse_args()
$mflags.defined?("DESTDIR") or $mflags << "DESTDIR=#{$destdir}"
end
if $extout
- $mflags << "extout=#{$extout.sub(/#{Regexp.quote($topdir)}/, '$(topdir)')}"
- $mflags << "extout_prefix=#{$extout_prefix}"
+ $absextout = File.expand_path(Config::expand($extout.dup), $topdir)
+ $extout = '$(topdir)/'+$extout
+ unless Config::expand($extout.dup) == $absextout
+ $extout = $absextout
+ end
+ $mflags << ("extout=" << $extout) << "extout_prefix="
end
$message = $OPT['message']
@@ -271,11 +275,11 @@ exts |= Dir.glob("#{ext_prefix}/*/**/MANIFEST").collect {|d|
if $extout
if $install
Config.expand(dest = "#{$destdir}#{$rubylibdir}")
- FileUtils.cp_r($extout+"/.", dest, :verbose => true, :noop => $dryrun)
+ FileUtils.cp_r($absextout+"/.", dest, :verbose => true, :noop => $dryrun)
exit
end
unless $ignore
- FileUtils.mkpath($extout)
+ FileUtils.mkpath($absextout)
end
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index c117741ee1..189c496128 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -868,7 +868,7 @@ DEFFILE = #{deffile}
CLEANFILES = #{$cleanfiles.join(' ')}
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
-extout = #{$extout.sub(/#{Regexp.quote($topdir)}/, '$(topdir)') if $extout}
+extout = #{$extout}
extout_prefix = #{$extout_prefix}
target_prefix = #{target_prefix}
LOCAL_LIBS = #{$LOCAL_LIBS}
@@ -898,7 +898,7 @@ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
}
end
mfile.print %{
-CLEANLIBS = #{$extout_prefix}$(TARGET).*
+CLEANLIBS = #{$extout_prefix}$(TARGET).{#{CONFIG['DLEXT']},#{$LIBEXT},exp,il?,tds,map}
CLEANOBJS = *.#{$OBJEXT} *.#{$LIBEXT} *.s[ol] *.pdb *.bak
all: #{target ? $extout ? "install" : "$(DLLIB)" : "Makefile"}