Fixes from vim v7.4 configure for Ruby 1.9 and later versions--
uses RbConfig instead of Config (deprecated in Ruby 1.9) and changes
vim to use libruby.so.# from /usr/lib/$(MACH64) rather than libruby.so.
Patching configure instead of configure.in; attempts to
run autoreconf against the patched configure.in produced errors.
Remove this patch once the vim upgrade to version 7.4 or later
is backported.
--- src/auto/configure Tue Jul 10 13:28:45 2012
+++ src/auto/configure Mon Feb 23 17:51:02 2015
@@ -6327,42 +6327,55 @@
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
$as_echo "OK" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby rbconfig" >&5
+$as_echo_n "checking Ruby rbconfig... " >&6; }
+ ruby_rbconfig="RbConfig"
+ if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then
+ ruby_rbconfig="Config"
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ruby_rbconfig" >&5
+$as_echo "$ruby_rbconfig" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby header files" >&5
$as_echo_n "checking Ruby header files... " >&6; }
- 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubyhdrdir" >&5
$as_echo "$rubyhdrdir" >&6; }
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]"`
+ if test "X$rubyversion" = "X"; then
+ rubyversion=`$vi_cv_path_ruby -e "print ((VERSION rescue RUBY_VERSION)).gsub(/\./, '')[0,2]"`
+ fi
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"
- elif test "$librubyarg" = "libruby.a"; then
- librubyarg="-lruby"
- RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
+ elif test "$librubyarg" = "libruby.a"; then
+ librubyarg="-lruby"
+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
fi
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
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
if test "X$rubyldflags" != "X"; then
- LDFLAGS="$rubyldflags $LDFLAGS"
+ if test "X`echo \"$LDFLAGS\" | grep -F -e \"$rubyldflags\"`" = "X"; then
+ LDFLAGS="$rubyldflags $LDFLAGS"
+ fi
fi
fi
RUBY_SRC="if_ruby.c"
@@ -6371,7 +6384,7 @@
$as_echo "#define FEAT_RUBY 1" >>confdefs.h
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 $ruby_rbconfig::CONFIG['LIBRUBY_SO']"`
$as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"