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
cf8e9784
Commit
cf8e9784
authored
Jan 20, 2013
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify documentation for new build process
parent
58398338
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
144 additions
and
36 deletions
+144
-36
doc/compile/README.md
doc/compile/README.md
+144
-36
No files found.
doc/compile/README.md
View file @
cf8e9784
...
@@ -25,40 +25,155 @@ of mruby and looks like this for example:
...
@@ -25,40 +25,155 @@ of mruby and looks like this for example:
```
```
MRuby::Build.new do |conf|
MRuby::Build.new do |conf|
conf.cc = ENV['CC'] || 'gcc'
toolchain :gcc
conf.ld = ENV['LD'] || 'gcc'
conf.ar = ENV['AR'] || 'ar'
conf.cflags << (ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration))
conf.ldflags << (ENV['LDFLAGS'] || %w(-lm))
end
end
```
```
All tools necessary to compile mruby can be set or modified here.
All tools necessary to compile mruby can be set or modified here.
The following options can be configurated:
*
conf.cc (C compiler)
*
conf.ld (Linker)
*
conf.ar (Archive utility)
*
conf.cxx (C++ compiler)
*
conf.objcc (Object compiler)
*
conf.asm (Assembler)
*
conf.yacc (Parser Generator)
*
conf.gperf (Hash function Generator)
*
conf.cat (Concatenate utility)
*
conf.git (GIT content tracker)
*
conf.cflags (C compiler flags)
*
conf.ldflags (Linker flags)
*
conf.cxxflags (C++ compiler flags)
*
conf.objccflags (Object compiler flags)
*
conf.asmflags (Assembler flags)
*
conf.gem (A GEM which should be integrated - can be set several times)
*
conf.bins (Build binaries)
To compile just call
```./minirake```
inside of the mruby source root. To
To compile just call
```./minirake```
inside of the mruby source root. To
generate the test tool environment call
```./minirake test```
. To clean
generate the test tool environment call
```./minirake test```
. To clean
all build files call
```./minirake clean```
.
all build files call
```./minirake clean```
.
## Build Configuration
The following options can be configurated:
### Toolchains
A template for a specific toolchain setting:
### GCC
Toolchain configuration for the GNU C Compiler.
```
toolchain :gcc
```
### clang
Toolchain configuration based on GCC using the LLVM C Compiler clang.
```
toolchain :clang
```
### Visual Studio 2012
Toolchain configuration for Visual Studio 2012 on Windows.
```
toolchain :vs2012
```
### Binaries
Which tools should be compiled?
*
mrbc (mruby compiler)
*
mruby (mruby interpreter)
*
mirb (mruby interactive shell
```
conf.bins = %(mrbc mruby mirb)
```
### File Separator
Which file separator is used?
```
conf.file_separator = '/'
```
### C Compiler
Configuration of the C compiler binary, flags and include paths.
```
conf.cc do |cc|
cc.command = ...
cc.flags = ...
cc.include_paths = ...
cc.defines = ...
cc.option_include_path = ...
cc.option_define = ...
cc.compile_options = ...
end
```
### Linker
Configuration of the Linker binary, flags and library paths.
```
conf.linker do |linker|
linker.command = ...
linker.flags = ...
linker.libraries = ...
linker.library_paths = ....
linker.option_library = ...
linker.option_library_path = ...
linker.link_options = ...
end
```
### Archiver
Configuration of the Archiver binary and flags.
```
conf.archiver do |archiver|
archiver.command = ...
archiver.archive_options = ...
end
```
### Parser Generator
Configuration of the Parser Generator binary and flags.
```
conf.yacc do |yacc|
yacc.command = ...
yacc.compile_options = ...
end
```
### GPerf
Configuration of the GPerf binary and flags.
```
conf.gperf do |gperf|
gperf.command = ...
gperf.compile_options = ...
end
```
### File Extensions
```
conf.exts do |exts
exts.object = ...
exts.executable = ...
exts.library = ...
end
```
### Mrbgems
Integrate GEMs in the build process.
```
# Integrate GEM with additional configuration
conf.gem 'path/to/gem' do |g|
g.cc.flags << ...
end
# Integrate GEM without additional configuration
conf.gem 'path/to/another/gem'
```
### Cross-Compilation
### Cross-Compilation
mruby can also be cross-compiled from one platform to another. To
mruby can also be cross-compiled from one platform to another. To
...
@@ -68,18 +183,11 @@ tools and flags for the target platform. An example could look
...
@@ -68,18 +183,11 @@ tools and flags for the target platform. An example could look
like this for example:
like this for example:
```
```
MRuby::CrossBuild.new('i386') do |conf|
MRuby::CrossBuild.new('32bit') do |conf|
conf.cc = ENV['CC'] || 'gcc'
toolchain :gcc
conf.ld = ENV['LD'] || 'gcc'
conf.ar = ENV['AR'] || 'ar'
if ENV['OS'] == 'Windows_NT' # MinGW
conf.cc.flags << "-m32"
conf.cflags = %w(-g -O3 -Wall -Werror-implicit-function-declaration -Di386_MARK)
conf.linker.flags << "-m32
conf.ldflags = %w(-s -static)
else
conf.cflags << %w(-g -O3 -Wall -Werror-implicit-function-declaration -arch i386)
conf.ldflags << %w(-arch i386)
end
end
end
```
```
...
...
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