Merge c-ares into libgrpc.a

pull/7900/head
Yuchen Zeng 9 years ago
parent 3a772a7c98
commit 15141a630d
  1. 925
      Makefile
  2. 1
      build.yaml
  3. 73
      grpc.gemspec
  4. 1
      src/ruby/ext/grpc/extconf.rb
  5. 31
      templates/Makefile.template

File diff suppressed because it is too large Load Diff

@ -3469,5 +3469,6 @@ ruby_gem:
deps:
- grpc
- gpr
- ares
- boringssl
- z

@ -954,4 +954,77 @@ Gem::Specification.new do |s|
s.files += %w( third_party/zlib/trees.c )
s.files += %w( third_party/zlib/uncompr.c )
s.files += %w( third_party/zlib/zutil.c )
s.files += %w( third_party/c-ares/ares.h )
s.files += %w( third_party/c-ares/ares_data.h )
s.files += %w( third_party/c-ares/ares_dns.h )
s.files += %w( third_party/c-ares/ares_getenv.h )
s.files += %w( third_party/c-ares/ares_getopt.h )
s.files += %w( third_party/c-ares/ares_inet_net_pton.h )
s.files += %w( third_party/c-ares/ares_iphlpapi.h )
s.files += %w( third_party/c-ares/ares_ipv6.h )
s.files += %w( third_party/c-ares/ares_library_init.h )
s.files += %w( third_party/c-ares/ares_llist.h )
s.files += %w( third_party/c-ares/ares_nowarn.h )
s.files += %w( third_party/c-ares/ares_platform.h )
s.files += %w( third_party/c-ares/ares_private.h )
s.files += %w( third_party/c-ares/ares_rules.h )
s.files += %w( third_party/c-ares/ares_setup.h )
s.files += %w( third_party/c-ares/ares_strcasecmp.h )
s.files += %w( third_party/c-ares/ares_strdup.h )
s.files += %w( third_party/c-ares/ares_version.h )
s.files += %w( third_party/c-ares/bitncmp.h )
s.files += %w( third_party/c-ares/config-win32.h )
s.files += %w( third_party/c-ares/setup_once.h )
s.files += %w( src/c-ares/ares_build.h )
s.files += %w( src/c-ares/config_linux/ares_config.h )
s.files += %w( src/c-ares/config_darwin/ares_config.h )
s.files += %w( third_party/c-ares/ares__close_sockets.c )
s.files += %w( third_party/c-ares/ares__get_hostent.c )
s.files += %w( third_party/c-ares/ares__read_line.c )
s.files += %w( third_party/c-ares/ares__timeval.c )
s.files += %w( third_party/c-ares/ares_cancel.c )
s.files += %w( third_party/c-ares/ares_create_query.c )
s.files += %w( third_party/c-ares/ares_data.c )
s.files += %w( third_party/c-ares/ares_destroy.c )
s.files += %w( third_party/c-ares/ares_expand_name.c )
s.files += %w( third_party/c-ares/ares_expand_string.c )
s.files += %w( third_party/c-ares/ares_fds.c )
s.files += %w( third_party/c-ares/ares_free_hostent.c )
s.files += %w( third_party/c-ares/ares_free_string.c )
s.files += %w( third_party/c-ares/ares_getenv.c )
s.files += %w( third_party/c-ares/ares_gethostbyaddr.c )
s.files += %w( third_party/c-ares/ares_gethostbyname.c )
s.files += %w( third_party/c-ares/ares_getnameinfo.c )
s.files += %w( third_party/c-ares/ares_getopt.c )
s.files += %w( third_party/c-ares/ares_getsock.c )
s.files += %w( third_party/c-ares/ares_init.c )
s.files += %w( third_party/c-ares/ares_library_init.c )
s.files += %w( third_party/c-ares/ares_llist.c )
s.files += %w( third_party/c-ares/ares_mkquery.c )
s.files += %w( third_party/c-ares/ares_nowarn.c )
s.files += %w( third_party/c-ares/ares_options.c )
s.files += %w( third_party/c-ares/ares_parse_a_reply.c )
s.files += %w( third_party/c-ares/ares_parse_aaaa_reply.c )
s.files += %w( third_party/c-ares/ares_parse_mx_reply.c )
s.files += %w( third_party/c-ares/ares_parse_naptr_reply.c )
s.files += %w( third_party/c-ares/ares_parse_ns_reply.c )
s.files += %w( third_party/c-ares/ares_parse_ptr_reply.c )
s.files += %w( third_party/c-ares/ares_parse_soa_reply.c )
s.files += %w( third_party/c-ares/ares_parse_srv_reply.c )
s.files += %w( third_party/c-ares/ares_parse_txt_reply.c )
s.files += %w( third_party/c-ares/ares_platform.c )
s.files += %w( third_party/c-ares/ares_process.c )
s.files += %w( third_party/c-ares/ares_query.c )
s.files += %w( third_party/c-ares/ares_search.c )
s.files += %w( third_party/c-ares/ares_send.c )
s.files += %w( third_party/c-ares/ares_strcasecmp.c )
s.files += %w( third_party/c-ares/ares_strdup.c )
s.files += %w( third_party/c-ares/ares_strerror.c )
s.files += %w( third_party/c-ares/ares_timeout.c )
s.files += %w( third_party/c-ares/ares_version.c )
s.files += %w( third_party/c-ares/ares_writev.c )
s.files += %w( third_party/c-ares/bitncmp.c )
s.files += %w( third_party/c-ares/inet_net_pton.c )
s.files += %w( third_party/c-ares/inet_ntop.c )
s.files += %w( third_party/c-ares/windows_port.c )
end

@ -87,7 +87,6 @@ end
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libcares.a') unless windows
if grpc_config == 'gcov'
$CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage'
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'

@ -556,7 +556,9 @@
endif
ifeq ($(EMBED_CARES),true)
CARES_DEP = $(LIBDIR)/$(CONFIG)/c-ares/libcares.a
CARES_DEP = $(LIBDIR)/$(CONFIG)/libares.a
CARES_MERGE_OBJS = $(LIBARES_OBJS)
CARES_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libares.a
CPPFLAGS := -Ithird_party/c-ares $(CPPFLAGS)
LDFLAGS := -L$(LIBDIR)/$(CONFIG)/c-ares $(LDFLAGS)
CARES_CFLAGS_EXTRA += $(findstring -m32,$(CFLAGS))
@ -891,23 +893,6 @@
$(Q)cp third_party/protobuf/src/.libs/libprotobuf.a $(LIBDIR)/$(CONFIG)/protobuf
$(Q)cp third_party/protobuf/src/protoc $(BINDIR)/$(CONFIG)/protobuf
third_party/c-ares/configure:
$(E) "[AUTOGEN] Preparing c-ares"
# Walkaround for github.com/c-ares/c-ares/issues/44
$(Q)sed -i'.bak' -e 's/AC_CONFIG_SUBDIRS(\[test\])/{}/g' third_party/c-ares/configure.ac
$(Q)(cd third_party/c-ares; ./buildconf; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g $(CARES_LDFLAGS_EXTRA)" CFLAGS="-g $(CARES_CFLAGS_EXTRA)" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g $(CARES_CPPFLAGS_EXTRA)" ./configure --disable-shared)
$(Q)mv third_party/c-ares/configure.ac.bak third_party/c-ares/configure.ac
$(LIBDIR)/$(CONFIG)/c-ares/libcares.a: third_party/c-ares/configure
$(E) "[MAKE] Building c-ares"
$(Q)$(MAKE) -C third_party/c-ares clean
$(Q)$(MAKE) -C third_party/c-ares
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/c-ares
$(Q)cp third_party/c-ares/.libs/libcares.a $(LIBDIR)/$(CONFIG)
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.o: third_party/c-ares/configure
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.o: third_party/c-ares/configure
static: static_c static_cxx
static_c: pc_c pc_c_unsecure cache.mk \
@ -1507,8 +1492,8 @@
% if lib.name != 'z':
$(ZLIB_DEP) \
% endif
% if lib.name == 'ares':
third_party/c-ares/configure \
% if lib.name != 'ares':
$(CARES_DEP) \
% endif
% endif
% if lib.language == 'c++':
@ -1518,11 +1503,11 @@
% if lib.get('baselib', False):
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \
$(CARES_MERGE_OBJS) \
% if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \
% endif
% endif
$(CARES_DEP)\
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
@ -1531,6 +1516,7 @@
% if lib.get('baselib', False):
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \
$(CARES_MERGE_OBJS) \
% if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \
% endif
@ -1575,7 +1561,7 @@
security = lib.get('secure', 'check')
if security == True:
common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)'
common = common + ' $(ZLIB_MERGE_LIBS) $(LDLIBS_CARES)'
common = common + ' $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS)'
if security in [True, 'check']:
for src in lib.src:
@ -1709,7 +1695,6 @@
% for dep in tgt.deps:
$(LIBDIR)/$(CONFIG)/lib${dep}.a\
% endfor
$(CARES_DEP)\
% if tgt.language == "c++" or tgt.boringssl or tgt.build == 'fuzzer':
## C++ targets specificies.

Loading…
Cancel
Save