aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-19 10:47:50 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-19 10:47:50 +0900
commitcb6ec86d296cc8e2541770bf827b4abcfc310178 (patch)
treecafad938736cc912a8143722037cb292f8ab9a5d /Makefile
parent6867272d5b5615bd74ec97bf35b4c4a8d9fe3a51 (diff)
parent3964cbbb5c30609ebd795a979074251cf59436c3 (diff)
downloadgit-cb6ec86d296cc8e2541770bf827b4abcfc310178.tar.gz
git-cb6ec86d296cc8e2541770bf827b4abcfc310178.tar.xz
Merge branch 'ti/external-sha1dc'
Platforms that ship with a separate sha1 with collision detection library can link to it instead of using the copy we ship as part of our source tree. * ti/external-sha1dc: sha1dc: allow building with the external sha1dc library sha1dc: build git plumbing code more explicitly
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f2bb7f2f6..68948dfbf 100644
--- a/Makefile
+++ b/Makefile
@@ -162,6 +162,11 @@ all::
# algorithm. This is slower, but may detect attempted collision attacks.
# Takes priority over other *_SHA1 knobs.
#
+# Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link
+# git with the external SHA1 collision-detect library.
+# Without this option, i.e. the default behavior is to build git with its
+# own built-in code (or submodule).
+#
# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
# sha1collisiondetection shipped as a submodule instead of the
# non-submodule copy in sha1dc/. This is an experimental option used
@@ -1475,6 +1480,15 @@ ifdef APPLE_COMMON_CRYPTO
BASIC_CFLAGS += -DSHA1_APPLE
else
DC_SHA1 := YesPlease
+ BASIC_CFLAGS += -DSHA1_DC
+ LIB_OBJS += sha1dc_git.o
+ifdef DC_SHA1_EXTERNAL
+ ifdef DC_SHA1_SUBMODULE
+$(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)
+ endif
+ BASIC_CFLAGS += -DDC_SHA1_EXTERNAL
+ EXTLIBS += -lsha1detectcoll
+else
ifdef DC_SHA1_SUBMODULE
LIB_OBJS += sha1collisiondetection/lib/sha1.o
LIB_OBJS += sha1collisiondetection/lib/ubc_check.o
@@ -1484,17 +1498,15 @@ else
LIB_OBJS += sha1dc/ubc_check.o
endif
BASIC_CFLAGS += \
- -DSHA1_DC \
-DSHA1DC_NO_STANDARD_INCLUDES \
-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
- -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C="\"sha1dc_git.c\"" \
- -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H="\"sha1dc_git.h\"" \
-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
endif
endif
endif
endif
+endif
ifdef SHA1_MAX_BLOCK_SIZE
LIB_OBJS += compat/sha1-chunked.o