summaryrefslogtreecommitdiffhomepage
path: root/lib
AgeCommit message (Collapse)Author
2020-12-19Avoid using `MRuby::CrossBuild.current`dearblue
This is because `MRuby::Build.currrent` and `MRuby::CrossBuild.current` are assignments to different instance variables.
2020-12-16Guess toolchain when `MRuby::Build#toolchain` argument is omittedKOBAYASHI Shuji
2020-12-15Output build log at the time of installationKOBAYASHI Shuji
2020-12-06Call `super` before creating `host` build in `MRuby::CrossBuild#initialize`KOBAYASHI Shuji
Call `super` (`block`) ahead so that creation of the `host` build can be skipped if pre-built `mrbc` can be specified in the future. close #5213.
2020-12-05Remove unused `@endian` in `MRuby::CrossBuild#initialize`KOBAYASHI Shuji
2020-12-05Make it possible that `libmruby.a` is not createdKOBAYASHI Shuji
Previously, `libmruby.a` was created even if only `mruby-bin-mrbc` or` mruby-compiler` was specified for gem, but by specifying `disable_libmruby`, the creation of `libmruby.a` can be suppressed. ### Note The https://github.com/mruby/mruby/pull/5084#issuecomment-723521971 incompatibility seems to be difficult for users to avoid, so the original behavior has been restored. Therefore, if we need `mrbc` other than the `host` build, we need to explicitly specify `mruby-bin-mrbc` gem. Due to the above changes, `build_config/boxing.rb` etc. will not work, but I have added` mruby-bin-mrbc` to `default.gembox` to fix it. I don't think this change is a big deal because originally `mruby-compiler` was included.
2020-12-02Merge pull request #5198 from shuujii/remove-unused-Rake-rulesYukihiro "Matz" Matsumoto
Remove unused Rake rules
2020-12-01Revert "Create presym files for each build target" (58ba883e)KOBAYASHI Shuji
Due to the above changes, it may not work with the existing build configurations in cross-compilation (even if we can build without presym), therefore revert it once (ref https://github.com/mruby/mruby/pull/5202#issuecomment-735412643). Sorry for the lack of consideration.
2020-11-28Remove unused Rake rulesKOBAYASHI Shuji
Currently, the source file language in the core is C only, and C++, Objective-C, and Assembly are not used, so Rake rules for them are removed.
2020-11-26Create presym files for each build targetKOBAYASHI Shuji
Previously, presym files were always created in `build/{presym,presym.inc}`. However, this constraint is inconvenient because it is common to use multiple build configurations and build targets in a single mruby tree. Therefore, change to create presym file for each build target.
2020-11-25Allow compiler name in build log to be customizedKOBAYASHI Shuji
For example, in the case of the C++ compiler, it is output as `CXX build/host/src/gc.cxx -> build/host/src/gc.cxx.o` (FYI, in the case of `enable_cxx_abi`, it outputs `CC ...` because the option to compile as C++ is added to C compiler).
2020-11-24Merge pull request #5178 from abinoam/fix_mruby_config_settingYukihiro "Matz" Matsumoto
Fix #5177 by setting MRUBY_CONFIG early
2020-11-23Fix #5177 - set MRUBY_CONFIG earlyAbinoam Praxedes Marques Junior
2020-11-23Merge pull request #5181 from ↵Yukihiro "Matz" Matsumoto
shuujii/raise-an-exception-instead-of-exiting-when-mrbc-fails Raise an exception instead of exiting when `mrbc` fails
2020-11-23Change output condition in `_pp`KOBAYASHI Shuji
* Output even with `rake -v` (to help debugging) * Not output when `rake -s`
2020-11-23Raise an exception instead of exiting when `mrbc` failsKOBAYASHI Shuji
2020-11-22Refine build log for generated filesKOBAYASHI Shuji
* Output `GEN` log for generated files * `MRBC` log is outputted one for each `mrbc` execution #### Before this patch: ```console CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb MRBC mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ``` #### After this patch: ```console GEN build/presym GEN build/presym.inc CC src/array.c -> build/host/src/array.o (snip) GEN mrblib/*.rb -> build/host/mrblib/mrblib.c MRBC mrblib/00class.rb mrblib/10error.rb (snip) CC mrbgems/mruby-time/src/time.c -> build/host/mrbgems/mruby-time/src/time.o GEN build/host/mrbgems/mruby-time/gem_init.c MRBC mrbgems/mruby-time/mrblib/time.rb (snip) CC mrbgems/mruby-socket/test/sockettest.c -> build/host/mrbgems/mruby-socket/test/sockettest.o GEN build/host/mrbgems/mruby-socket/gem_test.c MRBC mrbgems/mruby-socket/test/addrinfo.rb MRBC mrbgems/mruby-socket/test/basicsocket.rb (snip) ```
2020-11-22Move global function for build to `lib/mruby/core_ext.rb`KOBAYASHI Shuji
Because `_pp` is originally defined in `lib/mruby/core_ext.rb`, other global functions are moved to the file.
2020-11-21Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163KOBAYASHI Shuji
| Previous Name | New Name | |------------------------------|-------------------------| | MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI | | MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION | | MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK | | MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING | | MRB_DISABLE_STDIO | MRB_NO_STDIO | | ENABLE_LINENOISE | MRB_USE_LINENOISE | | ENABLE_READLINE | MRB_USE_READLINE | | DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE | | DISABLE_GEMS | MRB_NO_GEMS | * `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed. * `MRB_` prefix is added to those without. * The previous names can also be used for compatibility.
2020-11-21Automatically enable `MRB_ENABLE_DEBUG_HOOK` if `mruby-bin-debugger` is usedKOBAYASHI Shuji
2020-11-20Move `lib/mruby-core-ext.rb` to `lib/mruby/core_ext.rb` for consistencyKOBAYASHI Shuji
2020-11-19Allow `bintest` even if build name is not `host`KOBAYASHI Shuji
2020-11-18Remove unused `MRuby::Build#enable_{bin,}test=`KOBAYASHI Shuji
The writers seem to be unnecessary because `MRuby::Build#enable_{bin,}test` are used from the beginning.
2020-11-14Scan source files only from `cdump` enabled gems.Yukihiro "Matz" Matsumoto
2020-11-14Remove unused constant in `lib/mruby/build/command.rb`KOBAYASHI Shuji
2020-11-13Simplify `MRuby::Command#_run` to avoid duplicated compilationKOBAYASHI Shuji
ref: https://github.com/mruby/mruby/pull/4959#discussion_r402086196 Compiles twice because it falls back to `build.filename(command)` when `command` fails. This process was added at 9968af4 to support `ccache gcc` etc. At that time, it seems that it was necessary because `build.filename(command)` quoted the whole `command`, but now it does not quote, so we can just run `build.filename(command)`. ### Example ```console $ echo 1 > src/a.c $ rake -v ``` #### Before this patch: ```console (snip) gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. rake aborted! (snip) ``` #### After this patch: ```console (snip) gcc -std=gnu99 -g -O3 -Wall -Wundef -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wwrite-strings -I"/mruby/mruby/include" -MMD -o "/mruby/mruby/build/host/src/a.o" -c "/mruby/mruby/src/a.c" /mruby/mruby/src/a.c:1:1: error: expected identifier or '(' 1 ^ 1 error generated. rake aborted! (snip) ```
2020-11-02Search gem from `MRUBY_ROOT` if build config is in `build_config`.Yukihiro "Matz" Matsumoto
2020-10-30Fix the condition to detect core mrbgems.Yukihiro "Matz" Matsumoto
2020-10-29Use `mrb` dump format for non core mrbgems by default.Yukihiro "Matz" Matsumoto
If you confirm the gem is cdump safe, add `spec.enable_cdump` in `mrbgem.rake` file. Some external gems e.g. `mruby-mgem-template` do not work with cdump.
2020-10-29Use clear `if` instead of `unless` for condition.Yukihiro "Matz" Matsumoto
2020-10-29Use instance variable `@dir` instead of access method `dir`.Yukihiro "Matz" Matsumoto
2020-10-29Remove `mrblib_dir` and `objs_dir` configuration from gems.Yukihiro "Matz" Matsumoto
Always use `mrblib` and 'src` for directory names.
2020-10-29The path of the gem should be relative from `MRUBY_ROOT`.Yukihiro "Matz" Matsumoto
It was relative from the directory of the build configuration file, but the document says it's relative from `MRUBY_ROOT`. When the default configuration file was `MRUBY_ROOT/build_config.rb`, it was OK for most of the cases.
2020-10-29Move `build_config.rb` -> `build_config/default.rb`; ref #5098Yukihiro "Matz" Matsumoto
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.
2020-10-29Use `Dir.glob` instead of `map`.Yukihiro "Matz" Matsumoto
2020-10-19Revert `MRUBY_TARGET` mechanism; ref #5096KOBAYASHI Shuji
* In explanation of mruby, the expression `build_config.rb` is frequently used including official documents, so I think that it will not make sense if the file is no longer used. * The `MRUBY_TARGET` mechanism seems to have little improvement, so I don't think it should be changed to avoid unnecessary confusion. * `MRUBY_TARGET` and `MRuby.targets` represent somewhat different things, so using the same term "target" is a bit confusing. The mechanism that can be written short when using a file under `build_config` (renamed from `target`) directory remains (`build_config/${MRUBY_CONFIG}.rb` is used if the path specified in `MRUBY_CONFIG` doesn't exist).
2020-10-14Avoid using C struct dump for test Ruby code.Yukihiro "Matz" Matsumoto
Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption.
2020-10-12Remove compiler feature detectionRory OConnell
2020-10-12Work around removing tmp dirRory OConnell
2020-10-12Add methods for asking about compiler featuresRory OConnell
2020-10-12Update build process for both host and cross compile.Yukihiro "Matz" Matsumoto
2020-10-12Update `Rakefile`.Yukihiro "Matz" Matsumoto
So that you can omit `host` target. Now `host-debug` works.
2020-10-12Rename `mruby_version` in the lockfile to `mruby`; close #4658Yukihiro "Matz" Matsumoto
2020-10-12Add default `host` target for cross compiling.Yukihiro "Matz" Matsumoto
You don't have to define explicit `host` build target any more.
2020-10-12Make sure `bintest` only works with `host` target.Yukihiro "Matz" Matsumoto
2020-10-12Generate C struct from `irep` instead of binary dump.Yukihiro "Matz" Matsumoto
2020-10-12Revert part of "Start GitHub Actions" (4ce3997c)KOBAYASHI Shuji
Because some changes have been overridden.
2020-10-12Start GitHub Actions; close #4903Takeshi Watanabe
2020-10-12Build process updated:Yukihiro "Matz" Matsumoto
You have to specify `TARGET` to specify a configuration, e.g. ``` rake TARGET=host-debug all test ``` When you port `mruby` to a new configuration: 1. copy an existing configuration under `target` directory 2. modify the new configuration file 3. build using the new configuration 4. send PR if you please
2020-09-17Merge pull request #5081 from wataash/d-format-commentYukihiro "Matz" Matsumoto
*.d format is version-independent