1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# protobuf 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun# When bumping this package, make sure to also verify if the 8*4882a593Smuzhiyun# python-protobuf package still works and to update its hash, 9*4882a593Smuzhiyun# as they share the same version/site variables. 10*4882a593SmuzhiyunPROTOBUF_VERSION = 3.18.0 11*4882a593SmuzhiyunPROTOBUF_SOURCE = protobuf-cpp-$(PROTOBUF_VERSION).tar.gz 12*4882a593SmuzhiyunPROTOBUF_SITE = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VERSION) 13*4882a593SmuzhiyunPROTOBUF_LICENSE = BSD-3-Clause 14*4882a593SmuzhiyunPROTOBUF_LICENSE_FILES = LICENSE 15*4882a593SmuzhiyunPROTOBUF_CPE_ID_VENDOR = google 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun# N.B. Need to use host protoc during cross compilation. 18*4882a593SmuzhiyunPROTOBUF_DEPENDENCIES = host-protobuf 19*4882a593SmuzhiyunPROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/bin/protoc 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunPROTOBUF_CXXFLAGS = $(TARGET_CXXFLAGS) 22*4882a593Smuzhiyun 23*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y) 24*4882a593SmuzhiyunPROTOBUF_CXXFLAGS += -O0 25*4882a593Smuzhiyunendif 26*4882a593Smuzhiyun 27*4882a593Smuzhiyunifeq ($(BR2_or1k),y) 28*4882a593SmuzhiyunPROTOBUF_CXXFLAGS += -mcmodel=large 29*4882a593Smuzhiyunendif 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunPROTOBUF_CONF_ENV = CXXFLAGS="$(PROTOBUF_CXXFLAGS)" 32*4882a593Smuzhiyun 33*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) 34*4882a593SmuzhiyunPROTOBUF_CONF_ENV += LIBS=-latomic 35*4882a593Smuzhiyunendif 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunPROTOBUF_INSTALL_STAGING = YES 38*4882a593Smuzhiyun 39*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZLIB),y) 40*4882a593SmuzhiyunPROTOBUF_DEPENDENCIES += zlib 41*4882a593Smuzhiyunendif 42*4882a593Smuzhiyun 43*4882a593Smuzhiyundefine PROTOBUF_REMOVE_UNNECESSARY_TARGET_FILES 44*4882a593Smuzhiyun rm -rf $(TARGET_DIR)/usr/bin/protoc 45*4882a593Smuzhiyun rm -rf $(TARGET_DIR)/usr/lib/libprotoc.so* 46*4882a593Smuzhiyunendef 47*4882a593Smuzhiyun 48*4882a593SmuzhiyunPROTOBUF_POST_INSTALL_TARGET_HOOKS += PROTOBUF_REMOVE_UNNECESSARY_TARGET_FILES 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun$(eval $(autotools-package)) 51*4882a593Smuzhiyun$(eval $(host-autotools-package)) 52