From f1b78f4b0df6e6da53db2e35a3eb5fd925757ec4 Mon Sep 17 00:00:00 2001 From: Lennart Brinkmann Date: Sat, 23 Aug 2014 15:35:45 +0200 Subject: extconf.rb: remove "-Wl,--no-undefined" from ldflags Remove ldflag "-Wl,--no-undefined" if existent to allow for loading libyajl with dlopen. This fixes building the native extensions on systems like gentoo which set the ldflag "-Wl,--no-undefined" by default. --- ext/ffi_yajl/ext/encoder/extconf.rb | 3 +++ ext/ffi_yajl/ext/parser/extconf.rb | 3 +++ 2 files changed, 6 insertions(+) (limited to 'ext/ffi_yajl') diff --git a/ext/ffi_yajl/ext/encoder/extconf.rb b/ext/ffi_yajl/ext/encoder/extconf.rb index 0107112..bf9c839 100644 --- a/ext/ffi_yajl/ext/encoder/extconf.rb +++ b/ext/ffi_yajl/ext/encoder/extconf.rb @@ -8,6 +8,9 @@ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] $CFLAGS = " -I#{Libyajl2.include_path} #{$CFLAGS}" $LDFLAGS = " -L#{Libyajl2.opt_path} #{$LDFLAGS}" +# remove "-Wl,--no-undefined" flag if existent to allow for loading with dlopen +$LDFLAGS.slice!("-Wl,--no-undefined") + puts $CFLAGS puts $LDFLAGS diff --git a/ext/ffi_yajl/ext/parser/extconf.rb b/ext/ffi_yajl/ext/parser/extconf.rb index 3154142..d090638 100644 --- a/ext/ffi_yajl/ext/parser/extconf.rb +++ b/ext/ffi_yajl/ext/parser/extconf.rb @@ -8,6 +8,9 @@ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] $CFLAGS = "-I#{Libyajl2.include_path} #{$CFLAGS}" $LDFLAGS = "-L#{Libyajl2.opt_path} #{$LDFLAGS}" +# remove "-Wl,--no-undefined" flag if existent to allow for loading with dlopen +$LDFLAGS.slice!("-Wl,--no-undefined") + puts $CFLAGS puts $LDFLAGS -- cgit v1.2.1