Merge pull request #3974 from take-cheeze/repo_path
[mruby.git] / build_config.rb
blob1429837beab90ae42973186987e2c5ebd4c57225
1 MRuby::Build.new do |conf|
2   # load specific toolchain settings
4   # Gets set by the VS command prompts.
5   if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
6     toolchain :visualcpp
7   else
8     toolchain :gcc
9   end
11   enable_debug
13   # Use mrbgems
14   # conf.gem 'examples/mrbgems/ruby_extension_example'
15   # conf.gem 'examples/mrbgems/c_extension_example' do |g|
16   #   g.cc.flags << '-g' # append cflags in this gem
17   # end
18   # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
19   # conf.gem :core => 'mruby-eval'
20   # conf.gem :mgem => 'mruby-io'
21   # conf.gem :github => 'iij/mruby-io'
22   # conf.gem :git => '[email protected]:iij/mruby-io.git', :branch => 'master', :options => '-v'
24   # include the default GEMs
25   conf.gembox 'default'
26   # C compiler settings
27   # conf.cc do |cc|
28   #   cc.command = ENV['CC'] || 'gcc'
29   #   cc.flags = [ENV['CFLAGS'] || %w()]
30   #   cc.include_paths = ["#{root}/include"]
31   #   cc.defines = %w(DISABLE_GEMS)
32   #   cc.option_include_path = '-I%s'
33   #   cc.option_define = '-D%s'
34   #   cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
35   # end
37   # mrbc settings
38   # conf.mrbc do |mrbc|
39   #   mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers
40   # end
42   # Linker settings
43   # conf.linker do |linker|
44   #   linker.command = ENV['LD'] || 'gcc'
45   #   linker.flags = [ENV['LDFLAGS'] || []]
46   #   linker.flags_before_libraries = []
47   #   linker.libraries = %w()
48   #   linker.flags_after_libraries = []
49   #   linker.library_paths = []
50   #   linker.option_library = '-l%s'
51   #   linker.option_library_path = '-L%s'
52   #   linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
53   # end
55   # Archiver settings
56   # conf.archiver do |archiver|
57   #   archiver.command = ENV['AR'] || 'ar'
58   #   archiver.archive_options = 'rs %{outfile} %{objs}'
59   # end
61   # Parser generator settings
62   # conf.yacc do |yacc|
63   #   yacc.command = ENV['YACC'] || 'bison'
64   #   yacc.compile_options = '-o %{outfile} %{infile}'
65   # end
67   # gperf settings
68   # conf.gperf do |gperf|
69   #   gperf.command = 'gperf'
70   #   gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
71   # end
73   # file extensions
74   # conf.exts do |exts|
75   #   exts.object = '.o'
76   #   exts.executable = '' # '.exe' if Windows
77   #   exts.library = '.a'
78   # end
80   # file separetor
81   # conf.file_separator = '/'
83   # bintest
84   # conf.enable_bintest
85 end
87 MRuby::Build.new('host-debug') do |conf|
88   # load specific toolchain settings
90   # Gets set by the VS command prompts.
91   if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
92     toolchain :visualcpp
93   else
94     toolchain :gcc
95   end
97   enable_debug
99   # include the default GEMs
100   conf.gembox 'default'
102   # C compiler settings
103   conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
105   # Generate mruby debugger command (require mruby-eval)
106   conf.gem :core => "mruby-bin-debugger"
108   # bintest
109   # conf.enable_bintest
112 MRuby::Build.new('test') do |conf|
113   # Gets set by the VS command prompts.
114   if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
115     toolchain :visualcpp
116   else
117     toolchain :gcc
118   end
120   enable_debug
121   conf.enable_bintest
122   conf.enable_test
124   conf.gembox 'default'
127 #MRuby::Build.new('bench') do |conf|
128 #  # Gets set by the VS command prompts.
129 #  if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
130 #    toolchain :visualcpp
131 #  else
132 #    toolchain :gcc
133 #    conf.cc.flags << '-O3'
134 #  end
136 #  conf.gembox 'default'
137 #end
139 # Define cross build settings
140 # MRuby::CrossBuild.new('32bit') do |conf|
141 #   toolchain :gcc
143 #   conf.cc.flags << "-m32"
144 #   conf.linker.flags << "-m32"
146 #   conf.build_mrbtest_lib_only
148 #   conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
150 #   conf.test_runner.command = 'env'
151 # end