summaryrefslogtreecommitdiffhomepage
path: root/lib
AgeCommit message (Collapse)Author
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
2020-09-17*.d format is version-independentWataru Ashihara
As pointed out by @shuujii on https://github.com/mruby/mruby/pull/5079 , multi-path in single-line could be appear even with older-gcc or clang.
2020-09-17Fix skipping reading fileWataru Ashihara
2020-09-17Fix *.d parsing with gcc 9.3.0Wataru Ashihara
Before this commit: $ rake ... $ rm build/host/src/gc.o $ rake rake aborted! Don't know how to build task '/home/foo/mruby/build/host/src/gc.o' (See the list of available tasks with `rake --tasks`) ... After this commit: $ rake ... $ rm build/host/src/gc.o $ rake CC src/gc.c -> build/host/src/gc.o ... With gcc 9.3.0 on Ubuntu 20.04, build/host/src/array.d looks like: /build/host/src/array.o: /src/array.c \ /include/mruby.h /include/mrbconf.h \ /include/mruby/common.h \ ... /include/mruby/range.h \ /src/value_array.h and it has been parsed to: [ # /src/array.c missing "/include/mruby.h /include/mrbconf.h", # incorrectly parsed "/include/mruby/common.h", ... "/src/value_array.h", ] After this change, *.d will be parsed correctly. [ "/src/array.c", "/include/mruby.h", "/include/mrbconf.h", "/include/mruby/common.h", ... "/src/value_array.h", ]
2020-09-10Merge pull request #4933 from dearblue/variablesYukihiro "Matz" Matsumoto
Fix take over file scope variables with `mruby` and `mirb` command
2020-06-11Remove endian configuration methods.Yukihiro "Matz" Matsumoto
Since we made our opcode byte based, we need no endian option (`-e` and `-E`) to `mrbc`.
2020-05-26Revert part of "Start GitHub Actions" (4ce3997c)KOBAYASHI Shuji
Because some changes have been overridden.
2020-05-24Start GitHub Actions; close #4903Takeshi Watanabe
2020-04-29Sorting the list of gems at build time by namedearblue
Printing them in sorted order makes it easier to find the desired gem. But it has come to completely ignore the dependency.
2020-04-08Merged `cygwin_filename()` into `filename()` because Cygwin pathnames are in ↵mimaki
UNIX format.
2020-04-05Merge pull request #4960 from Reckordp/BuildAndroidYukihiro "Matz" Matsumoto
Validate windows by Dir testing
2020-04-04Revert part of #4959Yukihiro "Matz" Matsumoto
To prevent infinite loop on errors; reported by @shuujii
2020-04-03Helper for link window's libraryReckordp
2020-04-01build when directories and files have spacesDominic Sisneros
Modified the build to quote filenames so that it builds when files have spaces
2020-01-29Isolate top-level local variables by file scope; fix #4931dearblue
2019-12-28Use `Rake.verbose` instead of `$verbose` and `$pp_show` in build scriptsKOBAYASHI Shuji
The incompatibility that the commands of `FileUtils` origin output verbose by default due to the changes in d8a5163b and 26e6e75b is also fixed.
2019-12-27Use Rake DSL instead of commands of `FileUtils`KOBAYASHI Shuji
- Respect `--verbose(-v)` and `--dry-run(-n)` options. - Silence warnings to keyword arguments on Ruby 2.7.