Merge branch 'jc/sha1'
authorJunio C Hamano <junkio@cox.net>
Wed, 5 Jul 2006 23:36:25 +0000 (16:36 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 5 Jul 2006 23:36:25 +0000 (16:36 -0700)
* jc/sha1:
A better-scheduled PPC SHA-1 implementation.
test-sha1: test hashing large buffer
Makefile: add framework to verify and bench sha1 implementations.

1  2 
Makefile
diff --combined Makefile
index a78d05ddaa640ad50792c4fb8c78b957eb83400c,ea0044d62371566ae3903a5d29196473ffa0041e..7fa4a271bd55bfbf8db81178c2de47f7ebcfd298
+++ b/Makefile
@@@ -26,8 -26,6 +26,8 @@@ all
  #
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
 +# Define NO_STRLCPY if you don't have strlcpy.
 +#
  # Define NO_SETENV if you don't have setenv in the C library.
  #
  # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
@@@ -131,7 -129,7 +131,7 @@@ SCRIPT_SH = 
  
  SCRIPT_PERL = \
        git-archimport.perl git-cvsimport.perl git-relink.perl \
 -      git-shortlog.perl git-fmt-merge-msg.perl git-rerere.perl \
 +      git-shortlog.perl git-rerere.perl \
        git-annotate.perl git-cvsserver.perl \
        git-svnimport.perl git-mv.perl git-cvsexportcommit.perl \
        git-send-email.perl
@@@ -173,8 -171,7 +173,8 @@@ BUILT_INS = git-log$X git-whatchanged$
        git-ls-files$X git-ls-tree$X git-get-tar-commit-id$X \
        git-read-tree$X git-commit-tree$X git-write-tree$X \
        git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
 -      git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X
 +      git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
 +      git-fmt-merge-msg$X
  
  # what 'all' will build and 'install' will install, in gitexecdir
  ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@@ -230,7 -227,7 +230,7 @@@ BUILTIN_OBJS = 
        builtin-apply.o builtin-show-branch.o builtin-diff-files.o \
        builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
        builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
 -      builtin-update-ref.o
 +      builtin-update-ref.o builtin-fmt-merge-msg.o
  
  GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
  LIBS = $(GITLIBS) -lz
  # because maintaining the nesting to match is a pain.  If
  # we had "elif" things would have been much nicer...
  
 +ifeq ($(uname_S),Linux)
 +      NO_STRLCPY = YesPlease
 +endif
  ifeq ($(uname_S),Darwin)
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
 +      NO_STRLCPY = YesPlease
        ## fink
        ifeq ($(shell test -d /sw/lib && echo y),y)
                ALL_CFLAGS += -I/sw/include
@@@ -266,7 -259,6 +266,7 @@@ ifeq ($(uname_S),SunOS
        NEEDS_NSL = YesPlease
        SHELL_PATH = /bin/bash
        NO_STRCASESTR = YesPlease
 +      NO_STRLCPY = YesPlease
        ifeq ($(uname_R),5.8)
                NEEDS_LIBICONV = YesPlease
                NO_UNSETENV = YesPlease
@@@ -284,7 -276,6 +284,7 @@@ ifeq ($(uname_O),Cygwin
        NO_D_TYPE_IN_DIRENT = YesPlease
        NO_D_INO_IN_DIRENT = YesPlease
        NO_STRCASESTR = YesPlease
 +      NO_STRLCPY = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NEEDS_LIBICONV = YesPlease
        # There are conflicting reports about this.
@@@ -314,14 -305,12 +314,14 @@@ ifeq ($(uname_S),NetBSD
  endif
  ifeq ($(uname_S),AIX)
        NO_STRCASESTR=YesPlease
 +      NO_STRLCPY = YesPlease
        NEEDS_LIBICONV=YesPlease
  endif
  ifeq ($(uname_S),IRIX64)
        NO_IPV6=YesPlease
        NO_SETENV=YesPlease
        NO_STRCASESTR=YesPlease
 +      NO_STRLCPY = YesPlease
        NO_SOCKADDR_STORAGE=YesPlease
        SHELL_PATH=/usr/gnu/bin/bash
        ALL_CFLAGS += -DPATH_MAX=1024
@@@ -414,10 -403,6 +414,10 @@@ ifdef NO_STRCASEST
        COMPAT_CFLAGS += -DNO_STRCASESTR
        COMPAT_OBJS += compat/strcasestr.o
  endif
 +ifdef NO_STRLCPY
 +      COMPAT_CFLAGS += -DNO_STRLCPY
 +      COMPAT_OBJS += compat/strlcpy.o
 +endif
  ifdef NO_SETENV
        COMPAT_CFLAGS += -DNO_SETENV
        COMPAT_OBJS += compat/setenv.o
@@@ -588,11 -573,11 +588,11 @@@ git-ssh-push$X: rsh.
  git-imap-send$X: imap-send.o $(LIB_FILE)
  
  http.o http-fetch.o http-push.o: http.h
 -git-http-fetch$X: fetch.o http.o http-fetch.o $(LIB_FILE)
 +git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS)
        $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
 -git-http-push$X: revision.o http.o http-push.o $(LIB_FILE)
 +git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
        $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
@@@ -651,6 -636,12 +651,12 @@@ test-delta$X: test-delta.c diff-delta.
  test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS)
        $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
+ test-sha1$X: test-sha1.o $(GITLIBS)
+       $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
+ check-sha1:: test-sha1$X
+       ./test-sha1.sh
  check:
        for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done