From 7d27c43d59b3b7b4851bacde72bbe2c0c11d9722 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Tue, 20 Dec 2016 00:22:24 -0800 Subject: [PATCH] syncd: Remove platform dependency code (#138) --- README.md | 6 +----- configure.ac | 6 ------ debian/rules | 4 +--- syncd/Makefile.am | 12 ------------ syncd/syncd.cpp | 12 +++--------- 5 files changed, 5 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 4b21f4262..d95d39974 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,10 @@ Install prerequisite packages: sudo apt-get install libswsscommon libswsscommon-dev -Before compiling, you will need to set an environmental variable to indicate which 'SAI flavor' you are using. - - export DEB_SAI_FLAVOR=[FLAVOR] - You can compile and install from source using: ./autogen.sh - ./configure --with-sai=$(DEB_SAI_FLAVOR) + ./configure make && sudo make install You can also build a debian package using: diff --git a/configure.ac b/configure.ac index 3d2f37f24..abbc87926 100644 --- a/configure.ac +++ b/configure.ac @@ -23,15 +23,9 @@ AM_CONDITIONAL(DEBUG, test x$debug = xtrue) AC_ARG_WITH(sai, [ --with-sai Compiling against specific SAI], [case "${withval}" in - bcm) sai=bcm ;; - mlnx) sai=mlnx ;; - cavm) sai=cavm ;; vs) sai=vs ;; *) AC_MSG_ERROR(bad value ${withval} for --with-sai) ;; esac]) -AM_CONDITIONAL(SAIBCM, test x$sai = xbcm) -AM_CONDITIONAL(SAIMLNX, test x$sai = xmlnx) -AM_CONDITIONAL(SAICAVM, test x$sai = xcavm) AM_CONDITIONAL(SAIVS, test x$sai = xvs) AC_ARG_ENABLE(rpcserver, diff --git a/debian/rules b/debian/rules index 1dd0053aa..621512da0 100755 --- a/debian/rules +++ b/debian/rules @@ -16,8 +16,6 @@ include /usr/share/dpkg/default.mk # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -DEB_SAI_FLAVOR ?= "bcm" - # main packaging script based on dh7 syntax %: dh $@ --with autotools-dev @@ -35,7 +33,7 @@ else endif override_dh_auto_configure: - dh_auto_configure -- --with-sai=$(DEB_SAI_FLAVOR) ${CONFIGURE_ARGS} + dh_auto_configure -- ${CONFIGURE_ARGS} override_dh_installinit: ifeq ($(saithrift), yes) diff --git a/syncd/Makefile.am b/syncd/Makefile.am index 35f304eba..5631ef156 100644 --- a/syncd/Makefile.am +++ b/syncd/Makefile.am @@ -8,18 +8,6 @@ else DBGFLAGS = -g endif -if SAIBCM -SAIFLAGS = -DBRCMSAI -endif - -if SAIMLNX -SAIFLAGS = -DMLNXSAI -endif - -if SAICAVM -SAIFLAGS = -DCAVMSAI -endif - if SAIVS SAILIB=-L$(top_srcdir)/vslib/src/.libs -lsaivs else diff --git a/syncd/syncd.cpp b/syncd/syncd.cpp index 4d81f93f6..6a393886e 100644 --- a/syncd/syncd.cpp +++ b/syncd/syncd.cpp @@ -66,7 +66,6 @@ void exit_and_notify(int status) exit(status); } -#ifdef BRCMSAI void sai_diag_shell() { SWSS_LOG_ENTER(); @@ -88,7 +87,6 @@ void sai_diag_shell() sleep(1); } } -#endif /* BRCMSAI */ sai_object_id_t redis_create_virtual_object_id( _In_ sai_object_type_t object_type) @@ -1730,18 +1728,14 @@ int main(int argc, char **argv) exit_and_notify(EXIT_FAILURE); } -#ifdef BRCMSAI - if (options.diagShell) { - SWSS_LOG_NOTICE("starting bcm diag shell thread"); + SWSS_LOG_NOTICE("starting diag shell thread"); - std::thread bcm_diag_shell_thread = std::thread(sai_diag_shell); - bcm_diag_shell_thread.detach(); + std::thread diag_shell_thread = std::thread(sai_diag_shell); + diag_shell_thread.detach(); } -#endif /* BRCMSAI */ - #ifdef SAITHRIFT if (options.run_rpc_server) {