1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Creating dummy library for dl/fiddle tests on AIX.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kanemoto 2010-08-26 01:16:53 +00:00
parent 7e4015e16d
commit 6ef6cbc4f6
3 changed files with 62 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Thu Aug 26 10:38:11 2010 Yutaka Kanemoto <kanemoto@ruby-lang.org>
* test/dl/test_base.rb: AIX does not have dynamically loadable lib[cm].
* test/fiddle/helper.rb: AIX does not have dynamically loadable lib[cm].
Thu Aug 26 09:49:50 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_shuffle_bang): check number of argument.

View file

@ -47,6 +47,34 @@ when /solaris/
end
libc_so = File.join(libdir, "libc.so.6")
libm_so = File.join(libdir, "libm.so.6")
when /aix/
pwd=Dir.pwd
libc_so = libm_so = "#{pwd}/libaixdltest.so"
unless File.exist? libc_so
cobjs=%w!strcpy.o!
mobjs=%w!floats.o sin.o!
funcs=%w!sin sinf strcpy strncpy!
expfile='dltest.exp'
require 'tmpdir'
Dir.mktmpdir do |dir|
begin
Dir.chdir dir
%x!/usr/bin/ar x /usr/lib/libc.a #{cobjs.join(' ')}!
%x!/usr/bin/ar x /usr/lib/libm.a #{mobjs.join(' ')}!
%x!echo "#{funcs.join("\n")}\n" > #{expfile}!
require 'rbconfig'
if RbConfig::CONFIG["GCC"] = 'yes'
lflag='-Wl,'
else
lflag=''
end
flags="#{lflag}-bE:#{expfile} #{lflag}-bnoentry -lm"
%x!#{RbConfig::CONFIG["LDSHARED"]} -o #{libc_so} #{(cobjs+mobjs).join(' ')} #{flags}!
ensure
Dir.chdir pwd
end
end
end
else
libc_so = ARGV[0] if ARGV[0] && ARGV[0][0] == ?/
libm_so = ARGV[1] if ARGV[1] && ARGV[1][0] == ?/

View file

@ -38,6 +38,34 @@ when /kfreebsd/
when /bsd|dragonfly/
libc_so = "/usr/lib/libc.so"
libm_so = "/usr/lib/libm.so"
when /aix/
pwd=Dir.pwd
libc_so = libm_so = "#{pwd}/libaixdltest.so"
unless File.exist? libc_so
cobjs=%w!strcpy.o!
mobjs=%w!floats.o sin.o!
funcs=%w!sin sinf strcpy strncpy!
expfile='dltest.exp'
require 'tmpdir'
Dir.mktmpdir do |dir|
begin
Dir.chdir dir
%x!/usr/bin/ar x /usr/lib/libc.a #{cobjs.join(' ')}!
%x!/usr/bin/ar x /usr/lib/libm.a #{mobjs.join(' ')}!
%x!echo "#{funcs.join("\n")}\n" > #{expfile}!
require 'rbconfig'
if RbConfig::CONFIG["GCC"] = 'yes'
lflag='-Wl,'
else
lflag=''
end
flags="#{lflag}-bE:#{expfile} #{lflag}-bnoentry -lm"
%x!#{RbConfig::CONFIG["LDSHARED"]} -o #{libc_so} #{(cobjs+mobjs).join(' ')} #{flags}!
ensure
Dir.chdir pwd
end
end
end
else
libc_so = ARGV[0] if ARGV[0] && ARGV[0][0] == ?/
libm_so = ARGV[1] if ARGV[1] && ARGV[1][0] == ?/