summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.in5
-rw-r--r--eval.c18
-rw-r--r--ext/tcltklib/extconf.rb16
-rw-r--r--intern.h1
-rw-r--r--parse.y6
-rw-r--r--variable.c4
7 files changed, 45 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index c3876ae2156..41f225b564a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 23 03:06:25 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * variable.c (rb_autoload_load): should not require already
+ provided features.
+
Fri Sep 22 15:46:21 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
* lib/net/http.rb: too early parameter expantion in string.
diff --git a/configure.in b/configure.in
index 0e3d27b0da6..023ede70802 100644
--- a/configure.in
+++ b/configure.in
@@ -913,8 +913,9 @@ RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${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=`eval "echo ${SITEDIR}"`
+ [sitedir=$withval],
+ [sitedir=`eval "echo ${SITEDIR}"`])
+RUBY_SITE_LIB_PATH="${sitedir}"
RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}"
AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}")
diff --git a/eval.c b/eval.c
index f42c86cec23..770dd920ffa 100644
--- a/eval.c
+++ b/eval.c
@@ -5025,8 +5025,9 @@ static VALUE rb_features;
static st_table *loading_tbl;
static int
-rb_provided(feature)
+rb_feature_p(feature, wait)
const char *feature;
+ int wait;
{
VALUE *p, *pend;
char *f;
@@ -5045,7 +5046,8 @@ rb_provided(feature)
return Qtrue;
}
if (strcmp(f+len, ".rb") == 0) {
- goto load_wait;
+ if (wait) goto load_wait;
+ return Qtrue;
}
}
p++;
@@ -5070,6 +5072,13 @@ rb_provided(feature)
return Qtrue;
}
+int
+rb_provided(feature)
+ const char *feature;
+{
+ return rb_feature_p(feature, Qfalse);
+}
+
void
rb_provide(feature)
const char *feature;
@@ -5088,7 +5097,7 @@ rb_provide(feature)
strcpy(ext, ".so");
feature = buf;
}
- if (rb_provided(feature)) return;
+ if (rb_feature_p(feature, Qtrue)) return;
rb_ary_push(rb_features, rb_str_new2(feature));
}
@@ -5102,7 +5111,8 @@ rb_f_require(obj, fname)
volatile int safe = ruby_safe_level;
Check_SafeStr(fname);
- if (rb_provided(RSTRING(fname)->ptr)) return Qfalse;
+ if (rb_feature_p(RSTRING(fname)->ptr, Qtrue))
+ return Qfalse;
ext = strrchr(RSTRING(fname)->ptr, '.');
if (ext) {
feature = file = RSTRING(fname)->ptr;
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index 58f2708c791..c958755c6ef 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -18,10 +18,16 @@ tcllib = with_config("tcllib")
stubs = enable_config("tcltk_stubs") || with_config("tcltk_stubs")
def find_tcl(tcllib, stubs)
- paths = ["/usr/local/lib", "/usr/pkg"]
+ paths = ["/usr/local/lib", "/usr/pkg", "/usr/lib"]
func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable"
if tcllib
find_library(tcllib, func, *paths)
+ elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin/
+ find_library("tcl", func, *paths) or
+ find_library("tcl83", func, *paths) or
+ find_library("tcl82", func, *paths) or
+ find_library("tcl80", func, *paths) or
+ find_library("tcl76", func, *paths)
else
find_library("tcl", func, *paths) or
find_library("tcl8.3", func, *paths) or
@@ -32,10 +38,16 @@ def find_tcl(tcllib, stubs)
end
def find_tk(tklib, stubs)
- paths = ["/usr/local/lib", "/usr/pkg"]
+ paths = ["/usr/local/lib", "/usr/pkg", "/usr/lib"]
func = stubs ? "Tk_InitStubs" : "Tk_Init"
if tklib
find_library(tklib, func, *paths)
+ elsif RUBY_PLATFORM =~ /mswin32|mingw|cygwin/
+ find_library("tk", func, *paths) or
+ find_library("tk83", func, *paths) or
+ find_library("tk82", func, *paths) or
+ find_library("tk80", func, *paths) or
+ find_library("tk42", func, *paths)
else
find_library("tk", func, *paths) or
find_library("tk8.3", func, *paths) or
diff --git a/intern.h b/intern.h
index d651b408c4f..6fe2783f232 100644
--- a/intern.h
+++ b/intern.h
@@ -132,6 +132,7 @@ VALUE rb_obj_instance_eval _((int, VALUE*, VALUE));
void rb_load _((VALUE, int));
void rb_load_protect _((VALUE, int, int*));
void rb_jump_tag _((int)) NORETURN;
+int rb_provided _((const char*));
void rb_provide _((const char*));
VALUE rb_f_require _((VALUE, VALUE));
void rb_obj_call_init _((VALUE, int, VALUE*));
diff --git a/parse.y b/parse.y
index cf0687609a2..85cc49bcebf 100644
--- a/parse.y
+++ b/parse.y
@@ -1204,12 +1204,13 @@ primary : literal
class_nest++;
cref_push();
local_push();
+ $<num>$ = ruby_sourceline;
}
compstmt
kEND
{
$$ = NEW_CLASS($2, $5, $3);
- fixpos($$, $3);
+ nd_set_line($$, $<num>4);
local_pop();
cref_pop();
class_nest--;
@@ -1236,12 +1237,13 @@ primary : literal
class_nest++;
cref_push();
local_push();
+ $<num>$ = ruby_sourceline;
}
compstmt
kEND
{
$$ = NEW_MODULE($2, $4);
- fixpos($$, $4);
+ nd_set_line($$, $<num>3);
local_pop();
cref_pop();
class_nest--;
diff --git a/variable.c b/variable.c
index cd9fe0d48eb..871f715d03e 100644
--- a/variable.c
+++ b/variable.c
@@ -1053,6 +1053,10 @@ rb_autoload_load(id)
VALUE module;
st_delete(autoload_tbl, &id, &modname);
+ if (rb_provided(modname)) {
+ free(modname);
+ return;
+ }
module = rb_str_new2(modname);
free(modname);
FL_UNSET(module, FL_TAINT);