ruby-changes:36838
From: nobu <ko1@a...>
Date: Mon, 22 Dec 2014 12:42:21 +0900 (JST)
Subject: [ruby-changes:36838] nobu:r48919 (trunk): extconf.rb: libffi with libruby
nobu 2014-12-22 12:42:13 +0900 (Mon, 22 Dec 2014) New Revision: 48919 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48919 Log: extconf.rb: libffi with libruby * ext/fiddle/extconf.rb: link libffi with libruby for symbols provided by ruby on some platforms, e.g. alloca. Modified files: trunk/ext/fiddle/depend trunk/ext/fiddle/extconf.rb Index: ext/fiddle/depend =================================================================== --- ext/fiddle/depend (revision 48918) +++ ext/fiddle/depend (revision 48919) @@ -4,7 +4,8 @@ CONFIGURE_LIBFFI = \ https://github.com/ruby/ruby/blob/trunk/ext/fiddle/depend#L4 cd $(LIBFFI_DIR) && \ $(LIBFFI_CONFIGURE) --disable-shared \ --host=$(LIBFFI_ARCH) --enable-builddir=$(arch) \ - CC="$(CC)" CFLAGS="$(LIBFFI_CFLAGS)" + CC="$(CC)" CFLAGS="$(LIBFFI_CFLAGS)" \ + LD="$(LD)" LDFLAGS="$(LIBFFI_LDFLAGS)" $(OBJS): $(HDRS) $(ruby_headers) \ $(hdrdir)/ruby/io.h \ Index: ext/fiddle/extconf.rb =================================================================== --- ext/fiddle/extconf.rb (revision 48918) +++ ext/fiddle/extconf.rb (revision 48919) @@ -24,7 +24,7 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L24 end ffi_header = 'ffi.h' - libffi = Struct.new(*%I[dir srcdir builddir include lib a cflags opt arch]).new + libffi = Struct.new(*%I[dir srcdir builddir include lib a cflags ldflags opt arch]).new libffi.dir = ver if $srcdir == "." libffi.builddir = "#{ver}/#{RUBY_PLATFORM}" @@ -41,12 +41,14 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L41 FileUtils.mkdir_p(libffi.dir) libffi.opt = CONFIG['configure_args'][/'(-C)'/, 1] + libffi.ldflags = RbConfig.expand("$(LDFLAGS) #{libpathflag([relative_from($topdir, "..")])} #{$LIBRUBYARG}") libffi.arch = RbConfig::CONFIG['host'] args = %W[ #{libffi.srcdir}/configure #{libffi.opt} --disable-shared --host=#{libffi.arch} --enable-builddir=#{RUBY_PLATFORM} CC=#{RbConfig::CONFIG['CC']} CFLAGS=#{libffi.cflags} + LD=#{RbConfig::CONFIG['LD']} LDFLAGS=#{libffi.ldflags} ] Logging::open do @@ -116,6 +118,7 @@ create_makefile 'fiddle' do |conf| https://github.com/ruby/ruby/blob/trunk/ext/fiddle/extconf.rb#L118 LIBFFI_DIR = #{libffi.dir} LIBFFI_A = #{libffi.a} LIBFFI_CFLAGS = #{libffi.cflags} + LIBFFI_LDFLAGS = #{libffi.ldflags} FFI_H = $(LIBFFI_DIR)/include/ffi.h SUBMAKE_LIBFFI = #{submake} MK -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/