Skip to content

Commit a62e733

Browse files
committed
Merge branch 'ef/msys-imap'
* 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
2 parents 643faee + 9bccfcd commit a62e733

File tree

5 files changed

+81
-180
lines changed

5 files changed

+81
-180
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ EXTRA_PROGRAMS =
358358
PROGRAMS += $(EXTRA_PROGRAMS)
359359
PROGRAMS += git-fast-import$X
360360
PROGRAMS += git-hash-object$X
361+
PROGRAMS += git-imap-send$X
361362
PROGRAMS += git-index-pack$X
362363
PROGRAMS += git-merge-index$X
363364
PROGRAMS += git-merge-tree$X
@@ -906,7 +907,7 @@ ifdef MSVC
906907
GIT_VERSION := $(GIT_VERSION).MSVC
907908
pathsep = ;
908909
NO_PREAD = YesPlease
909-
NO_OPENSSL = YesPlease
910+
NEEDS_CRYPTO_WITH_SSL = YesPlease
910911
NO_LIBGEN_H = YesPlease
911912
NO_SYMLINK_HEAD = YesPlease
912913
NO_IPV6 = YesPlease
@@ -936,6 +937,7 @@ ifdef MSVC
936937
NO_REGEX = YesPlease
937938
NO_CURL = YesPlease
938939
NO_PTHREADS = YesPlease
940+
BLK_SHA1 = YesPlease
939941

940942
CC = compat/vcbuild/scripts/clink.pl
941943
AR = compat/vcbuild/scripts/lib.pl
@@ -958,7 +960,7 @@ else
958960
ifneq (,$(findstring MINGW,$(uname_S)))
959961
pathsep = ;
960962
NO_PREAD = YesPlease
961-
NO_OPENSSL = YesPlease
963+
NEEDS_CRYPTO_WITH_SSL = YesPlease
962964
NO_LIBGEN_H = YesPlease
963965
NO_SYMLINK_HEAD = YesPlease
964966
NO_IPV6 = YesPlease
@@ -985,6 +987,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
985987
UNRELIABLE_FSTAT = UnfortunatelyYes
986988
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
987989
NO_REGEX = YesPlease
990+
BLK_SHA1 = YesPlease
988991
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch
989992
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
990993
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o
@@ -1082,7 +1085,6 @@ EXTLIBS += -lz
10821085

10831086
ifndef NO_POSIX_ONLY_PROGRAMS
10841087
PROGRAMS += git-daemon$X
1085-
PROGRAMS += git-imap-send$X
10861088
endif
10871089
ifndef NO_OPENSSL
10881090
OPENSSL_LIBSSL = -lssl

compat/mingw.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,27 @@ static inline int waitpid(pid_t pid, int *status, unsigned options)
124124
return -1;
125125
}
126126

127+
#ifndef NO_OPENSSL
128+
#include <openssl/ssl.h>
129+
static inline int mingw_SSL_set_fd(SSL *ssl, int fd)
130+
{
131+
return SSL_set_fd(ssl, _get_osfhandle(fd));
132+
}
133+
#define SSL_set_fd mingw_SSL_set_fd
134+
135+
static inline int mingw_SSL_set_rfd(SSL *ssl, int fd)
136+
{
137+
return SSL_set_rfd(ssl, _get_osfhandle(fd));
138+
}
139+
#define SSL_set_rfd mingw_SSL_set_rfd
140+
141+
static inline int mingw_SSL_set_wfd(SSL *ssl, int fd)
142+
{
143+
return SSL_set_wfd(ssl, _get_osfhandle(fd));
144+
}
145+
#define SSL_set_wfd mingw_SSL_set_wfd
146+
#endif
147+
127148
/*
128149
* implementations of missing functions
129150
*/

compat/vcbuild/scripts/clink.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
push(@args, "zlib.lib");
3030
} elsif ("$arg" eq "-liconv") {
3131
push(@args, "iconv.lib");
32+
} elsif ("$arg" eq "-lcrypto") {
33+
push(@args, "libeay32.lib");
34+
push(@args, "ssleay32.lib");
3235
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
3336
$arg =~ s/^-L/-LIBPATH:/;
3437
push(@args, $arg);

contrib/buildsystems/engine.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ sub handleLinkLine
315315
$appout = shift @parts;
316316
} elsif ("$part" eq "-lz") {
317317
push(@libs, "zlib.lib");
318+
} elsif ("$part" eq "-lcrypto") {
319+
push(@libs, "libeay32.lib");
320+
push(@libs, "ssleay32.lib");
318321
} elsif ($part =~ /^-/) {
319322
push(@lflags, $part);
320323
} elsif ($part =~ /\.(a|lib)$/) {

0 commit comments

Comments
 (0)