Skip to content

Commit 9d23d58

Browse files
committed
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
1 parent 3269753 commit 9d23d58

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/auto/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7262,7 +7262,7 @@ $as_echo "$rubyhdrdir" >&6; }
72627262
if test -f "$rubylibdir/$librubya"; then
72637263
librubyarg="$librubyarg"
72647264
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
7265-
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
7265+
elif test "$vi_cv_path_ruby" = "/usr/bin/ruby" -a -d "/System/Library/Frameworks/Ruby.framework"; then
72667266
RUBY_LIBS="-framework Ruby"
72677267
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
72687268
librubyarg=

src/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
19301930
if test -f "$rubylibdir/$librubya"; then
19311931
librubyarg="$librubyarg"
19321932
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1933-
elif test -d "/System/Library/Frameworks/Ruby.framework"; then
1933+
elif test "$vi_cv_path_ruby" = "/usr/bin/ruby" -a -d "/System/Library/Frameworks/Ruby.framework"; then
19341934
dnl On Mac OS X it is safer to just use the -framework flag
19351935
RUBY_LIBS="-framework Ruby"
19361936
dnl Don't include the -I flag when -framework is set

0 commit comments

Comments
 (0)