Skip to content

Commit

Permalink
* ext/extmk.rb (extmake): skip uncompiled extensions.
Browse files Browse the repository at this point in the history
* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Apr 8, 2004
1 parent 4732bf2 commit fa7a5d5
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 16 deletions.
20 changes: 20 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Thu Apr 8 19:45:08 2004 Nobuyoshi Nakada <[email protected]>

* 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 <[email protected]>

* io.c (rb_io_binmode): inverted condition. [ruby-dev:23349]
Expand Down
2 changes: 2 additions & 0 deletions ext/extmk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 7 additions & 5 deletions lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %{
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/test/unit/ui/console/testrunner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions runruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions test/drb/drbtest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/ruby/envutil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 1 addition & 0 deletions test/runner.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
exit if defined?(CROSS_COMPILING)
require 'test/unit'

rcsid = %w$Id$
Expand Down
9 changes: 3 additions & 6 deletions test/soap/calc/test_calc_cgi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
require 'soap/rpc/driver'
require 'logger'
require 'webrick'
require 'rbconfig'
$:.replace($: | [File.expand_path("../ruby", File.dirname(__FILE__))])
require 'envutil'


module SOAP
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
Expand Down

0 comments on commit fa7a5d5

Please sign in to comment.