Add usage documentation for mrbgems

This commit is contained in:
Daniel Bovensiepen
2012-11-24 14:33:19 +08:00
parent b6a102481a
commit e9f8736882
+14 -2
View File
@@ -3,6 +3,20 @@
mrbgems is a library manager to integrate C and Ruby extension in an easy and
standardised way into mruby.
## Usage
By default mrbgems is currently deactivated. As long as mrbgems is deactivated
there is no overhead inside of the mruby interpreter.
To activate you have to make the following changes:
* set *ENABLE_GEMS* to *true* in *$(MRUBY_ROOT)/Makefile*
* define *ENABLE_GEMS* in *$(MRUBY_ROOT)/include/mrbconf.h*
* activate GEMs in *$(MRUBY_ROOT)/mrbgems/GEMS.active*
Every activated GEM has to be listed with his absolute path in *GEMS.active*. It
is possible to point to an alternative activate file:
* set *ACTIVE_GEMS* to your customized GEM list in *$(MRUBY_ROOT)/Makefile*
## GEM Structure
The maximal GEM structure looks like this:
@@ -28,8 +42,6 @@ rules to build a *gem.a* file inside of the GEM directory. Which will be used
for integration into the normal mruby build process. *README.md* is a short
description of your GEM.
All GEMs have to be located under *$(MRUBY_ROOT)/mrbgems/g/*.
## Build process
mrbgems will call *make* to build and *make clean* to clean your GEM. You