diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 02eb58df0c..884a50a1ac 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -32,7 +32,10 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \ $(DOCKER_FPM) # Inject brcm sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV) $(LIBSAITHRIFT_DEV) +$(LIBSAIREDIS)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV) +endif # Runtime dependency on brcm sai is set only for syncd $(SYNCD)_RDEPENDS += $(BRCM_SAI) diff --git a/platform/cavium/rules.mk b/platform/cavium/rules.mk index 3cdd8d61f6..2da9f5cca9 100644 --- a/platform/cavium/rules.mk +++ b/platform/cavium/rules.mk @@ -13,7 +13,10 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_SYNCD_CAVM_RPC) # Inject cavium sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(CAVM_SAI) $(CAVM_LIBSAI) $(LIBSAITHRIFT_DEV_CAVM) +$(LIBSAIREDIS)_DEPENDS += $(CAVM_SAI) $(CAVM_LIBSAI) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV_CAVM) +endif # Runtime dependency on cavium sai is set only for syncd $(SYNCD)_RDEPENDS += $(CAVM_SAI) diff --git a/platform/centec/rules.mk b/platform/centec/rules.mk index f9d776b61f..53759cb67f 100644 --- a/platform/centec/rules.mk +++ b/platform/centec/rules.mk @@ -11,7 +11,10 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_SYNCD_CENTEC_RPC) # Inject centec sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(CENTEC_SAI) $(LIBSAITHRIFT_DEV_CENTEC) +$(LIBSAIREDIS)_DEPENDS += $(CENTEC_SAI) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV_CENTEC) +endif # Runtime dependency on centec sai is set only for syncd $(SYNCD)_RDEPENDS += $(CENTEC_SAI) diff --git a/platform/marvell/rules.mk b/platform/marvell/rules.mk index 067e5ee473..93fe18eef8 100644 --- a/platform/marvell/rules.mk +++ b/platform/marvell/rules.mk @@ -10,7 +10,10 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_SYNCD_MRVL_RPC) # Inject mrvl sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(MRVL_FPA) $(MRVL_SAI) $(LIBSAITHRIFT_DEV_MRVL) +$(LIBSAIREDIS)_DEPENDS += $(MRVL_FPA) $(MRVL_SAI) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV_MRVL) +endif # Runtime dependency on mrvl sai is set only for syncd $(SYNCD)_RDEPENDS += $(MRVL_SAI) diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 18f1c068cb..c869bfc6cd 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -18,7 +18,10 @@ SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_FPM) # Inject mlnx sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) $(LIBSAITHRIFT_DEV) +$(LIBSAIREDIS)_DEPENDS += $(MLNX_SAI) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV) +endif # Runtime dependency on mlnx sai is set only for syncd $(SYNCD)_RDEPENDS += $(MLNX_SAI) diff --git a/platform/nephos/rules.mk b/platform/nephos/rules.mk index 6c201fcccd..797e2def91 100644 --- a/platform/nephos/rules.mk +++ b/platform/nephos/rules.mk @@ -22,7 +22,10 @@ SONIC_ONLINE_FILES += $(NPX_DIAG) $(WARM_VERIFIER) $(DSSERVE) SONIC_ALL += $(SONIC_ONE_IMAGE) $(DOCKER_FPM) # Inject nephos sai into sairedis -$(LIBSAIREDIS)_DEPENDS += $(NEPHOS_SAI) $(NEPHOS_SAI_DEV) $(LIBSAITHRIFT_DEV) +$(LIBSAIREDIS)_DEPENDS += $(NEPHOS_SAI) $(NEPHOS_SAI_DEV) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV) +endif # Runtime dependency on nephos sai is set only for syncd $(SYNCD)_RDEPENDS += $(NEPHOS_SAI) diff --git a/platform/p4/rules.mk b/platform/p4/rules.mk index 7fe6a60fad..975dbb82ec 100644 --- a/platform/p4/rules.mk +++ b/platform/p4/rules.mk @@ -10,5 +10,8 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk SONIC_ALL += $(DOCKER_SONIC_P4) -$(LIBSAIREDIS)_DEPENDS += $(P4_SWITCH) $(LIBSAITHRIFT_DEV_P4) +$(LIBSAIREDIS)_DEPENDS += $(P4_SWITCH) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DEPENDS += $(LIBSAITHRIFT_DEV_P4) +endif $(LIBSAIREDIS)_RDEPENDS += $(P4_SWITCH) diff --git a/rules/sairedis.mk b/rules/sairedis.mk index 946787da0d..db5bfbca8a 100644 --- a/rules/sairedis.mk +++ b/rules/sairedis.mk @@ -2,8 +2,15 @@ LIBSAIREDIS = libsairedis_1.0.0_amd64.deb $(LIBSAIREDIS)_SRC_PATH = $(SRC_PATH)/sonic-sairedis -$(LIBSAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV) +$(LIBSAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBSAIREDIS)_RDEPENDS += $(LIBSWSSCOMMON) +ifneq ($(ENABLE_SYNCD_RPC),y) +$(LIBSAIREDIS)_DPKG_TARGET = binary-syncd +else +# Inject libthrift build dependency for RPC build +$(LIBSAIREDIS)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV) +$(LIBSAIREDIS)_DPKG_TARGET = binary-syncd-rpc +endif $(LIBSAIREDIS)_DEB_BUILD_OPTIONS = nocheck SONIC_DPKG_DEBS += $(LIBSAIREDIS) @@ -21,10 +28,12 @@ SYNCD = syncd_1.0.0_amd64.deb $(SYNCD)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD))) +ifeq ($(ENABLE_SYNCD_RPC),y) SYNCD_RPC = syncd-rpc_1.0.0_amd64.deb $(SYNCD_RPC)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_RPC))) endif +endif LIBSAIMETADATA = libsaimetadata_1.0.0_amd64.deb $(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA))) @@ -49,11 +58,13 @@ $(SYNCD_DBG)_DEPENDS += $(SYNCD) $(SYNCD_DBG)_RDEPENDS += $(SYNCD) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_DBG))) +ifeq ($(ENABLE_SYNCD_RPC),y) SYNCD_RPC_DBG = syncd-rpc-dbg_1.0.0_amd64.deb $(SYNCD_RPC_DBG)_DEPENDS += $(SYNCD_RPC) $(SYNCD_RPC_DBG)_RDEPENDS += $(SYNCD_RPC) $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_RPC_DBG))) endif +endif LIBSAIMETADATA_DBG = libsaimetadata-dbg_1.0.0_amd64.deb $(LIBSAIMETADATA_DBG)_DEPENDS += $(LIBSAIMETADATA)