From cef661fc799a3a13ffdea4a3f69f1acd295de53d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 21 Apr 2005 12:33:22 -0700 Subject: Add support for alternate SHA1 library implementations. This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig. It's dual-licenced under MPL-1.1 or GPL, so in the context of git, we obviously use the GPL version. Side note: the Mozilla SHA1 implementation is about twice as fast as the default openssl one on my G5, but the default openssl one has optimized x86 assembly language on x86. So choose wisely. --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 562338ae0c..9573a1189d 100644 --- a/Makefile +++ b/Makefile @@ -29,22 +29,22 @@ LIB_H=cache.h object.h LIBS = $(LIB_FILE) LIBS += -lz -LIBS += -lssl + +ifdef MOZILLA_SHA1 + SHA1_HEADER="mozilla-sha1/sha1.h" + LIB_OBJS += mozilla-sha1/sha1.o +else + SHA1_HEADER= + LIBS += -lssl +endif + +CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)' $(LIB_FILE): $(LIB_OBJS) $(AR) rcs $@ $(LIB_OBJS) init-db: init-db.o -fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o - $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS) - -rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o - $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS) - -merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o - $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS) - %: %.o $(LIB_FILE) $(CC) $(CFLAGS) -o $@ $< $(LIBS) @@ -77,7 +77,7 @@ unpack-file.o: $(LIB_H) write-tree.o: $(LIB_H) clean: - rm -f *.o $(PROG) $(LIB_FILE) + rm -f *.o mozilla-sha1/*.o $(PROG) $(LIB_FILE) backup: clean cd .. ; tar czvf dircache.tar.gz dir-cache -- cgit v1.3-5-g9baa