diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/BUILD.template | 2 | ||||
-rw-r--r-- | templates/Makefile.template | 166 | ||||
-rw-r--r-- | templates/binding.gyp.template | 30 | ||||
-rw-r--r-- | templates/gRPC.podspec.template | 4 | ||||
-rw-r--r-- | templates/grpc.def.template | 6 | ||||
-rw-r--r-- | templates/grpc.gemspec.template | 25 | ||||
-rw-r--r-- | templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template | 52 | ||||
-rw-r--r-- | templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template | 59 | ||||
-rw-r--r-- | templates/tools/doxygen/Doxyfile.core.internal.template | 2 | ||||
-rw-r--r-- | templates/tools/doxygen/Doxyfile.core.template | 2 | ||||
-rw-r--r-- | templates/vsprojects/cpptest.props.template | 2 |
11 files changed, 224 insertions, 126 deletions
diff --git a/templates/BUILD.template b/templates/BUILD.template index 54dc697125..49703bb1f7 100644 --- a/templates/BUILD.template +++ b/templates/BUILD.template @@ -68,7 +68,7 @@ % endfor % for lib in libs: - % if lib.name in ("grpc", "gpr"): + % if lib.name in ("grpc"): ${objc_library(lib)} % endif % endfor diff --git a/templates/Makefile.template b/templates/Makefile.template index 1770d0f366..ef17d745e6 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -57,9 +57,7 @@ # Basic platform detection HOST_SYSTEM = $(shell uname | cut -f 1 -d_) - ifeq ($(SYSTEM),) - SYSTEM = $(HOST_SYSTEM) - endif + SYSTEM ?= $(HOST_SYSTEM) ifeq ($(SYSTEM),MSYS) SYSTEM = MINGW32 endif @@ -253,12 +251,12 @@ endif ifeq ($(SYSTEM),Linux) - LIBS = rt m pthread + LIBS = dl rt m pthread LDFLAGS += -pthread endif ifeq ($(SYSTEM),MINGW32) - LIBS = m pthread + LIBS = m pthread ws2_32 LDFLAGS += -pthread endif @@ -313,26 +311,18 @@ Libs: -L${'\$${libdir}'} $(PC_LIB),\ Libs.private: $(PC_LIBS_PRIVATE) - # gpr .pc file - PC_NAME = gRPC Portable Runtime - PC_DESCRIPTION = gRPC Portable Runtime - PC_CFLAGS = -pthread - PC_REQUIRES_PRIVATE = - PC_LIBS_PRIVATE = -lpthread - PC_LIB = -lgpr - ifneq ($(SYSTEM),Darwin) - PC_LIBS_PRIVATE += -lrt - endif - GPR_PC_FILE := $(PC_TEMPLATE) - ifeq ($(SYSTEM),MINGW32) SHARED_EXT = dll - endif - ifeq ($(SYSTEM),Darwin) + SHARED_PREFIX = + SHARED_VERSION = -${settings.version.major} + else ifeq ($(SYSTEM),Darwin) SHARED_EXT = dylib - endif - ifeq ($(SHARED_EXT),) + SHARED_PREFIX = lib + SHARED_VERSION = + else SHARED_EXT = so.$(VERSION) + SHARED_PREFIX = lib + SHARED_VERSION = endif ifeq ($(wildcard .git),) @@ -461,7 +451,7 @@ HAS_EMBEDDED_PROTOBUF = true endif - PC_REQUIRES_GRPC = gpr + PC_REQUIRES_GRPC = PC_LIBS_GRPC = ifeq ($(HAS_SYSTEM_ZLIB),false) @@ -553,23 +543,29 @@ # grpc .pc file PC_NAME = gRPC - PC_DESCRIPTION = high performance general RPC framework - PC_CFLAGS = - PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE) + PC_DESCRIPTION = High performance general RPC framework + PC_CFLAGS = -pthread + PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE) -lpthread PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE) PC_LIB = -lgrpc + ifneq ($(SYSTEM),Darwin) + PC_LIBS_PRIVATE += -lrt + endif GRPC_PC_FILE := $(PC_TEMPLATE) # gprc_unsecure .pc file PC_NAME = gRPC unsecure - PC_DESCRIPTION = high performance general RPC framework without SSL - PC_CFLAGS = - PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) + PC_DESCRIPTION = High performance general RPC framework without SSL + PC_CFLAGS = -pthread + PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) -lpthread PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) PC_LIB = -lgrpc + ifneq ($(SYSTEM),Darwin) + PC_LIBS_PRIVATE += -lrt + endif GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE) - # gprc_zookeeper .pc file + # grpc_zookeeper .pc file PC_NAME = gRPC zookeeper PC_DESCRIPTION = gRPC's zookeeper plugin PC_CFLAGS = @@ -790,7 +786,7 @@ static: static_c static_cxx - static_c: pc_c pc_c_unsecure cache.mk pc_gpr pc_c_zookeeper\ + static_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ % for lib in libs: % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ @@ -799,7 +795,7 @@ static_zookeeper_libs - static_cxx: pc_cxx pc_cxx_unsecure pc_gpr cache.mk \ + static_cxx: pc_cxx pc_cxx_unsecure cache.mk \ % for lib in libs: % if lib.build == 'all' and lib.language == 'c++': $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ @@ -809,10 +805,10 @@ shared: shared_c shared_cxx - shared_c: pc_c pc_c_unsecure pc_gpr cache.mk pc_c_zookeeper\ + shared_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper\ % for lib in libs: % if lib.build == 'all' and lib.language == 'c' and not lib.get('external_deps', None): - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif % endfor shared_zookeeper_libs @@ -820,7 +816,7 @@ shared_cxx: pc_cxx pc_cxx_unsecure cache.mk\ % for lib in libs: % if lib.build == 'all' and lib.language == 'c++': - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif % endfor @@ -828,7 +824,7 @@ shared_csharp: shared_c \ % for lib in libs: % if lib.build == 'all' and lib.language == 'csharp': - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif % endfor @@ -843,7 +839,7 @@ shared_zookeeper_libs:\ % for lib in libs: % if lib.build == 'all' and lib.language == 'c' and 'zookeeper' in lib.get('external_deps', []): - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\ + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)\ % endif % endfor @@ -868,8 +864,6 @@ % endif % endfor - pc_gpr: $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc - pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc @@ -1089,8 +1083,8 @@ % if lib.language == "c": % if lib.build == "all": % if not lib.get('external_deps', None): - $(E) "[STRIP] Stripping lib${lib.name}.so" - $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) + $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif % endif @@ -1100,8 +1094,8 @@ % if lib.language == "c": % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): - $(E) "[STRIP] Stripping lib${lib.name}.so" - $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) + $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif % endif @@ -1114,8 +1108,8 @@ % for lib in libs: % if lib.language == "c++": % if lib.build == "all": - $(E) "[STRIP] Stripping lib${lib.name}.so" - $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) + $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif % endfor @@ -1126,8 +1120,8 @@ % for lib in libs: % if lib.language == "csharp": % if lib.build == "all": - $(E) "[STRIP] Stripping lib${lib.name}.so" - $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) + $(E) "[STRIP] Stripping $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) % endif % endif % endfor @@ -1137,11 +1131,6 @@ $(E) "[MAKE] Generating $@" $(Q) echo "$(CACHE_MK)" | tr , '\n' >$@ - $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc: - $(E) "[MAKE] Generating $@" - $(Q) mkdir -p $(@D) - $(Q) echo "$(GPR_PC_FILE)" | tr , '\n' >$@ - $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc: $(E) "[MAKE] Generating $@" $(Q) mkdir -p $(@D) @@ -1283,19 +1272,14 @@ % if lib.language == lang_filter: % if lib.build == "all": % if not lib.get('external_deps', None): - ifeq ($(SYSTEM),MINGW32) - $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)" + $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(INSTALL) -d $(prefix)/lib - $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT) + $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) + ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a - else - $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)" - $(Q) $(INSTALL) -d $(prefix)/lib - $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT) - ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so - endif + else ifneq ($(SYSTEM),Darwin) + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so endif % endif % endif @@ -1306,19 +1290,14 @@ % if lib.language == lang_filter: % if lib.build == "all": % if 'zookeeper' in lib.get('external_deps', []): - ifeq ($(SYSTEM),MINGW32) - $(E) "[INSTALL] Installing ${lib.name}.$(SHARED_EXT)" + $(E) "[INSTALL] Installing $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(INSTALL) -d $(prefix)/lib - $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT) $(prefix)/lib/${lib.name}.$(SHARED_EXT) + $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) + ifeq ($(SYSTEM),MINGW32) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a - else - $(E) "[INSTALL] Installing lib${lib.name}.$(SHARED_EXT)" - $(Q) $(INSTALL) -d $(prefix)/lib - $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.$(SHARED_EXT) - ifneq ($(SYSTEM),Darwin) - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so - endif + else ifneq ($(SYSTEM),Darwin) + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so endif % endif % endif @@ -1354,10 +1333,9 @@ % endfor endif - install-pkg-config_c: pc_gpr pc_c pc_c_unsecure pc_c_zookeeper + install-pkg-config_c: pr pc_c pc_c_unsecure pc_c_zookeeper $(E) "[INSTALL] Installing C pkg-config files" $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig - $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc $(prefix)/lib/pkgconfig/gpr.pc $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(prefix)/lib/pkgconfig/grpc.pc $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(prefix)/lib/pkgconfig/grpc_unsecure.pc ifeq ($(HAS_ZOOKEEPER),true) @@ -1452,11 +1430,7 @@ $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: openssl_dep_error % if lib.build == "all": - ifeq ($(SYSTEM),MINGW32) - $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): openssl_dep_error - else - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): openssl_dep_error - endif + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): openssl_dep_error % endif else @@ -1469,11 +1443,7 @@ $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error % if lib.build == "all": - ifeq ($(SYSTEM),MINGW32) - $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error - else - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error - endif + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): protobuf_dep_error % endif else @@ -1490,11 +1460,7 @@ $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: protobuf_dep_error % if lib.build == "all": - ifeq ($(SYSTEM),MINGW32) - $(LIBDIR)/$(CONFIG)/${lib.name}.$(SHARED_EXT): protobuf_dep_error - else - $(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT): protobuf_dep_error - endif + $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT): protobuf_dep_error % endif else @@ -1551,8 +1517,8 @@ else: ld = '$(LD)' - out_base = '$(LIBDIR)/$(CONFIG)/' + lib.name - out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name + out_mingbase = '$(LIBDIR)/$(CONFIG)/' + lib.name + '$(SHARED_VERSION)' + out_libbase = '$(LIBDIR)/$(CONFIG)/lib' + lib.name + '$(SHARED_VERSION)' common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)' @@ -1598,24 +1564,28 @@ if lib.language == 'c++': common = common + ' $(LDLIBSXX) $(LDLIBS_PROTOBUF)' + + ldflags = '$(LDFLAGS)' + if lib.get('LDFLAGS', None): + ldflags += ' ' + lib['LDFLAGS'] %> % if lib.build == "all": ifeq ($(SYSTEM),MINGW32) - ${out_base}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps} + ${out_mingbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps} $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=${out_base}.def -Wl,--out-implib=${out_libbase}-imp.a -o ${out_base}.$(SHARED_EXT) ${common}${mingw_libs} + $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared ${lib.name}.def -Wl,--output-def=${out_mingbase}.def -Wl,--out-implib=${out_libbase}-dll.a -o ${out_mingbase}.$(SHARED_EXT) ${common}${mingw_libs} else ${out_libbase}.$(SHARED_EXT): $(LIB${lib.name.upper()}_OBJS) ${lib_deps} $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` ifeq ($(SYSTEM),Darwin) - $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name lib${lib.name}.$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} + $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} else - $(Q) ${ld} $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so.${settings.version.major} - $(Q) ln -sf lib${lib.name}.$(SHARED_EXT) ${out_libbase}.so + $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so.${settings.version.major} + $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so endif endif % endif diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template index a913585240..7cee562caa 100644 --- a/templates/binding.gyp.template +++ b/templates/binding.gyp.template @@ -46,7 +46,10 @@ ], 'conditions': [ ['OS == "win"', { - "include_dirs": [ "third_party/boringssl/include" ], + "include_dirs": [ + "third_party/boringssl/include", + "third_party/zlib" + ], "defines": [ '_WIN32_WINNT=0x0600', 'WIN32_LEAN_AND_MEAN', @@ -65,19 +68,20 @@ "ws2_32" ] }, { # OS != "win" + 'variables': { + 'config': '<!(echo $CONFIG)', + # The output of "node --version" is "v[version]". We use cut to + # remove the first character. + 'target%': '<!(node --version | cut -c2-)' + }, # Empirically, Node only exports ALPN symbols if its major version is >0. # io.js always reports versions >0 and always exports ALPN symbols. # Therefore, Node's major version will be truthy if and only if it - # supports ALPN. The output of "node -v" is v[major].[minor].[patch], - # like "v4.1.1" in a recent version. We use cut to split by period and - # take the first field (resulting in "v[major]"), then use cut again - # to take all but the first character, removing the "v". + # supports ALPN. The target is "[major].[minor].[patch]". We split by + # periods and take the first field to get the major version. 'defines': [ - 'TSI_OPENSSL_ALPN_SUPPORT=<!(node --version | cut -d. -f1 | cut -c2-)' + 'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)' ], - 'variables': { - 'config': '<!(echo $CONFIG)' - }, 'include_dirs': [ '<(node_root_dir)/deps/openssl/openssl/include', '<(node_root_dir)/deps/zlib' @@ -218,7 +222,8 @@ 'xcode_settings': { 'MACOSX_DEPLOYMENT_TARGET': '10.9', 'OTHER_CFLAGS': [ - '-stdlib=libc++' + '-stdlib=libc++', + '-std=c++11' ] } }], @@ -230,6 +235,11 @@ % endif % endfor ] + }], + ['OS=="linux"', { + 'ldflags': [ + '-Wl,-wrap,memcpy' + ] }] ], "target_name": "${module.name}", diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index a9948a41df..0d94130859 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -39,7 +39,7 @@ def grpc_files(libs): out = [] for lib in libs: - if lib.name in ("grpc", "gpr"): + if lib.name in ("grpc"): out += lib.get('headers', []) out += lib.get('public_headers', []) out += lib.get('src', []) @@ -48,7 +48,7 @@ def grpc_private_headers(libs): out = [] for lib in libs: - if lib.name in ("grpc", "gpr"): + if lib.name in ("grpc"): out += lib.get('headers', []) return out %> diff --git a/templates/grpc.def.template b/templates/grpc.def.template new file mode 100644 index 0000000000..ea3963c315 --- /dev/null +++ b/templates/grpc.def.template @@ -0,0 +1,6 @@ +%YAML 1.2 +--- | + EXPORTS + % for api in c_apis: + ${api.name} + % endfor diff --git a/templates/grpc.gemspec.template b/templates/grpc.gemspec.template index fdf87ee13f..9d034ddba1 100644 --- a/templates/grpc.gemspec.template +++ b/templates/grpc.gemspec.template @@ -18,7 +18,7 @@ s.required_ruby_version = '>= 2.0.0' s.requirements << 'libgrpc ~> 0.11.0 needs to be installed' - s.files = %w( Rakefile Makefile ) + s.files = %w( Makefile ) s.files += %w( etc/roots.pem ) s.files += Dir.glob('src/ruby/bin/**/*') s.files += Dir.glob('src/ruby/ext/**/*') @@ -35,22 +35,23 @@ s.platform = Gem::Platform::RUBY s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1' - s.add_dependency 'googleauth', '~> 0.5.1' + s.add_dependency 'googleauth', '~> 0.5.1' - s.add_development_dependency 'bundler', '~> 1.9' - s.add_development_dependency 'logging', '~> 2.0' - s.add_development_dependency 'simplecov', '~> 0.9' - s.add_development_dependency 'rake', '~> 10.4' - s.add_development_dependency 'rake-compiler', '~> 0.9' - s.add_development_dependency 'rspec', '~> 3.2' - s.add_development_dependency 'rubocop', '~> 0.30.0' - s.add_development_dependency 'signet', '~>0.7.0' + s.add_development_dependency 'bundler', '~> 1.9' + s.add_development_dependency 'logging', '~> 2.0' + s.add_development_dependency 'simplecov', '~> 0.9' + s.add_development_dependency 'rake', '~> 10.4' + s.add_development_dependency 'rake-compiler', '~> 0.9' + s.add_development_dependency 'rake-compiler-dock', '~> 0.5' + s.add_development_dependency 'rspec', '~> 3.2' + s.add_development_dependency 'rubocop', '~> 0.30.0' + s.add_development_dependency 'signet', '~> 0.7.0' s.extensions = %w(src/ruby/ext/grpc/extconf.rb) % for lib in libs: - % if lib.name in ('gpr', 'grpc'): - % for file in lib.public_headers + lib.headers + lib.src: + % if lib.name in ruby_gem.get('deps', []): + % for file in lib.get('public_headers', []) + lib.headers + lib.src: s.files += %w( ${file} ) % endfor % endif diff --git a/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template new file mode 100644 index 0000000000..e09a58781d --- /dev/null +++ b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.c.template @@ -0,0 +1,52 @@ +%YAML 1.2 +--- | + /* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #include <grpc/support/port_platform.h> + + #ifdef GPR_WIN32 + + #include "rb_grpc_imports.generated.h" + + %for api in c_apis: + ${api.name}_type ${api.name}_import; + %endfor + + void grpc_rb_load_imports(HMODULE library) { + %for api in c_apis: + ${api.name}_import = (${api.name}_type) GetProcAddress(library, "${api.name}"); + %endfor + } + + #endif /* GPR_WIN32 */ diff --git a/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template new file mode 100644 index 0000000000..9f17edeec0 --- /dev/null +++ b/templates/src/ruby/ext/grpc/rb_grpc_imports.generated.h.template @@ -0,0 +1,59 @@ +%YAML 1.2 +--- | + /* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #ifndef GRPC_RB_GRPC_IMPORTS_H_ + #define GRPC_RB_GRPC_IMPORTS_H_ + + #include <grpc/support/port_platform.h> + + #ifdef GPR_WIN32 + + #include <windows.h> + + %for header in sorted(set(api.header for api in c_apis)): + #include <${'/'.join(header.split('/')[1:])}> + %endfor + + %for api in c_apis: + typedef ${api.return_type}(*${api.name}_type)(${api.arguments}); + extern ${api.name}_type ${api.name}_import; + #define ${api.name} ${api.name}_import + %endfor + + void grpc_rb_load_imports(HMODULE library); + + #endif /* GPR_WIN32 */ + + #endif diff --git a/templates/tools/doxygen/Doxyfile.core.internal.template b/templates/tools/doxygen/Doxyfile.core.internal.template index 05be9d81aa..ac30e0afc2 100644 --- a/templates/tools/doxygen/Doxyfile.core.internal.template +++ b/templates/tools/doxygen/Doxyfile.core.internal.template @@ -1,4 +1,4 @@ %YAML 1.2 --- | <%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ - ${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, True)} + ${gen_doxyfile(['grpc'], 'Core', libs, True)} diff --git a/templates/tools/doxygen/Doxyfile.core.template b/templates/tools/doxygen/Doxyfile.core.template index 8004294ec1..679069bddc 100644 --- a/templates/tools/doxygen/Doxyfile.core.template +++ b/templates/tools/doxygen/Doxyfile.core.template @@ -1,4 +1,4 @@ %YAML 1.2 --- | <%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ - ${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, False)} + ${gen_doxyfile(['grpc'], 'Core', libs, False)} diff --git a/templates/vsprojects/cpptest.props.template b/templates/vsprojects/cpptest.props.template index 14169d6ddf..370b6e7e93 100644 --- a/templates/vsprojects/cpptest.props.template +++ b/templates/vsprojects/cpptest.props.template @@ -10,7 +10,7 @@ <WarningLevel>EnableAllWarnings</WarningLevel> </ClCompile> <Link> - <AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gpr_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;gpr.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\gtest\msvc\gtest\Debug;$(SolutionDir)\..\third_party\gflags\lib\Debug;$(SolutionDir)\..\Debug;$(SolutionDir)\..\packages\grpc.dependencies.openssl.${vspackages_dict['grpc.dependencies.openssl'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> |