2 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto f78ac530c8 amalgam.rb: support gems with core-affecting defines
Gems like mruby-task add preprocessor defines (MRB_USE_TASK_SCHEDULER)
that affect mrb_state structure. The amalgamation generator now detects
these defines from the build configuration and adds them at the top of
mruby.h before struct definitions are encountered.

Supported define patterns: MRB_USE_*, MRB_UTF8_*, HAVE_MRUBY_*

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 17:35:31 +09:00
Yukihiro "Matz" Matsumoto d995ca2910 build: add amalgamation support via rake amalgam task
Add ability to generate combined mruby.h and mruby.c files for
single-file embedding, similar to SQLite's amalgamation.

Usage: rake amalgam
Output: build/<target>/amalgam/mruby.{h,c}

Features:
- Headers concatenated in dependency order with guards stripped
- Sources concatenated with proper ordering (core, gems, mrblib)
- X-macro headers (ops.h) inlined at each include point
- Local includes automatically inlined
- Handles both src/ and core/ gem directory conventions

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-02 08:38:51 +09:00