summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Rakefile4
-rw-r--r--doc/mrbgems/README.md5
-rw-r--r--include/mrbconf.h4
3 files changed, 11 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index 029016aa2..a1c2e9441 100644
--- a/Rakefile
+++ b/Rakefile
@@ -36,6 +36,10 @@ end
LDFLAGS = [ENV['LDFLAGS']]
LIBS = [ENV['LIBS'] || '-lm']
+if !ENABLE_GEMS
+ CFLAGS << "-DDISABLE_GEMS"
+end
+
CFLAGS << "-Wall" << "-Werror-implicit-function-declaration" << "-I#{MRUBY_ROOT}/include"
if ENV['OS'] == 'Windows_NT'
MAKE_FLAGS = "--no-print-directory CC=#{CC} LL=#{LL} AR=#{AR} YACC=#{YACC} CFLAGS=\"#{CFLAGS.join(' ')}\" LDFLAGS=\"#{LDFLAGS.join(' ')}\" LIBS=\"#{LIBS.join(' ')}\" ENABLE_GEMS=\"#{ENABLE_GEMS}\" MRUBY_ROOT=\"#{MRUBY_ROOT}\""
diff --git a/doc/mrbgems/README.md b/doc/mrbgems/README.md
index 30bd28c01..0eaaad6bf 100644
--- a/doc/mrbgems/README.md
+++ b/doc/mrbgems/README.md
@@ -10,9 +10,12 @@ 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*
-* comment out ```DISABLE_GEMS``` in *$(MRUBY_ROOT)/include/mrbconf.h*
* activate GEMs in *$(MRUBY_ROOT)/mrbgems/GEMS.active*
+Notice that we do not need to comment out ```DISABLE_GEMS```
+in *$(MRUBY_ROOT)/include/mrbconf.h*, since this flag will now be included as
+a command line flag in *$(MRUBY_ROOT)/Rakefile*.
+
Every activated GEM has to be listed in *GEMS.active*. You have to point to
the GEM directory absolute or relative (based on *mrbgems/g*). It is possible
to point to an alternative activate file:
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 12be661f7..80c8bd6fa 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -50,7 +50,9 @@
//#define DISABLE_TIME /* Time class */
//#define DISABLE_STRUCT /* Struct class */
//#define DISABLE_STDIO /* use of stdio */
-#define DISABLE_GEMS /* Package Manager mrbgems */
+
+/* Now DISABLE_GEMS is added as a command line flag in Rakefile, */
+/* we do not need to set it here. */
#undef HAVE_UNISTD_H /* WINDOWS */
#define HAVE_UNISTD_H /* LINUX */