Thread (1 message) 1 message, 1 author, 2017-03-12

Re: [RFC PATCH] Move SHA-1 implementation selection into a header file

From: Junio C Hamano <hidden>
Date: 2017-03-12 17:54:23

Jeff King [off-list ref] writes:
quoted hunk
diff --git a/Makefile b/Makefile
index 9f0eae428..0d65d50e9 100644
--- a/Makefile
+++ b/Makefile
@@ -690,6 +690,7 @@ XDIFF_LIB = xdiff/lib.a
 VCSSVN_LIB = vcs-svn/lib.a
 
 GENERATED_H += common-cmds.h
+GENERATED_H += hash.h
...
-BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
-	$(COMPAT_CFLAGS)
+BASIC_CFLAGS += $(COMPAT_CFLAGS)
  ...
+hash.h:
+	$(QUIET_GEN)echo '#include $(SHA1_HEADER)' >$@+ && \
+	{ cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; }
+
That looks sensible.  We do not have to adjust the code to update
GIT-BUILD-OPTIONS and friends in this patch because the current way
to force rebuilding when SHA1_HEADER changes is by letting
GIT-CFLAGS file notice the change, and the new "hash.h" itself will
let the $(MAKE) notice if a different hash implementation is chosen
for the build.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help