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
6844ef71
Commit
6844ef71
authored
Apr 06, 2021
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix heading level in `doc/guides/link.md` [ci skip]
parent
1f03d34f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
doc/guides/link.md
doc/guides/link.md
+7
-8
No files found.
doc/guides/link.md
View file @
6844ef71
Linking `libmruby` to your application
# Linking `libmruby` to your application
===
You have two ways to link
`libmruby`
to your application.
You have two ways to link
`libmruby`
to your application.
*
using executable gem.
*
using executable gem.
*
using normal compilation process
*
using normal compilation process
# Executable Gems
#
#
Executable Gems
If your application is relatively small,
`mrbgem`
is easier way to
If your application is relatively small,
`mrbgem`
is easier way to
create the executable. By tradition, the gem name start with
create the executable. By tradition, the gem name start with
`mruby-bin-`
, e.g.
`mruby-bin-debugger`
.
`mruby-bin-`
, e.g.
`mruby-bin-debugger`
.
## `mrbgem.rake` file
##
#
`mrbgem.rake` file
The executable name is specified in
`mrbgem.rake`
file at the top of
The executable name is specified in
`mrbgem.rake`
file at the top of
your
`mrbgem`
directory.
your
`mrbgem`
directory.
...
@@ -26,7 +25,7 @@ MRuby::Gem::Specification.new('mruby-bin-example') do |spec|
...
@@ -26,7 +25,7 @@ MRuby::Gem::Specification.new('mruby-bin-example') do |spec|
end
end
```
```
## Source tree structure
##
#
Source tree structure
The source file for the gem executable should be in
The source file for the gem executable should be in
`<gem-name>/tools/<bin-name>`
. Currently, we support C or C++ source code
`<gem-name>/tools/<bin-name>`
. Currently, we support C or C++ source code
...
@@ -34,14 +33,14 @@ The source file for the gem executable should be in
...
@@ -34,14 +33,14 @@ The source file for the gem executable should be in
supported. Put the functionality in the different gem and specify dependency to
supported. Put the functionality in the different gem and specify dependency to
it in
`mrbgem.rake`
.
it in
`mrbgem.rake`
.
# Normal compilation process
#
#
Normal compilation process
The
`libmruby`
is a normal library so that you can just link it to your
The
`libmruby`
is a normal library so that you can just link it to your
application. Specify proper compiler options (
`-I`
etc.) and linker options
application. Specify proper compiler options (
`-I`
etc.) and linker options
(
`-Lmruby`
etc.) to compile and link your application. Specify those options in
(
`-Lmruby`
etc.) to compile and link your application. Specify those options in
your build script (e.g.
`Makefile`
).
your build script (e.g.
`Makefile`
).
## Compiler options
##
#
Compiler options
You need to specify compiler options that are compatible to mruby configuration,
You need to specify compiler options that are compatible to mruby configuration,
for example:
for example:
...
@@ -57,7 +56,7 @@ $ mruby-config --cflags
...
@@ -57,7 +56,7 @@ $ mruby-config --cflags
-std=gnu99 -g -O3 -Wall -DMRB_GC_FIXED_ARENA -I/home/matz/work/mruby/include -I/home/matz/work/mruby/build/host/include
-std=gnu99 -g -O3 -Wall -DMRB_GC_FIXED_ARENA -I/home/matz/work/mruby/include -I/home/matz/work/mruby/build/host/include
```
```
## Linker options
##
#
Linker options
Just like compiler options, you need to specify linker options that are
Just like compiler options, you need to specify linker options that are
compatible to mruby configuration.
compatible to mruby configuration.
...
...
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