Skip to content

Commit a66b51c

Browse files
committed
Merge branch 'ab/sha1dc-build'
Push the submodule version of collision-detecting SHA-1 hash implementation a bit harder on builders. * ab/sha1dc-build: sha1dc_git.h: re-arrange an ifdef chain for a subsequent change Makefile: under "make dist", include the sha1collisiondetection submodule Makefile: don't error out under DC_SHA1_EXTERNAL if DC_SHA1_SUBMODULE=auto
2 parents b2e45c6 + aa9b3b2 commit a66b51c

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,9 @@ else
15131513
LIB_OBJS += sha1dc_git.o
15141514
ifdef DC_SHA1_EXTERNAL
15151515
ifdef DC_SHA1_SUBMODULE
1516+
ifneq ($(DC_SHA1_SUBMODULE),auto)
15161517
$(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)
1518+
endif
15171519
endif
15181520
BASIC_CFLAGS += -DDC_SHA1_EXTERNAL
15191521
EXTLIBS += -lsha1detectcoll
@@ -2668,6 +2670,21 @@ dist: git-archive$(X) configure
26682670
$(GIT_TARNAME)/configure \
26692671
$(GIT_TARNAME)/version \
26702672
$(GIT_TARNAME)/git-gui/version
2673+
ifdef DC_SHA1_SUBMODULE
2674+
@mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib
2675+
@cp sha1collisiondetection/LICENSE.txt \
2676+
$(GIT_TARNAME)/sha1collisiondetection/
2677+
@cp sha1collisiondetection/LICENSE.txt \
2678+
$(GIT_TARNAME)/sha1collisiondetection/
2679+
@cp sha1collisiondetection/lib/sha1.[ch] \
2680+
$(GIT_TARNAME)/sha1collisiondetection/lib/
2681+
@cp sha1collisiondetection/lib/ubc_check.[ch] \
2682+
$(GIT_TARNAME)/sha1collisiondetection/lib/
2683+
$(TAR) rf $(GIT_TARNAME).tar \
2684+
$(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \
2685+
$(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \
2686+
$(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch]
2687+
endif
26712688
@$(RM) -r $(GIT_TARNAME)
26722689
gzip -f -9 $(GIT_TARNAME).tar
26732690

sha1dc_git.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Plumbing with collition-detecting SHA1 code */
22

3-
#ifdef DC_SHA1_SUBMODULE
4-
#include "sha1collisiondetection/lib/sha1.h"
5-
#elif defined(DC_SHA1_EXTERNAL)
3+
#ifdef DC_SHA1_EXTERNAL
64
#include <sha1dc/sha1.h>
5+
#elif defined(DC_SHA1_SUBMODULE)
6+
#include "sha1collisiondetection/lib/sha1.h"
77
#else
88
#include "sha1dc/sha1.h"
99
#endif

0 commit comments

Comments
 (0)