Skip to content
Snippets Groups Projects
Commit 5b9e7430 authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge github.com:grpc/grpc into bye-bye-completion-queue-pie

Conflicts:
	vsprojects/Grpc.mak
parents f7670f30 ad21fea2
No related branches found
No related tags found
No related merge requests found
Showing
with 458 additions and 335 deletions
...@@ -140,6 +140,29 @@ you will need to install certain modules for python. ...@@ -140,6 +140,29 @@ you will need to install certain modules for python.
$ sudo easy_install simplejson mako $ sudo easy_install simplejson mako
Mingw-specific notes:
---------------------
While gRPC compiles properly under mingw, some more preparation work is needed.
The recommendation is to use msys2. The installation instructions are available
at that address: http://msys2.github.io/
Once this is installed, make sure you are using the following: MinGW-w64 Win64.
You'll be required to install a few more packages:
$ pacman -S make mingw-w64-x86_64-gcc mingw-w64-x86_64-zlib autoconf automake libtool
Please also install OpenSSL from that website:
http://slproweb.com/products/Win32OpenSSL.html
The package Win64 OpenSSL v1.0.2a should do. At that point you should be able
to compile gRPC with the following:
$ export LDFLAGS="-L/mingw64/lib -L/c/OpenSSL-Win64"
$ export CPPFLAGS="-I/mingw64/include -I/c/OpenSSL-Win64/include"
$ make
A word on OpenSSL A word on OpenSSL
----------------- -----------------
......
This diff is collapsed.
...@@ -555,7 +555,8 @@ ...@@ -555,7 +555,8 @@
"filegroups": [ "filegroups": [
"grpc++_base" "grpc++_base"
], ],
"secure": "no" "secure": "no",
"vs_project_guid": "{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}"
}, },
{ {
"name": "grpc_plugin_support", "name": "grpc_plugin_support",
...@@ -1000,6 +1001,9 @@ ...@@ -1000,6 +1001,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1044,6 +1048,9 @@ ...@@ -1044,6 +1048,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1058,6 +1065,9 @@ ...@@ -1058,6 +1065,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1599,6 +1609,9 @@ ...@@ -1599,6 +1609,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1655,6 +1668,9 @@ ...@@ -1655,6 +1668,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1669,6 +1685,9 @@ ...@@ -1669,6 +1685,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
...@@ -1683,6 +1702,9 @@ ...@@ -1683,6 +1702,9 @@
"grpc", "grpc",
"gpr_test_util", "gpr_test_util",
"gpr" "gpr"
],
"platforms": [
"posix"
] ]
}, },
{ {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#ifndef GRPC_SUPPORT_TLS_H #ifndef GRPC_SUPPORT_TLS_H
#define GRPC_SUPPORT_TLS_H #define GRPC_SUPPORT_TLS_H
#include "port_platform.h" #include <grpc/support/port_platform.h>
/* Thread local storage. /* Thread local storage.
...@@ -63,15 +63,15 @@ ...@@ -63,15 +63,15 @@
ALL functions here may be implemented as macros. */ ALL functions here may be implemented as macros. */
#ifdef GPR_GCC_TLS #ifdef GPR_GCC_TLS
#include "tls_gcc.h" #include <grpc/support/tls_gcc.h>
#endif #endif
#ifdef GPR_MSVC_TLS #ifdef GPR_MSVC_TLS
#include "tls_msvc.h" #include <grpc/support/tls_msvc.h>
#endif #endif
#ifdef GPR_PTHREAD_TLS #ifdef GPR_PTHREAD_TLS
#include "tls_pthread.h" #include <grpc/support/tls_pthread.h>
#endif #endif
#endif #endif
...@@ -42,7 +42,7 @@ struct gpr_msvc_thread_local { ...@@ -42,7 +42,7 @@ struct gpr_msvc_thread_local {
}; };
#define GPR_TLS_DECL(name) \ #define GPR_TLS_DECL(name) \
static __thread struct gpr_msvc_thread_local name = {0} static __declspec(thread) struct gpr_msvc_thread_local name = {0}
#define gpr_tls_init(tls) do {} while (0) #define gpr_tls_init(tls) do {} while (0)
#define gpr_tls_destroy(tls) do {} while (0) #define gpr_tls_destroy(tls) do {} while (0)
......
...@@ -121,7 +121,6 @@ static void do_iocp_work() { ...@@ -121,7 +121,6 @@ static void do_iocp_work() {
} }
static void iocp_loop(void *p) { static void iocp_loop(void *p) {
void * eventshutdown = NULL;
while (gpr_atm_acq_load(&g_orphans) || while (gpr_atm_acq_load(&g_orphans) ||
gpr_atm_acq_load(&g_custom_events) || gpr_atm_acq_load(&g_custom_events) ||
!gpr_event_get(&g_shutdown_iocp)) { !gpr_event_get(&g_shutdown_iocp)) {
......
...@@ -98,10 +98,10 @@ static void on_connect(void *acp, int from_iocp) { ...@@ -98,10 +98,10 @@ static void on_connect(void *acp, int from_iocp) {
if (from_iocp) { if (from_iocp) {
DWORD transfered_bytes = 0; DWORD transfered_bytes = 0;
DWORD flags; DWORD flags;
info->outstanding = 0;
BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped,
&transfered_bytes, FALSE, &transfered_bytes, FALSE,
&flags); &flags);
info->outstanding = 0;
GPR_ASSERT(transfered_bytes == 0); GPR_ASSERT(transfered_bytes == 0);
if (!wsa_success) { if (!wsa_success) {
char *utf8_message = gpr_format_message(WSAGetLastError()); char *utf8_message = gpr_format_message(WSAGetLastError());
......
...@@ -56,6 +56,9 @@ endif ...@@ -56,6 +56,9 @@ endif
ifeq ($(SYSTEM),MSYS) ifeq ($(SYSTEM),MSYS)
SYSTEM = MINGW32 SYSTEM = MINGW32
endif endif
ifeq ($(SYSTEM),MINGW64)
SYSTEM = MINGW32
endif
ifndef BUILDDIR ifndef BUILDDIR
......
...@@ -33,10 +33,19 @@ ...@@ -33,10 +33,19 @@
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<% <%
disallowed_dependencies = set(['end2end_certs']) disallowed_dependencies = set(['end2end_certs'])
buildable_targets = [ target for target in targets build_from_project_file = set(['gpr',
if not disallowed_dependencies.intersection(target.deps) and 'grpc',
'grpc_unsecure',
'gpr_test_util',
'grpc_test_util',
'grpc_test_util_unsecure',
])
buildable_targets = [ target for target in targets + libs
if not disallowed_dependencies.intersection(target.get('deps', [])) and
target.build in ['all', 'test', 'private', 'tool', 'benchmark'] and
target.language in ['c', 'c++'] and
all([src.endswith('.c') for src in target.src]) and all([src.endswith('.c') for src in target.src]) and
'windows' in target.platforms ] 'windows' in target.get('platforms', ['windows']) ]
c_test_targets = [ target for target in buildable_targets if target.build == 'test' and not target.language == 'c++' ] c_test_targets = [ target for target in buildable_targets if target.build == 'test' and not target.language == 'c++' ]
cxx_test_targets = [ target for target in buildable_targets if target.build == 'test' and target.language == 'c++' ] cxx_test_targets = [ target for target in buildable_targets if target.build == 'test' and target.language == 'c++' ]
%>\ %>\
...@@ -45,31 +54,40 @@ ...@@ -45,31 +54,40 @@
OUT_DIR=test_bin OUT_DIR=test_bin
CC=cl.exe CC=cl.exe /nologo
LINK=link.exe LINK=link.exe /nologo
LIBTOOL=lib.exe /nologo /nodefaultlib
REPO_ROOT=.. REPO_ROOT=..
OPENSSL_INCLUDES = .\packages\${get_openssl()}\build\native\include\v120\Win32\Debug\static OPENSSL_INCLUDES = .\packages\${get_openssl()}\build\native\include
ZLIB_INCLUDES = .\packages\${get_zlib()}\build\native\include ZLIB_INCLUDES = .\packages\${get_zlib()}\build\native\include
INCLUDES=/I$(REPO_ROOT) /I$(REPO_ROOT)\include /I$(OPENSSL_INCLUDES) /I$(ZLIB_INCLUDES) INCLUDES=/I$(REPO_ROOT) /I$(REPO_ROOT)\include /I$(OPENSSL_INCLUDES) /I$(ZLIB_INCLUDES)
DEFINES=/D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /D _CRT_SECURE_NO_WARNINGS DEFINES=/D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /D _CRT_SECURE_NO_WARNINGS
CFLAGS=/c $(INCLUDES) /nologo /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- CFLAGS=/c $(INCLUDES) /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze-
LFLAGS=/DEBUG /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 LFLAGS=/DEBUG /INCREMENTAL /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86
OPENSSL_LIBS=.\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\ssleay32.lib .\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\libeay32.lib OPENSSL_LIBS=.\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\ssleay32.lib .\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\libeay32.lib
WINSOCK_LIBS=ws2_32.lib WINSOCK_LIBS=ws2_32.lib
GENERAL_LIBS=advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib winspool.lib
ZLIB_LIBS=.\packages\${get_zlib()}\build\native\lib\v120\Win32\Debug\static\cdecl\zlib.lib ZLIB_LIBS=.\packages\${get_zlib()}\build\native\lib\v120\Win32\Debug\static\cdecl\zlib.lib
LIBS=$(OPENSSL_LIBS) $(WINSOCK_LIBS) $(ZLIB_LIBS) LIBS=$(OPENSSL_LIBS) $(ZLIB_LIBS) $(GENERAL_LIBS) $(WINSOCK_LIBS)
build_gpr_test_util: all: buildtests
msbuild grpc.sln /t:gpr_test_util /p:Configuration=Debug
build_grpc_test_util:
msbuild grpc.sln /t:grpc_test_util /p:Configuration=Debug
$(OUT_DIR): $(OUT_DIR):
mkdir $(OUT_DIR) mkdir $(OUT_DIR)
build_libs: \
% for target in buildable_targets:
% if target.build == 'private' or target.build == 'all':
% if target.name in build_from_project_file:
build_${target.name} \
% else:
Debug\${target.name}.lib \
% endif
% endif
% endfor
buildtests: buildtests_c buildtests_cxx buildtests: buildtests_c buildtests_cxx
buildtests_c: \ buildtests_c: \
...@@ -87,24 +105,42 @@ ${target.name}.exe \ ...@@ -87,24 +105,42 @@ ${target.name}.exe \
echo All tests built. echo All tests built.
% for target in buildable_targets: % for target in buildable_targets:
${target.name}.exe: build_grpc_test_util $(OUT_DIR) %if target.name in build_from_project_file:
build_${target.name}:
msbuild grpc.sln /t:${target.name} /p:Configuration=Debug /p:Linkage-grpc_dependencies_zlib=static
%else:
%if target.build == 'private':
Debug\${target.name}.lib: \
%else:
${target.name}.exe: build_libs \
%endif
$(OUT_DIR)
echo Building ${target.name} echo Building ${target.name}
$(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ \ $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ \
%for source in target.src: %for source in target.src:
$(REPO_ROOT)\${to_windows_path(source)} \ $(REPO_ROOT)\${to_windows_path(source)} \
%endfor %endfor
%if not target.src:
$(REPO_ROOT)\${to_windows_path('vsprojects/dummy.c')} \
%endif
%if target.build == 'private':
$(LIBTOOL) /OUT:"Debug\${target.name}.lib" \
%else:
$(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\${target.name}.exe" \ $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\${target.name}.exe" \
%for dep in target.deps: %for dep in target.get('deps', []):
Debug\${dep}.lib \ Debug\${dep}.lib \
%endfor %endfor
$(LIBS) \ $(LIBS) \
%endif
%for source in target.src: %for source in target.src:
$(OUT_DIR)\${re.search('([^/]+)\.c$', source).group(1)}.obj \ $(OUT_DIR)\${re.search('([^/]+)\.c$', source).group(1)}.obj \
%endfor %endfor
%if target.build != 'private':
${target.name}: ${target.name}.exe ${target.name}: ${target.name}.exe
echo Running ${target.name} echo Running ${target.name}
$(OUT_DIR)\${target.name}.exe $(OUT_DIR)\${target.name}.exe
%endif
%endif
% endfor % endfor
#!/bin/sh
# To properly use this, you'll need to add:
#
# "debug": true
#
# to build.json
cd `dirname $0`/../..
./tools/buildgen/generate_projects.sh
git diff |
grep \\+Project |
cut -d\" -f 4 |
sort -u |
grep _test$ |
while read p ; do
mkdir -p templates/vsprojects/$p
echo '<%namespace file="../vcxproj_defs.include" import="gen_project"/>${gen_project("'$p'", targets)}' > templates/vsprojects/$p/$p.vcxproj.template
done
git diff |
grep \\+Project |
cut -d\" -f 4 |
sort -u |
grep -v _test$ |
while read p ; do
mkdir -p templates/vsprojects/$p
echo '<%namespace file="../vcxproj_defs.include" import="gen_project"/>${gen_project("'$p'", libs)}' > templates/vsprojects/$p/$p.vcxproj.template
done
./tools/buildgen/generate_projects.sh
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\ <%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('gpr', libs, targets)} ${gen_filters('gpr', libs)}
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ <%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('gpr', libs, targets)} ${gen_project('gpr', libs)}
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ <%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('gpr_test_util', libs, targets)} ${gen_project('gpr_test_util', libs)}
\ No newline at end of file \ No newline at end of file
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\ <%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc++', libs, targets)} ${gen_filters('grpc++', libs)}
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ <%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc++', libs, targets)} ${gen_project('grpc++', libs)}
\ No newline at end of file \ No newline at end of file
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc++_unsecure', libs)}
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc++_unsecure', libs)}
\ No newline at end of file
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\ <%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc', libs, targets)} ${gen_filters('grpc', libs)}
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ <%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc', libs, targets, packages=['openssl','zlib'])} ${gen_project('grpc', libs, packages=['openssl','zlib'])}
\ No newline at end of file \ No newline at end of file
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ <%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_csharp_ext', libs, targets, configuration_type = 'DynamicLibrary', additional_props = ['winsock'], packages=['openssl','zlib'])} ${gen_project('grpc_csharp_ext', libs, configuration_type = 'DynamicLibrary', props = ['winsock'], packages=['openssl','zlib'])}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment