Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* 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...
commit 2432c5ef97a296cde957cca6d1e7a7f1c5c6b419 1 parent 20f5f48
Nobuyoshi Nakada nobu authored
25 ChangeLog
... ... @@ -1,3 +1,28 @@
  1 +Thu Nov 14 22:40:29 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
  2 +
  3 + * configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
  4 +
  5 + * configure.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): linker
  6 + argument to link static/shared library respectively.
  7 +
  8 + * Makefile.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): added.
  9 +
  10 + * bcc32/Makefile.sub, win32/Makefile.sub: ditto.
  11 +
  12 + * instruby.rb (LIBRUBY_A): install to libdir.
  13 +
  14 + * lib/mkmf.rb (link_command): link static library of ruby, or
  15 + try_run fails unless LIBRUBY_SO is installed. [ruby-dev:18646]
  16 +
  17 + * eval.c (call_trace_func): toplevel caller was missing.
  18 + [ruby-dev:18754]
  19 +
  20 + * eval.c (proc_to_s): adjust created line number.
  21 +
  22 + * parse.y (primary, do_block, brace_block): adjust line number of
  23 + block to beginning line, instead of the first statement inside
  24 + the block.
  25 +
1 26 Thu Nov 14 08:23:42 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
2 27
3 28 * math.c (math_acos): check errno after operation. ditto for
4 Makefile.in
@@ -52,6 +52,8 @@ LIBRUBY_SO = @LIBRUBY_SO@
52 52 LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
53 53 LIBRUBY = @LIBRUBY@
54 54 LIBRUBYARG = @LIBRUBYARG@
  55 +LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@
  56 +LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
55 57
56 58 PREP = @PREP@ @ARCHFILE@
57 59 SETUP =
@@ -183,7 +185,7 @@ Makefile: $(srcdir)/Makefile.in
183 185 { echo "Makefile updated, restart."; exit 1; }
184 186
185 187 config.status: $(srcdir)/configure
186   - $(SHELL) ./config.status --recheck
  188 + MINIRUBY="$(MINIRUBY)" $(SHELL) ./config.status --recheck
187 189
188 190 $(srcdir)/configure: $(srcdir)/configure.in
189 191 cd $(srcdir) && $(AUTOCONF)
10 bcc32/Makefile.sub
@@ -132,7 +132,7 @@ ORGLIBPATH = $(LIB)
132 132
133 133 #### End of system configuration section. ####
134 134
135   -LIBRUBY_A = lib$(RUBY_INSTALL_NAME).lib
  135 +LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
136 136 LIBRUBY_SO = $(RUBY_SO_NAME).dll
137 137 LIBRUBY = $(RUBY_SO_NAME).lib
138 138 LIBRUBYARG = $(LIBRUBY)
@@ -350,11 +350,13 @@ s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
350 350 s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
351 351 s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
352 352 s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
353   -s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t
  353 +s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t
354 354 s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
355 355 s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t
356 356 s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t
357   -s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t
  357 +s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t
  358 +s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A),;t t
  359 +s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
358 360 s,@SOLIBS@,$(SOLIBS),;t t
359 361 s,@DLDLIBS@,$(DLDLIBS),;t t
360 362 s,@ENABLE_SHARED@,yes,;t t
@@ -392,7 +394,7 @@ $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $(LIBRUBY_SO) $(RUBYW_INSTALL_NAME).res
392 394
393 395 $(LIBRUBY_A): $(OBJS)
394 396 @-if exist $@ del $@
395   - $(AR) $(ARFLAGS) $@ $(OBJS)
  397 + $(AR) $(ARFLAGS) "$@" $(OBJS)
396 398
397 399 # $(LIBRUBY): $(LIBRUBY_SO)
398 400 # implib $@ $(LIBRUBY_SO)
17 configure.in
@@ -974,7 +974,7 @@ if test "$fat_binary" = yes ; then
974 974 fi
975 975
976 976 if test x"$cross_compiling" = xyes; then
977   - MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
  977 + test x"$MINIRUBY" = x && MINIRUBY="${RUBY-ruby} -I`pwd` -rfake"
978 978 PREP=fake.rb
979 979 else
980 980 MINIRUBY='./miniruby$(EXEEXT)'
@@ -984,9 +984,10 @@ AC_SUBST(MINIRUBY)
984 984 AC_SUBST(PREP)
985 985
986 986 FIRSTMAKEFILE=""
987   -LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a'
  987 +LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
988 988 LIBRUBY='$(LIBRUBY_A)'
989   -LIBRUBYARG='-l$(RUBY_INSTALL_NAME)'
  989 +LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
  990 +LIBRUBYARG='$(LIBRUBYARG_STATIC)'
990 991 SOLIBS=
991 992
992 993 case "$target_os" in
@@ -1010,7 +1011,8 @@ AC_ARG_ENABLE(shared,
1010 1011 [enable_shared=$enableval])
1011 1012 if test "$enable_shared" = 'yes'; then
1012 1013 LIBRUBY='$(LIBRUBY_SO)'
1013   - LIBRUBYARG='-l$(RUBY_SO_NAME)'
  1014 + LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
  1015 + LIBRUBYARG='$(LIBRUBYARG_SHARED)'
1014 1016 CFLAGS="$CFLAGS $CCDLFLAGS"
1015 1017 ENABLE_SHARED=yes
1016 1018 if test "$rb_cv_binary_elf" = yes; then
@@ -1040,7 +1042,7 @@ if test "$enable_shared" = 'yes'; then
1040 1042 SOLIBS='$(LIBS)'
1041 1043 LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
1042 1044 LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
1043   - LIBRUBYARG='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
  1045 + LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
1044 1046 if test "$rb_cv_binary_elf" = yes; then # ELF platforms
1045 1047 LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
1046 1048 else # a.out platforms
@@ -1067,7 +1069,7 @@ if test "$enable_shared" = 'yes'; then
1067 1069 LIBRUBY_DLDFLAGS='-bE:ruby.imp -bM:SRE -bnoentry'
1068 1070 ARCHFILE="ruby.imp"
1069 1071 fi
1070   - LIBRUBYARG='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so'
  1072 + LIBRUBYARG_SHARED='-L${libdir} -Wl,lib$(RUBY_SO_NAME).so'
1071 1073 SOLIBS='-lm -lc'
1072 1074 ;;
1073 1075 beos*)
@@ -1158,7 +1160,6 @@ case "$target_os" in
1158 1160 LIBRUBY='lib$(RUBY_SO_NAME).a'
1159 1161 fi
1160 1162 LIBRUBY_ALIASES=''
1161   - LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a'
1162 1163 FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
1163 1164 SOLIBS='$(LIBS)'
1164 1165 ;;
@@ -1177,6 +1178,8 @@ AC_SUBST(LIBRUBY_SO)
1177 1178 AC_SUBST(LIBRUBY_ALIASES)
1178 1179 AC_SUBST(LIBRUBY)
1179 1180 AC_SUBST(LIBRUBYARG)
  1181 +AC_SUBST(LIBRUBYARG_STATIC)
  1182 +AC_SUBST(LIBRUBYARG_SHARED)
1180 1183 AC_SUBST(SOLIBS)
1181 1184 AC_SUBST(DLDLIBS)
1182 1185 AC_SUBST(ENABLE_SHARED)
10 eval.c
@@ -2103,6 +2103,7 @@ call_trace_func(event, node, self, id, klass)
2103 2103
2104 2104 if (node) {
2105 2105 ruby_current_node = node;
  2106 + ruby_frame->node = node;
2106 2107 ruby_sourcefile = node->nd_file;
2107 2108 ruby_sourceline = nd_line(node);
2108 2109 }
@@ -2324,7 +2325,7 @@ rb_eval(self, n)
2324 2325 if (trace_func) {
2325 2326 call_trace_func("line", node, self,
2326 2327 ruby_frame->last_func,
2327   - ruby_frame->last_class);
  2328 + ruby_frame->last_class);
2328 2329 }
2329 2330 if (RTEST(rb_eval(self, node->nd_cond))) {
2330 2331 node = node->nd_body;
@@ -6686,17 +6687,18 @@ proc_to_s(self, other)
6686 6687 VALUE self, other;
6687 6688 {
6688 6689 struct BLOCK *data;
  6690 + NODE *node;
6689 6691 char *cname = rb_class2name(CLASS_OF(self));
6690 6692 const int w = (SIZEOF_LONG * CHAR_BIT) / 4;
6691 6693 long len = strlen(cname)+6+w; /* 6:tags 16:addr */
6692 6694 VALUE str;
6693 6695
6694 6696 Data_Get_Struct(self, struct BLOCK, data);
6695   - if (data->body) {
6696   - len += strlen(data->body->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
  6697 + if ((node = data->frame.node) || (node = data->body)) {
  6698 + len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
6697 6699 str = rb_str_new(0, len);
6698 6700 sprintf(RSTRING(str)->ptr, "#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->tag,
6699   - data->body->nd_file, nd_line(data->body));
  6701 + node->nd_file, nd_line(node));
6700 6702 }
6701 6703 else {
6702 6704 str = rb_str_new(0, len);
2  instruby.rb
@@ -81,7 +81,7 @@ def makelink(orig, link, verbose = false)
81 81 end
82 82 Installer.install dll, bindir, 0755, true if enable_shared and dll != lib
83 83 Installer.install lib, libdir, 0555, true unless lib == arc
84   -Installer.install arc, archlibdir, 0644, true
  84 +Installer.install arc, libdir, 0644, true
85 85 Installer.install "config.h", archlibdir, 0644, true
86 86 Installer.install "rbconfig.rb", archlibdir, 0644, true
87 87 if CONFIG["ARCHFILE"]
8 lib/mkmf.rb
@@ -211,7 +211,7 @@ def link_command(ldflags, opt="", libpath=$LIBPATH)
211 211 'LDFLAGS' => "#$LDFLAGS #{ldflags}",
212 212 'LIBPATH' => libpathflag(libpath),
213 213 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
214   - 'LIBS' => "#$LIBRUBYARG #{opt} #$LIBS")
  214 + 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
215 215 end
216 216
217 217 def cc_command(opt="")
@@ -558,6 +558,10 @@ def configuration(srcdir)
558 558 end
559 559 mk << %{
560 560 CC = #{CONFIG['CC']}
  561 +LIBRUBY = #{CONFIG['LIBRUBY']}
  562 +LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
  563 +LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
  564 +LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
561 565
562 566 CFLAGS = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS
563 567 CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS}
@@ -774,6 +778,8 @@ def init_mkmf(config = CONFIG)
774 778 $OBJEXT = config["OBJEXT"].dup
775 779 $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
776 780 $LIBRUBYARG = config['LIBRUBYARG']
  781 + $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
  782 + $LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED']
777 783 $LIBPATH = []
778 784
779 785 $objs = nil
23 parse.y
@@ -1302,10 +1302,14 @@ primary : literal
1302 1302 $$ = NEW_VCALL($1);
1303 1303 }
1304 1304 | kBEGIN
  1305 + {
  1306 + $<num>1 = ruby_sourceline;
  1307 + }
1305 1308 bodystmt
1306 1309 kEND
1307 1310 {
1308   - $$ = NEW_BEGIN($2);
  1311 + $$ = NEW_BEGIN($3);
  1312 + nd_set_line($$, $<num>1);
1309 1313 }
1310 1314 | tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} ')'
1311 1315 {
@@ -1589,22 +1593,27 @@ opt_block_var : none
1589 1593 do_block : kDO_BLOCK
1590 1594 {
1591 1595 $<vars>$ = dyna_push();
  1596 + $<num>1 = ruby_sourceline;
1592 1597 }
1593 1598 opt_block_var
1594 1599 compstmt
1595 1600 kEND
1596 1601 {
1597 1602 $$ = NEW_ITER($3, 0, $4);
1598   - fixpos($$, $3?$3:$4);
  1603 + nd_set_line($$, $<num>1);
1599 1604 dyna_pop($<vars>2);
1600 1605 }
1601   - | tLBRACE_ARG {$<vars>$ = dyna_push();}
  1606 + | tLBRACE_ARG
  1607 + {
  1608 + $<vars>$ = dyna_push();
  1609 + $<num>1 = ruby_sourceline;
  1610 + }
1602 1611 opt_block_var
1603 1612 compstmt
1604 1613 '}'
1605 1614 {
1606 1615 $$ = NEW_ITER($3, 0, $4);
1607   - fixpos($$, $3?$3:$4);
  1616 + nd_set_line($$, $<num>1);
1608 1617 dyna_pop($<vars>2);
1609 1618 }
1610 1619
@@ -1661,23 +1670,25 @@ method_call : operation paren_args
1661 1670 brace_block : '{'
1662 1671 {
1663 1672 $<vars>$ = dyna_push();
  1673 + $<num>1 = ruby_sourceline;
1664 1674 }
1665 1675 opt_block_var
1666 1676 compstmt '}'
1667 1677 {
1668 1678 $$ = NEW_ITER($3, 0, $4);
1669   - fixpos($$, $4);
  1679 + nd_set_line($$, $<num>1);
1670 1680 dyna_pop($<vars>2);
1671 1681 }
1672 1682 | kDO
1673 1683 {
1674 1684 $<vars>$ = dyna_push();
  1685 + $<num>1 = ruby_sourceline;
1675 1686 }
1676 1687 opt_block_var
1677 1688 compstmt kEND
1678 1689 {
1679 1690 $$ = NEW_ITER($3, 0, $4);
1680   - fixpos($$, $4);
  1691 + nd_set_line($$, $<num>1);
1681 1692 dyna_pop($<vars>2);
1682 1693 }
1683 1694 ;
8 win32/Makefile.sub
@@ -121,7 +121,7 @@ ORGLIBPATH = $(LIB)
121 121
122 122 #### End of system configuration section. ####
123 123
124   -LIBRUBY_A = lib$(RUBY_INSTALL_NAME).lib
  124 +LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
125 125 LIBRUBY_SO = $(RUBY_SO_NAME).dll
126 126 LIBRUBY = $(RUBY_SO_NAME).lib
127 127 LIBRUBYARG = $(LIBRUBY)
@@ -345,11 +345,13 @@ s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
345 345 s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
346 346 s,@RUBYW_INSTALL_NAME@,$(RUBYW_INSTALL_NAME),;t t
347 347 s,@RUBY_SO_NAME@,$(RUBY_SO_NAME),;t t
348   -s,@LIBRUBY_A@,lib$$(RUBY_INSTALL_NAME).lib,;t t
  348 +s,@LIBRUBY_A@,$$(RUBY_SO_NAME)-static.lib,;t t
349 349 s,@LIBRUBY_SO@,$$(RUBY_SO_NAME).dll,;t t
350 350 s,@LIBRUBY_ALIASES@,$(LIBRUBY_ALIASES),;t t
351 351 s,@LIBRUBY@,$$(RUBY_SO_NAME).lib,;t t
352   -s,@LIBRUBYARG@,$$(RUBY_SO_NAME).lib,;t t
  352 +s,@LIBRUBYARG@,$$(LIBRUBYARG_SHARED),;t t
  353 +s,@LIBRUBYARG_STATIC@,$$(LIBRUBY_A),;t t
  354 +s,@LIBRUBYARG_SHARED@,$$(LIBRUBY),;t t
353 355 s,@SOLIBS@,$(SOLIBS),;t t
354 356 s,@DLDLIBS@,$(DLDLIBS),;t t
355 357 s,@ENABLE_SHARED@,yes,;t t

0 comments on commit 2432c5e

Please sign in to comment.
Something went wrong with that request. Please try again.