Hi, the attached patch fixes two issues:
1) The Config::CONFIG["LIBRUBY_SO"] is used to obtain the Ruby's so name. This allows Vim to work without -devel package (at least on Fedora) and prevent possible SEGVs due to incompatible Ruby libraries. 2) It fixes "Use RbConfig instead of obsolete and deprecated Config" warnings, since these constant was deprecated quite a while ago. Please consider to accept them. Thank you. Vit -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
# HG changeset patch # User V?t Ondruch <[email protected]> # Date 1348054020 -7200 # Node ID 3ffb6be1eeb3aea9cc58da40c45b049515f427db # Parent 91c52d4cb1be45e7826fb75fee1683d2f5130fda Detect .so name from RUBYLIB_SO, which is available universaly at leas since Ruby 1.6. diff -r 91c52d4cb1be -r 3ffb6be1eeb3 src/configure.in --- a/src/configure.in Tue Sep 18 22:00:08 2012 +0200 +++ b/src/configure.in Wed Sep 19 13:27:00 2012 +0200 @@ -1474,7 +1474,7 @@ RUBY_PRO="if_ruby.pro" AC_DEFINE(FEAT_RUBY) if test "$enable_rubyinterp" = "dynamic"; then - libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG[["RUBY_SO_NAME"]], Config::CONFIG[["DLEXT"]]'` + libruby=`$vi_cv_path_ruby -r rbconfig -e 'puts Config::CONFIG[["LIBRUBY_SO"]]'` AC_DEFINE(DYNAMIC_RUBY) RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS= # HG changeset patch # User V?t Ondruch <[email protected]> # Date 1348066771 -7200 # Node ID 250a6b258f862f3b5bf9be74dae1cef80cd8c035 # Parent 3ffb6be1eeb3aea9cc58da40c45b049515f427db Fix te "Use RbConfig instead of obsolete and deprecated Config" warning for modern Rubies. diff -r 3ffb6be1eeb3 -r 250a6b258f86 src/configure.in --- a/src/configure.in Wed Sep 19 13:27:00 2012 +0200 +++ b/src/configure.in Wed Sep 19 16:59:31 2012 +0200 @@ -1429,24 +1429,30 @@ AC_MSG_CHECKING(Ruby version) if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then AC_MSG_RESULT(OK) + AC_MSG_CHECKING(Ruby rbconfig) + ruby_rbconfig="RbConfig" + if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then + ruby_rbconfig="Config" + fi + AC_MSG_RESULT($ruby_rbconfig) AC_MSG_CHECKING(Ruby header files) - rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null` + rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null` if test "X$rubyhdrdir" != "X"; then AC_MSG_RESULT($rubyhdrdir) RUBY_CFLAGS="-I$rubyhdrdir" - rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'` + rubyarch=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['arch']]"` if test -d "$rubyhdrdir/$rubyarch"; then RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch" fi - rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'` + rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"` RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion" - rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'` + rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"` if test "X$rubylibs" != "X"; then RUBY_LIBS="$rubylibs" fi - librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'` - librubya=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBY_A"]])'` - rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'` + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` + rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` if test -f "$rubylibdir/$librubya"; then librubyarg="$librubyarg" RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" @@ -1459,7 +1465,7 @@ if test "X$librubyarg" != "X"; then RUBY_LIBS="$librubyarg $RUBY_LIBS" fi - rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'` + rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"` if test "X$rubyldflags" != "X"; then dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only dnl be included if requested by passing --with-mac-arch to @@ -1474,7 +1480,7 @@ RUBY_PRO="if_ruby.pro" AC_DEFINE(FEAT_RUBY) if test "$enable_rubyinterp" = "dynamic"; then - libruby=`$vi_cv_path_ruby -r rbconfig -e 'puts Config::CONFIG[["LIBRUBY_SO"]]'` + libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"` AC_DEFINE(DYNAMIC_RUBY) RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS" RUBY_LIBS=
