| 1 |
# Cross Compiling configuration for MS-DOS |
| 2 |
# |
| 3 |
# Requires DJGPP cross-compiler, see |
| 4 |
# https://github.com/andrewwutw/build-djgpp/releases |
| 5 |
|
| 6 |
MRuby::CrossBuild.new("i586-pc-msdosdjgpp") do |conf| |
| 7 |
toolchain :gcc |
| 8 |
|
| 9 |
# If DJGPP is not in the PATH, set this to the bin directory |
| 10 |
DJGPP_PATH = nil |
| 11 |
|
| 12 |
GCC = 'i586-pc-msdosdjgpp-gcc' |
| 13 |
GXX = 'i586-pc-msdosdjgpp-g++' |
| 14 |
AR = 'i586-pc-msdosdjgpp-ar' |
| 15 |
|
| 16 |
conf.cc do |cc| |
| 17 |
cc.command = DJGPP_PATH ? File.join(DJGPP_PATH, GCC) : GCC |
| 18 |
cc.defines << 'MRB_WITHOUT_IO_PREAD_PWRITE' |
| 19 |
cc.defines << 'MRB_UTF8_STRING' |
| 20 |
end |
| 21 |
|
| 22 |
conf.cxx do |cxx| |
| 23 |
cxx.command = DJGPP_PATH ? File.join(DJGPP_PATH, GXX) : GXX |
| 24 |
cxx.defines << 'MRB_WITHOUT_IO_PREAD_PWRITE' |
| 25 |
cxx.defines << 'MRB_UTF8_STRING' |
| 26 |
end |
| 27 |
|
| 28 |
conf.linker do |linker| |
| 29 |
linker.command = DJGPP_PATH ? File.join(DJGPP_PATH, GXX) : GXX |
| 30 |
linker.libraries = %w(m) |
| 31 |
end |
| 32 |
|
| 33 |
conf.archiver do |archiver| |
| 34 |
archiver.command = DJGPP_PATH ? File.join(DJGPP_PATH, AR) : AR |
| 35 |
end |
| 36 |
|
| 37 |
# All provided gems that can be reasonably made to compile: |
| 38 |
# default.gembox, minus mruby-socket and replacing mruby-cmath with mruby-cmath-alt |
| 39 |
conf.gembox "stdlib" |
| 40 |
conf.gembox "stdlib-ext" |
| 41 |
|
| 42 |
conf.gem :core => 'mruby-io' # stdlib-io.gembox <- default.gembox |
| 43 |
# No socket support in DJGPP |
| 44 |
# conf.gem :core => 'mruby-socket' # stdlib-io.gembox <- default.gembox |
| 45 |
conf.gem :core => 'mruby-print' # stdlib-io.gembox <- default.gembox |
| 46 |
conf.gem :core => 'mruby-errno' # stdlib-io.gembox <- default.gembox |
| 47 |
conf.gem :core => 'mruby-dir' # stdlib-io.gembox <- default.gembox |
| 48 |
|
| 49 |
conf.gem :core => 'mruby-bigint' # math.gembox <- default.gembox |
| 50 |
conf.gem :core => 'mruby-complex' # math.gembox <- default.gembox |
| 51 |
conf.gem :core => 'mruby-math' # math.gembox <- default.gembox |
| 52 |
conf.gem :core => 'mruby-rational' # math.gembox <- default.gembox |
| 53 |
# Alternative implementation of cmath, not requiring <complex.h> |
| 54 |
# conf.gem :github => 'chasonr/mruby-cmath-alt' # math.gembox <- default.gembox |
| 55 |
|
| 56 |
conf.gembox "metaprog" |
| 57 |
|
| 58 |
conf.gem :core => 'mruby-bin-mrbc' # default.gembox |
| 59 |
conf.gem :core => 'mruby-bin-debugger' # default.gembox |
| 60 |
conf.gem :core => 'mruby-bin-mirb' # default.gembox |
| 61 |
conf.gem :core => 'mruby-bin-mruby' # default.gembox |
| 62 |
conf.gem :core => 'mruby-bin-strip' # default.gembox |
| 63 |
conf.gem :core => 'mruby-bin-config' # default.gembox |
| 64 |
|
| 65 |
# Other compilable gems |
| 66 |
conf.gem :core => 'mruby-binding' |
| 67 |
conf.gem :core => 'mruby-catch' |
| 68 |
conf.gem :core => 'mruby-enum-chain' |
| 69 |
conf.gem :core => 'mruby-error' |
| 70 |
conf.gem :core => 'mruby-exit' |
| 71 |
conf.gem :core => 'mruby-os-memsize' |
| 72 |
conf.gem :core => 'mruby-proc-binding' |
| 73 |
conf.gem :core => 'mruby-sleep' |
| 74 |
|
| 75 |
# For Onigmo regular expression support |
| 76 |
conf.gem :github => 'mattn/mruby-onig-regexp' |
| 77 |
end |