Ignore:
Timestamp:
Jul 9, 2020, 8:51:43 AM (4 years ago)
Author:
coas-nagasima
Message:

mrubyを2.1.1に更新

Location:
EcnlProtoTool/trunk/mruby-2.1.1
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/mruby-2.1.1/build_config.rb

    r424 r439  
    33
    44  # Gets set by the VS command prompts.
    5   #if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
     5  if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
    66    toolchain :visualcpp
    7   #else
    8   #  toolchain :gcc
    9   #end
    10 
    11   enable_debug
     7  else
     8    toolchain :gcc
     9  end
     10
     11  # Turn on `enable_debug` for better debugging
     12  # enable_debug
    1213
    1314  # Use mrbgems
     
    1819  # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
    1920  # conf.gem :core => 'mruby-eval'
    20   # conf.gem :mgem => 'mruby-io'
    21   # conf.gem :github => 'iij/mruby-io'
    22   # conf.gem :git => 'git@github.com:iij/mruby-io.git', :branch => 'master', :options => '-v'
     21  # conf.gem :mgem => 'mruby-onig-regexp'
     22  # conf.gem :github => 'mattn/mruby-onig-regexp'
     23  # conf.gem :git => 'git@github.com:mattn/mruby-onig-regexp.git', :branch => 'master', :options => '-v'
    2324
    2425  # include the default GEMs
     
    2930  #   cc.flags = [ENV['CFLAGS'] || %w()]
    3031  #   cc.include_paths = ["#{root}/include"]
    31   #   cc.defines = %w(DISABLE_GEMS)
    32   #   cc.option_include_path = '-I%s'
     32  #   cc.defines = %w()
     33  #   cc.option_include_path = %q[-I"%s"]
    3334  #   cc.option_define = '-D%s'
    34   #   cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
     35  #   cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
    3536  # end
    3637
     
    5051  #   linker.option_library = '-l%s'
    5152  #   linker.option_library_path = '-L%s'
    52   #   linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
     53  #   linker.link_options = "%{flags} -o "%{outfile}" %{objs} %{libs}"
    5354  # end
    5455
     
    5657  # conf.archiver do |archiver|
    5758  #   archiver.command = ENV['AR'] || 'ar'
    58   #   archiver.archive_options = 'rs %{outfile} %{objs}'
     59  #   archiver.archive_options = 'rs "%{outfile}" %{objs}'
    5960  # end
    6061
     
    6263  # conf.yacc do |yacc|
    6364  #   yacc.command = ENV['YACC'] || 'bison'
    64   #   yacc.compile_options = '-o %{outfile} %{infile}'
     65  #   yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
    6566  # end
    6667
     
    6869  # conf.gperf do |gperf|
    6970  #   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  #   gperf.compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
    7172  # end
    7273
     
    8485  # conf.enable_bintest
    8586end
    86 
     87=begin
    8788MRuby::Build.new('host-debug') do |conf|
    8889  # load specific toolchain settings
     
    110111end
    111112
    112 #MRuby::Build.new('test') do |conf|
     113MRuby::Build.new('test') do |conf|
     114  # Gets set by the VS command prompts.
     115  if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
     116    toolchain :visualcpp
     117  else
     118    toolchain :gcc
     119  end
     120
     121  enable_debug
     122  conf.enable_bintest
     123  conf.enable_test
     124
     125  conf.gembox 'default'
     126end
     127=end
     128#MRuby::Build.new('bench') do |conf|
    113129#  # Gets set by the VS command prompts.
    114130#  if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
     
    116132#  else
    117133#    toolchain :gcc
     134#    conf.cc.flags << '-O3'
    118135#  end
    119 #
    120 #  enable_debug
    121 #  conf.enable_bintest
    122 #  conf.enable_test
    123136#
    124137#  conf.gembox 'default'
     
    137150#
    138151#   conf.test_runner.command = 'env'
    139 #
    140152# end
    141153
    142 # Define cross build settings
     154# Cross build for arm-none-eabi
    143155MRuby::CrossBuild.new('arm-none-eabi') do |conf|
    144156  toolchain :gcc
     
    149161  conf.archiver.command = "arm-none-eabi-ar"
    150162
    151   conf.cc.flags << %w(-MD -MP -mlittle-endian -mcpu=cortex-a9 -mthumb -mthumb-interwork -marm -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -mno-unaligned-access -fno-strict-aliasing -nostdinc)
     163  conf.cc.flags << %w(-MD -MP -mlittle-endian -mcpu=cortex-a9 -mthumb -mthumb-interwork -marm -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -mno-unaligned-access -fno-strict-aliasing -nostdinc -Wstack-usage=256 -ffunction-sections -fdata-sections)
    152164  conf.cc.include_paths  << "../musl-1.1.18/include"
    153165
    154   conf.linker.flags << %w(-nostdlib)
    155   conf.linker.library_paths << "../musl-1.1.18/lib"
    156   conf.linker.libraries << %w(c gcc)
    157 
    158   #configuration for low memory environment
    159   conf.cc.defines << %w(MRB_GC_STRESS)
    160   #conf.cc.defines << %w(DISABLE_STDIO)
    161   conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
    162 
    163   conf.build_mrbtest_lib_only
     166  conf.cc.defines << %w(MRB_USE_CUSTOM_RO_DATA_P MRB_ENABLE_DEBUG_HOOK MRB_CONSTRAINED_BASELINE_PROFILE)
     167
     168  #conf.build_mrbtest_lib_only
    164169
    165170  conf.gem "#{root}/mrbgems/mruby-compiler"
     171  conf.gem "#{root}/mrbgems/mruby-eval"
     172  conf.gem "#{root}/mrbgems/mruby-io"
     173  conf.gem "#{root}/mrbgems/mruby-math"
     174  conf.gem "#{root}/mrbgems/mruby-pack"
     175  conf.gem "#{root}/mrbgems/mruby-print"
     176  conf.gem "#{root}/mrbgems/mruby-random"
     177  conf.gem "#{root}/mrbgems/mruby-socket"
     178  conf.gem "#{root}/mrbgems/mruby-sprintf"
     179  conf.gem "#{root}/mrbgems/mruby-struct"
     180  conf.gem "#{root}/mrbgems/mruby-time"
    166181  conf.gem "#{root}/mrbgems/mruby-numeric-ext"
    167182  conf.gem "#{root}/mrbgems/mruby-string-ext"
    168183  conf.gem '../mrbgems/mruby-onig-regexp'  do |g|
     184    g.cc.flags << %w(-DHAVE_ONIGMO_H)
    169185    g.cc.include_paths  << "../onigmo-6.1.3/src"
    170186  end
     
    177193  conf.gem "#{root}/../mrbgems/mruby-errno"
    178194  conf.gem "#{root}/../mrbgems/mruby-iijson"
    179   conf.gem "#{root}/../mrbgems/mruby-io"
    180195  conf.gem "#{root}/../mrbgems/mruby-ipaddr"
    181196  conf.gem "#{root}/../mrbgems/mruby-mock"
    182   conf.gem "#{root}/../mrbgems/mruby-pack"
    183197  #conf.gem "#{root}/../mrbgems/mruby-require"
    184   conf.gem "#{root}/../mrbgems/mruby-socket"
    185198  conf.gem "#{root}/../mrbgems/mruby-tls-openssl" do |g|
    186199    g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
     
    202215
    203216  conf.archiver.command = "llvm-ar"
     217  conf.cc.flags << '-ffunction-sections -fdata-sections'
     218  conf.linker.flags << '-Wl,--gc-sections'
    204219  conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins'
    205220  #conf.linker.flags << '-s BINARYEN=1'
     
    207222
    208223  # include the default GEMs
    209   conf.gembox 'default'
     224  #conf.gembox 'default'
    210225  conf.gem :core => 'mruby-bin-mrbc'
    211226end
Note: See TracChangeset for help on using the changeset viewer.