Changeset 281 for EcnlProtoTool/trunk/mruby-1.2.0
- Timestamp:
- May 1, 2017, 7:53:04 PM (7 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.2.0
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.2.0/build_config.rb
r279 r281 191 191 # conf.test_runner.command = 'env' 192 192 end 193 193 =begin 194 MRuby::CrossBuild.new("emscripten") do |conf| 195 toolchain :emscripten 196 197 conf.archiver.command = "llvm-ar" 198 conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins' 199 #conf.linker.flags << '-s BINARYEN=1' 200 #conf.exts.executable = '.html' 201 202 # include the default GEMs 203 conf.gembox 'default' 204 conf.gem :core => 'mruby-bin-mrbc' 205 end 206 =end -
EcnlProtoTool/trunk/mruby-1.2.0/tasks/mruby_build_commands.rake
r270 r281 1 1 require 'forwardable' 2 require 'digest/md5' 2 3 3 4 module MRuby … … 84 85 if MRUBY_BUILD_HOST_IS_CYGWIN 85 86 _run compile_options, { :flags => all_flags(_defineds, _include_paths, _flags), 86 :infile => cygwin_filename(infile), :outfile => cygwin_filename(outfile) } 87 :infile => cygwin_filename(infile), :outfile => cygwin_filename(outfile), 88 :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 87 89 else 88 90 _run compile_options, { :flags => all_flags(_defineds, _include_paths, _flags), 89 :infile => filename(infile), :outfile => filename(outfile) } 91 :infile => filename(infile), :outfile => filename(outfile), 92 :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 90 93 end 91 94 end … … 178 181 :flags_before_libraries => [flags_before_libraries, _flags_before_libraries].flatten.join(' '), 179 182 :flags_after_libraries => [flags_after_libraries, _flags_after_libraries].flatten.join(' '), 180 :libs => library_flags.join(' ') } 183 :libs => library_flags.join(' '), 184 :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 181 185 else 182 186 _run link_options, { :flags => all_flags(_library_paths, _flags), … … 184 188 :flags_before_libraries => [flags_before_libraries, _flags_before_libraries].flatten.join(' '), 185 189 :flags_after_libraries => [flags_after_libraries, _flags_after_libraries].flatten.join(' '), 186 :libs => library_flags.join(' ') } 190 :libs => library_flags.join(' '), 191 :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 187 192 end 188 193 end … … 201 206 FileUtils.mkdir_p File.dirname(outfile) 202 207 _pp "AR", outfile.relative_path 208 209 # reference from emar.py 210 outfilebase = File.dirname(outfile) 211 to_delete = [] 212 newargs = [] 213 objfiles.each do |orig_name| 214 dir_name = File.dirname(orig_name) 215 dir_name = dir_name.relative_path_from(Dir.pwd) 216 base_name = File.basename(orig_name) 217 parts = base_name.split('.') 218 # h = Digest::MD5.new.update(orig_name).to_s 219 h = Digest::MD5.new.update(orig_name).to_s.slice(0,4) 220 parts[0] += '_' + h 221 newname = parts.join('.') 222 full_newname = File.join(dir_name, newname) 223 if not File.exists?(full_newname) 224 begin # it is ok to fail here, we just don't get hashing 225 FileUtils.cp(orig_name, full_newname) 226 newargs << full_newname 227 to_delete << full_newname 228 rescue 229 end 230 end 231 end 232 203 233 if MRUBY_BUILD_HOST_IS_CYGWIN 204 _run archive_options, { :outfile => cygwin_filename(outfile), :objs => cygwin_filename(objfiles).join(' ') } 205 else 206 _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') } 234 _run archive_options, { :outfile => cygwin_filename(outfile), :objs => cygwin_filename(newargs).join(' '), :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 235 else 236 _run archive_options, { :outfile => filename(outfile), :objs => filename(newargs).join(' '), :outdir => File.dirname(outfile), :outfilebase => File.basename(outfile, ".*") } 237 end 238 239 to_delete.each do |d| 240 FileUtils.rm(d) 207 241 end 208 242 end -
EcnlProtoTool/trunk/mruby-1.2.0/tasks/toolchains/visualcpp.rake
r270 r281 1 1 MRuby::Toolchain.new(:visualcpp) do |conf| 2 [conf.cc].eachdo |cc|2 conf.cc do |cc| 3 3 cc.command = ENV['CC'] || 'cl.exe' 4 # C4013: implicit function declaration 5 cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /we4013 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)] 4 cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W4 /GS /analyze- /Zc:wchar_t /ZI /Gm /Od /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /EHsc /DWIN32 /D_DEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)] 5 cc.flags << %w(/we4002 /we4003 /we4005 /we4007 /we4010 /we4013 /we4015 /we4020 /we4022 /we4024 /we4028 /we4029 /we4031 /we4033 /we4034 /we4042 /we4047 /we4048 /we4049 /we4056 /we4067 /we4074 /we4079 /we4083 /we4088 /we4089 /we4090 /we4091 /we4094 /we4096 /we4098 /we4099 /we4113 /we4133 /we4715 /we4716) 6 cc.flags << %w(/wd4214 /wd4100 /wd4996) 7 cc.flags << "/Fd\"#{conf.build_dir}\\vc140.pdb\"" 8 cc.flags << "/Fp\"%{outdir}\\%{outfilebase}.pch\"" 6 9 cc.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING) 7 10 cc.option_include_path = '/I%s' … … 10 13 end 11 14 12 [conf.cxx].eachdo |cxx|15 conf.cxx do |cxx| 13 16 cxx.command = ENV['CXX'] || 'cl.exe' 14 cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHs /D_CRT_SECURE_NO_WARNINGS)] 17 cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W4 /GS /analyze- /Zc:wchar_t /ZI /Gm /Od /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /EHsc /DWIN32 /D_DEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)] 18 cxx.flags << %w(/we4002 /we4003 /we4005 /we4007 /we4010 /we4013 /we4015 /we4020 /we4022 /we4024 /we4028 /we4029 /we4031 /we4033 /we4034 /we4042 /we4047 /we4048 /we4049 /we4056 /we4067 /we4074 /we4079 /we4083 /we4088 /we4089 /we4090 /we4091 /we4094 /we4096 /we4098 /we4099 /we4113 /we4133 /we4715 /we4716) 19 cxx.flags << %w(/wd4214 /wd4100 /wd4996) 20 cxx.flags << "/Fd\"#{conf.build_dir}\\vc140.pdb\"" 21 cxx.flags << "/Fp\"%{outdir}\\%{outfilebase}.pch\"" 15 22 cxx.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING) 16 23 cxx.option_include_path = '/I%s' … … 21 28 conf.linker do |linker| 22 29 linker.command = ENV['LD'] || 'link.exe' 23 linker.flags = [ENV['LDFLAGS'] || %w(/NOLOGO /DEBUG /INCREMENTAL:NO /OPT:ICF /OPT:REF)] 30 linker.flags = [ENV['LDFLAGS'] || %w(/MANIFEST /NXCOMPAT /DYNAMICBASE /MACHINE:X86 /INCREMENTAL /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1)] 31 linker.flags << "/PDB:\"#{conf.build_dir}\\vc140.pdb\"" 32 #linker.flags << "/PGD:\"%{outdir}\\%{outfilebase}.pgd\"" 33 linker.flags << "/ManifestFile:\"%{outdir}\\%{outfilebase}.exe.intermediate.manifest\"" 24 34 linker.libraries = %w() 25 35 linker.library_paths = %w()
Note:
See TracChangeset
for help on using the changeset viewer.