Permalink
Browse files

* 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.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 20f5f48 commit 2432c5ef97a296cde957cca6d1e7a7f1c5c6b419 @nobu nobu committed Nov 14, 2002
Showing with 80 additions and 27 deletions.
  1. +25 −0 ChangeLog
  2. +3 −1 Makefile.in
  3. +6 −4 bcc32/Makefile.sub
  4. +10 −7 configure.in
  5. +6 −4 eval.c
  6. +1 −1 instruby.rb
  7. +7 −1 lib/mkmf.rb
  8. +17 −6 parse.y
  9. +5 −3 win32/Makefile.sub
View
@@ -1,3 +1,28 @@
+Thu Nov 14 22:40:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * 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 <matz@ruby-lang.org>
* math.c (math_acos): check errno after operation. ditto for
View
@@ -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)
View
@@ -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)
View
@@ -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)
View
10 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);
View
@@ -81,7 +81,7 @@ def makelink(orig, link, verbose = false)
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"]
View
@@ -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 @@ def configuration(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
View
23 parse.y
@@ -1302,10 +1302,14 @@ primary : literal
$$ = NEW_VCALL($1);
}
| kBEGIN
+ {
+ $<num>1 = ruby_sourceline;
+ }
bodystmt
kEND
{
- $$ = NEW_BEGIN($2);
+ $$ = NEW_BEGIN($3);
+ nd_set_line($$, $<num>1);
}
| tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} ')'
{
@@ -1589,22 +1593,27 @@ opt_block_var : none
do_block : kDO_BLOCK
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt
kEND
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $3?$3:$4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
- | tLBRACE_ARG {$<vars>$ = dyna_push();}
+ | tLBRACE_ARG
+ {
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
+ }
opt_block_var
compstmt
'}'
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $3?$3:$4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
@@ -1661,23 +1670,25 @@ method_call : operation paren_args
brace_block : '{'
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt '}'
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
| kDO
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt kEND
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
;
View
@@ -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

0 comments on commit 2432c5e

Please sign in to comment.