summaryrefslogtreecommitdiffhomepage
path: root/build_config.rb
diff options
context:
space:
mode:
authorYuichiro MASUI <[email protected]>2013-01-20 22:48:42 +0900
committerYuichiro MASUI <[email protected]>2013-01-20 22:48:42 +0900
commitced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95 (patch)
treed49c0d0f0b6139ad4c79c3e4b417d65941e97a4f /build_config.rb
parent583983385b81c21f82704b116eab52d606a609f4 (diff)
downloadmruby-ced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95.tar.gz
mruby-ced80d2b4b1ed4ef0752a8bbaf0dbfe7aa6c6a95.zip
Improved build scripts and config files
Diffstat (limited to 'build_config.rb')
-rw-r--r--build_config.rb113
1 files changed, 67 insertions, 46 deletions
diff --git a/build_config.rb b/build_config.rb
index 4e80a2596..1c177fdac 100644
--- a/build_config.rb
+++ b/build_config.rb
@@ -1,55 +1,76 @@
MRuby::Build.new do |conf|
- conf.cc = ENV['CC'] || 'gcc'
- conf.ld = ENV['LD'] || 'gcc'
- conf.ar = ENV['AR'] || 'ar'
- # conf.bins = %w(mrbc mruby mirb)
- # 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 = []
+ # load specific toolchain settings
+ toolchain :gcc
+ # Use mrbgems
# conf.gem 'doc/mrbgems/ruby_extension_example'
- # conf.gem 'doc/mrbgems/c_extension_example'
+ # conf.gem 'doc/mrbgems/c_extension_example' do |g|
+ # g.cc.flags << '-g' # append cflags in this gem
+ # end
# conf.gem 'doc/mrbgems/c_and_ruby_extension_example'
- # conf.gem :git => '[email protected]:masuidrive/mrbgems-example.git', :branch => 'master'
-end
+ # conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master'
+ # conf.gem :git => '[email protected]:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v'
-=begin
-MRuby::CrossBuild.new('i386') do |conf|
- conf.cc = ENV['CC'] || 'gcc'
- conf.ld = ENV['LD'] || 'gcc'
- conf.ar = ENV['AR'] || 'ar'
+ # Generate binaries
# conf.bins = %w(mrbc mruby mirb)
- # conf.cxx = 'gcc'
- # conf.objcc = 'gcc'
- # conf.asm = 'gcc'
- # conf.yacc = 'bison'
- # conf.gperf = 'gperf'
- # conf.cat = 'cat'
- # conf.git = 'git'
+
+ # C compiler settings
+ # conf.cc do |cc|
+ # cc.command = ENV['CC'] || 'gcc'
+ # cc.flags = [ENV['CFLAGS'] || %w()]
+ # cc.include_paths = ["#{root}/include"]
+ # cc.defines = %w(DISABLE_GEMS)
+ # cc.option_include_path = '-I%s'
+ # cc.option_define = '-D%s'
+ # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
+ # end
- 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 << []
+ # Linker settings
+ # conf.linker do |linker|
+ # linker.command = ENV['LD'] || 'gcc'
+ # linker.flags = [ENV['LDFLAGS'] || []]
+ # linker.libraries = %w()
+ # linker.library_paths = []
+ # linker.option_library = '-l%s'
+ # linker.option_library_path = '-L%s'
+ # linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
+ # end
+
+ # Archiver settings
+ # conf.archiver do |archiver|
+ # archiver.command = ENV['AR'] || 'ar'
+ # archiver.archive_options = 'rs %{outfile} %{objs}'
+ # end
+
+ # Parser generator settings
+ # conf.yacc do |yacc|
+ # yacc.command = ENV['YACC'] || 'bison'
+ # yacc.compile_options = '-o %{outfile} %{infile}'
+ # end
+
+ # gperf settings
+ # conf.gperf do |gperf|
+ # gperf.command = 'gperf'
+ # gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
+ # end
+
+ # file extensions
+ # conf.exts do |exts|
+ # exts.object = '.o'
+ # exts.executable = '' # '.exe' if Windows
+ # exts.library = '.a'
+ # end
- # conf.gem 'doc/mrbgems/ruby_extension_example'
- # conf.gem 'doc/mrbgems/c_extension_example'
- # conf.gem 'doc/mrbgems/c_and_ruby_extension_example'
+ # file separetor
+ # conf.file_separator = '/'
end
-=end \ No newline at end of file
+
+# Define cross build settings
+# MRuby::CrossBuild.new('32bit') do |conf|
+# toolchain :gcc
+#
+# conf.cc.flags << "-m32"
+# conf.linker.flags << "-m32"
+#
+# conf.gem 'doc/mrbgems/c_and_ruby_extension_example'
+# end