Skip to content

Commit

Permalink
syncd: Remove platform dependency code (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuotian Cheng authored Dec 20, 2016
1 parent e393930 commit 7d27c43
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 35 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ void exit_and_notify(int status)
exit(status);
}

#ifdef BRCMSAI
void sai_diag_shell()
{
SWSS_LOG_ENTER();
Expand All @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 7d27c43

Please sign in to comment.