Skip to content

Commit

Permalink
Merge branch 'ef/msys-imap'
Browse files Browse the repository at this point in the history
* ef/msys-imap:
  Windows: use BLK_SHA1 again
  MSVC: Enable OpenSSL, and translate -lcrypto
  mingw: enable OpenSSL
  mingw: wrap SSL_set_(w|r)fd to call _get_osfhandle
  imap-send: build imap-send on Windows
  imap-send: fix compilation-error on Windows
  imap-send: use run-command API for tunneling
  imap-send: use separate read and write fds
  imap-send: remove useless uid code
  • Loading branch information
Junio C Hamano committed Nov 18, 2009
2 parents 643faee + 9bccfcd commit a62e733
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 180 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,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
Expand Down Expand Up @@ -906,7 +907,7 @@ ifdef MSVC
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
Expand Down Expand Up @@ -936,6 +937,7 @@ ifdef MSVC
NO_REGEX = YesPlease
NO_CURL = YesPlease
NO_PTHREADS = YesPlease
BLK_SHA1 = YesPlease

CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
Expand All @@ -958,7 +960,7 @@ else
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
Expand All @@ -985,6 +987,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
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
Expand Down Expand Up @@ -1082,7 +1085,6 @@ EXTLIBS += -lz

ifndef NO_POSIX_ONLY_PROGRAMS
PROGRAMS += git-daemon$X
PROGRAMS += git-imap-send$X
endif
ifndef NO_OPENSSL
OPENSSL_LIBSSL = -lssl
Expand Down
21 changes: 21 additions & 0 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@ static inline int waitpid(pid_t pid, int *status, unsigned options)
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
*/
Expand Down
3 changes: 3 additions & 0 deletions compat/vcbuild/scripts/clink.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
push(@args, "zlib.lib");
} elsif ("$arg" eq "-liconv") {
push(@args, "iconv.lib");
} elsif ("$arg" eq "-lcrypto") {
push(@args, "libeay32.lib");
push(@args, "ssleay32.lib");
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
$arg =~ s/^-L/-LIBPATH:/;
push(@args, $arg);
Expand Down
3 changes: 3 additions & 0 deletions contrib/buildsystems/engine.pl
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ sub handleLinkLine
$appout = shift @parts;
} elsif ("$part" eq "-lz") {
push(@libs, "zlib.lib");
} elsif ("$part" eq "-lcrypto") {
push(@libs, "libeay32.lib");
push(@libs, "ssleay32.lib");
} elsif ($part =~ /^-/) {
push(@lflags, $part);
} elsif ($part =~ /\.(a|lib)$/) {
Expand Down
Loading

0 comments on commit a62e733

Please sign in to comment.