Index: configure.in =================================================================== --- configure.in (revision 35862) +++ configure.in (working copy) @@ -3012,6 +3012,13 @@ until VENDOR_DIR=`eval echo \\"${dir}\\" dir="${VENDOR_DIR}" done +AC_ARG_WITH(rubygemsdir, + AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]), + [rubygemsdir=$withval]) +if test "$rubygemsdir" != ""; then + AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir") +fi + if test "${LOAD_RELATIVE+set}"; then AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX="" @@ -3072,6 +3079,7 @@ AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl AC_SUBST(sitedir)dnl AC_SUBST(vendordir)dnl +AC_SUBST(rubygemsdir)dnl configure_args=$ac_configure_args AC_SUBST(configure_args)dnl Index: version.c =================================================================== --- version.c (revision 35862) +++ version.c (working copy) @@ -88,6 +88,10 @@ const char ruby_initial_load_paths[] = RUBY_VENDOR_LIB "\0" #endif +#ifdef RUBYGEMS_DIR + RUBYGEMS_DIR "\0" +#endif + RUBY_LIB "\0" #ifdef RUBY_THIN_ARCHLIB RUBY_THIN_ARCHLIB "\0" Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 35862) +++ tool/rbinstall.rb (working copy) @@ -311,6 +311,7 @@ sitelibdir = CONFIG["sitelibdir"] sitearchlibdir = CONFIG["sitearchdir"] vendorlibdir = CONFIG["vendorlibdir"] vendorarchlibdir = CONFIG["vendorarchdir"] +rubygemsdir = CONFIG["rubygemsdir"] mandir = CONFIG["mandir", true] docdir = CONFIG["docdir", true] configure_args = Shellwords.shellwords(CONFIG["configure_args"]) @@ -498,7 +499,15 @@ end install?(:local, :comm, :lib) do prepare "library scripts", rubylibdir noinst = %w[README* *.txt *.rdoc] + noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode) + if rubygemsdir + noinst = %w[obsolete.rb] + install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode) + install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode) + install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode) + install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode) + end end install?(:local, :arch, :lib) do Index: tool/mkconfig.rb =================================================================== --- tool/mkconfig.rb (revision 35862) +++ tool/mkconfig.rb (working copy) @@ -77,6 +77,7 @@ File.foreach "config.status" do |line| when /^RUBY_SO_NAME$/; next if $so_name when /^arch$/; if val.empty? then val = arch else arch = val end when /^sitearch/; val = '$(arch)' if val.empty? + when /^rubygemsdir/; next if val.empty? end case val when /^\$\(ac_\w+\)$/; next