2018-11-29 07:21:40 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# grpc
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-03-15 16:05:27 +01:00
|
|
|
GRPC_VERSION = 1.36.2
|
package: remove 'v' prefix from github-fetched packages
On Github, a large number of projects name their tag vXYZ (i.e v3.0,
v0.1, etc.). In some packages we do:
<pkg>_VERSION = v0.3
<pkg>_SITE = $(call github foo,bar,$(<pkg>_VERSION))
And in some other packages we do:
<pkg>_VERSION = 0.3
<pkg>_SITE = $(call github foo,bar,v$(<pkg>_VERSION))
I.e in one case we consider the version to be v0.3, in the other case
we consider 0.3 to be the version.
The problem with v0.3 is that when used in conjunction with
release-monitoring.org, it doesn't work very well, because
release-monitoring.org has the concept of "version prefix" and using
that they drop the "v" prefix for the version.
Therefore, a number of packages in Buildroot have a version that
doesn't match with release-monitoring.org because Buildroot has 'v0.3'
and release-monitoring.org has '0.3'.
Since really the version number of 0.3, is makes sense to update our
packages to drop this 'v'.
This commit only addresses the (common) case of github packages where
the prefix is simply 'v'. Other cases will be handled by separate
commits. Also, there are a few cases that couldn't be handled
mechanically that aren't covered by this commit.
Signed-off-by: Victor Huesca <victor.huesca@bootlin.com>
[Arnout: don't change flatbuffers, json-for-modern-cpp, libpagekite,
python-scapy3k, softether]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2019-06-12 08:42:06 +02:00
|
|
|
GRPC_SITE = $(call github,grpc,grpc,v$(GRPC_VERSION))
|
2018-11-29 07:21:40 +01:00
|
|
|
GRPC_LICENSE = Apache-2.0
|
|
|
|
GRPC_LICENSE_FILES = LICENSE
|
|
|
|
|
|
|
|
GRPC_INSTALL_STAGING = YES
|
|
|
|
|
|
|
|
# Need to use host grpc_cpp_plugin during cross compilation.
|
2020-09-11 18:34:09 +02:00
|
|
|
GRPC_DEPENDENCIES = c-ares host-grpc libabseil-cpp openssl protobuf re2 zlib
|
2020-08-13 16:45:49 +02:00
|
|
|
HOST_GRPC_DEPENDENCIES = host-c-ares host-libabseil-cpp host-openssl host-protobuf \
|
|
|
|
host-re2 host-zlib
|
2018-11-29 07:21:40 +01:00
|
|
|
|
2019-02-23 03:10:59 +01:00
|
|
|
# gRPC_CARES_PROVIDER=package won't work because it requires c-ares to have
|
|
|
|
# installed a cmake config file, but buildroot uses c-ares' autotools build,
|
|
|
|
# which doesn't do this. These CARES settings trick the gRPC cmake code into
|
|
|
|
# not looking for c-ares at all and yet still linking with the library.
|
2018-11-29 07:21:40 +01:00
|
|
|
GRPC_CONF_OPTS = \
|
2020-09-11 18:34:09 +02:00
|
|
|
-DgRPC_ABSL_PROVIDER=package \
|
2018-11-29 07:21:40 +01:00
|
|
|
-D_gRPC_CARES_LIBRARIES=cares \
|
|
|
|
-DgRPC_CARES_PROVIDER=none \
|
|
|
|
-DgRPC_PROTOBUF_PROVIDER=package \
|
2020-08-13 16:45:49 +02:00
|
|
|
-DgRPC_RE2_PROVIDER=package \
|
2018-11-29 07:21:40 +01:00
|
|
|
-DgRPC_SSL_PROVIDER=package \
|
2021-02-03 13:43:24 +01:00
|
|
|
-DgRPC_ZLIB_PROVIDER=package \
|
|
|
|
-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
|
|
|
|
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF
|
2018-11-29 07:21:40 +01:00
|
|
|
|
2018-12-07 18:12:41 +01:00
|
|
|
# grpc can use __atomic builtins, so we need to link with
|
|
|
|
# libatomic when available
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
|
|
|
GRPC_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
|
|
|
|
endif
|
|
|
|
|
2019-10-28 12:50:10 +01:00
|
|
|
GRPC_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
GRPC_CXXFLAGS = $(TARGET_CXXFLAGS)
|
|
|
|
|
2019-06-02 18:25:57 +02:00
|
|
|
# Set GPR_DISABLE_WRAPPED_MEMCPY otherwise build will fail on x86_64 with uclibc
|
|
|
|
# because grpc tries to link with memcpy@GLIBC_2.2.5
|
|
|
|
ifeq ($(BR2_x86_64):$(BR2_TOOLCHAIN_USES_GLIBC),y:)
|
2019-10-28 12:50:10 +01:00
|
|
|
GRPC_CFLAGS += -DGPR_DISABLE_WRAPPED_MEMCPY
|
|
|
|
GRPC_CXXFLAGS += -DGPR_DISABLE_WRAPPED_MEMCPY
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
|
|
|
|
GRPC_CFLAGS += -O0
|
|
|
|
GRPC_CXXFLAGS += -O0
|
2019-06-02 18:25:57 +02:00
|
|
|
endif
|
|
|
|
|
2019-12-06 23:25:49 +01:00
|
|
|
# Toolchains older than gcc5 will fail to compile with -0s due to:
|
|
|
|
# error: failure memory model cannot be stronger than success memory model for
|
|
|
|
# '__atomic_compare_exchange', so we use -O2 in these cases
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5):$(BR2_OPTIMIZE_S),:y)
|
|
|
|
GRPC_CFLAGS += -O2
|
|
|
|
GRPC_CXXFLAGS += -O2
|
|
|
|
endif
|
|
|
|
|
2019-10-28 12:50:10 +01:00
|
|
|
GRPC_CONF_OPTS += \
|
|
|
|
-DCMAKE_C_FLAGS="$(GRPC_CFLAGS)" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$(GRPC_CXXFLAGS)"
|
|
|
|
|
2018-11-29 07:21:40 +01:00
|
|
|
HOST_GRPC_CONF_OPTS = \
|
2020-09-11 18:34:09 +02:00
|
|
|
-DgRPC_ABSL_PROVIDER=package \
|
2018-11-29 07:21:40 +01:00
|
|
|
-D_gRPC_CARES_LIBRARIES=cares \
|
|
|
|
-DgRPC_CARES_PROVIDER=none \
|
|
|
|
-DgRPC_PROTOBUF_PROVIDER=package \
|
2020-08-13 16:45:49 +02:00
|
|
|
-DgRPC_RE2_PROVIDER=package \
|
2018-11-29 07:21:40 +01:00
|
|
|
-DgRPC_SSL_PROVIDER=package \
|
2020-09-11 18:34:09 +02:00
|
|
|
-DgRPC_ZLIB_PROVIDER=package
|
2018-11-29 07:21:40 +01:00
|
|
|
|
|
|
|
$(eval $(cmake-package))
|
|
|
|
$(eval $(host-cmake-package))
|