Hi!

I was building vim from source on macOS with --enable-rubyinterp and inside 
default rvm environment and encountered an error during build.

The error was that ld couldn’t find the ruby.2.4.1 library. Upon more thorough 
inspection of the build log, I found that although configure script found ruby 
include dir correctly, it didn’t find the library path.

The configuration script used a check for whether ruby command `ruby -r 
rbconfig -e 'print RbConfig::CONFIG["LIBRUBY_A"]’`returned ‘libruby.a’ do 
decide that it is on macOS and act accordingly. In fact, that command returns 
'libruby.2.4.1-static.a’ on my configuration (I believe it is not so much 
specific to my configuration, since macOS default ruby returns similar value).

To accomodate for that difference, I propose the following patch to 
configure.ac:

diff --git a/src/configure.ac b/src/configure.ac
index 938a77f91..1b031d52a 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -1878,7 +1878,7 @@ if test "$enable_rubyinterp" = "yes" -o 
"$enable_rubyinterp" = "dynamic"; then
        if test -f "$rubylibdir/$librubya"; then
          librubyarg="$librubyarg"
          RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
-       elif test "$librubyarg" = "libruby.a"; then
+       elif test "X`echo \"$librubya\" | $GREP -e \"libruby.*\\.a\"`" != "X"; 
then
          dnl required on Mac OS 10.3 where libruby.a doesn't exist
          librubyarg="-lruby"
          RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"

With regards, Ilya Mikhaltsou.

P.S. Also, there is a question of why `elif test "$librubyarg" = "libruby.a"` 
is not `elif test "$librubya" = "libruby.a"`. Did I miss some old obscure usage?

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui