From ce132b48bd8dee4e43fee65680e15e1a1ca4e2bb Mon Sep 17 00:00:00 2001 From: Mahesh Maddikayala Date: Fri, 16 Jul 2021 19:52:01 +0000 Subject: [PATCH 1/3] add support to link custom libnl libs --- configure.ac | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d7816b6f17..44fa7bd5f1 100644 --- a/configure.ac +++ b/configure.ac @@ -13,8 +13,6 @@ AC_HEADER_STDC AC_CHECK_LIB([hiredis], [redisConnect],, AC_MSG_ERROR([libhiredis is not installed.])) -AC_CHECK_LIB([nl-genl-3], [genl_connect]) - AC_CHECK_LIB([team], [team_alloc], AM_CONDITIONAL(HAVE_LIBTEAM, true), [AC_MSG_WARN([libteam is not installed.]) @@ -46,7 +44,27 @@ AC_ARG_WITH(extra-lib, prefix where extra libraries are installed], [AC_SUBST(LDFLAGS, "$LDFLAGS -L${withval}")]) -CFLAGS_COMMON="-std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/libnl3 -I/usr/include/swss" +AC_ARG_WITH(extra-usr-lib, +[ --with-extra-usr-lib=DIR + prefix where extra libraries are installed], +[AC_SUBST(LDFLAGS, "$LDFLAGS -L${withval}")]) + +AC_CHECK_LIB([nl-3], [nl_addr_alloc]) +AC_CHECK_LIB([nl-genl-3], [nl_socket_get_cb]) +AC_CHECK_LIB([nl-route-3], [nl_object_alloc]) +AC_CHECK_LIB([nl-nf-3], [nfnl_connect]) + +CFLAGS_COMMON="-std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/swss" + +AC_ARG_WITH(libnl-3.0-inc, +[ --with-libnl-3.0-inc=DIR + prefix where libnl-3.0 includes are installed], +[AC_SUBST(CPPFLAGS, "$CPPFLAGS -I${withval}") + AC_SUBST(LIBNL_INC_DIR, "${withval}")]) + +if test "${with_libnl_3_0_inc+set}" != set; then + CFLAGS_COMMON+=" I/usr/include/libnl3" +fi CFLAGS_COMMON+=" -Werror" CFLAGS_COMMON+=" -Wno-reorder" From 1e1c48ebae9f1e04587c742cc9dcb835c5af20e5 Mon Sep 17 00:00:00 2001 From: Mahesh Maddikayala Date: Fri, 16 Jul 2021 20:08:15 +0000 Subject: [PATCH 2/3] fix type --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 44fa7bd5f1..f0f4fe4bdf 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ AC_ARG_WITH(libnl-3.0-inc, AC_SUBST(LIBNL_INC_DIR, "${withval}")]) if test "${with_libnl_3_0_inc+set}" != set; then - CFLAGS_COMMON+=" I/usr/include/libnl3" + CFLAGS_COMMON+=" -I/usr/include/libnl3" fi CFLAGS_COMMON+=" -Werror" From 55bae9b8575b06e29b9a5eb395516aaf10210e11 Mon Sep 17 00:00:00 2001 From: Mahesh Maddikayala Date: Tue, 20 Jul 2021 00:49:48 +0000 Subject: [PATCH 3/3] updated the API name to check --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f0f4fe4bdf..edca67de7c 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ AC_ARG_WITH(extra-usr-lib, AC_CHECK_LIB([nl-3], [nl_addr_alloc]) AC_CHECK_LIB([nl-genl-3], [nl_socket_get_cb]) -AC_CHECK_LIB([nl-route-3], [nl_object_alloc]) +AC_CHECK_LIB([nl-route-3], [rtnl_route_nh_get_encap_mpls_dst]) AC_CHECK_LIB([nl-nf-3], [nfnl_connect]) CFLAGS_COMMON="-std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/swss"