From eb24302b877a09a6b255bc76dae6e93c85e13acb Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 9 Aug 2023 15:44:40 -0700 Subject: [PATCH] Build both the regular and RPC version when the RPC profile is enabled (#1273) When the RPC version needs to be built, the regular version of syncd also needs to be built. Unfortunately, this is not easy to do with the current build infra except for manually rerunning configure, removing the built object files/binaries, and building the new config. Signed-off-by: Saikrishna Arcot --- debian/control | 2 +- debian/rules | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index a07ed6d80..22dfa95e5 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 1.0.0 Package: syncd Architecture: any -Build-Profiles: +Build-Profiles: Depends: ${misc:Pre-Depends} Recommends: ${shlibs:Depends} Conflicts: syncd-rpc, syncd-vs diff --git a/debian/rules b/debian/rules index 97dfcd356..b872e8062 100755 --- a/debian/rules +++ b/debian/rules @@ -35,9 +35,6 @@ configure_opts += --disable-python2 endif ifneq ($(filter syncd,$(DEB_BUILD_PROFILES)),) -ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),) -configure_opts += --enable-rpcserver -endif ifneq ($(filter vs,$(DEB_BUILD_PROFILES)),) configure_opts += --with-sai=vs endif @@ -58,7 +55,17 @@ override_dh_auto_configure: dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts) override_dh_install: +ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),) + dh_install -N syncd-rpc + # This is to build a RPC-enabled version, and package that version into syncd-rpc + dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts) --enable-rpcserver + make clean + dh_auto_build + make install DESTDIR=$(shell pwd)/debian/tmp + dh_install -N syncd +else dh_install +endif ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),) sed -i 's|ENABLE_SAITHRIFT=0|ENABLE_SAITHRIFT=1 # Add a comment to fix https://github.com/Azure/sonic-buildimage/issues/2694 |' debian/syncd-rpc/usr/bin/syncd_init_common.sh endif