1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-04-12 05:06:23 +00:00
parent dc2f6b3d25
commit 861e4ba6b3
10 changed files with 87 additions and 12 deletions

View file

@ -1,3 +1,21 @@
Tue Apr 11 21:14:42 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
* config_s.dj: add @sitedir@.
* configure.in: add --with-sitedir=DIR option.
* instruby.rb: use CONFIG["sitedir"].
* lib/mkmf.rb: support 'make site-install'.
* win32/config.status: add @sitedir@.
Tue Apr 11 16:25:15 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* bignum.c (rb_big_2comp): unnecessary lvalue cast removed.
Tue Apr 11 02:25:53 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* hash.c (env_fetch): new method.
* marshal.c (marshal_dump): accepts depth = nil for unlimited depth.
Sun Apr 9 20:49:19 2000 Dave Thomas <Dave@Thomases.com>
* parse.y (str_extend): Allow class variables to be expanded.

View file

@ -69,7 +69,7 @@ rb_big_2comp(x) /* get 2's complement */
for (i=1; i<RBIGNUM(x)->len; i++) {
if (ds[i] != 0) return;
}
REALLOC_N(BDIGITS(x), USHORT, RBIGNUM(x)->len++);
REALLOC_N(RBIGNUM(x)->digits, USHORT, RBIGNUM(x)->len++);
ds = BDIGITS(x);
ds[RBIGNUM(x)->len-1] = 1;
}

View file

@ -53,4 +53,5 @@ s%@LIBRUBY_SO@%%g
s%@SOLIBS@%%g
s%@srcdir%.%g
s%@arch@%i386-djgpp%g
s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
ac_given_srcdir=.

View file

@ -817,14 +817,19 @@ test "$program_suffix" != NONE &&
RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
RUBY_LIB_PREFIX="${prefix}/lib/ruby"
RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
RUBY_SITE_LIB_PATH="${RUBY_LIB_PREFIX}/site_ruby"
RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
sitedir="${prefix}/lib/ruby/site_ruby"
AC_ARG_WITH(sitedir,
[--with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
[sitedir=$withval])
RUBY_SITE_LIB_PATH="${sitedir}"
RUBY_SITE_LIB_PATH2="${sitedir}/${MAJOR}.${MINOR}"
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
AC_SUBST(arch)dnl
AC_SUBST(sitedir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl

38
hash.c
View file

@ -336,7 +336,7 @@ rb_hash_fetch(argc, argv, hash)
if (argc > 1) {
rb_raise(rb_eArgError, "wrong # of arguments", argc);
}
return rb_yield(argv[0]);
return rb_yield(key);
}
if (argc == 1) {
rb_raise(rb_eIndexError, "key not found");
@ -918,6 +918,40 @@ rb_f_getenv(obj, name)
return Qnil;
}
static VALUE
env_fetch(argc, argv)
int argc;
VALUE *argv;
{
VALUE key, if_none;
char *nam, *env;
int len;
VALUE val;
rb_scan_args(argc, argv, "11", &key, &if_none);
nam = rb_str2cstr(key, &len);
if (strlen(nam) != len) {
rb_raise(rb_eArgError, "bad environment variable name");
}
env = getenv(nam);
if (!env) {
if (rb_iterator_p()) {
if (argc > 1) {
rb_raise(rb_eArgError, "wrong # of arguments", argc);
}
return rb_yield(key);
}
if (argc == 1) {
rb_raise(rb_eIndexError, "key not found");
}
return if_none;
}
if (strcmp(nam, "PATH") == 0 && !rb_env_path_tainted())
return rb_str_new2(env);
return rb_tainted_str_new2(env);
}
static void
path_tainted_p(path)
char *path;
@ -1434,7 +1468,9 @@ Init_Hash()
rb_extend_object(envtbl, rb_mEnumerable);
rb_define_singleton_method(envtbl,"[]", rb_f_getenv, 1);
rb_define_singleton_method(envtbl,"fetch", env_fetch, -1);
rb_define_singleton_method(envtbl,"[]=", rb_f_setenv, 2);
rb_define_singleton_method(envtbl,"store", rb_f_setenv, 2);
rb_define_singleton_method(envtbl,"each", env_each, 0);
rb_define_singleton_method(envtbl,"each_pair", env_each, 0);
rb_define_singleton_method(envtbl,"each_key", env_each_key, 0);

View file

@ -24,7 +24,7 @@ bindir = destdir+CONFIG["bindir"]
libdir = destdir+CONFIG["libdir"]
rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version
archlibdir = rubylibdir+arch
sitelibdir = destdir+CONFIG["prefix"]+"/lib/ruby/site_ruby"+version
sitelibdir = destdir+CONFIG["sitedir"]+version
sitearchlibdir = sitelibdir+arch
mandir = destdir+CONFIG["mandir"] + "/man1"
wdir = Dir.getwd

View file

@ -13,6 +13,8 @@ $config_cache = CONFIG["compile_dir"]+"/ext/config.cache"
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$archdir = $libdir+"/"+CONFIG["arch"]
$sitelibdir = CONFIG["sitedir"]+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
$sitearchdir = $sitelibdir+"/"+CONFIG["arch"]
if File.exist? $archdir + "/ruby.h"
$hdrdir = $archdir
@ -107,7 +109,7 @@ def try_run(src, opt="")
end
end
def install_rb(mfile, srcdir = nil)
def install_rb(mfile, dest, srcdir = nil)
libdir = "lib"
libdir = srcdir + "/" + libdir if srcdir
path = []
@ -120,10 +122,10 @@ def install_rb(mfile, srcdir = nil)
end
for f in dir
next if f == "."
mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir)/%s\n", f
mfile.printf "\t@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' %s/%s\n", dest, f
end
for f in path
mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s $(libdir)/%s\n", f, f
mfile.printf "\t@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0644, true)' lib/%s %s/%s\n", f, dest, f
end
end
@ -373,6 +375,8 @@ prefix = #{CONFIG["prefix"]}
exec_prefix = #{CONFIG["exec_prefix"]}
libdir = #{$libdir}
archdir = #{$archdir}
sitelibdir = #{$sitelibdir}
sitearchdir = #{$sitearchdir}
#### End of system configuration section. ####
@ -398,11 +402,21 @@ realclean: clean
install: $(archdir)/$(DLLIB)
site-install: $(sitearchdir)/$(DLLIB)
$(archdir)/$(DLLIB): $(DLLIB)
@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(archdir)
@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(archdir)/$(DLLIB)
EOMF
install_rb(mfile)
install_rb(mfile, "$(libdir)")
mfile.printf "\n"
mfile.printf <<EOMF
$(sitearchdir)/$(DLLIB): $(DLLIB)
@$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(sitearchdir)
@$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(sitearchdir)/$(DLLIB)
EOMF
install_rb(mfile, "$(sitelibdir)")
mfile.printf "\n"
if CONFIG["DLEXT"] != $OBJEXT

View file

@ -446,7 +446,7 @@ marshal_dump(argc, argv)
port = 0;
rb_scan_args(argc, argv, "12", &obj, &a1, &a2);
if (argc == 3) {
limit = NUM2INT(a2);
if (!NIL_P(a2)) limit = NUM2INT(a2);
port = a1;
}
else if (argc == 2) {

View file

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.5.3"
#define RUBY_RELEASE_DATE "2000-04-10"
#define RUBY_RELEASE_DATE "2000-04-11"
#define RUBY_VERSION_CODE 153
#define RUBY_RELEASE_CODE 20000410
#define RUBY_RELEASE_CODE 20000411

View file

@ -59,6 +59,7 @@ s%@LIBRUBY@%libruby.lib%g
s%@LIBRUBYARG@%libruby.lib%g
s%@SOLIBS@%%g
s%@arch@%i386-mswin32%g
s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
s%@configure_args@%--with-make-prog=nmake%g
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g