From 9d23d58d4c8800b395986fbcdeba4c80e7afe4d7 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 10 Mar 2017 08:26:01 -0800 Subject: [PATCH] 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 --- src/auto/configure | 2 +- src/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 3a73d5a351..842b000e23 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -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= diff --git a/src/configure.ac b/src/configure.ac index 72ca52e62e..bf6a94d2e7 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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