| 1 |
# Cross Compiling configuration for the Nintendo GameBoyAdvance. |
| 2 |
# This configuration requires devkitARM |
| 3 |
# https://devkitpro.org/wiki/Getting_Started/devkitARM |
| 4 |
# |
| 5 |
# Tested only on GNU/Linux |
| 6 |
# |
| 7 |
MRuby::CrossBuild.new("gameboyadvance") do |conf| |
| 8 |
toolchain :gcc |
| 9 |
|
| 10 |
DEVKITPRO_PATH = "/opt/devkitpro" |
| 11 |
BIN_PATH = "#{DEVKITPRO_PATH}/devkitARM/bin" |
| 12 |
|
| 13 |
# C compiler |
| 14 |
conf.cc do |cc| |
| 15 |
cc.command = "#{BIN_PATH}/arm-none-eabi-gcc" |
| 16 |
cc.flags << ["-mthumb-interwork", "-mthumb", "-O2"] |
| 17 |
cc.compile_options = %(%{flags} -o "%{outfile}" -c "%{infile}") |
| 18 |
end |
| 19 |
|
| 20 |
# C++ compiler |
| 21 |
conf.cxx do |cxx| |
| 22 |
cxx.command = "#{BIN_PATH}/arm-none-eabi-g++" |
| 23 |
cxx.include_paths = conf.cc.include_paths.dup |
| 24 |
cxx.flags = conf.cc.flags.dup |
| 25 |
cxx.flags << %w[-fno-rtti -fno-exceptions] |
| 26 |
cxx.defines = conf.cc.defines.dup |
| 27 |
cxx.compile_options = conf.cc.compile_options.dup |
| 28 |
end |
| 29 |
|
| 30 |
# Linker |
| 31 |
conf.linker do |linker| |
| 32 |
linker.command = "#{BIN_PATH}/arm-none-eabi-gcc" |
| 33 |
linker.flags << ["-mthumb-interwork", "-mthumb", "-specs=gba.specs"] |
| 34 |
end |
| 35 |
|
| 36 |
# No executables |
| 37 |
conf.bins = [] |
| 38 |
|
| 39 |
# Do not build executable test |
| 40 |
conf.build_mrbtest_lib_only |
| 41 |
|
| 42 |
# Disable C++ exception |
| 43 |
conf.disable_cxx_exception |
| 44 |
|
| 45 |
# Gems from core |
| 46 |
# removing mruby-io |
| 47 |
conf.gem core: "mruby-metaprog" |
| 48 |
conf.gem core: "mruby-pack" |
| 49 |
conf.gem core: "mruby-sprintf" |
| 50 |
conf.gem core: "mruby-print" |
| 51 |
conf.gem core: "mruby-math" |
| 52 |
conf.gem core: "mruby-time" |
| 53 |
conf.gem core: "mruby-struct" |
| 54 |
conf.gem core: "mruby-compar-ext" |
| 55 |
conf.gem core: "mruby-enum-ext" |
| 56 |
conf.gem core: "mruby-string-ext" |
| 57 |
conf.gem core: "mruby-numeric-ext" |
| 58 |
conf.gem core: "mruby-array-ext" |
| 59 |
conf.gem core: "mruby-hash-ext" |
| 60 |
conf.gem core: "mruby-range-ext" |
| 61 |
conf.gem core: "mruby-proc-ext" |
| 62 |
conf.gem core: "mruby-symbol-ext" |
| 63 |
conf.gem core: "mruby-random" |
| 64 |
conf.gem core: "mruby-object-ext" |
| 65 |
conf.gem core: "mruby-objectspace" |
| 66 |
conf.gem core: "mruby-fiber" |
| 67 |
conf.gem core: "mruby-enumerator" |
| 68 |
conf.gem core: "mruby-enum-lazy" |
| 69 |
conf.gem core: "mruby-toplevel-ext" |
| 70 |
conf.gem core: "mruby-kernel-ext" |
| 71 |
conf.gem core: "mruby-class-ext" |
| 72 |
conf.gem core: "mruby-compiler" |
| 73 |
end |