[qca-nss-clients] To change the dependancy on ipsecmgr for netlink

This patch compiles ipsec for netlink only if ipsecmgr
is enabled.

Change-Id: Ie6eed851ea7ffe724b1a998aea7effa79a6ba6c4
Signed-off-by: pavir <pavir@codeaurora.org>
diff --git a/netlink/Makefile b/netlink/Makefile
index cb746cc..54b577d 100644
--- a/netlink/Makefile
+++ b/netlink/Makefile
@@ -32,7 +32,6 @@
 qca-nss-netlink-objs += nss_nlgre_redir_lag.o
 qca-nss-netlink-objs += nss_nlipv4.o
 qca-nss-netlink-objs += nss_nlipv6.o
-qca-nss-netlink-objs += nss_nlipsec.o
 qca-nss-netlink-objs += nss_nloam.o
 qca-nss-netlink-objs += nss_nlethrx.o
 qca-nss-netlink-objs += nss_nledma.o
@@ -65,6 +64,11 @@
 else
 ccflags-y += -DCONFIG_NSS_NLDTLS=0
 endif
+IPSEC_ENABLED:=CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr=y
+IPSEC_CONFIG:=$(shell  grep $(IPSEC_ENABLED) $(TOPDIR)/.config)
+ifeq ($(IPSEC_CONFIG),$(IPSEC_ENABLED))
+qca-nss-netlink-objs += nss_nlipsec.o
+endif
 ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64))
 ccflags-y += -DCONFIG_NSS_NLCRYPTOV2=1
 qca-nss-netlink-objs += nss_nlcryptov2.o