Skip to content

Commit

Permalink
* configure.in (rubygems): add --disable-rubygems option.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 11, 2011
1 parent c7f86bb commit 020dc4b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
Fri Feb 11 12:03:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>

* configure.in (rubygems): add --disable-rubygems option.

Fri Feb 11 11:39:03 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>

* template/fake.rb.in (CROSS_COMPILING): get rid of NameError.
Expand Down
2 changes: 2 additions & 0 deletions Makefile.in
Expand Up @@ -89,6 +89,8 @@ XRUBY_LIBDIR = @XRUBY_LIBDIR@
XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@

DEFAULT_PRELUDES = $(@USE_RUBYGEMS@_GEM_PRELUDE)

#### End of system configuration section. ####

MAJOR= @MAJOR@
Expand Down
5 changes: 4 additions & 1 deletion common.mk
Expand Up @@ -104,7 +104,10 @@ OBJS = $(EXPORTOBJS) prelude.$(OBJEXT)

GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)

PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(srcdir)/gem_prelude.rb
PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
GEM_PRELUDE = $(srcdir)/gem_prelude.rb
YES_GEM_PRELUDE = $(GEM_PRELUDE)
NO_GEM_PRELUDE =
PRELUDES = prelude.c miniprelude.c
GOLFPRELUDES = golf_prelude.c

Expand Down
11 changes: 11 additions & 0 deletions configure.in
Expand Up @@ -2836,6 +2836,17 @@ if test -z "$MANTYPE"; then
fi
AC_SUBST(MANTYPE)

AC_ARG_ENABLE(rubygems,
AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
[enable_rubygems="$enableval"], [enable_rubygems=yes])
if test x"$enable_rubygems" = xno; then
AC_DEFINE(DISABLE_RUBYGEMS, 1)
USE_RUBYGEMS=NO
else
USE_RUBYGEMS=YES
fi
AC_SUBST(USE_RUBYGEMS)

arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
AS_MKDIR_P("${arch_hdrdir}")
config_h="${arch_hdrdir}/config.h"
Expand Down
3 changes: 3 additions & 0 deletions ruby.c
Expand Up @@ -111,6 +111,9 @@ cmdline_options_init(struct cmdline_options *opt)
opt->src.enc.index = src_encoding_index;
opt->ext.enc.index = -1;
opt->intern.enc.index = -1;
#if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
opt->disable |= DISABLE_BIT(gems);
#endif
return opt;
}

Expand Down
2 changes: 1 addition & 1 deletion test/ruby/envutil.rb
Expand Up @@ -197,6 +197,6 @@ class << self
CONFIG['bindir'] = dir
CONFIG['ruby_install_name'] = name
CONFIG['RUBY_INSTALL_NAME'] = name
Gem::ConfigMap[:bindir] = dir if defined?(Gem)
Gem::ConfigMap[:bindir] = dir if defined?(Gem::ConfigMap)
end
end
6 changes: 6 additions & 0 deletions win32/Makefile.sub
Expand Up @@ -276,6 +276,12 @@ XRUBY = $(RUNRUBY)
!ifndef RUBY
RUBY = ruby
!endif
!if "$(USE_RUBYGEMS)" == "NO"
DEFAULT_PRELUDES = $(NO_GEM_PRELUDE)
!else
DEFAULT_PRELUDES = $(YES_GEM_PRELUDE)
!endif

MAKEDIRS = $(MINIRUBY) -run -e mkdir -- -p

!if !defined(STACK)
Expand Down
12 changes: 12 additions & 0 deletions win32/configure.bat
Expand Up @@ -26,6 +26,8 @@ if "%1" == "--enable-win95" goto :enable-win95
if "%1" == "--disable-win95" goto :disable-win95
if "%1" == "--enable-debug-env" goto :enable-debug-env
if "%1" == "--disable-debug-env" goto :disable-debug-env
if "%1" == "--enable-rubygems" goto :enable-rubygems
if "%1" == "--disable-rubygems" goto :disable-rubygems
if "%1" == "--extout" goto :extout
if "%1" == "--path" goto :path
if "%1" == "--with-baseruby" goto :baseruby
Expand Down Expand Up @@ -123,6 +125,16 @@ goto :loop
echo>>confargs.tmp %1 \
shift
goto :loop
:enable-rubygems
echo>> ~tmp~.mak "USE_RUBYGEMS=YES" \
echo>>confargs.tmp %1 \
shift
goto :loop
:disable-rubygems
echo>> ~tmp~.mak "USE_RUBYGEMS=NO" \
echo>>confargs.tmp %1 \
shift
goto :loop
:ntver
echo>> ~tmp~.mak "NTVER=%~2" \
echo>>confargs.tmp %1=%2 \
Expand Down

0 comments on commit 020dc4b

Please sign in to comment.