patch 8.1.0360: using an external diff program is slow and inflexible
Problem: Using an external diff program is slow and inflexible.
Solution: Include the xdiff library. (Christian Brabandt, closes #2732)
Use it by default.
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
index 16cd712..2308135 100644
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -166,6 +166,25 @@
ifndef CROSS_COMPILE
CROSS_COMPILE =
endif
+
+# About the "sh.exe" condition, as explained by Ken Takata:
+#
+# If the makefile is executed with mingw32-make and sh.exe is not found in
+# $PATH, then $SHELL is set to "sh.exe" (without any path). In this case,
+# unix-like commands might not work and a dos-style path is needed.
+#
+# If the makefile is executed with mingw32-make and sh.exe IS found in $PATH,
+# then $SHELL is set with the actual path of sh.exe (e.g.
+# "C:/msys64/usr/bin/sh.exe"). In this case, unix-like commands can be used.
+#
+# If it is executed by the "make" command from cmd.exe, $SHELL is set to
+# "/bin/sh". If the "make" command is in the $PATH, other unix-like commands
+# might also work.
+#
+# If it is executed by the "make" command from a unix-like shell,
+# $SHELL is set with the unix-style path (e.g. "/bin/bash").
+# In this case, unix-like commands can be used.
+#
ifneq (sh.exe, $(SHELL))
DEL = rm
MKDIR = mkdir -p
@@ -810,6 +829,23 @@
$(OUTDIR)/term_vterm.o
endif
+# Include xdiff
+OBJ += $(OUTDIR)/xdiffi.o \
+ $(OUTDIR)/xemit.o \
+ $(OUTDIR)/xprepare.o \
+ $(OUTDIR)/xutils.o \
+ $(OUTDIR)/xhistogram.o \
+ $(OUTDIR)/xpatience.o
+
+XDIFF_DEPS = \
+ xdiff/xdiff.h \
+ xdiff/xdiffi.h \
+ xdiff/xemit.h \
+ xdiff/xinclude.h \
+ xdiff/xmacros.h \
+ xdiff/xprepare.h \
+ xdiff/xtypes.h \
+ xdiff/xutils.h
ifdef MZSCHEME
MZSCHEME_SUFFIX = Z
@@ -1055,6 +1091,23 @@
$(OUTDIR)/term_vterm.o: libvterm/src/vterm.c $(TERM_DEPS)
$(CCCTERM) libvterm/src/vterm.c -o $@
+$(OUTDIR)/xdiffi.o: xdiff/xdiffi.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xdiffi.c -o $(OUTDIR)/xdiffi.o
+
+$(OUTDIR)/xemit.o: xdiff/xemit.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xemit.c -o $(OUTDIR)/xemit.o
+
+$(OUTDIR)/xprepare.o: xdiff/xprepare.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xprepare.c -o $(OUTDIR)/xprepare.o
+
+$(OUTDIR)/xutils.o: xdiff/xutils.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xutils.c -o $(OUTDIR)/xutils.o
+
+$(OUTDIR)/xhistogram.o: xdiff/xhistogram.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xhistogram.c -o $(OUTDIR)/xhistogram.o
+
+$(OUTDIR)/xpatience.o: xdiff/xpatience.c $(XDIFF_DEPS)
+ $(CC) -c $(CFLAGS) xdiff/xpatience.c -o $(OUTDIR)/xpatience.o
pathdef.c: $(INCL)
ifneq (sh.exe, $(SHELL))