diff -Naur git-1.5.2.2-orig/Makefile git-1.5.2.2/Makefile
--- git-1.5.2.2-orig/Makefile	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/Makefile	2007-06-30 00:01:12.000000000 -0400
@@ -1,140 +1,10 @@
 # The default target of this Makefile is...
 all::
 
-# Define V=1 to have a more verbose compile.
-#
-# Define NO_OPENSSL environment variable if you do not have OpenSSL.
-# This also implies MOZILLA_SHA1.
-#
-# Define NO_CURL if you do not have curl installed.  git-http-pull and
-# git-http-push are not built, and you cannot use http:// and https://
-# transports.
-#
-# Define CURLDIR=/foo/bar if your curl header and library files are in
-# /foo/bar/include and /foo/bar/lib directories.
-#
-# Define NO_EXPAT if you do not have expat installed.  git-http-push is
-# not built, and you cannot push using http:// and https:// transports.
-#
-# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
-#
-# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
-# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
-#
-# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
-# do not support the 'size specifiers' introduced by C99, namely ll, hh,
-# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
-# some C compilers supported these specifiers prior to C99 as an extension.
-#
-# Define NO_STRCASESTR if you don't have strcasestr.
-#
-# Define NO_STRLCPY if you don't have strlcpy.
-#
-# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
-# If your compiler also does not support long long or does not have
-# strtoull, define NO_STRTOULL.
-#
-# 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.
-# Enable it on Windows.  By default, symrefs are still used.
-#
-# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
-# tests.  These tests take up a significant amount of the total test time
-# but are not needed unless you plan to talk to SVN repos.
-#
-# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
-# installed in /sw, but don't want GIT to link against any libraries
-# installed there.  If defined you may specify your own (or Fink's)
-# include directories and library directories by defining CFLAGS
-# and LDFLAGS appropriately.
-#
-# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
-# have DarwinPorts installed in /opt/local, but don't want GIT to
-# link against any libraries installed there.  If defined you may
-# specify your own (or DarwinPort's) include directories and
-# library directories by defining CFLAGS and LDFLAGS appropriately.
-#
-# Define PPC_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for PowerPC.
-#
-# Define ARM_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine optimized for ARM.
-#
-# Define MOZILLA_SHA1 environment variable when running make to make use of
-# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
-# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
-# choice) has very fast version optimized for i586.
-#
-# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
-#
-# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
-#
-# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
-# Patrick Mauritz).
-#
-# Define NO_MMAP if you want to avoid mmap.
-#
-# Define NO_PREAD if you have a problem with pread() system call (e.g.
-# cygwin.dll before v1.5.22).
-#
-# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
-# generally faster on your platform than accessing the working directory.
-#
-# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
-# the executable mode bit, but doesn't really do so.
-#
-# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
-#
-# Define NO_SOCKADDR_STORAGE if your platform does not have struct
-# sockaddr_storage.
-#
-# Define NO_ICONV if your libc does not properly support iconv.
-#
-# Define OLD_ICONV if your library has an old iconv(), where the second
-# (input buffer pointer) parameter is declared with type (const char **).
-#
-# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
-# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
-# is used instead.
-#
-# Define USE_NSEC below if you want git to care about sub-second file mtimes
-# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
-# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
-# randomly break unless your underlying filesystem supports those sub-second
-# times (my ext3 doesn't).
-#
-# Define USE_STDEV below if you want git to care about the underlying device
-# change being considered an inode change from the update-cache perspective.
-#
-# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
-#
-# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
-# MakeMaker (e.g. using ActiveState under Cygwin).
-#
-# Define WITH_P4IMPORT to build and install Python git-p4import script.
-#
-# Define NO_TCLTK if you do not want Tcl/Tk GUI.
-#
-# The TCL_PATH variable governs the location of the Tcl interpreter
-# used to optimize git-gui for your system.  Only used if NO_TCLTK
-# is not set.  Defaults to the bare 'tclsh'.
-#
-# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
-# If not set it defaults to the bare 'wish'. If it is set to the empty
-# string then NO_TCLTK will be forced (this is used by configure script).
-#
-
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
 
-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
-uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
-uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
-uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
-
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
@@ -387,103 +257,6 @@
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
 EXTLIBS = -lz
 
-#
-# Platform specific tweaks
-#
-
-# We choose to avoid "if .. else if .. else .. endif endif"
-# 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),GNU/kFreeBSD)
-	NO_STRLCPY = YesPlease
-endif
-ifeq ($(uname_S),Darwin)
-	NEEDS_SSL_WITH_CRYPTO = YesPlease
-	NEEDS_LIBICONV = YesPlease
-	OLD_ICONV = UnfortunatelyYes
-	NO_STRLCPY = YesPlease
-endif
-ifeq ($(uname_S),SunOS)
-	NEEDS_SOCKET = YesPlease
-	NEEDS_NSL = YesPlease
-	SHELL_PATH = /bin/bash
-	NO_STRCASESTR = YesPlease
-	NO_HSTRERROR = YesPlease
-	ifeq ($(uname_R),5.8)
-		NEEDS_LIBICONV = YesPlease
-		NO_UNSETENV = YesPlease
-		NO_SETENV = YesPlease
-		NO_C99_FORMAT = YesPlease
-		NO_STRTOUMAX = YesPlease
-	endif
-	ifeq ($(uname_R),5.9)
-		NO_UNSETENV = YesPlease
-		NO_SETENV = YesPlease
-		NO_C99_FORMAT = YesPlease
-		NO_STRTOUMAX = YesPlease
-	endif
-	INSTALL = ginstall
-	TAR = gtar
-	BASIC_CFLAGS += -D__EXTENSIONS__
-endif
-ifeq ($(uname_O),Cygwin)
-	NO_D_TYPE_IN_DIRENT = YesPlease
-	NO_D_INO_IN_DIRENT = YesPlease
-	NO_STRCASESTR = YesPlease
-	NO_SYMLINK_HEAD = YesPlease
-	NEEDS_LIBICONV = YesPlease
-	NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
-	NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
-	# There are conflicting reports about this.
-	# On some boxes NO_MMAP is needed, and not so elsewhere.
-	# Try commenting this out if you suspect MMAP is more efficient
-	NO_MMAP = YesPlease
-	NO_IPV6 = YesPlease
-	X = .exe
-endif
-ifeq ($(uname_S),FreeBSD)
-	NEEDS_LIBICONV = YesPlease
-	BASIC_CFLAGS += -I/usr/local/include
-	BASIC_LDFLAGS += -L/usr/local/lib
-endif
-ifeq ($(uname_S),OpenBSD)
-	NO_STRCASESTR = YesPlease
-	NEEDS_LIBICONV = YesPlease
-	BASIC_CFLAGS += -I/usr/local/include
-	BASIC_LDFLAGS += -L/usr/local/lib
-endif
-ifeq ($(uname_S),NetBSD)
-	ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
-		NEEDS_LIBICONV = YesPlease
-	endif
-	BASIC_CFLAGS += -I/usr/pkg/include
-	BASIC_LDFLAGS += -L/usr/pkg/lib
-	ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
-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
-	BASIC_CFLAGS += -DPATH_MAX=1024
-	# for now, build 32-bit version
-	BASIC_LDFLAGS += -L/usr/lib32
-endif
-ifneq (,$(findstring arm,$(uname_M)))
-	ARM_SHA1 = YesPlease
-endif
-
 -include config.mak.autogen
 -include config.mak
 
@@ -575,6 +348,20 @@
 ifdef NO_SYMLINK_HEAD
 	BASIC_CFLAGS += -DNO_SYMLINK_HEAD
 endif
+ifdef NO_TIME_R
+	COMPAT_CFLAGS += -DNO_TIME_R
+	COMPAT_OBJS += compat/gmtime_r.o
+endif
+ifdef NO_POLL
+	COMPAT_CFLAGS += -DNO_POLL
+	COMPAT_OBJS += compat/poll.o
+endif
+ifdef NO_SOCKLEN_T
+	CFLAGS += -DNO_SOCKLEN_T
+endif
+ifdef LESS_FLAGS
+	CFLAGS += -DLESS_FLAGS=\"$(LESS_FLAGS)\"
+endif
 ifdef NO_STRCASESTR
 	COMPAT_CFLAGS += -DNO_STRCASESTR
 	COMPAT_OBJS += compat/strcasestr.o
@@ -767,6 +554,7 @@
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@LESS_FLAGS@@/$(LESS_FLAGS)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    $@.sh >$@+ && \
 	chmod +x $@+ && \
@@ -778,6 +566,7 @@
 	rm -f $@ $@+
 	sed -e '1s|#!.*/python|#!$(PYTHON_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@LESS_FLAGS@@/$(LESS_FLAGS)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    $@.py >$@+
 	chmod +x $@+
@@ -798,6 +587,7 @@
 	    -e '}' \
 	    -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@LESS_FLAGS@@/$(LESS_FLAGS)/g' \
 	    $@.perl >$@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
@@ -832,6 +622,7 @@
 	$(QUIET_GEN)rm -f $@ $@+ && \
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@LESS_FLAGS@@/$(LESS_FLAGS)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
 	    -e '/@@GITWEB_CGI@@/d' \
@@ -844,6 +635,7 @@
 configure: configure.ac
 	$(QUIET_GEN)rm -f $@ $<+ && \
 	sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    -e 's/@@LESS_FLAGS@@/$(LESS_FLAGS)/g' \
 	    $< > $<+ && \
 	autoconf -o $@ $<+ && \
 	rm -f $<+
diff -Naur git-1.5.2.2-orig/builtin-blame.c git-1.5.2.2/builtin-blame.c
--- git-1.5.2.2-orig/builtin-blame.c	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/builtin-blame.c	2007-06-29 23:37:43.000000000 -0400
@@ -1554,7 +1554,7 @@
 	strcpy(hex, sha1_to_hex(suspect->commit->object.sha1));
 	printf("%s%c%d %d %d\n",
 	       hex,
-	       ent->guilty ? ' ' : '*', // purely for debugging
+	       ent->guilty ? ' ' : '*', /* purely for debugging */
 	       ent->s_lno + 1,
 	       ent->lno + 1,
 	       ent->num_lines);
diff -Naur git-1.5.2.2-orig/builtin-for-each-ref.c git-1.5.2.2/builtin-for-each-ref.c
--- git-1.5.2.2-orig/builtin-for-each-ref.c	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/builtin-for-each-ref.c	2007-06-29 22:17:45.000000000 -0400
@@ -520,10 +520,10 @@
 		grab_person("committer", val, deref, obj, buf, sz);
 		break;
 	case OBJ_TREE:
-		// grab_tree_values(val, deref, obj, buf, sz);
+		/* grab_tree_values(val, deref, obj, buf, sz); */
 		break;
 	case OBJ_BLOB:
-		// grab_blob_values(val, deref, obj, buf, sz);
+		/* grab_blob_values(val, deref, obj, buf, sz); */
 		break;
 	default:
 		die("Eh?  Object of type %d?", obj->type);
diff -Naur git-1.5.2.2-orig/compat/gmtime_r.c git-1.5.2.2/compat/gmtime_r.c
--- git-1.5.2.2-orig/compat/gmtime_r.c	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/compat/gmtime_r.c	2007-06-29 23:34:45.000000000 -0400
@@ -0,0 +1,22 @@
+#include <time.h>
+
+struct tm *
+gitgmtime_r(time_t *now, struct tm *res)
+{
+    struct tm *p = gmtime(now);
+
+    if (p) { *res = *p; return res; }
+
+    return 0;
+}
+
+
+struct tm *
+gitlocaltime_r(time_t *now, struct tm *res)
+{
+    struct tm *p = localtime(now);
+
+    if (p) { *res = *p; return res; }
+
+    return 0;
+}
diff -Naur git-1.5.2.2-orig/compat/poll.c git-1.5.2.2/compat/poll.c
--- git-1.5.2.2-orig/compat/poll.c	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/compat/poll.c	2007-06-30 00:13:39.000000000 -0400
@@ -0,0 +1,50 @@
+/*
+ * pretend poll using select()
+ */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "poll.h"
+
+int
+gitpoll(struct pollfd *arr, int nelems, int timeout)
+{
+    struct timeval tick;
+    fd_set input, output, error;
+    int rv, i, max = 0;
+
+    FD_ZERO(&input);
+    FD_ZERO(&output);
+    FD_ZERO(&error);
+
+    for (i=0; i < nelems; i++) {
+	arr[i].revents = 0;
+	if (max < arr[i].fd)
+	    max = arr[i].fd;
+	if (arr[i].events & POLLIN)
+	    FD_SET(arr[i].fd, &input);
+	if (arr[i].events & POLLOUT)
+	    FD_SET(arr[i].fd, &output);
+	if (arr[i].events & POLLHUP)
+	    FD_SET(arr[i].fd, &error);
+    }
+    
+    tick.tv_sec = timeout;
+    tick.tv_usec= 0;
+
+    rv=select(max+1, &input, &output, &error, (timeout != -1) ? &tick : NULL);
+
+    if (rv != -1) {
+	for (i=0; i < nelems; i++) {
+	    if (FD_ISSET(arr[i].fd, &input))
+		arr[i].revents |= POLLIN;
+	    if (FD_ISSET(arr[i].fd, &output))
+		arr[i].revents |= POLLOUT;
+	    if (FD_ISSET(arr[i].fd, &error))
+		arr[i].revents |= POLLHUP;
+	}
+    }
+    
+    return rv;
+}
diff -Naur git-1.5.2.2-orig/compat/poll.h git-1.5.2.2/compat/poll.h
--- git-1.5.2.2-orig/compat/poll.h	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/compat/poll.h	2007-06-29 23:57:36.000000000 -0400
@@ -0,0 +1,16 @@
+#ifndef GIT_POLL_H
+#define	GIT_POLL_H
+
+#define POLLIN	0x01
+#define POLLOUT	0x04
+#define POLLHUP	0x08
+
+struct pollfd {
+	int     fd;
+	short   events;
+	short   revents;
+};
+
+extern int poll(struct pollfd*,int,int);
+
+#endif/*GIT_POLL_H*/
diff -Naur git-1.5.2.2-orig/config.mak git-1.5.2.2/config.mak
--- git-1.5.2.2-orig/config.mak	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/config.mak	2007-06-30 08:23:59.000000000 -0400
@@ -0,0 +1,245 @@
+# Define V=1 to have a more verbose compile.
+#
+# Define NO_OPENSSL environment variable if you do not have OpenSSL.
+# This also implies MOZILLA_SHA1.
+#
+# Define NO_CURL if you do not have curl installed.  git-http-pull and
+# git-http-push are not built, and you cannot use http:// and https://
+# transports.
+#
+# Define CURLDIR=/foo/bar if your curl header and library files are in
+# /foo/bar/include and /foo/bar/lib directories.
+#
+# Define NO_EXPAT if you do not have expat installed.  git-http-push is
+# not built, and you cannot push using http:// and https:// transports.
+#
+# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
+#
+# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
+# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
+#
+# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
+# do not support the 'size specifiers' introduced by C99, namely ll, hh,
+# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
+# some C compilers supported these specifiers prior to C99 as an extension.
+#
+# Define NO_STRCASESTR if you don't have strcasestr.
+#
+# Define NO_STRLCPY if you don't have strlcpy.
+#
+# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
+# If your compiler also does not support long long or does not have
+# strtoull, define NO_STRTOULL.
+#
+# 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.
+# Enable it on Windows.  By default, symrefs are still used.
+#
+# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
+# tests.  These tests take up a significant amount of the total test time
+# but are not needed unless you plan to talk to SVN repos.
+#
+# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
+# installed in /sw, but don't want GIT to link against any libraries
+# installed there.  If defined you may specify your own (or Fink's)
+# include directories and library directories by defining CFLAGS
+# and LDFLAGS appropriately.
+#
+# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
+# have DarwinPorts installed in /opt/local, but don't want GIT to
+# link against any libraries installed there.  If defined you may
+# specify your own (or DarwinPort's) include directories and
+# library directories by defining CFLAGS and LDFLAGS appropriately.
+#
+# Define PPC_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine optimized for PowerPC.
+#
+# Define ARM_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine optimized for ARM.
+#
+# Define MOZILLA_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
+# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
+# choice) has very fast version optimized for i586.
+#
+# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
+#
+# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
+#
+# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
+# Patrick Mauritz).
+#
+# Define NO_MMAP if you want to avoid mmap.
+#
+# Define NO_PREAD if you have a problem with pread() system call (e.g.
+# cygwin.dll before v1.5.22).
+#
+# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
+# generally faster on your platform than accessing the working directory.
+#
+# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
+# the executable mode bit, but doesn't really do so.
+#
+# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
+#
+# Define NO_SOCKADDR_STORAGE if your platform does not have struct
+# sockaddr_storage.
+#
+# Define NO_ICONV if your libc does not properly support iconv.
+#
+# Define OLD_ICONV if your library has an old iconv(), where the second
+# (input buffer pointer) parameter is declared with type (const char **).
+#
+# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
+# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
+# is used instead.
+#
+# Define USE_NSEC below if you want git to care about sub-second file mtimes
+# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
+# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
+# randomly break unless your underlying filesystem supports those sub-second
+# times (my ext3 doesn't).
+#
+# Define USE_STDEV below if you want git to care about the underlying device
+# change being considered an inode change from the update-cache perspective.
+#
+# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
+#
+# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
+# MakeMaker (e.g. using ActiveState under Cygwin).
+#
+# Define WITH_P4IMPORT to build and install Python git-p4import script.
+#
+# Define NO_TCLTK if you do not want Tcl/Tk GUI.
+#
+# The TCL_PATH variable governs the location of the Tcl interpreter
+# used to optimize git-gui for your system.  Only used if NO_TCLTK
+# is not set.  Defaults to the bare 'tclsh'.
+#
+# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
+# If not set it defaults to the bare 'wish'. If it is set to the empty
+# string then NO_TCLTK will be forced (this is used by configure script).
+#
+
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
+uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
+uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
+
+# sparse is architecture-neutral, which means that we need to tell it
+# explicitly what architecture to check for. Fix this up for yours..
+SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
+
+#
+# Platform specific tweaks
+#
+
+# We choose to avoid "if .. else if .. else .. endif endif"
+# 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),GNU/kFreeBSD)
+	NO_STRLCPY = YesPlease
+endif
+ifeq ($(uname_S),Darwin)
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	OLD_ICONV = UnfortunatelyYes
+	NO_STRLCPY = YesPlease
+endif
+ifeq ($(uname_S),SunOS)
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	SHELL_PATH = /bin/bash
+	NO_STRCASESTR = YesPlease
+	NO_HSTRERROR = YesPlease
+	ifeq ($(uname_R),5.8)
+		NEEDS_LIBICONV = YesPlease
+		NO_UNSETENV = YesPlease
+		NO_SETENV = YesPlease
+		NO_C99_FORMAT = YesPlease
+		NO_STRTOUMAX = YesPlease
+	endif
+	ifeq ($(uname_R),5.9)
+		NO_UNSETENV = YesPlease
+		NO_SETENV = YesPlease
+		NO_C99_FORMAT = YesPlease
+		NO_STRTOUMAX = YesPlease
+	endif
+	INSTALL = ginstall
+	TAR = gtar
+	BASIC_CFLAGS += -D__EXTENSIONS__
+endif
+ifeq ($(uname_O),Cygwin)
+	NO_D_TYPE_IN_DIRENT = YesPlease
+	NO_D_INO_IN_DIRENT = YesPlease
+	NO_STRCASESTR = YesPlease
+	NO_SYMLINK_HEAD = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
+	NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
+	# There are conflicting reports about this.
+	# On some boxes NO_MMAP is needed, and not so elsewhere.
+	# Try commenting this out if you suspect MMAP is more efficient
+	NO_MMAP = YesPlease
+	NO_IPV6 = YesPlease
+	X = .exe
+endif
+ifeq ($(uname_S),FreeBSD)
+	NEEDS_LIBICONV = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+endif
+ifeq ($(uname_S),OpenBSD)
+	NO_STRCASESTR = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+endif
+ifeq ($(uname_S),NetBSD)
+	ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
+		NEEDS_LIBICONV = YesPlease
+	endif
+	BASIC_CFLAGS += -I/usr/pkg/include
+	BASIC_LDFLAGS += -L/usr/pkg/lib
+	ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
+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
+	BASIC_CFLAGS += -DPATH_MAX=1024
+	# for now, build 32-bit version
+	BASIC_LDFLAGS += -L/usr/lib32
+endif
+ifneq (,$(findstring arm,$(uname_M)))
+	ARM_SHA1 = YesPlease
+endif
+
+ifeq ($(uname_S),Darwin)
+	ifndef NO_FINK
+		ifeq ($(shell test -d /sw/lib && echo y),y)
+			BASIC_CFLAGS += -I/sw/include
+			BASIC_LDFLAGS += -L/sw/lib
+		endif
+	endif
+	ifndef NO_DARWIN_PORTS
+		ifeq ($(shell test -d /opt/local/lib && echo y),y)
+			BASIC_CFLAGS += -I/opt/local/include
+			BASIC_LDFLAGS += -L/opt/local/lib
+		endif
+	endif
+endif
diff -Naur git-1.5.2.2-orig/configure.inc git-1.5.2.2/configure.inc
--- git-1.5.2.2-orig/configure.inc	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/configure.inc	2007-06-29 17:22:21.000000000 -0400
@@ -0,0 +1,1324 @@
+#   %A%
+#   Copyright (c) 1999-2007 David Parsons. All rights reserved.
+#   
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#  3. My name may not be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#     
+#  THIS SOFTWARE IS PROVIDED BY DAVID PARSONS ``AS IS'' AND ANY
+#  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+#  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+#  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
+#  PARSONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+#  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+#  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+#  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+#  THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+
+#
+# this preamble code is executed when this file is sourced and it picks
+# interesting things off the command line.
+#
+ac_default_path="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
+
+ac_standard="--src=DIR		where the source lives (.)
+--prefix=DIR		where to install the final product (/usr/local)
+--execdir=DIR		where to put executables (prefix/bin)
+--sbindir=DIR		where to put static executables (prefix/sbin)
+--confdir=DIR		where to put configuration information (/etc)
+--libdir=DIR		where to put libraries (prefix/lib)
+--libexecdir=DIR	where to put private executables
+--mandir=DIR		where to put manpages"
+
+__fail=exit
+
+if dirname B/A 2>/dev/null >/dev/null; then
+__ac_dirname() {
+    dirname "$1"
+}
+else
+__ac_dirname() {
+    echo "$1" | sed -e 's:/[^/]*$::'
+}
+fi
+
+ac_progname=$0
+ac_configure_command=
+Q=\'
+for x in "$@"; do
+    ac_configure_command="$ac_configure_command $Q$x$Q"
+done
+# ac_configure_command="$*"
+
+__d=`__ac_dirname "$ac_progname"`
+if [ "$__d" = "$ac_progname" ]; then
+    AC_SRCDIR=`pwd`
+else
+    AC_SRCDIR=`cd $__d;pwd`
+fi
+
+__ac_dir() {
+    if test -d "$1"; then
+	(cd "$1";pwd)
+    else
+	echo "$1";
+    fi
+}
+
+while [ $# -gt 0 ]; do
+    unset matched
+
+    case X"$1" in
+    X--src|X--srcdir)
+	AC_SRCDIR=`__ac_dir "$2"`
+	_set_srcdir=1
+	shift 2;;
+
+    X--src=*|X--srcdir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_SRCDIR=`__ac_dir "$__d"`
+	_set_srcdir=1
+	shift 1 ;;
+
+    X--prefix)
+	AC_PREFIX=`__ac_dir "$2"`
+	_set_prefix=1
+	shift 2;;
+
+    X--prefix=*)
+	__d=`echo "$1"| sed -e 's/^[^=]*=//'`
+	AC_PREFIX=`__ac_dir "$__d"`
+	_set_prefix=1
+	shift 1;;
+
+    X--confdir)
+	AC_CONFDIR=`__ac_dir "$2"`
+	_set_confdir=1
+	shift 2;;
+
+    X--confdir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_CONFDIR=`__ac_dir "$__d"`
+	_set_confdir=1
+	shift 1;;
+
+    X--libexec|X--libexecdir)
+	AC_LIBEXEC=`__ac_dir "$2"`
+	_set_libexec=1
+	shift 2;;
+
+    X--libexec=*|X--libexecdir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_LIBEXEC=`__ac_dir "$__d"`
+	_set_libexec=1
+	shift 1;;
+
+    X--lib|X--libdir)
+	AC_LIBDIR=`__ac_dir "$2"`
+	_set_libdir=1
+	shift 2;;
+
+    X--lib=*|X--libdir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_LIBDIR=`__ac_dir "$__d"`
+	_set_libdir=1
+	shift 1;;
+
+    X--exec|X--execdir)
+	AC_EXECDIR=`__ac_dir "$2"`
+	_set_execdir=1
+	shift 2;;
+
+    X--exec=*|X--execdir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_EXECDIR=`__ac_dir "$__d"`
+	_set_execdir=1
+	shift 1;;
+
+    X--sbin|X--sbindir)
+	AC_SBINDIR=`__ac_dir "$2"`
+	_set_sbindir=1
+	shift 2;;
+
+    X--sbin=*|X--sbindir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_SBINDIR=`__ac_dir "$__d"`
+	_set_sbindir=1
+	shift 1;;
+
+    X--man|X--mandir)
+	AC_MANDIR=`__ac_dir "$2"`
+	_set_mandir=1
+	shift 2;;
+
+    X--man=*|X--mandir=*)
+	__d=`echo "$1" | sed -e 's/^[^=]*=//'`
+	AC_MANDIR=`__ac_dir "$__d"`
+	_set_mandir=1
+	shift 1;;
+
+    X--use-*=*)
+	_var=`echo "$1"| sed -n 's/^--use-\([A-Za-z][-A-Za-z0-9_]*\)=.*$/\1/p'`
+	if [ "$_var" ]; then
+	    _val=`echo "$1" | sed -e 's/^--use-[^=]*=\(.*\)$/\1/'`
+	    _v=`echo $_var | tr '[a-z]' '[A-Z]' | tr '-' '_'`
+	    case X"$_val" in
+	    X[Yy][Ee][Ss]|X[Tt][Rr][Uu][Ee]) eval USE_${_v}=T ;;
+	    X[Nn][Oo]|X[Ff][Aa][Ll][Ss][Ee]) eval unset USE_${_v} ;;
+	    *) echo "Bad value for --use-$_var ; must be yes or no"
+	       exit 1 ;;
+	    esac
+	else
+	    echo "Bad option $1.   Use --help to show options" 1>&2
+	    exit 1
+	fi
+	shift 1 ;;
+
+    X--use-*)
+        _var=`echo "$1"|sed -n 's/^--use-\([A-Za-z][-A-Za-z0-9_]*\)$/\1/p'`
+	_v=`echo $_var | tr '[a-z]' '[A-Z]' | tr '-' '_'`
+	eval USE_${_v}=T
+	shift 1;;
+
+    X--with-*=*)
+	_var=`echo "$1"| sed -n 's/^--with-\([A-Za-z][-A-Za-z0-9_]*\)=.*$/\1/p'`
+	if [ "$_var" ]; then
+	    _val=`echo "$1" | sed -e 's/^--with-[^=]*=\(.*\)$/\1/'`
+	    _v=`echo $_var | tr '[a-z]' '[A-Z]' | tr '-' '_'`
+	    eval WITH_${_v}=\"$_val\"
+	else
+	    echo "Bad option $1.   Use --help to show options" 1>&2
+	    exit 1
+	fi
+	shift 1 ;;
+
+    X--with-*)
+	_var=`echo "$1" | sed -n 's/^--with-\([A-Za-z][A-Za-z0-9_-]*\)$/\1/p'`
+	if [ "$_var" ]; then
+	    _v=`echo $_var | tr '[a-z]' '[A-Z]' | tr '-' '_'`
+	    eval WITH_${_v}=1
+	else
+	    echo "Bad option $1.   Use --help to show options" 1>&2
+	    exit 1
+	fi
+	shift 1 ;;
+
+    X--help)
+	echo "$ac_standard"
+	test "$ac_help" && echo "$ac_help"
+	exit 0;;
+
+    *)	if [ "$LOCAL_AC_OPTIONS" ]; then
+	    eval "$LOCAL_AC_OPTIONS"
+	else
+	    ac_error=T
+	fi
+	if [ "$ac_error" ]; then
+	    echo "Bad option $1.   Use --help to show options" 1>&2
+	    exit 1
+	fi ;;
+    esac
+done
+
+
+#
+# echo w/o newline
+#
+echononl()
+{
+    ${ac_echo:-echo} "${@}$ac_echo_nonl"
+}
+
+#
+# log something to the terminal and to a logfile.
+#
+LOG () {
+    echo "$@"
+    echo "$@" 1>&5
+}
+
+#
+# log something to the terminal without a newline, and to a logfile with
+# a newline
+#
+LOGN () {
+    echononl "$@" 1>&5
+    echo "$@"
+}
+
+#
+# log something to the terminal
+#
+TLOG () {
+    echo "$@" 1>&5
+}
+
+#
+# log something to the terminal, no newline
+#
+TLOGN () {
+    echononl "$@" 1>&5
+}
+
+
+#
+# AC_CONTINUE tells configure not to bomb if something fails, but to
+# continue blithely along
+#
+AC_CONTINUE () {
+    __fail="return"
+}
+
+#
+# Emulate gnu autoconf's AC_CHECK_HEADERS() function
+#
+AC_CHECK_HEADERS () {
+    AC_PROG_CC
+
+    echo "/* AC_CHECK_HEADERS */" > /tmp/ngc$$.c
+    for hdr in $*; do
+	echo "#include <$hdr>" >> /tmp/ngc$$.c
+    done
+    echo "main() { }" >> /tmp/ngc$$.c
+
+    LOGN "checking for header $hdr"
+
+    if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c; then
+	AC_DEFINE 'HAVE_'`echo $hdr | tr 'a-z' 'A-Z' | tr './' '_'` 1
+	TLOG " (found)"
+	rc=0
+    else
+	TLOG " (not found)"
+	rc=1
+    fi
+    rm -f /tmp/ngc$$.c /tmp/ngc$$
+    return $rc
+}
+
+
+#
+# emulate GNU autoconf's AC_CHECK_FUNCS function
+#
+AC_CHECK_FUNCS () {
+    AC_PROG_CC
+
+F=$1
+shift
+rm -f /tmp/ngc$$.c
+
+while [ "$1" ]; do
+    echo "#include <$1>" >> /tmp/ngc$$.c
+    shift
+done
+
+    cat >> /tmp/ngc$$.c << EOF
+main()
+{
+
+    $F();
+}
+EOF
+
+    QQ=`echo $F | sed -e 's/(.*$//'`
+    LOGN "checking for the $QQ function"
+
+    if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS; then
+	AC_DEFINE `echo ${2:-HAVE_$QQ} | tr 'a-z' 'A-Z'` 1
+	TLOG " (found)"
+	rc=0
+    else
+	echo "offending command was:"
+	cat /tmp/ngc$$.c
+	echo "$AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS"
+	TLOG " (not found)"
+	rc=1
+    fi
+    rm -f /tmp/ngc$$.c /tmp/ngc$$
+    return $rc
+}
+
+
+#
+# check to see if some structure exists
+#
+# usage: AC_CHECK_STRUCT structure {include ...}
+#
+AC_CHECK_STRUCT () {
+    AC_PROG_CC
+    struct=$1
+    shift
+
+    rm -f /tmp/ngc$$.c
+
+    for include in $*; do
+	echo "#include <$include>" >> /tmp/ngc$$.c
+    done
+
+    cat >> /tmp/ngc$$.c << EOF
+main()
+{
+    struct $struct foo;
+}
+EOF
+
+    LOGN "checking for struct $struct"
+
+    if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $AC_LIBS 2>>config.log; then
+	AC_DEFINE HAVE_STRUCT_`echo ${struct} | tr 'a-z' 'A-Z'`
+	TLOG " (found)"
+	rc=0
+    else
+	TLOG " (not found)"
+	rc=1
+    fi
+    rm -f /tmp/ngc$$.c /tmp/ngc$$
+    return $rc
+}
+
+
+#
+# check to see if some structure contains a field
+#
+# usage: AC_CHECK_FIELD structure field {include ...}
+#
+AC_CHECK_FIELD () {
+    AC_PROG_CC
+
+    struct=$1
+    field=$2
+    shift 2
+
+    rm -f /tmp/ngc$$.c
+
+    for include in $*;do
+	echo "#include <$include>" >> /tmp/ngc$$.c
+    done
+
+    cat >> /tmp/ngc$$.c << EOF
+main()
+{
+    struct $struct foo;
+
+    foo.$field;
+}
+EOF
+
+    LOGN "checking that struct $struct has a $field field"
+
+    if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $AC_LIBS 2>>config.log; then
+	AC_DEFINE HAVE_`echo ${struct}_$field | tr 'a-z' 'A-Z'`
+	TLOG " (yes)"
+	rc=0
+    else
+	TLOG " (no)"
+	rc=1
+    fi
+    rm -f /tmp/ngc$$.c /tmp/ngc$$
+    return $rc
+}
+
+
+#
+# check that the C compiler works
+#
+AC_PROG_CC () {
+    test "$AC_CC" && return 0
+
+    cat > /tmp/ngc$$.c << \EOF
+#include <stdio.h>
+main()
+{
+    puts("hello, sailor");
+}
+EOF
+
+    TLOGN "checking the C compiler"
+
+    unset AC_CFLAGS AC_LDFLAGS
+
+    if [ "$CC" ] ; then
+	AC_CC="$CC"
+    elif [ "$WITH_PATH" ]; then
+	AC_CC=`acLookFor cc`
+    elif [ "`acLookFor cc`" ]; then
+	# don't specify the full path if the user is looking in their $PATH
+	# for a C compiler.
+	AC_CC=cc
+    fi
+
+    # finally check for POSIX c89
+    test "$AC_CC" || AC_CC=`acLookFor c89`
+
+    if [ ! "$AC_CC" ]; then
+	TLOG " (no C compiler found)"
+	$__fail 1
+    fi
+    echo "checking out the C compiler"
+
+    $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c
+    status=$?
+
+    TLOGN " ($AC_CC)"
+    if [ $status -eq 0 ]; then
+	TLOG " ok"
+
+	# check that the CFLAGS and LDFLAGS aren't bogus
+
+	unset AC_CFLAGS AC_LDFLAGS
+
+	if [ "$CFLAGS" ]; then
+	    test "$CFLAGS" && echo "validating CFLAGS=${CFLAGS}"
+	    if $AC_CC $CFLAGS -o /tmp/ngc$$.o /tmp/ngc$$.c ; then
+		AC_CFLAGS=${CFLAGS:-"-g"}
+		test "$CFLAGS" && echo "CFLAGS=\"${CFLAGS}\" are okay"
+	    elif [ "$CFLAGS" ]; then
+		echo "ignoring bogus CFLAGS=\"${CFLAGS}\""
+	    fi
+	else
+	    AC_CFLAGS=-g
+	fi
+	if [ "$LDFLAGS" ]; then
+	    test "$LDFLAGS" && echo "validating LDFLAGS=${LDFLAGS}"
+	    if $AC_CC $LDFLAGS -o /tmp/ngc$$ /tmp/ngc$$.o; then
+		AC_LDFLAGS=${LDFLAGS:-"-g"}
+		test "$LDFLAGS" && TLOG "LDFLAGS=\"${LDFLAGS}\" are okay"
+	    elif [ "$LDFLAGS" ]; then
+		TLOG "ignoring bogus LDFLAGS=\"${LDFLAGS}\""
+	    fi
+	else
+	    AC_LDFLAGS=${CFLAGS:-"-g"}
+	fi
+    else
+	AC_FAIL " does not compile code properly"
+    fi
+
+    AC_SUB 'CC' "$AC_CC"
+
+    rm -f /tmp/ngc$$ /tmp/ngc$$.c /tmp/ngc$$.o
+
+    return $status
+}
+
+
+#
+# acLookFor actually looks for a program, without setting anything.
+#
+acLookFor () {
+    path=${AC_PATH:-$ac_default_path}
+    case "X$1" in
+    X-[rx]) __mode=$1
+	    shift
+	    ;;
+    *)	    __mode=-x
+	    ;;
+    esac
+    oldifs="$IFS"
+    for program in $*; do
+	IFS=":"
+	for x in $path; do
+	    if [ $__mode $x/$program -a -f $x/$program ]; then
+		echo $x/$program
+		break 2
+	    fi
+	done
+    done
+    IFS="$oldifs"
+    unset __mode
+}
+
+
+#
+# check that a program exists and set its path
+#
+MF_PATH_INCLUDE () {
+    SYM=$1; shift
+
+    case X$1 in
+    X-[rx]) __mode=$1
+	    shift
+	    ;;
+    *)      unset __mode
+	    ;;
+    esac
+
+    TLOGN "looking for $1"
+
+    DEST=`acLookFor $__mode $*`
+
+    __sym=`echo "$SYM" | tr '[a-z]' '[A-Z]'`
+    if [ "$DEST" ]; then
+	TLOG " ($DEST)"
+	echo "$1 is $DEST"
+	AC_MAK $SYM
+	AC_DEFINE PATH_$__sym \""$DEST"\"
+	AC_SUB $__sym "$DEST"
+	eval CF_$SYM=$DEST
+	return 0
+    else
+	#AC_SUB $__sym ''
+	echo "$1 is not found"
+	TLOG " (not found)"
+	return 1
+    fi
+}
+
+
+#
+# AC_INIT starts the ball rolling
+#
+# After AC_INIT, fd's 1 and 2 point to config.log
+# and fd 5 points to what used to be fd 1
+#
+AC_INIT () {
+    __config_files="config.cmd config.sub config.h config.mak config.log"
+    rm -f $__config_files
+    __cwd=`pwd`
+    exec 5>&1 1>$__cwd/config.log 2>&1
+    AC_CONFIGURE_FOR=__AC_`echo $1 | sed -e 's/\..$//' | tr 'a-z' 'A-Z' | tr ' ' '_'`_D
+
+    # check to see whether to use echo -n or echo ...\c
+    #
+    echo -n hello > $$
+    echo world >> $$
+    if grep "helloworld" $$ >/dev/null; then
+	ac_echo="echo -n"
+	echo "[echo -n] works"
+    else
+	ac_echo="echo"
+	echo 'hello\c' > $$
+	echo 'world' >> $$
+	if grep "helloworld" $$ >/dev/null; then
+	    ac_echo_nonl='\c'
+	    echo "[echo ...\\c] works"
+	fi
+    fi
+    rm -f $$
+
+    LOG "Configuring for [$1]"
+
+    cat > $__cwd/config.h << EOF
+/*
+ * configuration for $1${2:+" ($2)"}, generated `date`
+ * by ${LOGNAME:-`whoami`}@`hostname`
+ */
+#ifndef $AC_CONFIGURE_FOR
+#define $AC_CONFIGURE_FOR 1
+
+
+EOF
+
+    unset __share
+    if [ -d $AC_PREFIX/share/man ]; then
+	for t in 1 2 3 4 5 6 7 8 9; do
+	    if [ -d $AC_PREFIX/share/man/man$t ]; then
+		__share=/share
+	    elif [ -d $AC_PREFIX/share/man/cat$t ]; then
+		__share=/share
+	    fi
+	done
+    else
+	__share=
+    fi
+
+    if [ -d $AC_PREFIX/libexec ]; then
+	__libexec=libexec
+    else
+	__libexec=lib
+    fi
+
+
+    AC_PREFIX=${AC_PREFIX:-/usr/local}
+    AC_EXECDIR=${AC_EXECDIR:-$AC_PREFIX/bin}
+    AC_SBINDIR=${AC_SBINDIR:-$AC_PREFIX/sbin}
+    AC_LIBDIR=${AC_LIBDIR:-$AC_PREFIX/lib}
+    AC_MANDIR=${AC_MANDIR:-$AC_PREFIX$__share/man}
+    AC_LIBEXEC=${AC_LIBEXEC:-$AC_PREFIX/$__libexec}
+    AC_CONFDIR=${AC_CONFDIR:-/etc}
+
+    AC_PATH=${WITH_PATH:-$PATH}
+    AC_PROG_CPP
+    AC_PROG_INSTALL
+
+    ac_os=`uname -s`
+    _os=`echo $ac_os | tr '[a-z]' '[A-Z]'`
+    AC_DEFINE OS_$_os	1
+    eval OS_${_os}=1
+    unset _os
+}
+
+
+#
+# AC_LIBRARY checks to see if a given library exists and contains the
+# given function.
+# usage: AC_LIBRARY function library [alternate ...]
+#
+AC_LIBRARY() {
+    SRC=$1
+    shift
+
+    __acllibs=
+    __aclhdrs=
+
+    for x in "$@"; do
+	case X"$x" in
+	X-l*) __acllibs="$__acllibs $x" ;;
+	*)    __aclhdrs="$__aclhdrs $x" ;;
+	esac
+    done
+
+    # first see if the function can be found in any of the
+    # current libraries
+    AC_QUIET AC_CHECK_FUNCS $SRC $__aclhdrs && return 0
+
+    # then search through the list of libraries
+    __libs="$LIBS"
+    for x in $__acllibs; do
+	LIBS="$__libs $x"
+	if AC_QUIET AC_CHECK_FUNCS $SRC $__aclhdrs; then
+	    AC_LIBS="$AC_LIBS $x"
+	    return 0
+	fi
+    done
+    return 1
+}
+
+
+#
+# AC_PROG_LEX checks to see if LEX exists, and if it's lex or flex.
+#
+AC_PROG_LEX() {
+    TLOGN "looking for lex "
+
+    DEST=`acLookFor lex`
+    if [ "$DEST" ]; then
+	AC_MAK LEX
+	AC_DEFINE PATH_LEX \"$DEST\"
+	AC_SUB 'LEX' "$DEST"
+	echo "lex is $DEST"
+    else
+	DEST=`acLookFor flex`
+	if [ "$DEST" ]; then
+	    AC_MAK FLEX
+	    AC_DEFINE 'LEX' \"$DEST\"
+	    AC_SUB 'LEX', "$DEST"
+	    echo "lex is $DEST"
+	else
+	    AC_SUB LEX ''
+	    echo "neither lex or flex found"
+	    TLOG " (not found)"
+	    return 1
+	fi
+    fi
+
+    if AC_LIBRARY yywrap -ll -lfl; then
+	TLOG "($DEST)"
+	return 0
+    fi
+    TLOG "(no lex library found)"
+    return 1
+}
+
+
+#
+# AC_PROG_YACC checks to see if YACC exists, and if it's bison or
+# not.
+#
+AC_PROG_YACC () {
+
+    TLOGN "looking for yacc "
+
+    DEST=`acLookFor yacc`
+    if [ "$DEST" ]; then
+	AC_MAK YACC
+	AC_DEFINE PATH_YACC \"$DEST\"
+	AC_SUB 'YACC' "$DEST"
+	TLOG "($DEST)"
+	echo "yacc is $DEST"
+    else
+	DEST=`acLookFor bison`
+	if [ "$DEST" ]; then
+	    AC_MAK BISON
+	    AC_DEFINE 'YACC' \"$DEST\"
+	    AC_SUB 'YACC' "$DEST -y"
+	    echo "yacc is $DEST -y"
+	    TLOG "($DEST -y)"
+	else
+	    AC_SUB 'YACC' ''
+	    echo "neither yacc or bison found"
+	    TLOG " (not found)"
+	    return 1
+	fi
+    fi
+    return 0
+}
+
+
+#
+# AC_PROG_LN_S checks to see if ln exists, and, if so, if ln -s works
+#
+AC_PROG_LN_S () {
+    test "$AC_FIND_PROG" || AC_PROG_FIND
+
+    test "$AC_FIND_PROG" || return 1
+    
+    TLOGN "looking for \"ln -s\""
+    DEST=`acLookFor ln`
+
+    if [ "$DEST" ]; then
+	rm -f /tmp/b$$
+	$DEST -s /tmp/a$$ /tmp/b$$
+	if [ "`$AC_FIND_PROG /tmp/b$$ -type l -print`" ]; then
+	    TLOG " ($DEST)"
+	    echo "$DEST exists, and ln -s works"
+	    AC_SUB 'LN_S' "$DEST -s"
+	    rm -f /tmp/b$$
+	else
+	    AC_SUB 'LN_S' ''
+	    TLOG " ($DEST exists, but -s does not seem to work)"
+	    echo "$DEST exists, but ln -s doesn't seem to work"
+	    rm -f /tmp/b$$
+	    return 1
+	fi
+    else
+	AC_SUB 'LN_S' ''
+	echo "ln not found"
+	TLOG " (not found)"
+	return 1
+    fi
+}
+
+
+#
+# AC_PROG_FIND looks for the find program and sets the FIND environment
+# variable
+#
+AC_PROG_FIND () {
+    if test -z "$AC_FIND_PROG"; then
+	MF_PATH_INCLUDE FIND find
+	rc=$?
+	AC_FIND_PROG=$DEST
+	return $rc
+    fi
+    return 0
+}
+
+
+#
+# AC_PROG_AWK looks for the awk program and sets the AWK environment
+# variable
+#
+AC_PROG_AWK () {
+    if test -z "$AC_AWK_PROG"; then
+	MF_PATH_INCLUDE AWK awk
+	rc=$?
+	AC_AWK_PROG=$DEST
+	return $rc
+    fi
+    return 0
+}
+
+
+#
+# AC_PROG_SED looks for the sed program and sets the SED environment
+# variable
+#
+AC_PROG_SED () {
+    if test -z "$AC_SED_PROG"; then
+	MF_PATH_INCLUDE SED sed
+	rc=$?
+	AC_SED_PROG=$DEST
+	return $rc
+    fi
+    return 0
+}
+
+
+#
+# AC_HEADER_SYS_WAIT looks for sys/wait.h
+#
+AC_HEADER_SYS_WAIT () {
+    AC_CHECK_HEADERS sys/wait.h || return 1
+}
+
+#
+# AC_TYPE_PID_T checks to see if the pid_t type exists
+#
+AC_TYPE_PID_T () {
+    cat > /tmp/pd$$.c << EOF
+#include <sys/types.h>
+main() { pid_t me; }
+EOF
+
+    LOGN "checking for pid_t"
+
+    if $AC_CC -c /tmp/pd$$.c -o /tmp/pd$$.o; then
+	TLOG " (found)"
+	rc=0
+    else
+	echo "typedef int pid_t;" >> $__cwd/config.h
+	TLOG " (not found)"
+	rc=1
+    fi
+    rm -f /tmp/pd$$.o /tmp/pd$$.c
+    return $rc
+}
+
+
+#
+# AC_C_CONST checks to see if the compiler supports the const keyword
+#
+AC_C_CONST () {
+    cat > /tmp/pd$$.c << EOF
+const char me=1;
+EOF
+    LOGN "checking for \"const\" keyword"
+
+    if $AC_CC -c /tmp/pd$$.c -o /tmp/pd$$.o; then
+	TLOG " (yes)"
+	rc=0
+    else
+	AC_DEFINE 'const' '/**/'
+	TLOG " (no)"
+	rc=1
+    fi
+    rm -f /tmp/pd$$.o /tmp/pd$$.c
+    return $rc
+}
+
+
+#
+# AC_SCALAR_TYPES checks to see if the compiler can generate 2 and 4 byte ints.
+#
+AC_SCALAR_TYPES () {
+    cat > /tmp/pd$$.c << EOF
+#include <stdio.h>
+main()
+{
+    unsigned long v_long;
+    unsigned int v_int;
+    unsigned short v_short;
+
+    if (sizeof v_long == 4)
+	puts("#define DWORD	unsigned long");
+    else if (sizeof v_int == 4)
+	puts("#define DWORD	unsigned int");
+    else
+	exit(1);
+
+    if (sizeof v_int == 2)
+	puts("#define WORD	unsigned int");
+    else if (sizeof v_short == 2)
+	puts("#define WORD	unsigned short");
+    else
+	exit(2);
+    puts("#define BYTE	unsigned char");
+    exit(0);
+}
+EOF
+    rc=1
+    LOGN "defining WORD & DWORD scalar types"
+    if $AC_CC /tmp/pd$$.c -o /tmp/pd$$; then
+	if /tmp/pd$$  >> $__cwd/config.h; then
+	    rc=0
+	fi
+    fi
+    case "$rc" in
+    0) TLOG "" ;;
+    *) TLOG " ** FAILED **" ;;
+    esac
+    rm -f /tmp/pd$$ /tmp/pd$$.c
+}
+
+
+#
+# AC_OUTPUT generates makefiles from makefile.in's
+#
+AC_OUTPUT () {
+    cd $__cwd
+    AC_SUB 'LIBS'    "$AC_LIBS"
+    AC_SUB 'CONFIGURE_FILES' "$__config_files"
+    AC_SUB 'GENERATED_FILES' "$*"
+    AC_SUB 'CFLAGS'  "$AC_CFLAGS"
+    AC_SUB 'LDFLAGS' "$AC_LDFLAGS"
+    AC_SUB 'srcdir'  "$AC_SRCDIR"
+    AC_SUB 'prefix'  "$AC_PREFIX"
+    AC_SUB 'exedir'  "$AC_EXECDIR"
+    AC_SUB 'sbindir' "$AC_SBINDIR"
+    AC_SUB 'libdir'  "$AC_LIBDIR"
+    AC_SUB 'libexec' "$AC_LIBEXEC"
+    AC_SUB 'confdir' "$AC_CONFDIR"
+    AC_SUB 'mandir'  "$AC_MANDIR"
+
+    if [ -r config.sub ]; then
+	test "$AC_SED_PROG" || AC_PROG_SED
+	test "$AC_SED_PROG" || return 1
+
+	echo                                   >> config.h
+	echo "#endif/* ${AC_CONFIGURE_FOR} */" >> config.h
+
+	rm -f config.cmd
+	Q=\'
+	cat - > config.cmd << EOF
+#! /bin/sh
+${CC:+CC=${Q}${CC}${Q}} ${CFLAGS:+CFLAGS=${Q}${CFLAGS}${Q}} $ac_progname $ac_configure_command
+EOF
+	chmod +x config.cmd
+
+	__d=$AC_SRCDIR
+	for makefile in $*;do
+	    if test -r $__d/${makefile}.in; then
+		LOG "generating $makefile"
+		./config.md `__ac_dirname ./$makefile` 2>/dev/null
+		$AC_SED_PROG -f config.sub < $__d/${makefile}.in > $makefile
+		__config_files="$__config_files $makefile"
+	    else
+		LOG "WARNING: ${makefile}.in does not exist!"
+	    fi
+	done
+	unset __d
+
+    else
+	echo 
+    fi
+}
+
+#
+# AC_CHECK_FLOCK checks to see if flock() exists and if the LOCK_NB argument
+# works properly.
+#
+AC_CHECK_FLOCK() {
+
+    AC_CHECK_HEADERS sys/types.h sys/file.h fcntl.h
+
+    cat << EOF > $$.c
+#include <stdio.h>
+#include <sys/file.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+main()
+{
+    int x = open("$$.c", O_RDWR, 0666);
+    int y = open("$$.c", O_RDWR, 0666);
+
+    if (flock(x, LOCK_EX) != 0)
+	exit(1);
+    if (flock(y, LOCK_EX|LOCK_NB) == 0)
+	exit(1);
+    exit(0);
+}
+EOF
+
+    LOGN "checking for flock()"
+    HAS_FLOCK=0
+    if $AC_CC -o flock $$.c ; then
+	if ./flock ; then
+	    LOG " (found)"
+	    HAS_FLOCK=1
+	    AC_DEFINE HAS_FLOCK
+	else
+	    LOG " (bad)"
+	fi
+    else
+	LOG " (no)"
+    fi
+
+    rm -f flock $$.c
+
+    case "$HAS_FLOCK" in
+    0) return 1 ;;
+    *) return 0 ;;
+    esac
+}
+
+
+#
+# AC_CHECK_RESOLVER finds out whether the berkeley resolver is
+# present on this system.
+#
+AC_CHECK_RESOLVER () {
+    AC_PROG_CC
+
+    TLOGN "checking for the Berkeley resolver library"
+
+    __ACR_rc=0
+
+    cat > /tmp/ngc$$.c << EOF
+#include <sys/types.h>
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+
+main()
+{
+    char bfr[256];
+
+    res_init();
+    res_query("hello", C_IN, T_A, bfr, sizeof bfr);
+}
+EOF
+
+    if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c; then
+	TLOG " (found)"
+    elif $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c -lresolv; then
+	TLOG " (found, needs -lresolv)"
+	AC_LIBS="$AC_LIBS -lresolv"
+    elif $AC_CC -DBIND_8_COMPAT -o /tmp/ngc$$ /tmp/ngc$$.c; then
+	TLOG " (found, needs BIND_8_COMPAT)"
+	AC_DEFINE BIND_8_COMPAT 1
+    elif $AC_CC -DBIND_8_COMPAT -o /tmp/ngc$$ /tmp/ngc$$.c -lresolv; then
+	TLOG " (found, needs BIND_8_COMPAT & -lresolv)"
+	AC_DEFINE BIND_8_COMPAT 1
+    else
+	TLOG " (not found)"
+	__ACR_rc=1
+    fi
+    rm -f /tmp/ngc$$.c
+    return $__ACR_rc
+}
+
+
+#
+# AC_CHECK_ALLOCA looks for alloca
+#
+AC_CHECK_ALLOCA () {
+
+    AC_PROG_CC
+    AC_CHECK_HEADERS stdlib.h
+
+    cat - > /tmp/ngc$$.c << EOF
+#if T
+# include <alloca.h>
+#else
+# include <stdlib.h>
+#endif
+main()
+{
+	alloca(10);
+}
+EOF
+
+    LOGN "checking for the alloca function"
+    if $AC_CC -DT /tmp/ngc$$.c -o /tmp/ngc$$; then
+	AC_DEFINE 'HAVE_ALLOCA_H' 1
+	status=0
+	TLOG " (found in alloca.h)"
+    elif $AC_CC /tmp/ngc$$.c -o /tmp/ngc$$; then
+	TLOG " (found)"
+	status=0
+    else
+	TLOG " (not found)"
+	status=1
+    fi
+    rm -f /tmp/ngc$$.c /tmp/ngc
+    return $status
+
+}
+
+
+#
+# AC_PROG_INSTALL finds the install program and guesses whether it's a 
+# Berkeley or GNU install program
+#
+AC_PROG_INSTALL () {
+
+    DEST=`acLookFor install`
+
+    LOGN "checking for install"
+    unset IS_BSD
+    if [ "$DEST" ]; then
+	# BSD install or GNU install?  Let's find out...
+	touch /tmp/a$$
+
+	$DEST /tmp/a$$ /tmp/b$$
+
+	if test -r /tmp/a$$; then
+	    LOG " ($DEST)"
+	else
+	    IS_BSD=1
+	    LOG " ($DEST) bsd install"
+	fi
+	rm -f /tmp/a$$ /tmp/b$$
+    else
+	DEST=`acLookFor ginstall`
+	if [ "$DEST" ]; then
+	    LOG " ($DEST)"
+	else
+	    DEST="false"
+	    LOG " (not found)"
+	fi
+    fi
+
+    if [ "$IS_BSD" ]; then
+	PROG_INSTALL="$DEST -c"
+    else
+	PROG_INSTALL="$DEST"
+    fi
+
+    AC_SUB 'INSTALL' "$PROG_INSTALL"
+    AC_SUB 'INSTALL_PROGRAM' "$PROG_INSTALL -s -m 755"
+    AC_SUB 'INSTALL_DATA' "$PROG_INSTALL -m 444"
+
+    # finally build a little directory installer
+    # if mkdir -p works, use that, otherwise use install -d,
+    # otherwise build a script to do it by hand.
+    # in every case, test to see if the directory exists before
+    # making it.
+
+    if mkdir -p $$a/b; then
+	# I like this method best.
+	__mkdir="mkdir -p"
+	rmdir $$a/b
+	rmdir $$a
+    elif $PROG_INSTALL -d $$a/b; then
+	__mkdir="$PROG_INSTALL -d"
+	rmdir $$a/b
+	rmdir $$a
+    fi
+
+    __config_files="$__config_files config.md"
+    AC_SUB 'INSTALL_DIR' "$__cwd/config.md"
+    echo "#! /bin/sh"                                   > $__cwd/config.md
+    echo "# script generated" `date` "by configure.sh" >> $__cwd/config.md
+    echo                                               >> $__cwd/config.md
+    if [ "$__mkdir" ]; then
+	echo "test -d \"\$1\" || $__mkdir \"\$1\""     >> $__cwd/config.md
+	echo "exit $?"                                 >> $__cwd/config.md
+    else
+	cat - >> $__cwd/config.md << \EOD
+pieces=`IFS=/; for x in $1; do echo $x; done`
+dir=
+for x in $pieces; do
+    dir="$dir$x"
+    mkdir $dir || exit 1
+    dir="$dir/"
+done
+exit 0
+EOD
+    fi
+    chmod +x $__cwd/config.md
+}
+
+#
+# acCheckCPP is a local that runs a C preprocessor with a given set of
+# compiler options
+#
+acCheckCPP () {
+	cat > /tmp/ngc$$.c << EOF
+#define FOO BAR
+
+FOO
+EOF
+
+    if $1 $2 /tmp/ngc$$.c > /tmp/ngc$$.o; then
+	if grep -v '#define' /tmp/ngc$$.o | grep -s BAR >/dev/null; then
+	    echo "CPP=[$1], CPPFLAGS=[$2]"
+	    AC_SUB 'CPP' "$1"
+	    AC_SUB 'CPPFLAGS' "$2"
+	    rm /tmp/ngc$$.c /tmp/ngc$$.o
+	    return 0
+	fi
+    fi
+    rm /tmp/ngc$$.c /tmp/ngc$$.o
+    return 1
+}
+
+
+#
+# AC_PROG_CPP checks for cpp, then checks to see which CPPFLAGS are needed
+# to run it as a filter.
+#
+AC_PROG_CPP () {
+    if [ "$AC_CPP_PROG" ]; then
+	DEST=$AC_CPP_PROG
+    else
+	__ac_path="$AC_PATH"
+	AC_PATH="/lib:/usr/lib:${__ac_path:-$ac_default_path}"
+	DEST=`acLookFor cpp`
+	AC_PATH="$__ac_path"
+    fi
+
+    unset fail
+    LOGN "Looking for cpp"
+    if [ "$DEST" ]; then
+	TLOGN " ($DEST)"
+	acCheckCPP $DEST "$CPPFLAGS" || \
+		 acCheckCPP $DEST -traditional-cpp -E || \
+		 acCheckCPP $DEST -E || \
+		 acCheckCPP $DEST -traditional-cpp -pipe || \
+	         acCheckCPP $DEST -pipe || fail=1
+
+	if [ "$fail" ]; then
+	    AC_FAIL " (can't run cpp as a pipeline)"
+	else
+	    TLOG " ok"
+	    return 0
+	fi
+    fi
+    AC_FAIL " (not found)"
+}
+
+#
+# AC_FAIL spits out an error message, then __fail's 
+AC_FAIL() {
+    LOG "$*" 
+    $__fail 1
+}
+
+#
+# AC_SUB writes a substitution into config.sub
+AC_SUB() {
+    (   echononl "s;@$1@;"
+	_subst=`echo $2 | sed -e 's/;/\\;/g'`
+	echononl "$_subst"
+	echo ';g' ) >> $__cwd/config.sub
+}
+
+#
+# AC_MAK writes a define into config.mak
+AC_MAK() {
+    if [ "$2" ]; then
+	echo "$1=$2"
+    else
+	echo "HAVE_$1=1"
+    fi >> $__cwd/config.mak
+}
+
+#
+# AC_DEFINE adds a #define to config.h
+AC_DEFINE() {
+    echo "#define $1 ${2:-1}" >> $__cwd/config.h
+}
+
+#
+# AC_INCLUDE adds a #include to config.h
+AC_INCLUDE() {
+    echo "#include \"$1\"" >> $__cwd/config.h
+}
+
+#
+# AC_CONFIG adds a configuration setting to all the config files
+AC_CONFIG() {
+    AC_DEFINE "PATH_$1" \""$2"\"
+    AC_MAK "$1"
+    AC_SUB "$1" "$2"
+}
+
+#
+# AC_QUIET does something quietly
+AC_QUIET() {
+    eval $* 5>/dev/null
+}
diff -Naur git-1.5.2.2-orig/configure.sh git-1.5.2.2/configure.sh
--- git-1.5.2.2-orig/configure.sh	1969-12-31 19:00:00.000000000 -0500
+++ git-1.5.2.2/configure.sh	2007-06-30 10:15:50.000000000 -0400
@@ -0,0 +1,353 @@
+#! /bin/sh
+
+# local options:  ac_help is the help message that describes them
+# and LOCAL_AC_OPTIONS is the script that interprets them.  LOCAL_AC_OPTIONS
+# is a script that's processed with eval, so you need to be very careful to
+# make certain that what you quote is what you want to quote.
+
+# load in the configuration file
+#
+ac_help='
+--with-curl	build with curl (=dir)
+--no-mmap	Avoid mmap
+--verbose	Be chattery when building $TARGET'
+
+LOCAL_AC_OPTIONS='
+unset ac_error
+case X"$1" in
+X--no-mmap) NO_MMAP_PLEASE=1
+	    shift ;;
+X--verbose) V_FLAG=1;
+	    shift ;;
+	*)  ac_error=T ;;
+esac'
+
+TARGET=git
+USE_MAILWRAPPERS=T
+. ./configure.inc
+
+AC_INIT $TARGET
+AC_PROG_CC
+AC_SCALAR_TYPES
+
+#  thing that aren't found on some older Unices (Mastodon, SLS Linux,
+#  some versions of FreeBSD older than jordan_hubbard_goes_apple)
+#
+
+# (assume if there's no gmtime_r that there will be no localtime_r either)
+AC_CHECK_FUNCS gmtime_r || AC_MAK NO_TIME_R Yes
+AC_CHECK_FUNCS hstrerror || AC_MAK NO_HSTRERROR Yes
+AC_CHECK_FUNCS inet_ntop || AC_MAK NO_INET_NTOP Yes
+AC_CHECK_FUNCS inet_pton || AC_MAK NO_INET_PTON Yes
+AC_CHECK_HEADERS sys/poll.h || AC_MAK NO_POLL Yes
+AC_CHECK_HEADERS sys/select.h
+AC_CHECK_HEADERS inttypes.h
+
+# Do we have a socklen_t?
+#
+cat - > /tmp/$$.c << EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+
+main() { socklen_t foo = 1; }
+EOF
+
+$AC_CC -o /tmp/$$.o -c /tmp/$$.c || AC_MAK NO_SOCKLEN_T Yes
+rm -f /tmp/$$.o /tmp/$$.c
+
+# don't pass fancy flags into LESS
+
+TLOGN "checking less compatability "
+if less -FRSX var.c  </dev/null >/dev/null; then
+    AC_MAK LESS_FLAGS "FRSX"
+    TLOG "(supports -FRSX flags)"
+else
+    TLOG "(archaic)"
+fi
+
+# Define V=1 to have a more verbose compile.
+test "$V_FLAG" && AC_MAK V 1
+
+# Define NO_OPENSSL environment variable if you do not have OpenSSL.
+# This also implies MOZILLA_SHA1
+
+TLOGN "looking for libssl"
+if AC_LIBRARY SSLv2_client_method  -lssl -lcrypto; then
+    case "$AC_LIBS" in
+    *crypto*)   TLOG " (needs -lcrypto)"
+		AC_MAK NEEDS_SSL_WITH_CRYPTO Yes ;;
+    *)          TLOG " (found)" ;;
+    esac
+else
+    TLOG " (not found)"
+    AC_MAK NO_OPENSSL Yes
+fi
+
+# Define NO_CURL if you do not have curl installed.  git-http-pull and
+# git-http-push are not build, and you cannot use http:// and https://
+# transports.
+
+# Define CURLDIR=/foo/bar if your curl header and library files are in
+# /foo/bar/include and /foo/bar/lib directories.
+
+case "$WITH_CURL" in
+/*)	CURLDIR="$WITH_CURL"
+	CFLAGS="$CFLAGS -I$WITH_CURL/include"
+	LDFLAGS="$LDFLAGS -L$WITH_CURL/lib" ;;
+esac
+
+TLOGN "looking for libcurl"
+if AC_LIBRARY curl_version_info -lcurl; then
+    if [ "$CURLDIR" ]; then
+	TLOG " (in $CURLDIR)"
+    else
+	TLOG " (found)"
+    fi
+    AC_MAK CURLDIR $CURLDIR
+else
+    TLOG " (not found)"
+    AC_MAK NO_CURL Yes
+    test "$WITH_CURL" && AC_FAIL "Cannot find libcurl ${CURLDIR:+in $CURDIR}"
+fi
+
+
+# Define NO_EXPAT if you do not havve expat installed.  git-http-push is
+# not built, and you cannot push using http:// and https:// transports.
+
+TLOGN "looking for libexpat"
+if AC_LIBRARY XML_GetBase -lexpat; then
+    TLOG "(found) "
+else
+    TLOG "(not found) "
+    AC_MAK NO_EXPAT Yes
+fi
+
+
+# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
+
+if AC_CHECK_FIELD dirent d_ino sys/types.h sys/dir.h; then
+    : yayy
+else
+    AC_MAK NO_D_INO_IN_DIRENT Yes
+fi
+
+
+# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
+# do not support the 'size specifiers' introduced by C99, namedly ll, hh,
+# j, z, t. )re[resentong ;png ;png ont, char, intmax_t, size_t, ptrdiff_t.
+# some C compilers supported these specifiers prior to C99 as an extension.
+
+
+function check_format() {
+    cat - > /tmp/$$.c << EOF
+#include <stdio.h>
+#include <stddef.h>
+#include <inttypes.h>
+
+main()
+{
+    $1 t = $2;
+
+    printf("%$3", t);
+}
+EOF
+
+    if $AC_CC -o  /tmp/$$ /tmp/$$.c; then
+	O=`/tmp/$$`
+	case "$0" in
+	"$3") return 1 ;;
+	*)    return 0 ;;
+	esac
+    fi
+    return 1
+}
+
+
+TLOGN "C99 printf formats are "
+if check_format "long long" "1" "ll" && check_format "char" "1" "hh" \
+				    && check_format "intmax_t" 1 "j" \
+				      && check_format "size_t" 1 "z" \
+				   && check_format "ptrdiff_t" 1 "t"; then
+    TLOG "supported"
+else
+    TLOG "not supported"
+    AC_MAK NO_C99_FORMAT Yes
+fi
+
+rm -f /tmp/$$ /tmp/$$.c
+
+# Define NO_STRCASESTR if you don't have strcasestr
+
+AC_CHECK_FUNCS strcasestr || AC_MAK NO_STRCASESTR Yes
+
+# Define NO_STRLCPY if you don't have strlcpy.
+
+AC_CHECK_FUNCS strlcpy || AC_MAK NO_STRLCPY Yes
+
+# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
+# If your compiler also does not support long long or does not have
+# strtoull, define NO_STRTOULL.
+
+if AC_CHECK_FUNCS strtoumax ; then
+    : yayy
+else
+    AC_MAK NO_STRTOUMAX Yes
+
+    if AC_CHECK_FUNCS strtoull; then
+	: more yayy 
+    else
+	AC_MAK NO_STRTOULL Yes
+    fi
+fi
+
+
+# Define NO_SETENV if you don't have setenv in the C library.
+
+AC_CHECK_FUNCS setenv || AC_MAK NO_SETENV Yes
+
+# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
+# Enable it on Windows.  By default, symrefs are still used.
+
+AC_PROG_LN_S || AC_MAK NO_SYMLINK_HEAD Yes
+
+
+# Define NO_FINK if your are building on Darwin/Mac OS X, have Fink
+# installed in /sw, but don't want Git to link against any libraries
+# installed there.  If defined you may specify your own (or Fink's)
+# include directories and library directories by defining CFLAGS
+# and LDFLAGS appropriately
+
+
+[ "$OS_DARWIN" -a -d /sw ] || AC_MAK NO_FINK
+
+# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
+# have DarwinPorta installed in /opt/local, but don't want Git to
+# link against any libraries installed there.  If defined you may
+# specify your own (or DarwinPorts's) include directories and
+# library directories by defining CFLAGS and LDFLAGS appropriately.
+
+[ "$OS_DARWIN" -a -d /opt/local ] || AC_MAK NO_DARWIN_PORTS
+
+# Define PPC_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine optimized for PowerPC.
+#
+# Define ARM_SHA1 environment variable when running make to make use of
+# a bundled SHA1 routine optimized for ARM.
+#
+# Define MOZILLA_SHA1 environment variable when runnign make to make use of
+# a bundled SHA1 routine coming from Mozilla.  It is GPL'd and should be used
+# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (defaut
+# choice) has very fast version optimized for i586
+
+case `uname -m` in
+*arm*)  AC_MAK ARM_SHA1 Yes ;;
+*ppc*)  AC_MAK PPC_SHA1 Yes ;;
+*i586*) AC_MAK MOZILLA_SHA1 Yes ;;
+esac
+
+# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
+# (see the libssl check)
+
+#  Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
+
+if AC_LIBRARY iconv_open; then
+    : iconv is part of libc
+elif AC_LIBRARY iconv_open -liconv; then
+    AC_MAK NEEDS_LIBICONV Yes
+else
+    AC_MAK NO_ICONV Yes
+fi
+
+# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
+# Patrick Mauritz)
+
+AC_LIBRARY socket -lsocket -lnsl
+
+case "$AC_LIBS" in
+*socket*) AC_MAK NEEDS_SOCKET Yes ;;
+esac
+
+case "$AC_LIBS" in
+*nsl*) AC_MAK NEEDS_NSL Yes ;;
+esac
+
+# define NO_MMAP if you want to avoid mmap.
+
+[ "$NO_MMAP_PLEASE" ] && AC_MAK NO_MMAP Yes
+
+
+# Define NO_PREAD if you have a problem with pread() system call (e.g.
+# cygwin .dll before v1.5.22).
+
+AC_CHECK_FUNCS pread  || AC_MAK NO_PREAD Yes
+
+# @@@@
+# define NO_FAST_WORKING_DIRECTORY if access objects in pack files is
+# generally faster on your platform than access the working directory
+
+# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
+# the executable mode bit, but doesn't really do so.
+
+if [ `uname -o 2>/dev/null` == Cygwin ]; then
+    AC_MAK NO_FAST_WORKING_DIRECTORY Yes
+    AC_MAK NO_TRUSTABLE_FILEMODE Yes
+fi
+
+# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
+
+AC_CHECK_FUNCS getaddrinfo || AC_MAK NO_IPV6 Yes
+
+# Define NO_SOCKADDR_STORAGE if your platform does not have struct
+# sockaddr_storage.
+
+AC_CHECK_STRUCT sockaddr_storage netdb.h || AC_MAK NO_SOCKADDR_STORAGE Yes
+
+# Define NO_ICONV if your libc does not properly support iconv.
+
+# (see the test for NEEDS_LIBICONV)
+
+# @@@@
+#  Define OLD_ICONV if your library has an old iconv(), where the second
+# (input buffer pointer) parameter is declared with type (const char**).
+
+
+# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
+# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
+# is used instead.
+
+
+# (first check to see if this is a gcc)
+
+if $AC_CC --version 2>/dev/null| grep -s -i 'free software foundation'; then
+    echo 'char code[] = "Yes";' >> /tmp/$$.c
+    
+    if $AC_CC -R /usr/lib -o /tmp/$$  /tmp/$$.c; then
+	TLOG "$AC_CC uses -R to set runtime paths (gcc-specific option)"
+    else
+	AC_MAK NO_R_TO_GCC Yes
+    fi
+    rm -f /tmp/$$ /tmp/$$.c
+
+    # If this is gcc, also check and see if it's a gcc that doesn't
+    # freak out over the __attribute__((__noreturn__)) extension.
+
+    echo '__attribute__((__noreturn__)) main() { exit(1); }' > /tmp/$$.c
+
+    if $AC_CC -o /tmp/$$ /tmp/$$.c; then
+	TLOG "$AC_CC understands __attribute__((__noreturn__))"
+	AC_DEFINE WORKING_NORETURN 1
+    fi
+    rm -f /tmp/$$.c /tmp/$$.o
+else
+    AC_MAK NO_R_TO_GCC Yes
+fi
+
+AC_MAK CC "$AC_CC"
+test "$CFLAGS" && AC_MAK CFLAGS "$CFLAGS"
+test "$LDFLAGS" && ACMAK LDFLAGS "$LDFLAGS"
+
+test "$AC_PREFIX"  && AC_MAK prefix $AC_PREFIX
+test "$AC_CONFDIR" && AC_MAK sysconfdir $AC_CONFDIR
+test "$AC_EXECDIR" && AC_MAK bindir $AC_EXECDIR
+
+AC_OUTPUT
diff -Naur git-1.5.2.2-orig/git-compat-util.h git-1.5.2.2/git-compat-util.h
--- git-1.5.2.2-orig/git-compat-util.h	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/git-compat-util.h	2007-06-30 00:04:10.000000000 -0400
@@ -1,6 +1,8 @@
 #ifndef GIT_COMPAT_UTIL_H
 #define GIT_COMPAT_UTIL_H
 
+#include "config.h"
+
 #define _FILE_OFFSET_BITS 64
 
 #ifndef FLEX_ARRAY
@@ -34,7 +36,6 @@
 
 #include <unistd.h>
 #include <stdio.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <stddef.h>
 #include <stdlib.h>
@@ -44,13 +45,29 @@
 #include <limits.h>
 #include <sys/param.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <dirent.h>
 #include <sys/time.h>
 #include <time.h>
+
+#if NO_TIME_R
+struct tm *gitgmtime_r(time_t *now, struct tm *res);
+struct tm *gitlocaltime_r(time_t *now, struct tm *res);
+#define localtime_r gitlocaltime_r
+#define gmtime_r gitgmtime_r
+#endif
+
 #include <signal.h>
 #include <sys/wait.h>
 #include <fnmatch.h>
+
+#if NO_POLL
+#define poll gitpoll
+#include "compat/poll.h"
+#else
 #include <sys/poll.h>
+#endif
+
 #include <sys/socket.h>
 #include <assert.h>
 #include <regex.h>
@@ -59,7 +76,16 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <pwd.h>
+
+#if HAVE_INTTYPES_H
 #include <inttypes.h>
+#else
+typedef unsigned long long uintmax_t;
+typedef unsigned long long uint64_t;
+typedef DWORD uint32_t;
+typedef WORD uint16_t;
+#endif
+
 #if defined(__CYGWIN__)
 #undef _XOPEN_SOURCE
 #include <grp.h>
@@ -85,7 +111,7 @@
 #define PRIuMAX "llu"
 #endif
 
-#ifdef __GNUC__
+#if WORKING_NORETURN
 #define NORETURN __attribute__((__noreturn__))
 #else
 #define NORETURN
@@ -137,6 +163,10 @@
 #define DEFAULT_PACKED_GIT_LIMIT \
 	((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
 
+#ifdef NO_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
 #ifdef NO_PREAD
 #define pread git_pread
 extern ssize_t git_pread(int fd, void *buf, size_t count, off_t offset);
diff -Naur git-1.5.2.2-orig/git-svn.perl git-1.5.2.2/git-svn.perl
--- git-1.5.2.2-orig/git-svn.perl	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/git-svn.perl	2007-06-29 20:26:38.000000000 -0400
@@ -3446,7 +3446,7 @@
 		return;
 	}
 	open STDIN, '<&', $rfd or ::fatal "Can't redirect stdin: $!\n";
-	$ENV{LESS} ||= 'FRSX';
+	$ENV{LESS} ||= '@@LESS_FLAGS@@';
 	exec $pager or ::fatal "Can't run pager: $! ($pager)\n";
 }
 
diff -Naur git-1.5.2.2-orig/git.spec git-1.5.2.2/git.spec
--- git-1.5.2.2-orig/git.spec	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/git.spec	1969-12-31 19:00:00.000000000 -0500
@@ -1,256 +0,0 @@
-# Pass --without docs to rpmbuild if you don't want the documentation
-
-%define python_path /usr/bin/python
-
-Name: 		git
-Version: 	1.5.2.2
-Release: 	1%{?dist}
-Summary:  	Git core and tools
-License: 	GPL
-Group: 		Development/Tools
-URL: 		http://kernel.org/pub/software/scm/git/
-Source: 	http://kernel.org/pub/software/scm/git/%{name}-%{version}.tar.gz
-BuildRequires:	zlib-devel >= 1.2, openssl-devel, curl-devel, expat-devel  %{!?_without_docs:, xmlto, asciidoc > 6.0.3}
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:	git-core, git-svn, git-cvs, git-arch, git-email, gitk, git-gui, git-p4, perl-Git
-
-%description
-Git is a fast, scalable, distributed revision control system with an
-unusually rich command set that provides both high-level operations
-and full access to internals.
-
-This is a dummy package which brings in all subpackages.
-
-%package core
-Summary:	Core git tools
-Group:		Development/Tools
-Requires:	zlib >= 1.2, rsync, curl, less, openssh-clients, expat
-%description core
-Git is a fast, scalable, distributed revision control system with an
-unusually rich command set that provides both high-level operations
-and full access to internals.
-
-These are the core tools with minimal dependencies.
-
-%package svn
-Summary:        Git tools for importing Subversion repositories
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, subversion
-%description svn
-Git tools for importing Subversion repositories.
-
-%package cvs
-Summary:        Git tools for importing CVS repositories
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, cvs, cvsps
-%description cvs
-Git tools for importing CVS repositories.
-
-%package arch
-Summary:        Git tools for importing Arch repositories
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, tla
-%description arch
-Git tools for importing Arch repositories.
-
-%package p4
-Summary:        Git tools for importing Perforce repositories
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, python
-%description p4
-Git tools for importing Perforce repositories.
-
-%package email
-Summary:        Git tools for sending email
-Group:          Development/Tools
-Requires:	git-core = %{version}-%{release} 
-%description email
-Git tools for sending email.
-
-%package gui
-Summary:        Git GUI tool
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, tk >= 8.4
-%description gui
-Git GUI tool
-
-%package -n gitk
-Summary:        Git revision tree visualiser ('gitk')
-Group:          Development/Tools
-Requires:       git-core = %{version}-%{release}, tk >= 8.4
-%description -n gitk
-Git revision tree visualiser ('gitk')
-
-%package -n perl-Git
-Summary:        Perl interface to Git
-Group:          Development/Libraries
-Requires:       git-core = %{version}-%{release}
-Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
-BuildRequires:  perl(Error)
-
-%description -n perl-Git
-Perl interface to Git
-
-%prep
-%setup -q
-
-%build
-make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_P4IMPORT=YesPlease \
-     ETC_GITCONFIG=/etc/gitconfig \
-     prefix=%{_prefix} PYTHON_PATH=%{python_path} all %{!?_without_docs: doc}
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \
-     WITH_P4IMPORT=YesPlease prefix=%{_prefix} mandir=%{_mandir} \
-     ETC_GITCONFIG=/etc/gitconfig \
-     PYTHON_PATH=%{python_path} \
-     INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
-find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
-find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'
-find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
-
-(find $RPM_BUILD_ROOT%{_bindir} -type f | grep -vE "p4import|archimport|svn|cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@)               > bin-man-doc-files
-(find $RPM_BUILD_ROOT%{perl_vendorlib} -type f | sed -e s@^$RPM_BUILD_ROOT@@) >> perl-files
-%if %{!?_without_docs:1}0
-(find $RPM_BUILD_ROOT%{_mandir} $RPM_BUILD_ROOT/Documentation -type f | grep -vE "p4import|archimport|svn|git-cvs|email|gitk|git-gui|git-citool" | sed -e s@^$RPM_BUILD_ROOT@@ -e 's/$/*/' ) >> bin-man-doc-files
-%else
-rm -rf $RPM_BUILD_ROOT%{_mandir}
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-# These are no files in the root package
-
-%files svn
-%defattr(-,root,root)
-%{_bindir}/*svn*
-%doc Documentation/*svn*.txt
-%{!?_without_docs: %{_mandir}/man1/*svn*.1*}
-%{!?_without_docs: %doc Documentation/*svn*.html }
-
-%files cvs
-%defattr(-,root,root)
-%doc Documentation/*git-cvs*.txt
-%{_bindir}/*cvs*
-%{!?_without_docs: %{_mandir}/man1/*cvs*.1*}
-%{!?_without_docs: %doc Documentation/*git-cvs*.html }
-
-%files arch
-%defattr(-,root,root)
-%doc Documentation/git-archimport.txt
-%{_bindir}/git-archimport
-%{!?_without_docs: %{_mandir}/man1/git-archimport.1*}
-%{!?_without_docs: %doc Documentation/git-archimport.html }
-
-%files p4
-%defattr(-,root,root)
-%doc Documentation/git-p4import.txt
-%{_bindir}/git-p4import
-%{!?_without_docs: %{_mandir}/man1/git-p4import.1*}
-%{!?_without_docs: %doc Documentation/git-p4import.html }
-
-%files email
-%defattr(-,root,root)
-%doc Documentation/*email*.txt
-%{_bindir}/*email*
-%{!?_without_docs: %{_mandir}/man1/*email*.1*}
-%{!?_without_docs: %doc Documentation/*email*.html }
-
-%files gui
-%defattr(-,root,root)
-%{_bindir}/git-gui
-%{_bindir}/git-citool
-%{_datadir}/git-gui/
-# Not Yet...
-# %{!?_without_docs: %{_mandir}/man1/git-gui.1}
-# %{!?_without_docs: %doc Documentation/git-gui.html}
-# %{!?_without_docs: %{_mandir}/man1/git-citool.1}
-# %{!?_without_docs: %doc Documentation/git-citool.html}
-
-%files -n gitk
-%defattr(-,root,root)
-%doc Documentation/*gitk*.txt
-%{_bindir}/*gitk*
-%{!?_without_docs: %{_mandir}/man1/*gitk*.1*}
-%{!?_without_docs: %doc Documentation/*gitk*.html }
-
-%files -n perl-Git -f perl-files
-%defattr(-,root,root)
-
-%files core -f bin-man-doc-files
-%defattr(-,root,root)
-%{_datadir}/git-core/
-%doc README COPYING Documentation/*.txt
-%{!?_without_docs: %doc Documentation/*.html Documentation/howto}
-%{!?_without_docs: %doc Documentation/technical}
-
-%changelog
-* Tue May 13 2007 Quy Tonthat <qtonthat@gmail.com>
-- Added lib files for git-gui
-- Added Documentation/technical (As needed by Git Users Manual)
-
-* Tue May 8 2007 Quy Tonthat <qtonthat@gmail.com>
-- Added howto files
-
-* Tue Mar 27 2007 Eygene Ryabinkin <rea-git@codelabs.ru>
-- Added the git-p4 package: Perforce import stuff.
-
-* Mon Feb 13 2007 Nicolas Pitre <nico@cam.org>
-- Update core package description (Git isn't as stupid as it used to be)
-
-* Mon Feb 12 2007 Junio C Hamano <junkio@cox.net>
-- Add git-gui and git-citool.
-
-* Mon Nov 14 2005 H. Peter Anvin <hpa@zytor.com> 0.99.9j-1
-- Change subpackage names to git-<name> instead of git-core-<name>
-- Create empty root package which brings in all subpackages
-- Rename git-tk -> gitk
-
-* Thu Nov 10 2005 Chris Wright <chrisw@osdl.org> 0.99.9g-1
-- zlib dependency fix
-- Minor cleanups from split
-- Move arch import to separate package as well
-
-* Tue Sep 27 2005 Jim Radford <radford@blackbean.org>
-- Move programs with non-standard dependencies (svn, cvs, email)
-  into separate packages
-
-* Tue Sep 27 2005 H. Peter Anvin <hpa@zytor.com>
-- parallelize build
-- COPTS -> CFLAGS
-
-* Fri Sep 16 2005 Chris Wright <chrisw@osdl.org> 0.99.6-1
-- update to 0.99.6
-
-* Fri Sep 16 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Linus noticed that less is required, added to the dependencies
-
-* Sun Sep 11 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Updated dependencies
-- Don't assume manpages are gzipped
-
-* Thu Aug 18 2005 Chris Wright <chrisw@osdl.org> 0.99.4-4
-- drop sh_utils, sh-utils, diffutils, mktemp, and openssl Requires
-- use RPM_OPT_FLAGS in spec file, drop patch0
-
-* Wed Aug 17 2005 Tom "spot" Callaway <tcallawa@redhat.com> 0.99.4-3
-- use dist tag to differentiate between branches
-- use rpm optflags by default (patch0)
-- own %{_datadir}/git-core/
-
-* Mon Aug 15 2005 Chris Wright <chrisw@osdl.org>
-- update spec file to fix Buildroot, Requires, and drop Vendor
-
-* Sun Aug 07 2005 Horst H. von Brand <vonbrand@inf.utfsm.cl>
-- Redid the description
-- Cut overlong make line, loosened changelog a bit
-- I think Junio (or perhaps OSDL?) should be vendor...
-
-* Thu Jul 14 2005 Eric Biederman <ebiederm@xmission.com>
-- Add the man pages, and the --without docs build option
-
-* Wed Jul 7 2005 Chris Wright <chris@osdl.org>
-- initial git spec file
diff -Naur git-1.5.2.2-orig/pager.c git-1.5.2.2/pager.c
--- git-1.5.2.2-orig/pager.c	2007-06-16 11:31:24.000000000 -0400
+++ git-1.5.2.2/pager.c	2007-06-29 20:28:02.000000000 -0400
@@ -1,6 +1,12 @@
 #include "cache.h"
 
+#if HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#else
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
 
 /*
  * This is split up from the rest of git so that we might do
@@ -62,7 +68,9 @@
 	close(fd[0]);
 	close(fd[1]);
 
-	setenv("LESS", "FRSX", 0);
+#ifdef LESS_FLAGS
+	setenv("LESS", LESS_FLAGS, 0);
+#endif
 	run_pager(pager);
 	die("unable to execute pager '%s'", pager);
 	exit(255);
