Merge branch 'rj/cygwin-msvc'
authorJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2009 07:48:11 +0000 (23:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2009 07:48:11 +0000 (23:48 -0800)
* rj/cygwin-msvc:
MSVC: Add support for building with NO_MMAP
Makefile: keep MSVC and Cygwin configuration separate

1  2 
Makefile
compat/mingw.h
diff --combined Makefile
index 7b8d11d118c7b17213014caee4b50a3d0ce19995,306ca8611c93e83727f25a9a2182d9b2973079ae..4e596dcd0bfe01c2d325a02ac5d7b39b67df2912
+++ b/Makefile
@@@ -159,10 -159,6 +159,10 @@@ all:
  # Define ASCIIDOC_NO_ROFF if your DocBook XSL escapes raw roff directives
  # (versions 1.72 and later and 1.68.1 and earlier).
  #
 +# Define GNU_ROFF if your target system uses GNU groff.  This forces
 +# apostrophes to be ASCII so that cut&pasting examples to the shell
 +# will work.
 +#
  # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
  # MakeMaker (e.g. using ActiveState under Cygwin).
  #
@@@ -216,6 -212,12 +216,12 @@@ uname_R := $(shell sh -c 'uname -r 2>/d
  uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
  uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
  
+ ifdef MSVC
+       # avoid the MingW and Cygwin configuration sections
+       uname_S := Windows
+       uname_O := Windows
+ endif
  # CFLAGS and LDFLAGS are for the users to override from the command line.
  
  CFLAGS = -g -O2 -Wall
@@@ -358,7 -360,6 +364,7 @@@ EXTRA_PROGRAMS 
  PROGRAMS += $(EXTRA_PROGRAMS)
  PROGRAMS += git-fast-import$X
  PROGRAMS += git-hash-object$X
 +PROGRAMS += git-imap-send$X
  PROGRAMS += git-index-pack$X
  PROGRAMS += git-merge-index$X
  PROGRAMS += git-merge-tree$X
@@@ -417,7 -418,6 +423,7 @@@ LIB_H += builtin.
  LIB_H += cache.h
  LIB_H += cache-tree.h
  LIB_H += commit.h
 +LIB_H += compat/bswap.h
  LIB_H += compat/cygwin.h
  LIB_H += compat/mingw.h
  LIB_H += csum-file.h
@@@ -458,7 -458,6 +464,7 @@@ LIB_H += sideband.
  LIB_H += sigchain.h
  LIB_H += strbuf.h
  LIB_H += string-list.h
 +LIB_H += submodule.h
  LIB_H += tag.h
  LIB_H += transport.h
  LIB_H += tree.h
@@@ -557,7 -556,6 +563,7 @@@ LIB_OBJS += sideband.
  LIB_OBJS += sigchain.o
  LIB_OBJS += strbuf.o
  LIB_OBJS += string-list.o
 +LIB_OBJS += submodule.o
  LIB_OBJS += symlinks.o
  LIB_OBJS += tag.o
  LIB_OBJS += trace.o
@@@ -602,6 -600,7 +608,6 @@@ BUILTIN_OBJS += builtin-diff-index.
  BUILTIN_OBJS += builtin-diff-tree.o
  BUILTIN_OBJS += builtin-diff.o
  BUILTIN_OBJS += builtin-fast-export.o
 -BUILTIN_OBJS += builtin-fetch--tool.o
  BUILTIN_OBJS += builtin-fetch-pack.o
  BUILTIN_OBJS += builtin-fetch.o
  BUILTIN_OBJS += builtin-fmt-merge-msg.o
@@@ -900,11 -899,11 +906,11 @@@ ifeq ($(uname_S),HP-UX
        NO_SYS_SELECT_H = YesPlease
        SNPRINTF_RETURNS_BOGUS = YesPlease
  endif
- ifdef MSVC
+ ifeq ($(uname_S),Windows)
        GIT_VERSION := $(GIT_VERSION).MSVC
        pathsep = ;
        NO_PREAD = YesPlease
 -      NO_OPENSSL = YesPlease
 +      NEEDS_CRYPTO_WITH_SSL = YesPlease
        NO_LIBGEN_H = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NO_IPV6 = YesPlease
        NO_REGEX = YesPlease
        NO_CURL = YesPlease
        NO_PTHREADS = YesPlease
 +      BLK_SHA1 = YesPlease
  
        CC = compat/vcbuild/scripts/clink.pl
        AR = compat/vcbuild/scripts/lib.pl
@@@ -953,11 -951,11 +959,11 @@@ els
        BASIC_CFLAGS += -Zi -MTd
  endif
        X = .exe
- else
+ endif
  ifneq (,$(findstring MINGW,$(uname_S)))
        pathsep = ;
        NO_PREAD = YesPlease
 -      NO_OPENSSL = YesPlease
 +      NEEDS_CRYPTO_WITH_SSL = YesPlease
        NO_LIBGEN_H = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NO_IPV6 = YesPlease
        UNRELIABLE_FSTAT = UnfortunatelyYes
        OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
        NO_REGEX = YesPlease
 +      BLK_SHA1 = YesPlease
        COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
        COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
@@@ -1003,7 -1000,6 +1009,6 @@@ els
        NO_PTHREADS = YesPlease
  endif
  endif
- endif
  
  -include config.mak.autogen
  -include config.mak
@@@ -1082,6 -1078,7 +1087,6 @@@ EXTLIBS += -l
  
  ifndef NO_POSIX_ONLY_PROGRAMS
        PROGRAMS += git-daemon$X
 -      PROGRAMS += git-imap-send$X
  endif
  ifndef NO_OPENSSL
        OPENSSL_LIBSSL = -lssl
@@@ -1381,7 -1378,7 +1386,7 @@@ SHELL = $(SHELL_PATH
  
  all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
  ifneq (,$X)
 -      $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
 +      $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
  endif
  
  all::
@@@ -1805,10 -1802,7 +1810,10 @@@ dist: git.spec git-archive$(X) configur
        gzip -f -9 $(GIT_TARNAME).tar
  
  rpm: dist
 -      $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
 +      $(RPMBUILD) \
 +              --define "_source_filedigest_algorithm md5" \
 +              --define "_binary_filedigest_algorithm md5" \
 +              -ta $(GIT_TARNAME).tar.gz
  
  htmldocs = git-htmldocs-$(GIT_VERSION)
  manpages = git-manpages-$(GIT_VERSION)
@@@ -1836,7 -1830,7 +1841,7 @@@ distclean: clea
        $(RM) configure
  
  clean:
 -      $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
 +      $(RM) *.o block-sha1/*.o arm/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
                $(LIB_FILE) $(XDIFF_LIB)
        $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
diff --combined compat/mingw.h
index 6907345f90128eb20c1ca0a81c452af775877b4b,26c402733e1171179424b8188235c1b82be25ca8..51993ef114b4743267fc7b922dcae68345d2fd0a
@@@ -124,27 -124,6 +124,27 @@@ static inline int waitpid(pid_t pid, in
        return -1;
  }
  
 +#ifndef NO_OPENSSL
 +#include <openssl/ssl.h>
 +static inline int mingw_SSL_set_fd(SSL *ssl, int fd)
 +{
 +      return SSL_set_fd(ssl, _get_osfhandle(fd));
 +}
 +#define SSL_set_fd mingw_SSL_set_fd
 +
 +static inline int mingw_SSL_set_rfd(SSL *ssl, int fd)
 +{
 +      return SSL_set_rfd(ssl, _get_osfhandle(fd));
 +}
 +#define SSL_set_rfd mingw_SSL_set_rfd
 +
 +static inline int mingw_SSL_set_wfd(SSL *ssl, int fd)
 +{
 +      return SSL_set_wfd(ssl, _get_osfhandle(fd));
 +}
 +#define SSL_set_wfd mingw_SSL_set_wfd
 +#endif
 +
  /*
   * implementations of missing functions
   */
@@@ -187,7 -166,7 +187,7 @@@ int mingw_connect(int sockfd, struct so
  int mingw_rename(const char*, const char*);
  #define rename mingw_rename
  
- #ifdef USE_WIN32_MMAP
+ #if defined(USE_WIN32_MMAP) || defined(_MSC_VER)
  int mingw_getpagesize(void);
  #define getpagesize mingw_getpagesize
  #endif