diff --git a/ChangeLog b/ChangeLog index 732a36c88a..8ea06908cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Thu Nov 14 22:40:29 2002 Nobuyoshi Nakada + + * configure.in (LIBRUBY_A): append -static. [ruby-dev:18689] + + * configure.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): linker + argument to link static/shared library respectively. + + * Makefile.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): added. + + * bcc32/Makefile.sub, win32/Makefile.sub: ditto. + + * instruby.rb (LIBRUBY_A): install to libdir. + + * lib/mkmf.rb (link_command): link static library of ruby, or + try_run fails unless LIBRUBY_SO is installed. [ruby-dev:18646] + + * eval.c (call_trace_func): toplevel caller was missing. + [ruby-dev:18754] + + * eval.c (proc_to_s): adjust created line number. + + * parse.y (primary, do_block, brace_block): adjust line number of + block to beginning line, instead of the first statement inside + the block. + Thu Nov 14 08:23:42 2002 Yukihiro Matsumoto * math.c (math_acos): check errno after operation. ditto for diff --git a/Makefile.in b/Makefile.in index 5f51f6b91d..d36f649f95 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,6 +52,8 @@ LIBRUBY_SO = @LIBRUBY_SO@ LIBRUBY_ALIASES= @LIBRUBY_ALIASES@ LIBRUBY = @LIBRUBY@ LIBRUBYARG = @LIBRUBYARG@ +LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@ +LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@ PREP = @PREP@ @ARCHFILE@ SETUP = @@ -183,7 +185,7 @@ Makefile: $(srcdir)/Makefile.in { echo "Makefile updated, restart."; exit 1; } config.status: $(srcdir)/configure - $(SHELL) ./config.status --recheck + MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in cd $(srcdir) && $(AUTOCONF) diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index 2abd1f3470..80aa5e1137 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -132,7 +132,7 @@ ORGLIBPATH = $(LIB) #### End of system configuration section. #### -LIBRUBY_A = lib$(RUBY_INSTALL_NAME).lib +LIBRUBY_A = $(RUBY_SO_NAME)-static.lib LIBRUBY_SO = $(RUBY_SO_NAME).dll LIBRUBY = $(RUBY_SO_NAME).lib LIBRUBYARG = $(LIBRUBY) @@ -350,11 +350,13 @@ s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t -s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t +s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t -s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t +s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t +s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A),;t t +s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t s,@SOLIBS@,$(SOLIBS),;t t s,@DLDLIBS@,$(DLDLIBS),;t t s,@ENABLE_SHARED@,yes,;t t @@ -392,7 +394,7 @@ $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res $(LIBRUBY_A): $(OBJS) @-if exist $@ del $@ - $(AR) $(ARFLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) "$@" $(OBJS) # $(LIBRUBY): $(LIBRUBY_SO) # implib $@ $(LIBRUBY_SO) diff --git a/configure.in b/configure.in index 7397bf9837..1db8649cd4 100644 --- a/configure.in +++ b/configure.in @@ -974,7 +974,7 @@ if test "$fat_binary" = yes ; then fi if test x"$cross_compiling" = xyes; then - MINIRUBY="${RUBY-ruby} -I`pwd` -rfake" + test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake" PREP=fake.rb else MINIRUBY='./miniruby$(EXEEXT)' @@ -984,9 +984,10 @@ AC_SUBST(MINIRUBY) AC_SUBST(PREP) FIRSTMAKEFILE="" -LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a' +LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a' LIBRUBY='$(LIBRUBY_A)' -LIBRUBYARG='-l$(RUBY_INSTALL_NAME)' +LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static' +LIBRUBYARG='$(LIBRUBYARG_STATIC)' SOLIBS= case "$target_os" in @@ -1010,7 +1011,8 @@ AC_ARG_ENABLE(shared, [enable_shared=$enableval]) if test "$enable_shared" = 'yes'; then LIBRUBY='$(LIBRUBY_SO)' - LIBRUBYARG='-l$(RUBY_SO_NAME)' + LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)' + LIBRUBYARG='$(LIBRUBYARG_SHARED)' CFLAGS="$CFLAGS $CCDLFLAGS" ENABLE_SHARED=yes if test "$rb_cv_binary_elf" = yes; then @@ -1040,7 +1042,7 @@ if test "$enable_shared" = 'yes'; then SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)' LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' - LIBRUBYARG='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)' + LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)' if test "$rb_cv_binary_elf" = yes; then # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so' else # a.out platforms @@ -1067,7 +1069,7 @@ if test "$enable_shared" = 'yes'; then LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry' ARCHFILE="ruby.imp" fi - LIBRUBYARG='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so' + LIBRUBYARG_SHARED='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so' SOLIBS='-lm -lc' ;; beos*) @@ -1158,7 +1160,6 @@ case "$target_os" in LIBRUBY='lib$(RUBY_SO_NAME).a' fi LIBRUBY_ALIASES='' - LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a' FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in SOLIBS='$(LIBS)' ;; @@ -1177,6 +1178,8 @@ AC_SUBST(LIBRUBY_SO) AC_SUBST(LIBRUBY_ALIASES) AC_SUBST(LIBRUBY) AC_SUBST(LIBRUBYARG) +AC_SUBST(LIBRUBYARG_STATIC) +AC_SUBST(LIBRUBYARG_SHARED) AC_SUBST(SOLIBS) AC_SUBST(DLDLIBS) AC_SUBST(ENABLE_SHARED) diff --git a/eval.c b/eval.c index 3e9548d757..79cde66aa0 100644 --- a/eval.c +++ b/eval.c @@ -2103,6 +2103,7 @@ call_trace_func(event, node, self, id, klass) if (node) { ruby_current_node = node; + ruby_frame->node = node; ruby_sourcefile = node->nd_file; ruby_sourceline = nd_line(node); } @@ -2324,7 +2325,7 @@ rb_eval(self, n) if (trace_func) { call_trace_func("line", node, self, ruby_frame->last_func, - ruby_frame->last_class); + ruby_frame->last_class); } if (RTEST(rb_eval(self, node->nd_cond))) { node = node->nd_body; @@ -6686,17 +6687,18 @@ proc_to_s(self, other) VALUE self, other; { struct BLOCK *data; + NODE *node; char *cname = rb_class2name(CLASS_OF(self)); const int w = (SIZEOF_LONG * CHAR_BIT) / 4; long len = strlen(cname)+6+w; /* 6:tags 16:addr */ VALUE str; Data_Get_Struct(self, struct BLOCK, data); - if (data->body) { - len += strlen(data->body->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3; + if ((node = data->frame.node) || (node = data->body)) { + len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3; str = rb_str_new(0, len); sprintf(RSTRING(str)->ptr, "#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->tag, - data->body->nd_file, nd_line(data->body)); + node->nd_file, nd_line(node)); } else { str = rb_str_new(0, len); diff --git a/instruby.rb b/instruby.rb index 84aa430d47..8ab84ad93e 100644 --- a/instruby.rb +++ b/instruby.rb @@ -81,7 +81,7 @@ if rubyw_install_name and !rubyw_install_name.empty? end Installer.install dll, bindir, 0755, true if enable_shared and dll != lib Installer.install lib, libdir, 0555, true unless lib == arc -Installer.install arc, archlibdir, 0644, true +Installer.install arc, libdir, 0644, true Installer.install "config.h", archlibdir, 0644, true Installer.install "rbconfig.rb", archlibdir, 0644, true if CONFIG["ARCHFILE"] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 8566d3da3a..33ab04c7cb 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -211,7 +211,7 @@ def link_command(ldflags, opt="", libpath=$LIBPATH) 'LDFLAGS' => "#$LDFLAGS #{ldflags}", 'LIBPATH' => libpathflag(libpath), 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", - 'LIBS' => "#$LIBRUBYARG #{opt} #$LIBS") + 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS") end def cc_command(opt="") @@ -558,6 +558,10 @@ VPATH = $(srcdir) end mk << %{ CC = #{CONFIG['CC']} +LIBRUBY = #{CONFIG['LIBRUBY']} +LIBRUBY_A = #{CONFIG['LIBRUBY_A']} +LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED +LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC CFLAGS = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS} @@ -774,6 +778,8 @@ def init_mkmf(config = CONFIG) $OBJEXT = config["OBJEXT"].dup $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}" $LIBRUBYARG = config['LIBRUBYARG'] + $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC'] + $LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED'] $LIBPATH = [] $objs = nil diff --git a/parse.y b/parse.y index 5b8417f51f..3aef278141 100644 --- a/parse.y +++ b/parse.y @@ -1302,10 +1302,14 @@ primary : literal $$ = NEW_VCALL($1); } | kBEGIN + { + $1 = ruby_sourceline; + } bodystmt kEND { - $$ = NEW_BEGIN($2); + $$ = NEW_BEGIN($3); + nd_set_line($$, $1); } | tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} ')' { @@ -1589,22 +1593,27 @@ opt_block_var : none do_block : kDO_BLOCK { $$ = dyna_push(); + $1 = ruby_sourceline; } opt_block_var compstmt kEND { $$ = NEW_ITER($3, 0, $4); - fixpos($$, $3?$3:$4); + nd_set_line($$, $1); dyna_pop($2); } - | tLBRACE_ARG {$$ = dyna_push();} + | tLBRACE_ARG + { + $$ = dyna_push(); + $1 = ruby_sourceline; + } opt_block_var compstmt '}' { $$ = NEW_ITER($3, 0, $4); - fixpos($$, $3?$3:$4); + nd_set_line($$, $1); dyna_pop($2); } @@ -1661,23 +1670,25 @@ method_call : operation paren_args brace_block : '{' { $$ = dyna_push(); + $1 = ruby_sourceline; } opt_block_var compstmt '}' { $$ = NEW_ITER($3, 0, $4); - fixpos($$, $4); + nd_set_line($$, $1); dyna_pop($2); } | kDO { $$ = dyna_push(); + $1 = ruby_sourceline; } opt_block_var compstmt kEND { $$ = NEW_ITER($3, 0, $4); - fixpos($$, $4); + nd_set_line($$, $1); dyna_pop($2); } ; diff --git a/win32/Makefile.sub b/win32/Makefile.sub index bcf0d8fa5d..0164910437 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -121,7 +121,7 @@ ORGLIBPATH = $(LIB) #### End of system configuration section. #### -LIBRUBY_A = lib$(RUBY_INSTALL_NAME).lib +LIBRUBY_A = $(RUBY_SO_NAME)-static.lib LIBRUBY_SO = $(RUBY_SO_NAME).dll LIBRUBY = $(RUBY_SO_NAME).lib LIBRUBYARG = $(LIBRUBY) @@ -345,11 +345,13 @@ s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t -s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t +s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t -s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t +s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t +s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A),;t t +s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t s,@SOLIBS@,$(SOLIBS),;t t s,@DLDLIBS@,$(DLDLIBS),;t t s,@ENABLE_SHARED@,yes,;t t