summaryrefslogtreecommitdiff
path: root/test/dl
diff options
context:
space:
mode:
authorkanemoto <kanemoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-26 01:16:53 +0000
committerkanemoto <kanemoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-26 01:16:53 +0000
commit6ef6cbc4f6e6a9a81af48cbd4cad16f1eb6998e2 (patch)
treec0d9d4ae2f556a3b32bb64faf6b9f354c0cb1606 /test/dl
parent7e4015e16d3d3c5780440a9d15af4bcae8d4e4e1 (diff)
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
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_base.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/dl/test_base.rb b/test/dl/test_base.rb
index c9b5419..3b22ce5 100644
--- a/test/dl/test_base.rb
+++ b/test/dl/test_base.rb
@@ -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] == ?/