diff --git a/configure.ac b/configure.ac index 64f963508d27..6043c8864f06 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,9 @@ AC_ARG_ENABLE(rpcserver, *) AC_MSG_ERROR(bad value ${enableval} for --enable-rpcserver) ;; esac],[rpcserver=false]) AM_CONDITIONAL(SAITHRIFT, test x$rpcserver = xtrue) +AM_COND_IF([SAITHRIFT], [ + AC_CHECK_LIB([thrift], [main], [], [AC_MSG_ERROR(libthrift is required for rpcserver)]) +]) CFLAGS_COMMON="-std=c++11 -Wall -fPIC -Wno-write-strings" AC_SUBST(CFLAGS_COMMON) diff --git a/syncd/Makefile.am b/syncd/Makefile.am index 6ede4ef691e8..68fc21fe84ec 100644 --- a/syncd/Makefile.am +++ b/syncd/Makefile.am @@ -37,7 +37,7 @@ if SAITHRIFT SAI_RPC_INCLUDE_DIR = ../libsaiserver/include SAI_RPC_LIB_DIR = ../libsaiserver/lib syncd_CPPFLAGS += -I$(SAI_RPC_INCLUDE_DIR) -DSAITHRIFT=yes -syncd_LDADD += -L$(SAI_RPC_LIB_DIR) -lrpcserver +syncd_LDADD += -L$(SAI_RPC_LIB_DIR) -lrpcserver -lthrift endif syncd_request_shutdown_SOURCES = syncd_request_shutdown.cpp