Files
Yukihiro "Matz" Matsumoto 06d236d535 mruby-bin-config: register installer in products instead of bins
`build.bins` is for compiled binaries with bare names; entries are
fed through `exefile()` in `tasks/bin.rake`, which appends
`exts.executable` (e.g. `.exe`) when no extension is present.

When `ENV['OS']` is not `Windows_NT` but the toolchain has
`exts.executable=".exe"` (e.g. cross builds, or environments where
`OS` is unset under visualcpp), `mruby-bin-config` ended up with a
file task at `.../mruby-config` while rake asked for
`.../mruby-config.exe`, aborting with "Don't know how to build task".

Skip the `bins` path and call `build.define_installer` directly with
`mruby_config_path`, mirroring the existing `iscross` branch. The
file task path now always matches the script content's extension
(`.bat` on Windows, no extension elsewhere).

close #6807, reported by UENO, M. (@eunos-1128).

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-25 19:57:44 +09:00
..
2023-09-17 17:48:36 +09:00

mruby-bin-config

mruby-config outputs the configuration used to build mruby, useful for compiling C extensions.

Usage

mruby-config [switches]

Options

  • --cc - print C compiler name
  • --cflags - print flags passed to C compiler
  • --cxx - print C++ compiler name
  • --cxxflags - print flags passed to C++ compiler
  • --as - print assembler name
  • --asflags - print flags passed to assembler
  • --objc - print Objective C compiler name
  • --objcflags - print flags passed to Objective C compiler
  • --ld - print linker name
  • --ldflags - print flags passed to linker
  • --ldflags-before-libs - print flags passed to linker before linked libraries
  • --libs - print linked libraries
  • --libmruby-path - print libmruby path
  • --help - print help

Examples

# Get C compiler
mruby-config --cc

# Get compiler flags for building extensions
mruby-config --cflags

# Compile a C extension
gcc $(mruby-config --cflags) -c extension.c

# Link with mruby
gcc extension.o $(mruby-config --ldflags) $(mruby-config --libs)

License

MIT License - see the mruby LICENSE file.