From 0c8b964ef7694f73aba5e1019521bc3d540efbe7 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 21 Dec 2014 07:15:04 +0000 Subject: fiddle: do not disturb other checks * ext/fiddle/extconf.rb: add the local ffi library and header just before create_makefile, not to disturb other checks. also prepend the extension path name to the local library name for static linked ext. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/fiddle/extconf.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb index f0c7ef41c5..8f1ff547fa 100644 --- a/ext/fiddle/extconf.rb +++ b/ext/fiddle/extconf.rb @@ -33,8 +33,6 @@ begin libffi.lib = "#{libffi.builddir}/.libs" libffi.a = "#{libffi.lib}/libffi.#{$LIBEXT}" libffi.cflags = RbConfig.expand("$(CFLAGS)", CONFIG.merge("warnflags"=>"")) - $LIBPATH.unshift libffi.lib - $INCFLAGS << " -I" << libffi.include ver = ver[/libffi-(.*)/, 1] end end @@ -79,6 +77,11 @@ types.each do |type, signed| end end +if libffi + $LIBPATH.unshift libffi.lib + $INCFLAGS << " -I" << libffi.include + $LOCAL_LIBS.prepend("#{libffi.a} ").strip! +end create_makefile 'fiddle' do |conf| next conf unless libffi if $gnumake @@ -102,6 +105,8 @@ create_makefile 'fiddle' do |conf| end if libffi + $LIBPATH.pop + $LOCAL_LIBS.prepend("ext/fiddle/") args = [$make, *sysquote($mflags)] Logging::open do Logging.message("%p\n", args) -- cgit v1.2.3