Hi,
I've had Mac users reporting problems with the --with-ruby-command
switch to configure (or when the version of Ruby in the PATH is in a
non-standard location) and subsequently received patches that fixes
the problem (see below).
As far as I can understand setting 'librubyarg' doesn't work because
the wrong Ruby command is used to figure out where the Ruby library is
located (it seems to be searching for libraries in a header directory,
why?).
This patch is necessary for Ruby linking to work properly on Mac OS X
(I've had at least two independent verifications that it works), but I
do not know if it breaks other platforms. Can somebody please test
this?
Björn
diff --git a/src/configure.in b/src/configure.in
index 7b5e08f..ddcebd1 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1387,10 +1387,10 @@ AC_ARG_ENABLE(rubyinterp,
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
AC_MSG_CHECKING(--with-ruby-command argument)
+ AC_SUBST(vi_cv_path_ruby)
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the
Ruby command (default: ruby)],
- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
+ RUBY_CMD="$withval"; vi_cv_path_ruby="$withval";
AC_MSG_RESULT($RUBY_CMD),
RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
- AC_SUBST(vi_cv_path_ruby)
AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
if test "X$vi_cv_path_ruby" != "X"; then
AC_MSG_CHECKING(Ruby version)
@@ -1412,18 +1412,15 @@ if test "$enable_rubyinterp" = "yes" -o
"$enable_rubyinterp" = "dynamic"; then
RUBY_LIBS="$rubylibs"
fi
librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print
Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
- if test -f "$rubyhdrdir/$librubyarg"; then
- librubyarg="$rubyhdrdir/$librubyarg"
- else
- rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print
Config.expand(Config::CONFIG[["libdir"]])'`
- if test -f "$rubylibdir/$librubyarg"; then
- librubyarg="$rubylibdir/$librubyarg"
- elif test "$librubyarg" = "libruby.a"; then
- dnl required on Mac OS 10.3 where libruby.a doesn't exist
- librubyarg="-lruby"
- else
- librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print
'$librubyarg'.gsub(/-L\./,
%'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
- fi
+ 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"]])'`
+ if test -f "$rubylibdir/$librubya"; then
+ librubyarg="$librubyarg"
+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
+ elif test "$librubyarg" = "libruby.a"; then
+ dnl required on Mac OS 10.3 where libruby.a doesn't exist
+ librubyarg="-lruby"
+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
fi
if test "X$librubyarg" != "X"; then
--
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