]> granicus.if.org Git - vim/commitdiff
patch 8.2.4039: the xdiff library is linked in even when not used v8.2.4039
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 13:36:57 +0000 (13:36 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 13:36:57 +0000 (13:36 +0000)
Problem:    The xdiff library is linked in even when not used.
Solution:   Use configure to decide whether xdiff object files are included.

src/Makefile
src/auto/configure
src/config.mk.in
src/configure.ac
src/feature.h
src/version.c

index aafe1398dcab790a7bae52d0554a1a744ac630e7..c65781ec59d1964e90469152c4b8f670fc1b2d9f 100644 (file)
@@ -1874,7 +1874,7 @@ OBJ_COMMON = \
        $(OS_EXTRA_OBJ) \
        $(NETBEANS_OBJ) \
        $(CHANNEL_OBJ) \
-       $(XDIFF_OBJS)
+       $(XDIFF_OBJS_USED)
 
 # The files included by tests are not in OBJ_COMMON.
 OBJ_MAIN = \
index cde05d688efe00106cf1f4af5be3a59040285255..72d2d076dc82ddca1e859cfe01531c8f0b5086a2 100755 (executable)
@@ -714,6 +714,7 @@ LUA_SRC
 vi_cv_path_plain_lua
 vi_cv_path_luajit
 vi_cv_path_lua
+XDIFF_OBJS_USED
 compiledby
 dogvimdiff
 dovimdiff
@@ -5305,6 +5306,20 @@ else
 $as_echo "yes" >&6; }
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking diff feature" >&5
+$as_echo_n "checking diff feature... " >&6; }
+if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled in $features version" >&5
+$as_echo "disabled in $features version" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled" >&5
+$as_echo "enabled" >&6; }
+  $as_echo "#define FEAT_DIFF 1" >>confdefs.h
+
+  XDIFF_OBJS_USED="\$(XDIFF_OBJS)"
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-luainterp argument" >&5
 $as_echo_n "checking --enable-luainterp argument... " >&6; }
 # Check whether --enable-luainterp was given.
index df09cfe30b67017934456aa86418926ac0690256..4eb692839be5d003e04a0c369367ceb3d9c6938d 100644 (file)
@@ -37,6 +37,8 @@ X_PRE_LIBS    = @X_PRE_LIBS@
 X_EXTRA_LIBS   = @X_EXTRA_LIBS@
 X_LIBS         = @X_LIB@
 
+XDIFF_OBJS_USED        = @XDIFF_OBJS_USED@
+
 LUA_LIBS       = @LUA_LIBS@
 LUA_SRC                = @LUA_SRC@
 LUA_OBJ                = @LUA_OBJ@
index b5f217ca1f92a93523fdbc3b938b60a2c52ea5fc..86f70f581cd1999acde807ce44d35b509ff5149a 100644 (file)
@@ -567,6 +567,16 @@ else
   AC_MSG_RESULT(yes)
 fi
 
+AC_MSG_CHECKING([diff feature])
+if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+  AC_MSG_RESULT([disabled in $features version])
+else
+  AC_MSG_RESULT(enabled)
+  AC_DEFINE(FEAT_DIFF)
+  XDIFF_OBJS_USED="\$(XDIFF_OBJS)"
+  AC_SUBST(XDIFF_OBJS_USED)
+fi
+
 dnl Check for Lua feature.
 AC_MSG_CHECKING(--enable-luainterp argument)
 AC_ARG_ENABLE(luainterp,
index fcd0d4b5cbd53f3f3ad85bbc7f286a2f7c679f1e..b2df6f9a5c8e9c18f50440e7746d4185d7417f00 100644 (file)
 /*
  * +diff               Displaying diffs in a nice way.
  *                     Requires +windows and +autocmd.
+ *                     Can be enabled in autoconf already.
  */
-#if defined(FEAT_NORMAL)
+#if defined(FEAT_NORMAL) && !defined(FEAT_DIFF)
 # define FEAT_DIFF
 #endif
 
index c4d639ef6a8c4387e8678109471bc6edde9a0429..542227c903a2affb8d676b178e5da119f46e36e0 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4039,
 /**/
     4038,
 /**/