Skip to content

Commit

Permalink
Various MacOS build fixes.
Browse files Browse the repository at this point in the history
-) Secure files shouldn't be in the base grpc.
-) grpc++ depends on gpr.
-) grpc++ depends on protobuf (!)
  • Loading branch information
nicolasnoble committed Feb 21, 2015
1 parent cc07b2d commit dda049c
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 186 deletions.
58 changes: 23 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,10 @@ $(OBJDIR)/$(CONFIG)/test/core/util/test_config.o:


LIBGRPC_SRC = \
src/core/httpcli/format_request.c \
src/core/httpcli/httpcli.c \
src/core/httpcli/httpcli_security_context.c \
src/core/httpcli/parser.c \
src/core/security/auth.c \
src/core/security/base64.c \
src/core/security/credentials.c \
Expand All @@ -2242,6 +2246,8 @@ LIBGRPC_SRC = \
src/core/security/secure_transport_setup.c \
src/core/security/security_context.c \
src/core/security/server_secure_chttp2.c \
src/core/surface/secure_channel_create.c \
src/core/surface/secure_server_create.c \
src/core/tsi/fake_transport_security.c \
src/core/tsi/ssl_transport_security.c \
src/core/tsi/transport_security.c \
Expand All @@ -2260,10 +2266,6 @@ LIBGRPC_SRC = \
src/core/channel/noop_filter.c \
src/core/compression/algorithm.c \
src/core/compression/message_compress.c \
src/core/httpcli/format_request.c \
src/core/httpcli/httpcli.c \
src/core/httpcli/httpcli_security_context.c \
src/core/httpcli/parser.c \
src/core/iomgr/alarm.c \
src/core/iomgr/alarm_heap.c \
src/core/iomgr/endpoint.c \
Expand Down Expand Up @@ -2318,8 +2320,6 @@ LIBGRPC_SRC = \
src/core/surface/init.c \
src/core/surface/lame_client.c \
src/core/surface/metadata_array.c \
src/core/surface/secure_channel_create.c \
src/core/surface/secure_server_create.c \
src/core/surface/server.c \
src/core/surface/server_chttp2.c \
src/core/surface/server_create.c \
Expand Down Expand Up @@ -2372,6 +2372,10 @@ ifneq ($(OPENSSL_DEP),)
# This is to ensure the embedded OpenSSL is built beforehand, properly
# installing headers to their final destination on the drive. We need this
# otherwise parallel compilation will fail if a source is compiled first.
src/core/httpcli/format_request.c: $(OPENSSL_DEP)
src/core/httpcli/httpcli.c: $(OPENSSL_DEP)
src/core/httpcli/httpcli_security_context.c: $(OPENSSL_DEP)
src/core/httpcli/parser.c: $(OPENSSL_DEP)
src/core/security/auth.c: $(OPENSSL_DEP)
src/core/security/base64.c: $(OPENSSL_DEP)
src/core/security/credentials.c: $(OPENSSL_DEP)
Expand All @@ -2381,6 +2385,8 @@ src/core/security/secure_endpoint.c: $(OPENSSL_DEP)
src/core/security/secure_transport_setup.c: $(OPENSSL_DEP)
src/core/security/security_context.c: $(OPENSSL_DEP)
src/core/security/server_secure_chttp2.c: $(OPENSSL_DEP)
src/core/surface/secure_channel_create.c: $(OPENSSL_DEP)
src/core/surface/secure_server_create.c: $(OPENSSL_DEP)
src/core/tsi/fake_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/ssl_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/transport_security.c: $(OPENSSL_DEP)
Expand All @@ -2399,10 +2405,6 @@ src/core/channel/metadata_buffer.c: $(OPENSSL_DEP)
src/core/channel/noop_filter.c: $(OPENSSL_DEP)
src/core/compression/algorithm.c: $(OPENSSL_DEP)
src/core/compression/message_compress.c: $(OPENSSL_DEP)
src/core/httpcli/format_request.c: $(OPENSSL_DEP)
src/core/httpcli/httpcli.c: $(OPENSSL_DEP)
src/core/httpcli/httpcli_security_context.c: $(OPENSSL_DEP)
src/core/httpcli/parser.c: $(OPENSSL_DEP)
src/core/iomgr/alarm.c: $(OPENSSL_DEP)
src/core/iomgr/alarm_heap.c: $(OPENSSL_DEP)
src/core/iomgr/endpoint.c: $(OPENSSL_DEP)
Expand Down Expand Up @@ -2457,8 +2459,6 @@ src/core/surface/event_string.c: $(OPENSSL_DEP)
src/core/surface/init.c: $(OPENSSL_DEP)
src/core/surface/lame_client.c: $(OPENSSL_DEP)
src/core/surface/metadata_array.c: $(OPENSSL_DEP)
src/core/surface/secure_channel_create.c: $(OPENSSL_DEP)
src/core/surface/secure_server_create.c: $(OPENSSL_DEP)
src/core/surface/server.c: $(OPENSSL_DEP)
src/core/surface/server_chttp2.c: $(OPENSSL_DEP)
src/core/surface/server_create.c: $(OPENSSL_DEP)
Expand Down Expand Up @@ -2528,6 +2528,10 @@ ifneq ($(NO_DEPS),true)
endif
endif

$(OBJDIR)/$(CONFIG)/src/core/httpcli/format_request.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli_security_context.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/parser.o:
$(OBJDIR)/$(CONFIG)/src/core/security/auth.o:
$(OBJDIR)/$(CONFIG)/src/core/security/base64.o:
$(OBJDIR)/$(CONFIG)/src/core/security/credentials.o:
Expand All @@ -2537,6 +2541,8 @@ $(OBJDIR)/$(CONFIG)/src/core/security/secure_endpoint.o:
$(OBJDIR)/$(CONFIG)/src/core/security/secure_transport_setup.o:
$(OBJDIR)/$(CONFIG)/src/core/security/security_context.o:
$(OBJDIR)/$(CONFIG)/src/core/security/server_secure_chttp2.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_channel_create.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_server_create.o:
$(OBJDIR)/$(CONFIG)/src/core/tsi/fake_transport_security.o:
$(OBJDIR)/$(CONFIG)/src/core/tsi/ssl_transport_security.o:
$(OBJDIR)/$(CONFIG)/src/core/tsi/transport_security.o:
Expand All @@ -2555,10 +2561,6 @@ $(OBJDIR)/$(CONFIG)/src/core/channel/metadata_buffer.o:
$(OBJDIR)/$(CONFIG)/src/core/channel/noop_filter.o:
$(OBJDIR)/$(CONFIG)/src/core/compression/algorithm.o:
$(OBJDIR)/$(CONFIG)/src/core/compression/message_compress.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/format_request.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli_security_context.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/parser.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/alarm.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/alarm_heap.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/endpoint.o:
Expand Down Expand Up @@ -2613,8 +2615,6 @@ $(OBJDIR)/$(CONFIG)/src/core/surface/event_string.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/init.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/lame_client.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/metadata_array.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_channel_create.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_server_create.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server_chttp2.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server_create.o:
Expand Down Expand Up @@ -2732,10 +2732,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/channel/noop_filter.c \
src/core/compression/algorithm.c \
src/core/compression/message_compress.c \
src/core/httpcli/format_request.c \
src/core/httpcli/httpcli.c \
src/core/httpcli/httpcli_security_context.c \
src/core/httpcli/parser.c \
src/core/iomgr/alarm.c \
src/core/iomgr/alarm_heap.c \
src/core/iomgr/endpoint.c \
Expand Down Expand Up @@ -2790,8 +2786,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/surface/init.c \
src/core/surface/lame_client.c \
src/core/surface/metadata_array.c \
src/core/surface/secure_channel_create.c \
src/core/surface/secure_server_create.c \
src/core/surface/server.c \
src/core/surface/server_chttp2.c \
src/core/surface/server_create.c \
Expand Down Expand Up @@ -2872,10 +2866,6 @@ $(OBJDIR)/$(CONFIG)/src/core/channel/metadata_buffer.o:
$(OBJDIR)/$(CONFIG)/src/core/channel/noop_filter.o:
$(OBJDIR)/$(CONFIG)/src/core/compression/algorithm.o:
$(OBJDIR)/$(CONFIG)/src/core/compression/message_compress.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/format_request.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/httpcli_security_context.o:
$(OBJDIR)/$(CONFIG)/src/core/httpcli/parser.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/alarm.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/alarm_heap.o:
$(OBJDIR)/$(CONFIG)/src/core/iomgr/endpoint.o:
Expand Down Expand Up @@ -2930,8 +2920,6 @@ $(OBJDIR)/$(CONFIG)/src/core/surface/event_string.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/init.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/lame_client.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/metadata_array.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_channel_create.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/secure_server_create.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server_chttp2.o:
$(OBJDIR)/$(CONFIG)/src/core/surface/server_create.o:
Expand Down Expand Up @@ -3067,18 +3055,18 @@ endif


ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT): $(LIBGRPC++_OBJS) $(ZLIB_DEP)$(LIBDIR)/$(CONFIG)/grpc.$(SHARED_EXT) $(OPENSSL_DEP)
$(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT): $(LIBGRPC++_OBJS) $(ZLIB_DEP)$(LIBDIR)/$(CONFIG)/gpr.$(SHARED_EXT)$(LIBDIR)/$(CONFIG)/grpc.$(SHARED_EXT) $(OPENSSL_DEP)
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++.def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++-imp.a -o $(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) -lgrpc-imp
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++.def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++-imp.a -o $(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr-imp -lgrpc-imp
else
$(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT) $(OPENSSL_DEP)
$(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT) $(OPENSSL_DEP)
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) -lgrpc
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++.so.0 -o $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) -lgrpc
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++.so.0 -o $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBGRPC++_OBJS) $(LDLIBS) $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc
$(Q) ln -sf libgrpc++.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++.so.0
$(Q) ln -sf libgrpc++.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++.so
endif
Expand Down
21 changes: 11 additions & 10 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
"src/core/channel/noop_filter.h",
"src/core/compression/algorithm.h",
"src/core/compression/message_compress.h",
"src/core/httpcli/format_request.h",
"src/core/httpcli/httpcli.h",
"src/core/httpcli/httpcli_security_context.h",
"src/core/httpcli/parser.h",
"src/core/iomgr/alarm.h",
"src/core/iomgr/alarm_heap.h",
"src/core/iomgr/alarm_internal.h",
Expand Down Expand Up @@ -124,10 +120,6 @@
"src/core/channel/noop_filter.c",
"src/core/compression/algorithm.c",
"src/core/compression/message_compress.c",
"src/core/httpcli/format_request.c",
"src/core/httpcli/httpcli.c",
"src/core/httpcli/httpcli_security_context.c",
"src/core/httpcli/parser.c",
"src/core/iomgr/alarm.c",
"src/core/iomgr/alarm_heap.c",
"src/core/iomgr/endpoint.c",
Expand Down Expand Up @@ -182,8 +174,6 @@
"src/core/surface/init.c",
"src/core/surface/lame_client.c",
"src/core/surface/metadata_array.c",
"src/core/surface/secure_channel_create.c",
"src/core/surface/secure_server_create.c",
"src/core/surface/server.c",
"src/core/surface/server_chttp2.c",
"src/core/surface/server_create.c",
Expand Down Expand Up @@ -304,6 +294,10 @@
"include/grpc/grpc_security.h"
],
"headers": [
"src/core/httpcli/format_request.h",
"src/core/httpcli/httpcli.h",
"src/core/httpcli/httpcli_security_context.h",
"src/core/httpcli/parser.h",
"src/core/security/auth.h",
"src/core/security/base64.h",
"src/core/security/credentials.h",
Expand All @@ -316,6 +310,10 @@
"src/core/tsi/transport_security_interface.h"
],
"src": [
"src/core/httpcli/format_request.c",
"src/core/httpcli/httpcli.c",
"src/core/httpcli/httpcli_security_context.c",
"src/core/httpcli/parser.c",
"src/core/security/auth.c",
"src/core/security/base64.c",
"src/core/security/credentials.c",
Expand All @@ -325,6 +323,8 @@
"src/core/security/secure_transport_setup.c",
"src/core/security/security_context.c",
"src/core/security/server_secure_chttp2.c",
"src/core/surface/secure_channel_create.c",
"src/core/surface/secure_server_create.c",
"src/core/tsi/fake_transport_security.c",
"src/core/tsi/ssl_transport_security.c",
"src/core/tsi/transport_security.c"
Expand Down Expand Up @@ -431,6 +431,7 @@
"src/cpp/util/time.cc"
],
"deps": [
"gpr",
"grpc"
],
"secure": true,
Expand Down
3 changes: 3 additions & 0 deletions templates/Makefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,9 @@ endif
common = common + ' $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS)'
lib_deps = lib_deps + ' $(OPENSSL_DEP)'
mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)'

if lib.language == 'c++':
common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)'
%>

% if lib.build == "all":
Expand Down
32 changes: 16 additions & 16 deletions vsprojects/vs2013/grpc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
<ClInclude Include="..\..\include\grpc\status.h" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\core\httpcli\format_request.h" />
<ClInclude Include="..\..\src\core\httpcli\httpcli.h" />
<ClInclude Include="..\..\src\core\httpcli\httpcli_security_context.h" />
<ClInclude Include="..\..\src\core\httpcli\parser.h" />
<ClInclude Include="..\..\src\core\security\auth.h" />
<ClInclude Include="..\..\src\core\security\base64.h" />
<ClInclude Include="..\..\src\core\security\credentials.h" />
Expand All @@ -109,10 +113,6 @@
<ClInclude Include="..\..\src\core\channel\noop_filter.h" />
<ClInclude Include="..\..\src\core\compression\algorithm.h" />
<ClInclude Include="..\..\src\core\compression\message_compress.h" />
<ClInclude Include="..\..\src\core\httpcli\format_request.h" />
<ClInclude Include="..\..\src\core\httpcli\httpcli.h" />
<ClInclude Include="..\..\src\core\httpcli\httpcli_security_context.h" />
<ClInclude Include="..\..\src\core\httpcli\parser.h" />
<ClInclude Include="..\..\src\core\iomgr\alarm.h" />
<ClInclude Include="..\..\src\core\iomgr\alarm_heap.h" />
<ClInclude Include="..\..\src\core\iomgr\alarm_internal.h" />
Expand Down Expand Up @@ -186,6 +186,14 @@
<ClInclude Include="..\..\src\core\transport\transport_impl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\core\httpcli\format_request.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\httpcli.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\httpcli_security_context.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\parser.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\auth.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\base64.c">
Expand All @@ -204,6 +212,10 @@
</ClCompile>
<ClCompile Include="..\..\src\core\security\server_secure_chttp2.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\secure_channel_create.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\secure_server_create.c">
</ClCompile>
<ClCompile Include="..\..\src\core\tsi\fake_transport_security.c">
</ClCompile>
<ClCompile Include="..\..\src\core\tsi\ssl_transport_security.c">
Expand Down Expand Up @@ -240,14 +252,6 @@
</ClCompile>
<ClCompile Include="..\..\src\core\compression\message_compress.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\format_request.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\httpcli.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\httpcli_security_context.c">
</ClCompile>
<ClCompile Include="..\..\src\core\httpcli\parser.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\alarm.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\alarm_heap.c">
Expand Down Expand Up @@ -356,10 +360,6 @@
</ClCompile>
<ClCompile Include="..\..\src\core\surface\metadata_array.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\secure_channel_create.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\secure_server_create.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\server.c">
</ClCompile>
<ClCompile Include="..\..\src\core\surface\server_chttp2.c">
Expand Down
Loading

0 comments on commit dda049c

Please sign in to comment.