-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmruby.diff
38 lines (35 loc) · 1.11 KB
/
mruby.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/build_config.rb b/build_config.rb
index 1429837..35df7d6 100644
--- a/build_config.rb
+++ b/build_config.rb
@@ -34,11 +34,20 @@ MRuby::Build.new do |conf|
# cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
# end
+ conf.cc do |cc|
+ cc.flags = '-fPIC'
+ end
+
# mrbc settings
# conf.mrbc do |mrbc|
# mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers
# end
+ conf.archiver do |archiver|
+ archiver.command = 'gcc'
+ archiver.archive_options = '-shared -o %{outfile} %{objs}'
+ end
+
# Linker settings
# conf.linker do |linker|
# linker.command = ENV['LD'] || 'gcc'
diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb
index 57bd9c5..97a55d3 100644
--- a/lib/mruby/build.rb
+++ b/lib/mruby/build.rb
@@ -61,7 +61,7 @@ module MRuby
if ENV['OS'] == 'Windows_NT'
@exts = Exts.new('.o', '.exe', '.a')
else
- @exts = Exts.new('.o', '', '.a')
+ @exts = Exts.new('.o', '', '.so')
end
build_dir = build_dir || ENV['MRUBY_BUILD_DIR'] || "#{MRUBY_ROOT}/build"