summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 12:58:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 12:58:18 +0000
commita9f70432d42242108f99c65453cece26bf891c17 (patch)
tree48f161508155929eb641a043c88ba23d04e98e09 /ext
parent990a0bb897e59d26c399b550c2a7641a109f76db (diff)
extconf.rb: libffi PIC objects
* ext/fiddle/extconf.rb: make PIC objects if it will be linked as a shared object eventually. [ruby-core:67128] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/fiddle/extconf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2bc5b85..f505a28 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -36,7 +36,7 @@ begin
end
libffi.include = "#{libffi.builddir}/include"
libffi.lib = "#{libffi.builddir}/.libs"
- libffi.a = "#{libffi.lib}/libffi.#{$LIBEXT}"
+ libffi.a = "#{libffi.lib}/libffi_convenience.#{$LIBEXT}"
nowarn = CONFIG.merge("warnflags"=>"")
libffi.cflags = RbConfig.expand("$(CFLAGS)", nowarn)
ver = ver[/libffi-(.*)/, 1]
@@ -64,9 +64,10 @@ begin
ld = RbConfig::CONFIG['LD']
args.concat %W[
--srcdir=#{libffi.srcdir}
- --disable-shared --host=#{libffi.arch}
+ --host=#{libffi.arch}
--enable-builddir=#{RUBY_PLATFORM}
]
+ args << ($enable_shared && !$static ? '--enable-shared' : '--enable-static')
args << libffi.opt if libffi.opt
args.concat %W[
CC=#{cc} CFLAGS=#{libffi.cflags}