diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-29 11:32:46 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-29 11:49:05 +0900 |
| commit | 33742d941ff3e8e361c6d3a36071765b686cb94c (patch) | |
| tree | 559479c20b7efe532c4712090446b38de4f63dc4 /doc | |
| parent | c1ad4c42616943c25a2f9a17626e820aea6a31b7 (diff) | |
| download | mruby-33742d941ff3e8e361c6d3a36071765b686cb94c.tar.gz mruby-33742d941ff3e8e361c6d3a36071765b686cb94c.zip | |
Move `build_config.rb` -> `build_config/default.rb`; ref #5098
In addition, update the documents referring `build_config.rb` which is
no longer used. The new `build_config.rb` describes the new configuration
structure in the comment.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guides/compile.md | 41 | ||||
| -rw-r--r-- | doc/guides/mrbgems.md | 17 |
2 files changed, 30 insertions, 28 deletions
diff --git a/doc/guides/compile.md b/doc/guides/compile.md index ad57970e3..ab774a633 100644 --- a/doc/guides/compile.md +++ b/doc/guides/compile.md @@ -24,24 +24,26 @@ Optional: ## Build -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: +To compile `mruby` with the default build configuration, just invoke `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`. + +You can specify your owne configration file by the `MRUBY_CONFIG` environment +variable (you can use `CONFIG` for shorthand for `MRUBY_CONFIG`). If the path +doesn't exist, *build_config/${MRUBY_CONFIG}.rb* is used. The default +configuration is defined in the `build_config/default_config.rb` file. + +Those build configuration files contain the build configurationof mruby, for +example: + ```ruby MRuby::Build.new do |conf| toolchain :gcc end ``` -All tools necessary to compile mruby can be set or modified here. In case -you want to maintain an additional *build_config.rb* you can define a -customized path using the *$MRUBY_CONFIG* environment variable. If the -path doesn't exist, *build_config/${MRUBY_CONFIG}.rb* is used. - -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`. +All tools necessary to compile mruby can be set or modified here. ## Build Configuration @@ -306,11 +308,11 @@ When debugging mode is enabled ## Cross-Compilation -mruby can also be cross-compiled from one platform to another. To -achieve this the *build_config.rb* needs to contain an instance of -`MRuby::CrossBuild`. This instance defines the compilation -tools and flags for the target platform. An example could look -like this: +mruby can also be cross-compiled from one platform to another. To achieve +cross-compilation, the build configuration needs to contain an instance of +`MRuby::CrossBuild`. This instance defines the compilation tools and flags +for the target platform. An example could look like this: + ```ruby MRuby::CrossBuild.new('32bit') do |conf| toolchain :gcc @@ -320,8 +322,9 @@ MRuby::CrossBuild.new('32bit') do |conf| end ``` -All configuration options of `MRuby::Build` can also be used -in `MRuby::CrossBuild`. +All configuration options of `MRuby::Build` can also be used in +`MRuby::CrossBuild`. You can find examples under the *build_config* +directory. ### Mrbtest in Cross-Compilation diff --git a/doc/guides/mrbgems.md b/doc/guides/mrbgems.md index ffbf17f26..4246587ce 100644 --- a/doc/guides/mrbgems.md +++ b/doc/guides/mrbgems.md @@ -5,16 +5,15 @@ standardised way into mruby. ## Usage -By default mrbgems is currently deactivated. As soon as you add a GEM to your -build configuration (i.e. *build_config.rb*), mrbgems will be activated and the -extension integrated. +You have to activate mrbgems explicitly in your build configuration. To add +a GEM, add the following line to your build configuration file, for example: -To add a GEM into the *build_config.rb* add the following line for example: ```ruby conf.gem '/path/to/your/gem/dir' ``` You can also use a relative path which would be relative from the mruby root: + ```ruby conf.gem 'examples/mrbgems/ruby_extension_example' ``` @@ -54,9 +53,9 @@ NOTE: `:bitbucket` option supports only git. Hg is unsupported in this version. There are instances when you wish to add a collection of mrbgems into mruby at once, or be able to substitute mrbgems based on configuration, without having to -add each gem to the *build_config.rb* file. A packaged collection of mrbgems +add each gem to your build configration file. A packaged collection of mrbgems is called a GemBox. A GemBox is a file that contains a list of mrbgems to load -into mruby, in the same format as if you were adding them to *build_config.rb* +into mruby, in the same format as if you were adding them to the build config via `config.gem`, but wrapped in an `MRuby::GemBox` object. GemBoxes are loaded into mruby via `config.gembox 'boxname'`. @@ -73,7 +72,7 @@ must be saved with a *.gembox* extension inside the *mrbgems* directory to to be picked up by mruby. To use this example GemBox, we save it as `custom.gembox` inside the *mrbgems* -directory in mruby, and add the following to our *build_config.rb* file inside +directory in mruby, and add the following to your build configration file inside the build block: ```ruby conf.gembox 'custom' @@ -184,12 +183,12 @@ Version requirement supports following operators: When more than one version requirements is passed, the dependency must satisfy all of it. -You can have default gem to use as dependency when it's not defined in *build_config.rb*. +You can have default gem to use as dependency when it's not defined in your build configuration. When the last argument of `add_dependency` call is `Hash`, it will be treated as default gem information. Its format is same as argument of method `MRuby::Build#gem`, expect that it can't be treated as path gem location. When a special version of dependency is required, -use `MRuby::Build#gem` in *build_config.rb* to override default gem. +use `MRuby::Build#gem` in the build configuration to override default gem. If you have conflicting GEMs use the following method: * `spec.add_conflict(gem, *requirements)` |
