diff --git a/ChangeLog b/ChangeLog index 026fd565319be2..828067bff1f422 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Thu Apr 8 19:45:08 2004 Nobuyoshi Nakada + + * ext/extmk.rb (extmake): skip uncompiled extensions. + + * lib/mkmf.rb (create_makefile): emit no rules for static library if + $static is nil, e.g., outside of ext/. + + * lib/test/unit/ui/console/testrunner.rb (test_started): show test + name via $0. + + * runruby.rb: set environments to use the compiled binary. + + * test/runner.rb: do nothing while cross-compiling. + + * test/drb/drbtest.rb, test/soap/calc/test_calc_cgi.rb: use envutil to + know ruby binary. + + * test/ruby/envutil.rb: give priority to RUBY environment variable to + use just compiled binary and libraries. + Thu Apr 8 19:03:33 2004 Nobuyoshi Nakada * io.c (rb_io_binmode): inverted condition. [ruby-dev:23349] diff --git a/ext/extmk.rb b/ext/extmk.rb index f6f522465204d9..84c378fcc725f6 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -103,6 +103,8 @@ def extmake(target) else if $static m = File.read(makefile) + $target = m[/^TARGET[ \s]*=[ \s]*(\S*)/, 1] or $static = nil + /^STATIC_LIB[ \t]*=[ \t]*\S+/ =~ m or $static = nil $preload = Shellwords.shellwords(m[/^preload[ \t]*=[ \t]*(.*)/, 1] || "") $DLDFLAGS += " " + (m[/^DLDFLAGS[ \t]*=[ \t]*(.*)/, 1] || "") if s = m[/^LIBS[ \t]*=[ \t]*(.*)/, 1] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 8dbd064930397c..307c5b314f1128 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -884,7 +884,7 @@ def create_makefile(target, srcprefix = nil) OBJS = #{$objs} TARGET = #{target} DLLIB = #{dllib} -STATIC_LIB = #{staticlib} +STATIC_LIB = #{staticlib unless $static.nil?} } if $extout mfile.print %{ @@ -976,10 +976,12 @@ def create_makefile(target, srcprefix = nil) mfile.print "@-$(RM) $@\n\t" mfile.print "@-$(MAKEDIRS) $(@D)\n\t" mfile.print LINK_SO, "\n\n" - mfile.print "$(STATIC_LIB): $(OBJS)\n\t" - mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)" - if ranlib = config_string('RANLIB') - mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true" + unless $static.nil? + mfile.print "$(STATIC_LIB): $(OBJS)\n\t" + mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)" + config_string('RANLIB') do |ranlib| + mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true" + end end mfile.print "\n\n" if makedef diff --git a/lib/test/unit/ui/console/testrunner.rb b/lib/test/unit/ui/console/testrunner.rb index f20ae9775b968a..5f387764037492 100644 --- a/lib/test/unit/ui/console/testrunner.rb +++ b/lib/test/unit/ui/console/testrunner.rb @@ -90,6 +90,7 @@ def finished(elapsed_time) end def test_started(name) + $0 = $0.sub(/(?:\0.*)?\z/) {"\0"+name} output_single(name + ": ", VERBOSE) end diff --git a/runruby.rb b/runruby.rb index 4eaa1332247a71..ca831410f077a9 100755 --- a/runruby.rb +++ b/runruby.rb @@ -36,6 +36,8 @@ libs << abs_extout << File.expand_path(RUBY_PLATFORM, abs_extout) end config["bindir"] = abs_archdir +ENV["RUBY"] = File.expand_path(ruby) +ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR) if e = ENV["RUBYLIB"] libs |= e.split(File::PATH_SEPARATOR) diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb index c95b9002357bd0..dad26759c026f5 100644 --- a/test/drb/drbtest.rb +++ b/test/drb/drbtest.rb @@ -2,14 +2,12 @@ require 'drb/drb' require 'drb/extservm' require 'timeout' -require 'rbconfig' +$:.replace($: | [File.expand_path("../ruby", File.dirname(__FILE__))]) +require 'envutil' class DRbService @@manager = DRb::ExtServManager.new - @@ruby = File.join( - Config::CONFIG["bindir"], - Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] - ) + @@ruby = EnvUtil.rubybin @@ruby += " -d" if $DEBUG @@dir = File.dirname(File.expand_path(__FILE__)) def self.manager diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 4bae3d9e3bbd94..38dba96c931fef 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -9,6 +9,7 @@ def rubybin end begin require "rbconfig" + ENV["RUBY"] or File.join( Config::CONFIG["bindir"], Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] diff --git a/test/runner.rb b/test/runner.rb index 4ecc35aecc3965..d491b053a8a9b1 100644 --- a/test/runner.rb +++ b/test/runner.rb @@ -1,3 +1,4 @@ +exit if defined?(CROSS_COMPILING) require 'test/unit' rcsid = %w$Id$ diff --git a/test/soap/calc/test_calc_cgi.rb b/test/soap/calc/test_calc_cgi.rb index d1655b0b01b3d1..6b26329460fc92 100644 --- a/test/soap/calc/test_calc_cgi.rb +++ b/test/soap/calc/test_calc_cgi.rb @@ -2,7 +2,8 @@ require 'soap/rpc/driver' require 'logger' require 'webrick' -require 'rbconfig' +$:.replace($: | [File.expand_path("../ruby", File.dirname(__FILE__))]) +require 'envutil' module SOAP @@ -10,11 +11,7 @@ module Calc class TestCalcCGI < Test::Unit::TestCase - # This test shuld be run after installing ruby. - RUBYBIN = File.join( - Config::CONFIG["bindir"], - Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"] - ) + RUBYBIN = EnvUtil.rubybin RUBYBIN << " -d" if $DEBUG Port = 17171