diff --git a/lib/inline.rb b/lib/inline.rb index 92840b2..922f55a 100644 --- a/lib/inline.rb +++ b/lib/inline.rb @@ -608,7 +608,7 @@ def build cmd = cmd.gsub(/-Wl,-soname,\$@/, "-Wl,-soname,#{File.basename so_name}") # strip off some makefile macros for mingw 1.9 - cmd = cmd.gsub(/\$\(.*\)/, '') if RUBY_PLATFORM =~ /mingw/ + cmd = cmd.gsub(/\$(?\((?:[^()]|\g)*\))/, '') if RUBY_PLATFORM =~ /mingw/ cmd += " 2> #{DEV_NULL}" if $TESTING and not $DEBUG