Skip to content

Commit a8f3112

Browse files
committed
WIP
1 parent 2ff40ad commit a8f3112

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/easy_compile/compilation_tasks.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,13 @@ def disable_shared
106106
makefile_tasks.each do |task|
107107
task.enhance do
108108
makefile_content = File.read(task.name)
109-
makefile_content.sub!(/(LIBRUBYARG_SHARED = )(?:-l\$\(RUBY_SO_NAME\))(.*)/, '\1\2')
109+
makefile_content.match(/LIBRUBYARG_SHARED = (.*)/) do |match|
110+
shared_flags = match[1].split(" ")
111+
shared_flags.reject! { |flag| flag == "-l$(RUBY_SO_NAME)" }
112+
makefile_content.gsub!(/(LIBRUBYARG_SHARED = ).*/, "\\1#{shared_flags.join(' ')}")
110113

111-
File.write(task.name, makefile_content)
114+
File.write(task.name, makefile_content)
115+
end
112116
end
113117
end
114118
end

0 commit comments

Comments
 (0)