forked from mruby/mruby
/
build_config.rb
53 lines (48 loc) · 1.53 KB
/
build_config.rb
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
MRuby::Build.new do |conf|
conf.cc = ENV['CC'] || 'gcc'
conf.ld = ENV['LD'] || 'gcc'
conf.ar = ENV['AR'] || 'ar'
# conf.cxx = conf.cc
# conf.objcc = conf.cc
# conf.asm = conf.cc
# conf.yacc = 'bison'
# conf.gperf = 'gperf'
# conf.cat = 'cat'
# conf.git = 'git'
conf.cflags << (ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration))
conf.ldflags << (ENV['LDFLAGS'] || %w(-lm))
# conf.cxxflags = []
# conf.objccflags = []
# conf.asmflags = []
# conf.gem 'doc/mrbgems/ruby_extension_example'
# conf.gem 'doc/mrbgems/c_extension_example'
# conf.gem 'doc/mrbgems/c_and_ruby_extension_example'
# conf.gem :git => 'git@github.com:masuidrive/mrbgems-example.git', :branch => 'master'
end
=begin
MRuby::CrossBuild.new('i386') do |conf|
conf.cc = ENV['CC'] || 'gcc'
conf.ld = ENV['LD'] || 'gcc'
conf.ar = ENV['AR'] || 'ar'
# conf.cxx = 'gcc'
# conf.objcc = 'gcc'
# conf.asm = 'gcc'
# conf.yacc = 'bison'
# conf.gperf = 'gperf'
# conf.cat = 'cat'
# conf.git = 'git'
if ENV['OS'] == 'Windows_NT' # MinGW
conf.cflags = %w(-g -O3 -Wall -Werror-implicit-function-declaration -Di386_MARK)
conf.ldflags = %w(-s -static)
else
conf.cflags << %w(-g -O3 -Wall -Werror-implicit-function-declaration -arch i386)
conf.ldflags << %w(-arch i386)
end
# conf.cxxflags << []
# conf.objccflags << []
# conf.asmflags << []
# conf.gem 'doc/mrbgems/ruby_extension_example'
# conf.gem 'doc/mrbgems/c_extension_example'
# conf.gem 'doc/mrbgems/c_and_ruby_extension_example'
end
=end