summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/fiddle/extconf.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 269c0c7..9c39c3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Dec 25 21:58:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/fiddle/extconf.rb: make PIC objects if it will be linked as
+ a shared object eventually. [ruby-core:67128]
+
Thu Dec 25 19:01:13 2014 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/fiddle/win32/libffi-3.2.1-mswin.patch: support mswin32.
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}