Skip to content

Instantly share code, notes, and snippets.

@IxDay
Created October 27, 2023 06:08
Show Gist options
  • Select an option

  • Save IxDay/42f3ad09f32bb9b82fbadabdcff89b4e to your computer and use it in GitHub Desktop.

Select an option

Save IxDay/42f3ad09f32bb9b82fbadabdcff89b4e to your computer and use it in GitHub Desktop.

Revisions

  1. IxDay created this gist Oct 27, 2023.
    103 changes: 103 additions & 0 deletions build.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,103 @@
    =begin
    # https://github.com/mruby/mruby.git
    MRUBY_CONFIG=build.rb rake
    =end

    MRuby::Build.new do |conf|
    # load specific toolchain settings
    conf.toolchain

    # Use mrbgems
    # conf.gem 'examples/mrbgems/ruby_extension_example'
    # conf.gem 'examples/mrbgems/c_extension_example' do |g|
    # g.cc.flags << '-g' # append cflags in this gem
    # end
    # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
    # conf.gem :core => 'mruby-eval'
    # conf.gem :mgem => 'mruby-onig-regexp'
    # conf.gem :github => 'mattn/mruby-onig-regexp'
    # conf.gem :git => '[email protected]:mattn/mruby-onig-regexp.git', :branch => 'master', :options => '-v'

    # include the GEM box 5.6MB
    conf.gembox 'default'

    # include color 5.6MB
    conf.gem :github => 'mruby-Forum/mruby-ansi-colors'

    # include the mrake utilitary 6.8MB
    conf.gem :github => 'ixday/mruby-rake'

    # # include json and yaml support 7.5MB
    conf.gem :github => 'mattn/mruby-json'
    conf.gem :github => 'mrbgems/mruby-yaml'

    # # include SSL support 9.8MB
    # conf.gem :github => 'luisbebop/mruby-polarssl'

    # # include HTTP server 11MB
    # conf.gem :github => 'matsumotory/mruby-simplehttp'

    # 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()
    # cc.option_include_path = %q[-I"%s"]
    # cc.option_define = '-D%s'
    # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
    # end

    # mrbc settings
    # conf.mrbc do |mrbc|
    # mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers
    # end

    # Linker settings
    # conf.linker do |linker|
    # linker.command = ENV['LD'] || 'gcc'
    # linker.flags = [ENV['LDFLAGS'] || []]
    # linker.flags_before_libraries = []
    # linker.libraries = %w()
    # linker.flags_after_libraries = []
    # linker.library_paths = []
    # linker.option_library = '-l%s'
    # linker.option_library_path = '-L%s'
    # linker.link_options = %Q[%{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 = %q[-o "%{outfile}" "%{infile}"]
    # end

    # gperf settings
    # conf.gperf do |gperf|
    # gperf.command = 'gperf'
    # gperf.compile_options = %q[-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

    # file separator
    # conf.file_separator = '/'

    # Turn on `enable_debug` for better debugging
    #conf.enable_debug
    #conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
    #conf.gem core: 'mruby-bin-debugger'
    conf.enable_bintest
    conf.enable_test
    end