なかだです。

At Fri, 8 Nov 2002 15:29:45 +0900,
Nobuyoshi-Nakada wrote:
> At Fri, 8 Nov 2002 12:25:18 +0900,
> WATANABE Hirofumi wrote:
> > なるほど。じゃ安易に
> >   cp libruby17.a libruby17-static.a
> > として-lruby17-staticを用意してしまうというのはどうでしょう?
> > #symlinkが使える環境ならsymlinkで。
> > extmk.rb的にはこれでよさそう。
> > 
> > mkmf.rb的にはそもそもlibruby17.aが$(archdir)にある必要もない気がします。
> > libruby17.aをリンクすることもほとんどないし、いっそのこと
> >   mv libruby17.a libruby17-static.a
> > として$(libdir)にインストールしてしまったほうが使いやすい気
> > がしてきました。
> 
> LIBRUBY_Aごと変えてしまうというのは? 私も、スタティックライブラ
> リはいまいち使い途がないとは感じてました。

こんなところかも。


Index: Makefile.in =================================================================== RCS file: /cvs/ruby/src/ruby/Makefile.in,v retrieving revision 1.38 diff -u -2 -p -r1.38 Makefile.in --- Makefile.in 3 Nov 2002 21:42:13 -0000 1.38 +++ Makefile.in 8 Nov 2002 08:29:23 -0000 @@ -53,4 +53,6 @@ LIBRUBY_ALIASES= @LIBRUBY_ALIASES@ LIBRUBY = @LIBRUBY@ LIBRUBYARG = @LIBRUBYARG@ +LIBRUBYARG_STATIC = @LIBRUBYARG_STATIC@ +LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@ PREP = @PREP@ @ARCHFILE@ Index: configure.in =================================================================== RCS file: /cvs/ruby/src/ruby/configure.in,v retrieving revision 1.150 diff -u -2 -p -r1.150 configure.in --- configure.in 24 Oct 2002 12:58:41 -0000 1.150 +++ configure.in 8 Nov 2002 06:48:32 -0000 @@ -1015,7 +1015,8 @@ 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= @@ -1041,5 +1042,6 @@ AC_ARG_ENABLE(shared, 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 @@ -1072,5 +1074,5 @@ if test "$enable_shared" = 'yes'; then 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' @@ -1099,5 +1101,5 @@ if test "$enable_shared" = 'yes'; then 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' ;; @@ -1190,5 +1192,4 @@ case "$target_os" in fi LIBRUBY_ALIASES='' - LIBRUBY_A='lib$(RUBY_INSTALL_NAME)s.a' FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in SOLIBS='$(LIBS)' @@ -1209,4 +1210,6 @@ AC_SUBST(LIBRUBY_ALIASES) AC_SUBST(LIBRUBY) AC_SUBST(LIBRUBYARG) +AC_SUBST(LIBRUBYARG_STATIC) +AC_SUBST(LIBRUBYARG_SHARED) AC_SUBST(SOLIBS) AC_SUBST(DLDLIBS) Index: instruby.rb =================================================================== RCS file: /cvs/ruby/src/ruby/instruby.rb,v retrieving revision 1.25 diff -u -2 -p -r1.25 instruby.rb --- instruby.rb 4 Nov 2002 11:06:03 -0000 1.25 +++ instruby.rb 8 Nov 2002 08:52:03 -0000 @@ -82,5 +82,5 @@ 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 Index: lib/mkmf.rb =================================================================== RCS file: /cvs/ruby/src/ruby/lib/mkmf.rb,v retrieving revision 1.115 diff -u -2 -p -r1.115 mkmf.rb --- lib/mkmf.rb 4 Nov 2002 11:06:03 -0000 1.115 +++ lib/mkmf.rb 8 Nov 2002 06:50:28 -0000 @@ -212,5 +212,5 @@ def link_command(ldflags, opt="", libpat 'LIBPATH' => libpathflag(libpath), 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", - 'LIBS' => "#$LIBRUBYARG #{opt} #$LIBS") + 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS") end @@ -775,4 +775,6 @@ def init_mkmf(config = CONFIG) $LIBS = "#{config['LIBS']} #{config['DLDLIBS']}" $LIBRUBYARG = config['LIBRUBYARG'] + $LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC'] + $LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED'] $LIBPATH = [] Index: bcc32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/bcc32/Makefile.sub,v retrieving revision 1.13 diff -u -2 -p -r1.13 Makefile.sub --- bcc32/Makefile.sub 3 Nov 2002 21:42:14 -0000 1.13 +++ bcc32/Makefile.sub 8 Nov 2002 07:34:20 -0000 @@ -133,5 +133,5 @@ 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 @@ -351,9 +351,11 @@ s,@rubyw_install_name@,$(RUBYW_INSTALL_N 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 @@ -393,5 +395,5 @@ $(WPROGRAM): $(MAINOBJ) $(WINMAINOBJ) $( $(LIBRUBY_A): $(OBJS) @-if exist $@ del $@ - $(AR) $(ARFLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) "$@" $(OBJS) # $(LIBRUBY): $(LIBRUBY_SO) Index: win32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/win32/Makefile.sub,v retrieving revision 1.31 diff -u -2 -p -r1.31 Makefile.sub --- win32/Makefile.sub 3 Nov 2002 21:42:14 -0000 1.31 +++ win32/Makefile.sub 8 Nov 2002 07:56:27 -0000 @@ -122,5 +122,5 @@ 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 @@ -346,9 +346,11 @@ s,@rubyw_install_name@,$(RUBYW_INSTALL_N 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@,$$(LIBRUBY_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
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦