@@ -1387,10 +1387,10 @@ AC_ARG_ENABLE(rubyinterp,
13871387AC_MSG_RESULT($enable_rubyinterp)
13881388if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
13891389 AC_MSG_CHECKING(--with-ruby-command argument)
1390+ AC_SUBST(vi_cv_path_ruby)
13901391 AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
1391- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
1392+ RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; AC_MSG_RESULT($RUBY_CMD),
13921393 RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
1393- AC_SUBST(vi_cv_path_ruby)
13941394 AC_PATH_PROG(vi_cv_path_ruby, $RUBY_CMD)
13951395 if test "X$vi_cv_path_ruby" != "X"; then
13961396 AC_MSG_CHECKING(Ruby version)
@@ -1412,18 +1412,15 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
14121412 RUBY_LIBS="$rubylibs"
14131413 fi
14141414 librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
1415- if test -f "$rubyhdrdir/$librubyarg"; then
1416- librubyarg="$rubyhdrdir/$librubyarg"
1417- else
1418- rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
1419- if test -f "$rubylibdir/$librubyarg"; then
1420- librubyarg="$rubylibdir/$librubyarg"
1421- elif test "$librubyarg" = "libruby.a"; then
1422- dnl required on Mac OS 10.3 where libruby.a doesn't exist
1423- librubyarg="-lruby"
1424- else
1425- librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
1426- fi
1415+ librubya=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBY_A"]])'`
1416+ rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
1417+ if test -f "$rubylibdir/$librubya"; then
1418+ librubyarg="$librubyarg"
1419+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
1420+ elif test "$librubyarg" = "libruby.a"; then
1421+ dnl required on Mac OS 10.3 where libruby.a doesn't exist
1422+ librubyarg="-lruby"
1423+ RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
14271424 fi
14281425
14291426 if test "X$librubyarg" != "X"; then
0 commit comments