Fix link flags for Ruby

Fix #468

configure script had an issue that linker always links system Ruby framework.

    $ configure --enable-rubyinterp=yes --with-ruby-command=/usr/bin/ruby
    $ grep RUBY_LIBS src/auto/config.mk
    RUBY_LIBS= -framework Ruby

    $ configure --enable-rubyinterp=yes --with-ruby-command=/usr/local/bin/ruby
    $ grep RUBY_LIBS src/auto/config.mk
    RUBY_LIBS= -framework Ruby

After this commit, configure will pick right library settings from Ruby

    $ configure --enable-rubyinterp=yes --with-ruby-command=/usr/bin/ruby
    $ grep RUBY_LIBS src/auto/config.mk
    RUBY_LIBS= -framework Ruby

    $ configure --enable-rubyinterp=yes --with-ruby-command=/usr/local/bin/ruby
    $ grep RUBY_LIBS src/auto/config.mk
    RUBY_LIBS= -lruby.2.4.0 -lpthread -ldl -lobjc
This commit is contained in:
Kazuki Sakamoto
2017-03-10 08:26:01 -08:00
parent 32697534ba
commit 9d23d58d4c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -7262,7 +7262,7 @@ $as_echo "$rubyhdrdir" >&6; }
if test -f "$rubylibdir/$librubya"; then
librubyarg="$librubyarg"
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
elif test "$vi_cv_path_ruby" = "/usr/bin/ruby" -a -d "/System/Library/Frameworks/Ruby.framework"; then
RUBY_LIBS="-framework Ruby"
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
librubyarg=
+1 -1
View File
@@ -1930,7 +1930,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 -d "/System/Library/Frameworks/Ruby.framework"; then
elif test "$vi_cv_path_ruby" = "/usr/bin/ruby" -a -d "/System/Library/Frameworks/Ruby.framework"; then
dnl On Mac OS X it is safer to just use the -framework flag
RUBY_LIBS="-framework Ruby"
dnl Don't include the -I flag when -framework is set