]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0681: configure: -lruby added even for a dynamic ruby build v9.2.0681
authorChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 12:34:15 +0000 (12:34 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 12:34:15 +0000 (12:34 +0000)
Problem:  configure: -lruby is added to the link flags even for a
          dynamic ruby build, creating a hard dependency on the Ruby
          library (Johannes Schindelin, after v9.2.0674).
Solution: For a dynamic build filter out -l flags from librubyarg.

related: #20558

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/auto/configure
src/configure.ac
src/version.c

index bcbeb525cc1945f5115f5f8ebf13152e5c99e5f5..a20eea1667722f7632cc01193157744afc60e70e 100755 (executable)
@@ -8613,6 +8613,12 @@ printf "%s\n" "$rubyhdrdir" >&6; }
 
          RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS"
          RUBY_LIBS=
+                                         for arg in $librubyarg; do
+           case "$arg" in
+             -L*|-R*|-Wl,-R*|-Wl,-rpath*) RUBY_LIBS="$RUBY_LIBS $arg" ;;
+           esac
+         done
+         librubyarg=
        fi
        if test "X$librubyarg" != "X"; then
          RUBY_LIBS="$librubyarg $RUBY_LIBS"
index bac22369882eee6f491c21b36b26e012c679da44..710cb317fcaf8f9e4d00610f4c6febd1f6a73243 100644 (file)
@@ -2162,6 +2162,16 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
          AC_DEFINE(DYNAMIC_RUBY)
          RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS"
          RUBY_LIBS=
+         dnl For dynamic Ruby keep only the library search path / runpath from
+         dnl librubyarg so the dlopen()ed library can be found at runtime,
+         dnl without adding -lruby and thus a hard dependency on the Ruby
+         dnl library, which would defeat dynamic loading.
+         for arg in $librubyarg; do
+           case "$arg" in
+             -L*|-R*|-Wl,-R*|-Wl,-rpath*) RUBY_LIBS="$RUBY_LIBS $arg" ;;
+           esac
+         done
+         librubyarg=
        fi
        if test "X$librubyarg" != "X"; then
          RUBY_LIBS="$librubyarg $RUBY_LIBS"
index 484f7515a9fcb1496220a3e62b5021047f28d8c8..edf47e86b75e7660c8fa749c70c075e420578780 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    681,
 /**/
     680,
 /**/