Skip to content

Commit

Permalink
update configure.ac
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur committed Nov 23, 2023
1 parent cc25de8 commit df2a357
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ common_libswsscommon_la_SOURCES = \

common_libswsscommon_la_CXXFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(LIBNL_CFLAGS) $(CODE_COVERAGE_CXXFLAGS)
common_libswsscommon_la_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(LIBNL_CPPFLAGS) $(CODE_COVERAGE_CPPFLAGS)
common_libswsscommon_la_LIBADD = -lpthread $(LIBNL_LIBS) $(CODE_COVERAGE_LIBS) -lzmq -lboost_serialization -luuid -lyang -ldashapi
common_libswsscommon_la_LIBADD = -lpthread $(LIBNL_LIBS) $(CODE_COVERAGE_LIBS) -lzmq -lboost_serialization -luuid -lyang
common_libswsscommon_la_LDFLAGS = -Wl,-z,now $(LDFLAGS)

common_swssloglevel_SOURCES = \
Expand Down
6 changes: 6 additions & 0 deletions common/redisreply.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "config.h"

#include <set>
#include <string.h>
#include <stdint.h>
Expand All @@ -15,7 +17,9 @@
#include "common/rediscommand.h"
#include "common/stringutility.h"

#ifdef DASH_API_INSTALLED
#include <dash_api/utils.h>
#endif

using namespace std;
using namespace boost;
Expand Down Expand Up @@ -320,6 +324,7 @@ string RedisReply::to_string(redisReply *reply,const vector<string> &commands)

auto command = boost::to_upper_copy<string>(commands[0]);

#ifdef DASH_API_INSTALLED
if (commands.size() > 1)
{
if (reply->type == REDIS_REPLY_ARRAY
Expand All @@ -331,6 +336,7 @@ string RedisReply::to_string(redisReply *reply,const vector<string> &commands)
return formatPbReply(reply->element, reply->elements, commands[1]);
}
}
#endif

return to_string(reply, command);
}
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0 libnl-route-3.0 libnl-nf-3.
CFLAGS="$CFLAGS $LIBNL_CFLAGS"
LIBS="$LIBS $LIBNL_LIBS"

AC_CHECK_LIB([dashapi], [PbBinaryToJsonString], [
AC_DEFINE(DASH_API_INSTALLED, 1, [Define if DASH API is installed])
LIBS="$LIBS -ldashapi"
],)

LDFLAGS="-Wl,--no-undefined $LDFLAGS"
AC_SUBST([LDFLAGS])

Expand Down

0 comments on commit df2a357

Please sign in to comment.