Skip to content

Commit

Permalink
add option to build without syncd
Browse files Browse the repository at this point in the history
Signed-off-by: Guohan Lu <[email protected]>
  • Loading branch information
lguohan committed Jun 29, 2020
1 parent 4247481 commit ccbb3bc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
SUBDIRS = meta lib vslib syncd saiplayer saidump saidiscovery tests saisdkdump python
SUBDIRS = meta lib vslib python

if SYNCD
SUBDIRS += syncd saiplayer saidump saidiscovery saisdkdump tests
endif

ACLOCAL_AMFLAGS = -I m4
16 changes: 14 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,28 @@ AM_CONDITIONAL(SAIVS, test x$sai = xvs)

AC_ARG_WITH(swss-common-inc,
[ --with-swss-common-inc=DIR
prefix where swss-common includes are installed],
prefix where swss-common includes are installed],
[AC_SUBST(CPPFLAGS, "$CPPFLAGS -I${withval}")
AC_SUBST(SWSS_COMMON_INC_DIR, "${withval}")])

AC_ARG_WITH(swss-common-lib,
[ --with-swss-common-lib=DIR
prefix where swss-common libraries are installed],
prefix where swss-common libraries are installed],
[AC_SUBST(LDFLAGS, "$LDFLAGS -L${withval}")
AC_SUBST(SWSS_COMMON_LIB_DIR, "${withval}")])

AC_ARG_ENABLE(syncd,
[ --enable-syncd build syncd],
[case "${enableval}" in
yes) syncd=true ;;
no) syncd=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-syncd) ;;
esac],[syncd=true])
AM_CONDITIONAL(SYNCD, test x$syncd = xtrue)
AM_COND_IF([SYNCD], [
AM_COND_IF([SAIVS], [], [AC_CHECK_LIB([sai], [main], [AC_MSG_NOTICE(libsai found)], [AC_MSG_ERROR(libsai is required for syncd)])
])])

AC_ARG_ENABLE(rpcserver,
[ --enable-rpcserver compile with thrift rpcserver included],
[case "${enableval}" in
Expand Down
6 changes: 6 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ build:

binary: binary-syncd-rpc binary-syncd

binary-sairedis:
echo '--enable-syncd=no' > /tmp/syncd-build
dh clean --with autotools-dev
dh build -N syncd -N syncd-dbg -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev
dh binary -N syncd -N syncd-dbg -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev

binary-syncd:
echo > /tmp/syncd-build
dh clean --with autotools-dev
Expand Down

0 comments on commit ccbb3bc

Please sign in to comment.