Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
260dc6d7
Commit
260dc6d7
authored
Feb 22, 2020
by
SiZiOUS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving comments in the cross-compiling example for the Sega Dreamcast (sh-elf).
parent
2f6afb52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
examples/targets/build_config_dreamcast_shelf.rb
examples/targets/build_config_dreamcast_shelf.rb
+25
-15
No files found.
examples/targets/build_config_dreamcast_shelf.rb
View file @
260dc6d7
MRuby
::
Build
.
new
do
|
conf
|
MRuby
::
Build
.
new
do
|
conf
|
# Gets set by the VS command prompts
# Gets set by the VS command prompts.
if
ENV
[
'VisualStudioVersion'
]
||
ENV
[
'VSINSTALLDIR'
]
if
ENV
[
'VisualStudioVersion'
]
||
ENV
[
'VSINSTALLDIR'
]
toolchain
:visualcpp
toolchain
:visualcpp
else
else
...
@@ -9,27 +8,31 @@ MRuby::Build.new do |conf|
...
@@ -9,27 +8,31 @@ MRuby::Build.new do |conf|
enable_debug
enable_debug
#
i
nclude the default GEMs
#
I
nclude the default GEMs
conf
.
gembox
'default'
conf
.
gembox
'default'
end
end
# Cross Compiling configuration for Sega Dreamcast
# Cross Compiling configuration for
the
Sega Dreamcast
# This
requires KallistiOS to be installed
# This
configuration requires KallistiOS (KOS)
# https://dreamcast.wiki
# https://dreamcast.wiki
#
#
# Tested on GNU/Linux, MinGW-w64/MSYS2, Cygwin, macOS and MinGW/MSYS (see below)
#
MRuby
::
CrossBuild
.
new
(
"dreamcast"
)
do
|
conf
|
MRuby
::
CrossBuild
.
new
(
"dreamcast"
)
do
|
conf
|
toolchain
:gcc
toolchain
:gcc
# Supporting DreamSDK (if necessarys)
# Support for DreamSDK (based on MinGW/MSYS)
# To compile mruby with DreamSDK, RubyInstaller for Windows should be installed
DREAMSDK_HOME
=
ENV
[
"DREAMSDK_HOME"
]
DREAMSDK_HOME
=
ENV
[
"DREAMSDK_HOME"
]
MSYS_ROOT
=
!
(
DREAMSDK_HOME
.
nil?
||
DREAMSDK_HOME
.
empty?
)
?
"
#{
DREAMSDK_HOME
}
/msys/1.0"
:
""
MSYS_ROOT
=
!
(
DREAMSDK_HOME
.
nil?
||
DREAMSDK_HOME
.
empty?
)
?
"
#{
DREAMSDK_HOME
}
/msys/1.0"
:
""
#
For all host system
s
#
Setting path
s
DREAMCAST_PATH
=
"
#{
MSYS_ROOT
}
/opt/toolchains/dc"
DREAMCAST_PATH
=
"
#{
MSYS_ROOT
}
/opt/toolchains/dc"
KOS_PATH
=
"
#{
DREAMCAST_PATH
}
/kos"
KOS_PATH
=
"
#{
DREAMCAST_PATH
}
/kos"
BIN_PATH
=
"
#{
DREAMCAST_PATH
}
/sh-elf/bin"
BIN_PATH
=
"
#{
DREAMCAST_PATH
}
/sh-elf/bin"
# C compiler
# Flags were extracted from KallistiOS environment files
conf
.
cc
do
|
cc
|
conf
.
cc
do
|
cc
|
cc
.
command
=
"
#{
BIN_PATH
}
/sh-elf-gcc"
cc
.
command
=
"
#{
BIN_PATH
}
/sh-elf-gcc"
cc
.
include_paths
<<
[
"
#{
KOS_PATH
}
/include"
,
"
#{
KOS_PATH
}
/kernel/arch/dreamcast/include"
,
"
#{
KOS_PATH
}
/addons/include"
,
"
#{
KOS_PATH
}
/../kos-ports/include"
]
cc
.
include_paths
<<
[
"
#{
KOS_PATH
}
/include"
,
"
#{
KOS_PATH
}
/kernel/arch/dreamcast/include"
,
"
#{
KOS_PATH
}
/addons/include"
,
"
#{
KOS_PATH
}
/../kos-ports/include"
]
...
@@ -39,6 +42,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
...
@@ -39,6 +42,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
cc
.
defines
<<
%w(_arch_sub_pristine)
cc
.
defines
<<
%w(_arch_sub_pristine)
end
end
# C++ compiler
conf
.
cxx
do
|
cxx
|
conf
.
cxx
do
|
cxx
|
cxx
.
command
=
conf
.
cc
.
command
.
dup
cxx
.
command
=
conf
.
cc
.
command
.
dup
cxx
.
include_paths
=
conf
.
cc
.
include_paths
.
dup
cxx
.
include_paths
=
conf
.
cc
.
include_paths
.
dup
...
@@ -47,28 +51,34 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
...
@@ -47,28 +51,34 @@ MRuby::CrossBuild.new("dreamcast") do |conf|
cxx
.
defines
=
conf
.
cc
.
defines
.
dup
cxx
.
defines
=
conf
.
cc
.
defines
.
dup
cxx
.
compile_options
=
conf
.
cc
.
compile_options
.
dup
cxx
.
compile_options
=
conf
.
cc
.
compile_options
.
dup
end
end
# Linker
# There is an issue when making the mruby library with KallistiOS:
# 'newlib_kill.o' and 'newlib_getpid.o' aren't found so they are explicitly
# specified here at least for now.
conf
.
linker
do
|
linker
|
conf
.
linker
do
|
linker
|
linker
.
command
=
"
#{
BIN_PATH
}
/sh-elf-gcc"
linker
.
command
=
"
#{
BIN_PATH
}
/sh-elf-gcc"
linker
.
flags
<<
[
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_kill.o"
,
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_getpid.o"
,
"-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group"
]
linker
.
flags
<<
[
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_kill.o"
,
"
#{
MSYS_ROOT
}
/opt/toolchains/dc/kos/kernel/build/newlib_getpid.o"
,
"-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group"
]
linker
.
library_paths
<<
[
"
#{
KOS_PATH
}
/lib/dreamcast"
,
"
#{
KOS_PATH
}
/addons/lib/dreamcast"
,
"
#{
KOS_PATH
}
/../kos-ports/lib"
]
linker
.
library_paths
<<
[
"
#{
KOS_PATH
}
/lib/dreamcast"
,
"
#{
KOS_PATH
}
/addons/lib/dreamcast"
,
"
#{
KOS_PATH
}
/../kos-ports/lib"
]
end
end
# Archiver
conf
.
archiver
do
|
archiver
|
conf
.
archiver
do
|
archiver
|
archiver
.
command
=
"
#{
BIN_PATH
}
/sh-elf-ar"
archiver
.
command
=
"
#{
BIN_PATH
}
/sh-elf-ar"
archiver
.
archive_options
=
'rcs %{outfile} %{objs}'
archiver
.
archive_options
=
'rcs %{outfile} %{objs}'
end
end
#
n
o executables
#
N
o executables
conf
.
bins
=
[]
conf
.
bins
=
[]
#
d
o not build executable test
#
D
o not build executable test
conf
.
build_mrbtest_lib_only
conf
.
build_mrbtest_lib_only
#
d
isable C++ exception
#
D
isable C++ exception
conf
.
disable_cxx_exception
conf
.
disable_cxx_exception
#gems from core
# Gems from core
# removing mruby-io
conf
.
gem
:core
=>
"mruby-metaprog"
conf
.
gem
:core
=>
"mruby-metaprog"
conf
.
gem
:core
=>
"mruby-pack"
conf
.
gem
:core
=>
"mruby-pack"
conf
.
gem
:core
=>
"mruby-sprintf"
conf
.
gem
:core
=>
"mruby-sprintf"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment