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
80c15ddd
Unverified
Commit
80c15ddd
authored
May 19, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the build instruction.
parent
7fde48b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
31 deletions
+68
-31
doc/guides/compile.md
doc/guides/compile.md
+68
-31
No files found.
doc/guides/compile.md
View file @
80c15ddd
...
@@ -14,37 +14,53 @@ To compile mruby out of the source code you need the following tools:
...
@@ -14,37 +14,53 @@ To compile mruby out of the source code you need the following tools:
Note that
`bison`
bundled with MacOS is too old to compile
`mruby`
.
Note that
`bison`
bundled with MacOS is too old to compile
`mruby`
.
Try
`brew install bison`
and follow the instuction shown to update
Try
`brew install bison`
and follow the instuction shown to update
the
`$PATH`
to compile
`mruby`
.
the
`$PATH`
to compile
`mruby`
. We also encourage to upgrade
`ruby`
on MacOS in similar manner.
Optional:
Optional:
*
GIT
(to update mruby source and integrate mrbgems easier)
*
git
(to update mruby source and integrate mrbgems easier)
*
C++ compiler (to use GEMs which include
\*
.cpp,
\*
.cxx,
\*
.cc)
*
C++ compiler (to use GEMs which include
\*
.cpp,
\*
.cxx,
\*
.cc)
*
Assembler (to use GEMs which include
\*
.asm)
*
Assembler (to use GEMs which include
\*
.asm)
## Usage
## Build
To compile
`mruby`
, just call
`rake`
inside of the mruby source
root. To generate and execute the test tools call
`rake test`
. To
clean all build files call
`rake clean`
. To see full command line on
build, call
`rake -v`
.
If you want to compile for the specific configuration, specify
`MRUBY_TARGET`
or
`TARGET`
environment variable, e.g
```
sh
rake
TAGRET
=
host
```
The default target is
`host`
. The compilation target desciption files
(with
`.rb`
suffix) are contained in the
`target`
directory.
A build description file contains the build configuration of mruby and
looks like the following for example:
Inside of the root directory of the mruby source a file exists
called
*build_config.rb*
. This file contains the build configuration
of mruby and looks like this for example:
```
ruby
```
ruby
MRuby
::
Build
.
new
do
|
conf
|
MRuby
::
Build
.
new
do
|
conf
|
toolchain
:gcc
toolchain
:gcc
end
end
```
```
All tools necessary to compile mruby can be set or modified here. In case
All tools necessary to compile mruby can be set or modified here. In
you want to maintain an additional
*build_config.rb*
you can define a
case you want to try different configuration, you can create a new
customized path using the
*$MRUBY_CONFIG*
environment variable.
configuration file under
`target`
and specify the configuration using
the
`MRUBY_TARGET`
environment variable.
To compile just call
`rake`
inside of the mruby source root. To
generate and execute the test tools call
`rake test`
. To clean
all build files call
`rake clean`
. To see full command line on
build, call
`rake -v`
.
## Build Configuration
## Build Configuration
Inside of the
*build_config.rb*
the following options can be configured
To create a new configuration, copy the existing configuration in the
based on your environment.
`target`
directory, and modify it. We wish you submit a pull-request,
once you created a new configuration for a new platform.
Inside of the configuration file, the following options can be
configured based on your environment.
### Toolchains
### Toolchains
...
@@ -88,15 +104,12 @@ in `ANDROID_STANDALONE_TOOLCHAIN`.
...
@@ -88,15 +104,12 @@ in `ANDROID_STANDALONE_TOOLCHAIN`.
### Binaries
### Binaries
It is possible to select which tools should be compiled during the compilation
It is possible to select which tools should be compiled during the compilation
process. The following tools can be selected:
process. For example,
*
mruby (mruby interpreter)
*
mirb (mruby interactive shell)
To select them declare conf.gem as follows:
*
`mruby`
```
ruby
*
`mirb`
conf
.
gem
"
#{
root
}
/mrbgems/mruby-bin-mruby"
conf
.
gem
"
#{
root
}
/mrbgems/mruby-bin-mirb"
The configuration are done via
`mrbgems`
. See
`Mrbgems`
section.
```
### File Separator
### File Separator
...
@@ -209,17 +222,33 @@ end
...
@@ -209,17 +222,33 @@ end
### Mrbgems
### Mrbgems
Integrate GEMs in the build process.
`mruby`
comes with the (sort of) packaging system named
`mrbgems`
. To
specify
`gem`
, you can use
`conf.gem`
in the configuration file.
```
ruby
```
ruby
# Integrate GEM with additional configuration
# Integrate a bundled Gem you see in `mrbgems` directory
conf
.
gem
'path/to/gem'
do
|
g
|
conf
.
gem
:core
=>
'mruby-something'
g
.
cc
.
flags
<<
...
end
# Integrate a Gem from GitHub
conf
.
gem
:github
=>
'someone/mruby-another'
# Integrate GEM without additional configuration
# Integrate a mruby binary Gem
conf
.
gem
'path/to/another/gem'
conf
.
gem
:core
=>
'mruby-bin-mruby'
# Integrate a interactive mruby binary Gem
conf
.
gem
:core
=>
'mruby-bin-mirb'
# Integrate GemBox (set of Gems)
conf
.
gembox
"default"
```
```
A GemBox is a set of Gems defined in
`mrbgems/default.gembox`
for example.
It's just a set of
`mrbgem`
configurations.
There is a
`RubyGem`
(gem for CRuby) named
`mgem`
that help you to
manage
`mrbgems`
. Try
`gem install mgem`
.
`mgem`
can show you the list
of registered
`mrbgems`
.
See doc/mrbgems/README.md for more option about mrbgems.
See doc/mrbgems/README.md for more option about mrbgems.
### Mrbtest
### Mrbtest
...
@@ -327,6 +356,10 @@ root directory. The structure of this directory will look like this:
...
@@ -327,6 +356,10 @@ root directory. The structure of this directory will look like this:
+- build
+- build
|
|
+- presym <- List of preallocated symbolx
|
+- presym.inc <- C source file for preallocated symbols
|
+- host
+- host
|
|
+- bin <- Binaries (mirb, mrbc and mruby)
+- bin <- Binaries (mirb, mrbc and mruby)
...
@@ -378,6 +411,10 @@ In case of a cross-compilation to *i386* the *build* directory structure looks
...
@@ -378,6 +411,10 @@ In case of a cross-compilation to *i386* the *build* directory structure looks
like this:
like this:
+- build
+- build
|
+- presym <- List of preallocated symbolx
|
+- presym.inc <- C source file for preallocated symbols
|
|
+- host
+- host
| |
| |
...
...
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