MinGW における拡張ライブラリ作成と Ruby 1.8/1.9 共瘢雹存について


#1

e$B@1$H?=$7$^$9!#e(B

e$B;d$Oe(B MinGW e$B$Ge(B Ruby e$B3HD%%i%$%V%i%j$r:n@.$7$F$$$^$9!#e(B
e$B$=$N:]$Ke(B Ruby 1.8 e$BMQ$He(B Ruby 1.9
e$BMQ$N3HD%%i%$%V%i%j$rJL!9$K:n$j$?$$$N$G$9$,!"e(B
MinGW e$B$K$*$$$Fe(B

  1. Ruby 1.8 e$B$He(B Ruby 1.9 e$B$r6&B8$5$;!"e(B
    e$B$J$*$+$De(B

  2. e$B$=$l$>$l$Ne(B Ruby e$B$Ne(B DLL e$B%U%!%$%kL>$re(B
    (e$B%G%U%)%k%H$Ne(B) msvcrt-ruby(e$B%P!<%8%g%sHV9fe(B).dll e$B$K$9$ke(B
    e$BJ}K!$rCN$j$?$$$G$9!#e(B

  3. e$B$N$?$a$Ke(B Ruby e$B%3%s%Q%$%k;~$Ne(B configure e$B$Ke(B
    program-suffix e$B0z?t$r$D$1$?>l9g!"e(B
    e$B%i%$%V%i%j$N%U%!%$%kL>$bJQ$o$C$F$7$^$&$?$a!"e(B 2.
    e$B$N>r7o$,K~$?$5$l$^$;$s!#e(B

  4. e$B$N>r7o$G$"$k!Ve(BRuby e$B$Ne(B DLL
    e$BL>$,%G%U%)%k%H!W$G$J$$$H!":n@.$7$?3HD%%i%$%V%i%j$,B>$N%f!<%6!<$N4D6-$Ge(B
    e$BF0$+$J$$2DG=@-$,9b$/$J$j$^$9!#M}M3$O!e(B Windows e$B$K$*$$$Fe(B Ruby
    e$B$re(B
    e$B;HMQ$9$k?M$OBg35e(B ActiveScriptRuby
    e$B$J$I$N%$%s%9%H!<%i!<$rMxMQ$9$k$b$N$H;W$o$l$^$9$,!e(B
    e$B$=$N>l9ge(B ruby
    e$B$N%3%^%s%IL>!%i%$%V%i%jL>$O%G%U%)%k%H$N$^$^$G$$k$+$i$G$9!#e(B

e$B$^$?!EvA3e(B Windows e$B$Ne(B Ruby
e$B%f!<%6!<$K<+J,$N3HD%%i%$%V%i%j$r;H$C$F$$$?$@$/$?$a$K$O!e(B
so e$B%U%!%$%k$N$^$^;H$C$F$$$?$@$/I,MW$,$$k$H;W$o$l$^$9!#e(B
e$B%f!<%6!<3F<+$,3HD%%i%$%V%i%j$r%3%s%Q%$%k$9$k$H$$$&$N$O8=<BE*$G$O$$j$^$;$s!#e(B
e$B$=$N$?$a!e(B so e$B%U%!%$%k$,%j%s%/$9$ke(B DLL
e$B%U%!%$%k$O$d$O$j%G%U%)%k%H$NL>A0$r;}$DI,MW$,$$k$N$G$9!#e(B

e$B$I$&$>$h$m$7$/$*4j$$$7$^$9!#e(B


#2

e$B$3$s$P$s$o!"%5%$%m%9$G$9!#e(B

Hajime H. removed_email_address@domain.invalide$B$5$s!'e(B

e$B@1$H?=$7$^$9!#e(B

e$B;d$Oe(B MinGW e$B$Ge(B Ruby e$B3HD%%i%$%V%i%j$r:n@.$7$F$$$^$9!#e(B
e$B$=$N:]$Ke(B Ruby 1.8 e$BMQ$He(B Ruby 1.9 e$BMQ$N3HD%%i%$%V%i%j$rJL!9$K:n$j$?$$$N$Ge(B
e$B$9$,!"e(B
MinGW e$B$K$*$$$Fe(B

  1. Ruby 1.8 e$B$He(B Ruby 1.9 e$B$r6&B8$5$;!"e(B
    e$BJL!9$N%G%#%l%/%H%j$Ke(B1.8e$B7OE}$He(B1.9e$B7OE}$rF~$l$k$N$G$OBLL$G$7$g$&$+!)e(B
    e$B%S%k%I;~$K!Ve(Bconfigure
    suffix=/msys/1.0/local/ruby1x/e$B!W$H;XDj$7$F$$$$F!"e(B
    e$BI,MW$J$H$-$K!Ve(Bexport PATH=e$B1>!9!W$d!Ve(Bsource
    e$B1>!9!W$HBG$A9~$s$GL@<(E
    $K@Z$je(B
    e$BBX$($k$3$H$,=PMh$^$9!#e(B

e$B$J$*$+$De(B
2. e$B$=$l$>$l$Ne(B Ruby e$B$Ne(B DLL e$B%U%!%$%kL>$re(B (e$B%G%U%)%k%H$Ne(B) msvcrt-ruby(e$B%P!<e(B
e$B%8%g%sHV9fe(B).dll e$B$K$9$ke(B
e$BJ}K!$rCN$j$?$$$G$9!#e(B
e$B>e5-$NJ}K!$G$9$H!"%G%U%)%k%H$Ne(BDLLe$B%U%!%$%kL>$K$J$j$^$9$N$G!"e(B2.e$B$N>r7o$b%^%Ce(B
e$B%A$7$^$9!#e(B

e$B$b$74{=P$G$7$?$i$4$a$s$J$5$$!#O7GL?4$J$,$i$H;W$C$F$/$@$5$$!#e(B

e$B!c!a!a!a!a!a!de(B
e$B%5%$%m%9@?e(B
removed_email_address@domain.invalid
http://www.twin.ne.jp/~cyross/Miyako
http://d.hatena.ne.jp/cyross/
e$B!c!a!a!a!a!a!de(B


#3

e$B@1$G$9!#e(B

2009/04/02 1:00 removed_email_address@domain.invalid:

e$BJL!9$N%G%#%l%/%H%j$Ke(B1.8e$B7OE}$He(B1.9e$B7OE}$rF~$l$k$N$G$OBLL$G$7$g$&$+!)e(B

e$B$b$74{=P$G$7$?$i$4$a$s$J$5$$!#O7GL?4$J$,$i$H;W$C$F$/$@$5$$!#e(B

(suffix e$B$G$O$J$/$Fe(B --prefix e$B$G$7$g$&$+!#e(B)

e$B$?$7$+$K$=$l$GBg>fIW$=$&$G$9$M!#e(B
PATH e$B$r@Z$jBX$($k$N$,$A$g$C$H<j4V$+$b$7$l$^$;$s$,CW$7J}$J$$$+!#e(B

e$B$I$&$b$"$j$,$H$&$4$6$$$^$9!#e(B


#4

e$B@1$G$9!#e(B

e$B$H$7$F$*$1$P!"%Q%9$rDL$7$F$$$J$/$F$b!e(Bruby19e$B$$k$$$Oe(Bruby18e$B$He(B
e$B$$$&L>A0$G$=$l$>$l$N%P!<%8%g%s$Ne(Brubye$B$r<B9T$G$-$^$9!#e(B
e$BB>$N%7%%k>e$G@83h$5$l$F$$$k$J$i!"$=$l$>$l$NN.57$G!#e(B

e$B$$$?$7$+$K!#$"$j$,$H$&$4$6$$$^$9!#e(B


#5

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message [ruby-dev:38246] Re: MinGW
e$B$K$*$1$k3HD%%i%$%V%i%j:n@.$He(B Ruby 1.8/1.9 e$B6&B8$K$D$$$Fe(B
on Apr.02,2009 08:03:40, removed_email_address@domain.invalid wrote:

e$B$?$7$+$K$=$l$GBg>fIW$=$&$G$9$M!#e(B
PATH e$B$r@Z$jBX$($k$N$,$A$g$C$H<j4V$+$b$7$l$^$;$s$,CW$7J}$J$$$+!#e(B

e$BE,Ev$Ke(Baliase$B$r@Z$C$F$*$1$P$$$$$s$8$c$J$$$G$7$g$&$+!#e(B
e$B$b$7%3%^%s%I%W%m%s%W%H$N>e$G@83h$7$F$$$k$N$G$"$l$P!"Nc$($P!"e(B1.9
e$B$re(BC:\ruby-1.9e$B$K!"e(B1.8e$B$re(BC:\ruby-1.8e$B$K%$%s%9%H!<%k$7$F$k$J$i$P!"e(B

doskey ruby19=C:\ruby-1.9\bin\ruby $*
doskey ruby18=C:\ruby-1.8\bin\ruby $*

e$B$H$7$F$*$1$P!"%Q%9$rDL$7$F$$$J$/$F$b!e(Bruby19e$B$$k$$$Oe(Bruby18e$B$He(B
e$B$$$&L>A0$G$=$l$>$l$N%P!<%8%g%s$Ne(Brubye$B$r<B9T$G$-$^$9!#e(B
e$BB>$N%7%%k>e$G@83h$5$l$F$$$k$J$i!"$=$l$>$l$NN.57$G!#e(B

e$B$=$l$G$O!#e(B


#6

e$B$J$+$@$G$9!#e(B

At Wed, 1 Apr 2009 22:47:23 +0900,
Hajime H. wrote in [ruby-dev:38241]:

  1. e$B$N$?$a$Ke(B Ruby e$B%3%s%Q%$%k;~$Ne(B configure e$B$Ke(B --program-suffix e$B0z?t$r$D$1$?>l9g!"e(B
    e$B%i%$%V%i%j$N%U%!%$%kL>$bJQ$o$C$F$7$^$&$?$a!"e(B 2. e$B$N>r7o$,K~$?$5$l$^$;$s!#e(B

[ruby-dev:38255]e$B$b4^$a$F!"e(Bprogram-suffixe$B$K%i%$%V%i%jL>$d%Q%9L>e(B
e$B$^$G1F6A$r<u$1$k$N$OMxE@$h$j$bLLE]$J$3$H$N$[$&$,B?$$5$$,$7$^$9!#e(B

Index: configure.in

configure.in (revision 23150)
+++ configure.in (working copy)
@@ -112,4 +112,6 @@ if test $program_prefix = NONE; then
program_prefix=
fi
+RUBY_BASE_NAME=ruby
+AC_SUBST(RUBY_BASE_NAME)

AC_CANONICAL_TARGET
@@ -1924,5 +1926,5 @@ case $target_os in
esac

-RUBY_SO_NAME=$(RUBY_INSTALL_NAME)
+RUBY_SO_NAME=$(RUBY_BASE_NAME)
LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
@@ -2012,5 +2014,5 @@ if test $enable_shared = yes; then
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "-Wl,-unexported_symbol,Init*
$(XLDFLAGS)
LIBRUBY_SO=lib$(RUBY_SO_NAME).dylib.$(MAJOR).$(MINOR).$(TEENY)

  • LIBRUBY_ALIASES=lib$(RUBY_SO_NAME).dylib
    lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib
    lib$(RUBY_INSTALL_NAME).dylib
  • LIBRUBY_ALIASES=lib$(RUBY_SO_NAME).dylib
    lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib
    lib$(RUBY_INSTALL_NAME).dylib
    ;;
    when(interix*)
    @@ -2102,14 +2104,15 @@ case $target_os in
    ;;
    when(cygwin*|mingw*)
  • RUBY_SO_NAME="${RUBY_SO_NAME}${MAJOR}${MINOR}${TEENY}"
    LIBRUBY_DLDFLAGS="${DLDFLAGS}" -Wl,out-implib=$(LIBRUBY)
    case $target_os in
    when(cygwin*)
    if test x"$enable_shared" = xyes; then
  • LIBRUBY_SO=cyg$(RUBY_SO_NAME)${MAJOR}${MINOR}${TEENY}.dll
  • LIBRUBY_SO=cyg$(RUBY_SO_NAME).dll
    LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}" $(RUBYDEF)
    fi
    ;;
    when(mingw*)

RUBY_SO_NAME=${rb_cv_msvcrt}-$(RUBY_INSTALL_NAME)${MAJOR}${MINOR}${TEENY}

  •  RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
     if test x"$enable_shared" = xyes; then
    
    LIBRUBY_SO=$(RUBY_SO_NAME).dll
    @@ -2267,12 +2270,19 @@ test $program_suffix != NONE &&
    ri_suffix=$program_suffix

-RUBY_INSTALL_NAME="${ri_prefix}ruby${ri_suffix}"
+RUBY_INSTALL_NAME="${ri_prefix}"$(RUBY_BASE_NAME)"${ri_suffix}"
case $target_os in
when(cygwin*|mingw*)

  • RUBYW_INSTALL_NAME="${ri_prefix}rubyw${ri_suffix}"
  • rubyw_install_name="$RUBYW_INSTALL_NAME"
  • RUBYW_INSTALL_NAME="${ri_prefix}"$(RUBY_BASE_NAME)w"${ri_suffix}"
  • rubyw_install_name=$(RUBYW_INSTALL_NAME)
    ;;
    esac
    -RUBY_LIB_PREFIX=eval echo \\"${libdir}/${RUBY_INSTALL_NAME}\\"

+rubylibprefix=${libdir}/${RUBY_BASE_NAME}
+AC_ARG_WITH(rubylibprefix,

  •  AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby 
    

libraries [[LIBDIR/RUBY_INSTALL_NAME]]]),

  •  [rubylibprefix=$withval])
    

+RUBY_LIB_PREFIX=eval echo \\"${rubylibprefix}\\"
+AC_SUBST(rubylibprefix)

AC_ARG_WITH(ruby-version,
@@ -2306,12 +2316,18 @@ AC_ARG_WITH(sitedir,
AS_HELP_STRING([with-sitedir=DIR], [site libraries in DIR
[[RUBY_LIB_PREFIX/site_ruby]]]),
[sitedir=$withval],

  •        [sitedir='${libdir}/${RUBY_INSTALL_NAME}/site_ruby'])
    

-SITE_DIR=eval echo \\"${sitedir}\\"

  •        [sitedir='${rubylibprefix}/site_ruby'])
    

+dir="${sitedir}"
+until SITE_DIR=eval echo \\"${dir}\\"; test ${dir} = ${SITE_DIR};
do

  • dir="${SITE_DIR}"
    +done

AC_ARG_WITH(vendordir,
AS_HELP_STRING([with-vendordir=DIR], [vendor libraries in DIR
[[RUBY_LIB_PREFIX/vendor_ruby]]]),
[vendordir=$withval],

  •        [vendordir='${libdir}/${RUBY_INSTALL_NAME}/vendor_ruby'])
    

-VENDOR_DIR=eval echo \\"${vendordir}\\"

  •        [vendordir='${rubylibprefix}/vendor_ruby'])
    

+dir="${vendordir}"
+until VENDOR_DIR=eval echo \\"${dir}\\"; test ${dir} =
${VENDOR_DIR}; do

  • dir="${VENDOR_DIR}"
    +done

if test ${LOAD_RELATIVE+set}; then
@@ -2415,7 +2431,7 @@ fi

AC_ARG_WITH(rubyhdrdir,

  •  AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR 
    

[[INCLUDEDIR/RUBY_INSTALL_NAME/RUBY_VERSION]]]),

  •  AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR 
    

[[INCLUDEDIR/RUBY_BASE_NAME/RUBY_VERSION]]]),
[rubyhdrdir=$withval],

[rubyhdrdir=${includedir}/${RUBY_INSTALL_NAME}-${ruby_version}])

  •  [rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}'])
    

AC_ARG_WITH(sitehdrdir,
@@ -2486,5 +2502,5 @@ AC_SUBST(BUILTIN_TRANSSRCS)
AC_SUBST(BUILTIN_TRANSOBJS)

-PACKAGE=$RUBY_INSTALL_NAME
+PACKAGE=$RUBY_BASE_NAME
AC_SUBST(PACKAGE)
AC_MSG_RESULT($PACKAGE library version = $ruby_version)
Index: win32/Makefile.sub

win32/Makefile.sub (revision 23150)
+++ win32/Makefile.sub (working copy)
@@ -33,6 +33,9 @@ LIB = $(pathlist:;=/lib;)
srcdir =
!endif
+!ifndef RUBY_BASE_NAME
+RUBY_BASE_NAME = ruby
+!endif
!ifndef RUBY_INSTALL_NAME
-RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)ruby$(RUBY_SUFFIX)
+RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(RUBY_SUFFIX)
!endif
!if !defined(RUBYW_INSTALL_NAME) || $(RUBYW_INSTALL_NAME) ==
$(RUBY_INSTALL_NAME)
@@ -117,5 +120,5 @@ ruby_version = $(MAJOR).$(MINOR).$(TEENY

!ifndef RUBY_SO_NAME
-RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY)
+RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)$(TEENY)
!endif
!ifndef RUBY_PLATFORM
@@ -530,5 +533,5 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/
#define DLEXT .so
#define RUBY_LIB_VERSION_STYLE 3 /* full */
-#define RUBY_LIB_PREFIX /lib/$(RUBY_INSTALL_NAME)
+#define RUBY_LIB_PREFIX /lib/$(RUBY_BASE_NAME)
#define RUBY_LIB RUBY_LIB_PREFIX"/RUBY_LIB_VERSION
#define RUBY_SITE_LIB RUBY_LIB_PREFIX/site_ruby"
@@ -646,4 +649,5 @@ s,@RDOCTARGET@,;t t
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
+s,@RUBY_BASE_NAME@,$(RUBY_BASE_NAME),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
@@ -687,7 +691,8 @@ s,@arch@,$(ARCH)-$(PLATFORM),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
s,@ruby_version@,$(ruby_version),;t t
-s,@sitedir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/site_ruby,;t t
-s,@vendordir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/vendor_ruby,;t t
-s,@rubyhdrdir@,$$(includedir)/$${RUBY_INSTALL_NAME}-$$(ruby_version),;t
t
+s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t
+s,@sitedir@,$${rubylibprefix}/site_ruby,;t t
+s,@vendordir@,$${rubylibprefix}/vendor_ruby,;t t
+s,@rubyhdrdir@,$$(includedir)/$${RUBY_BASE_NAME}-$$(ruby_version),;t t
s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t


#7

At Tue, 7 Apr 2009 19:43:22 +0900,
Nobuyoshi N. wrote:

At Wed, 1 Apr 2009 22:47:23 +0900,
Hajime H. wrote in [ruby-dev:38241]:

  1. Ruby configure --program-suffix
    2.

[ruby-dev:38255]program-suffix

prefix


soname


#8

e$B$J$+$@$G$9!#e(B

At Wed, 8 Apr 2009 12:40:09 +0900,
Akinori MUSHA wrote in [ruby-dev:38290]:

  1. e$B$N$?$a$Ke(B Ruby e$B%3%s%Q%$%k;~$Ne(B configure e$B$Ke(B --program-suffix e$B0z?t$r$D$1$?>l9g!"e(B
    e$B%i%$%V%i%j$N%U%!%$%kL>$bJQ$o$C$F$7$^$&$?$a!"e(B 2. e$B$N>r7o$,K~$?$5$l$^$;$s!#e(B

[ruby-dev:38255]e$B$b4^$a$F!"e(Bprogram-suffixe$B$K%i%$%V%i%jL>$d%Q%9L>e(B
e$B$^$G1F6A$r<u$1$k$N$OMxE@$h$j$bLLE]$J$3$H$N$[$&$,B?$$5$$,$7$^$9!#e(B

e$B!!MxE@$H$7$F$O!F1$8e(Bprefixe$B2<$KJ#?t$N%P!<%8%g%s$r%$%s%9%H!<%k$G$-$ke(B
e$B$H$$$&$3$H$,$$C$F!"%Q%C%1!<%8%7%9%F%`Ey$NET9g>e$=$l$O<:$$$?$/$J$$e(B
e$B$G$9!#e(B

program-transform-namee$B$G$O$I$&$G$7$g$&$+!#e(Bsede$B$r40A4$K%(%%e%l!<e(B
e$B%H$7$?$o$1$G$O$"$j$^$;$s$,!"e(Bse$B$He(Bye$B%3%^%s%I$OBP1~$7$F$
$^$7$?!#e(B

e$B!!%Q%9L>$O$o$+$j$^$;$s$,!"%i%$%V%i%jL>$O1F6A$r<u$1$F$b$h$$$N$G$Oe(B
e$B$J$$$G$7$g$&$+!#>/$J$/$H$be(Bsonamee$B$r;XDj$9$k%*%W%7%g%s$O;D$7$F$[$7$$e(B
e$B$G$9!#e(B

with-sonamee$B$H$+e(B?

Index: Makefile.in

Makefile.in (revision 23166)
+++ Makefile.in (working copy)
@@ -67,4 +67,5 @@ BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@

+RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
Index: configure.in

configure.in (revision 23166)
+++ configure.in (working copy)
@@ -114,4 +114,6 @@ fi
RUBY_BASE_NAME=echo ruby | sed "$program_transform_name"
RUBYW_BASE_NAME=echo rubyw | sed "$program_transform_name"
+AC_SUBST(RUBY_BASE_NAME)
+AC_SUBST(RUBYW_BASE_NAME)

AC_CANONICAL_TARGET
@@ -1926,5 +1928,8 @@ case $target_os in
esac

-RUBY_SO_NAME=$(RUBY_INSTALL_NAME)
+AC_ARG_WITH(soname,

  • AS_HELP_STRING([with-soname=SONAME], [base name of shared
    library]),
  • [RUBY_SO_NAME=$withval], [RUBY_SO_NAME=$(RUBY_BASE_NAME)])

LIBRUBY_LDSHARED=$LDSHARED
LIBRUBY_DLDFLAGS=$DLDFLAGS
@@ -2014,5 +2019,5 @@ if test $enable_shared = yes; then
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "-Wl,-unexported_symbol,Init*
$(XLDFLAGS)
LIBRUBY_SO=lib$(RUBY_SO_NAME).dylib

  • LIBRUBY_ALIASES=lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib
    lib$(RUBY_INSTALL_NAME).dylib
  • LIBRUBY_ALIASES=lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib
    lib$(RUBY_INSTALL_NAME).dylib
    ;;
    when(interix*)
    @@ -2104,14 +2109,15 @@ case $target_os in
    ;;
    when(cygwin*|mingw*)
  • RUBY_SO_NAME="${RUBY_SO_NAME}${MAJOR}${MINOR}${TEENY}"
    LIBRUBY_DLDFLAGS="${DLDFLAGS}" -Wl,out-implib=$(LIBRUBY)
    case $target_os in
    when(cygwin*)
    if test x"$enable_shared" = xyes; then
  • LIBRUBY_SO=cyg$(RUBY_SO_NAME)${MAJOR}${MINOR}${TEENY}.dll
  • LIBRUBY_SO=cyg$(RUBY_SO_NAME).dll
    LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}" $(RUBYDEF)
    fi
    ;;
    when(mingw*)

RUBY_SO_NAME=${rb_cv_msvcrt}-$(RUBY_INSTALL_NAME)${MAJOR}${MINOR}${TEENY}

  •  RUBY_SO_NAME="${rb_cv_msvcrt}-${RUBY_SO_NAME}"
     if test x"$enable_shared" = xyes; then
    
    LIBRUBY_SO=$(RUBY_SO_NAME).dll
    @@ -2269,12 +2275,18 @@ test $program_suffix != NONE &&
    ri_suffix=$program_suffix

-RUBY_INSTALL_NAME="${ri_prefix}${RUBY_BASE_NAME}${ri_suffix}"
+RUBY_INSTALL_NAME="${ri_prefix}"$(RUBY_BASE_NAME)"${ri_suffix}"
case $target_os in
when(cygwin*|mingw*)

  • RUBYW_INSTALL_NAME="${ri_prefix}${RUBYW_BASE_NAME}${ri_suffix}"
  • rubyw_install_name="$RUBYW_INSTALL_NAME"
  • RUBYW_INSTALL_NAME="${ri_prefix}"$(RUBYW_BASE_NAME)"${ri_suffix}"
  • rubyw_install_name=$(RUBYW_INSTALL_NAME)
    ;;
    esac
    -RUBY_LIB_PREFIX=eval echo \\"${libdir}/${RUBY_INSTALL_NAME}\\"

+rubylibprefix=${libdir}/${RUBY_BASE_NAME}
+AC_ARG_WITH(rubylibprefix,

  •  AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby 
    

libraries [[LIBDIR/RUBY_INSTALL_NAME]]]),

  •  [rubylibprefix=$withval])
    

+RUBY_LIB_PREFIX=eval echo \\"${rubylibprefix}\\"
+AC_SUBST(rubylibprefix)

AC_ARG_WITH(ruby-version,
@@ -2308,12 +2320,18 @@ AC_ARG_WITH(sitedir,
AS_HELP_STRING([with-sitedir=DIR], [site libraries in DIR
[[RUBY_LIB_PREFIX/site_ruby]]]),
[sitedir=$withval],

  •        [sitedir='${libdir}/${RUBY_INSTALL_NAME}/site_ruby'])
    

-SITE_DIR=eval echo \\"${sitedir}\\"

  •        [sitedir='${rubylibprefix}/site_ruby'])
    

+dir="${sitedir}"
+until SITE_DIR=eval echo \\"${dir}\\"; test ${dir} = ${SITE_DIR};
do

  • dir="${SITE_DIR}"
    +done

AC_ARG_WITH(vendordir,
AS_HELP_STRING([with-vendordir=DIR], [vendor libraries in DIR
[[RUBY_LIB_PREFIX/vendor_ruby]]]),
[vendordir=$withval],

  •        [vendordir='${libdir}/${RUBY_INSTALL_NAME}/vendor_ruby'])
    

-VENDOR_DIR=eval echo \\"${vendordir}\\"

  •        [vendordir='${rubylibprefix}/vendor_ruby'])
    

+dir="${vendordir}"
+until VENDOR_DIR=eval echo \\"${dir}\\"; test ${dir} =
${VENDOR_DIR}; do

  • dir="${VENDOR_DIR}"
    +done

if test ${LOAD_RELATIVE+set}; then
@@ -2417,7 +2435,7 @@ fi

AC_ARG_WITH(rubyhdrdir,

  •  AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR 
    

[[INCLUDEDIR/RUBY_INSTALL_NAME/RUBY_VERSION]]]),

  •  AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR 
    

[[INCLUDEDIR/RUBY_BASE_NAME/RUBY_VERSION]]]),
[rubyhdrdir=$withval],

[rubyhdrdir=${includedir}/${RUBY_INSTALL_NAME}-${ruby_version}])

  •  [rubyhdrdir='${includedir}/${RUBY_BASE_NAME}-${ruby_version}'])
    

AC_ARG_WITH(sitehdrdir,
@@ -2488,5 +2506,5 @@ AC_SUBST(BUILTIN_TRANSSRCS)
AC_SUBST(BUILTIN_TRANSOBJS)

-PACKAGE=$RUBY_INSTALL_NAME
+PACKAGE=$RUBY_BASE_NAME
AC_SUBST(PACKAGE)
AC_MSG_RESULT($PACKAGE library version = $ruby_version)
Index: lib/mkmf.rb

lib/mkmf.rb (revision 23166)
+++ lib/mkmf.rb (working copy)
@@ -1451,4 +1451,5 @@ AR = #{CONFIG[AR]}
EXEEXT = #{CONFIG[EXEEXT]}

+RUBY_BASE_NAME = #{CONFIG[RUBY_BASE_NAME]}
RUBY_INSTALL_NAME = #{CONFIG[RUBY_INSTALL_NAME]}
RUBY_SO_NAME = #{CONFIG[RUBY_SO_NAME]}
Index: win32/Makefile.sub

win32/Makefile.sub (revision 23166)
+++ win32/Makefile.sub (working copy)
@@ -33,6 +33,9 @@ LIB = $(pathlist:;=/lib;)
srcdir =
!endif
+!ifndef RUBY_BASE_NAME
+RUBY_BASE_NAME = ruby
+!endif
!ifndef RUBY_INSTALL_NAME
-RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)ruby$(RUBY_SUFFIX)
+RUBY_INSTALL_NAME = $(PROGRAM_PREFIX)$(RUBY_BASE_NAME)$(RUBY_SUFFIX)
!endif
!if !defined(RUBYW_INSTALL_NAME) || $(RUBYW_INSTALL_NAME) ==
$(RUBY_INSTALL_NAME)
@@ -117,5 +120,5 @@ ruby_version = $(MAJOR).$(MINOR).$(TEENY

!ifndef RUBY_SO_NAME
-RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)$(TEENY)
+RUBY_SO_NAME = $(RT)-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)$(TEENY)
!endif
!ifndef RUBY_PLATFORM
@@ -530,5 +533,5 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/
#define DLEXT .so
#define RUBY_LIB_VERSION_STYLE 3 /* full */
-#define RUBY_LIB_PREFIX /lib/$(RUBY_INSTALL_NAME)
+#define RUBY_LIB_PREFIX /lib/$(RUBY_BASE_NAME)
#define RUBY_LIB RUBY_LIB_PREFIX"/RUBY_LIB_VERSION
#define RUBY_SITE_LIB RUBY_LIB_PREFIX/site_ruby"
@@ -646,4 +649,5 @@ s,@RDOCTARGET@,;t t
s,@LIBRUBY_LDSHARED@,$(LIBRUBY_LDSHARED),;t t
s,@LIBRUBY_DLDFLAGS@,$(LIBRUBY_DLDFLAGS),;t t
+s,@RUBY_BASE_NAME@,$(RUBY_BASE_NAME),;t t
s,@RUBY_INSTALL_NAME@,$(RUBY_INSTALL_NAME),;t t
s,@rubyw_install_name@,$(RUBYW_INSTALL_NAME),;t t
@@ -687,7 +691,8 @@ s,@arch@,$(ARCH)-$(PLATFORM),;t t
s,@sitearch@,$(ARCH)-$(RT),;t t
s,@ruby_version@,$(ruby_version),;t t
-s,@sitedir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/site_ruby,;t t
-s,@vendordir@,$${prefix}/lib/$${RUBY_INSTALL_NAME}/vendor_ruby,;t t
-s,@rubyhdrdir@,$$(includedir)/$${RUBY_INSTALL_NAME}-$$(ruby_version),;t
t
+s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t
+s,@sitedir@,$${rubylibprefix}/site_ruby,;t t
+s,@vendordir@,$${rubylibprefix}/vendor_ruby,;t t
+s,@rubyhdrdir@,$$(includedir)/$${RUBY_BASE_NAME}-$$(ruby_version),;t t
s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
s,@vendorhdrdir@,$$(rubyhdrdir)/vendor_ruby,;t t