source: EcnlProtoTool/trunk/mruby-1.3.0/tasks/toolchains/gcc.rake@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 2.3 KB
Line 
1MRuby::Toolchain.new(:gcc) do |conf, _params|
2 [conf.cc, conf.objc, conf.asm].each do |cc|
3 cc.command = ENV['CC'] || 'gcc'
4 cc.flags = [ENV['CFLAGS'] || %w(-g -std=gnu99 -Og -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wwrite-strings)]
5 cc.defines = %w(DISABLE_GEMS)
6 cc.option_include_path = '-I%s'
7 cc.option_define = '-D%s'
8 cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}'
9 cc.cxx_compile_flag = '-x c++ -std=c++03'
10 cc.cxx_exception_flag = '-fexceptions'
11 end
12
13 [conf.cxx].each do |cxx|
14 cxx.command = ENV['CXX'] || 'g++'
15 cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(-g -Og -Wall -Werror-implicit-function-declaration)]
16 cxx.defines = %w(DISABLE_GEMS)
17 cxx.option_include_path = '-I%s'
18 cxx.option_define = '-D%s'
19 cxx.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}'
20 cxx.cxx_compile_flag = '-x c++ -std=c++03'
21 cxx.cxx_exception_flag = '-fexceptions'
22 end
23
24 conf.linker do |linker|
25 linker.command = ENV['LD'] || 'gcc'
26 linker.flags = [ENV['LDFLAGS'] || %w()]
27 linker.libraries = %w(m)
28 linker.library_paths = []
29 linker.option_library = '-l%s'
30 linker.option_library_path = '-L%s'
31 linker.link_options = '%{flags} -o %{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
32 end
33
34 [[conf.cc, 'c'], [conf.cxx, 'c++']].each do |cc, lang|
35 cc.instance_variable_set :@header_search_language, lang
36 def cc.header_search_paths
37 if @header_search_command != command
38 result = `echo | #{build.filename command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1`
39 result = `echo | #{command} -x#{@header_search_language} -Wp,-v - -fsyntax-only 2>&1` if $?.exitstatus != 0
40 return include_paths if $?.exitstatus != 0
41
42 @frameworks = []
43 @header_search_paths = result.lines.map { |v|
44 framework = v.match(/^ (.*)(?: \(framework directory\))$/)
45 if framework
46 @frameworks << framework[1]
47 next nil
48 end
49
50 v.match(/^ (.*)$/)
51 }.compact.map { |v| v[1] }.select { |v| File.directory? v }
52 @header_search_paths += include_paths
53 @header_search_command = command
54 end
55 @header_search_paths
56 end
57 end
58end
Note: See TracBrowser for help on using the repository browser.