[dpdk-dev] mk: fix dependencies to optional configs

Message ID 20170330123228.28567-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Olivier Matz March 30, 2017, 12:32 p.m. UTC
  In rte.lib.mk, the list of libraries passed to the link
command (LDLIBS) is generated from the DEPDIRS-xxx variables.
If a library is not compiled because it is disabled in
configuration, it should not appear in DEPDIRS-xxx.

- librte_port depends on librte_kni only if it is enabled.
- librte_table depends on librte_acl only if it is enabled.

Fixes: feb9f680cd2c ("mk: optimize directory dependencies")
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit March 30, 2017, 12:37 p.m. UTC | #1
On 3/30/2017 1:32 PM, Olivier Matz wrote:
> In rte.lib.mk, the list of libraries passed to the link
> command (LDLIBS) is generated from the DEPDIRS-xxx variables.
> If a library is not compiled because it is disabled in
> configuration, it should not appear in DEPDIRS-xxx.
> 
> - librte_port depends on librte_kni only if it is enabled.
> - librte_table depends on librte_acl only if it is enabled.
> 
> Fixes: feb9f680cd2c ("mk: optimize directory dependencies")
> Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon March 30, 2017, 1:37 p.m. UTC | #2
2017-03-30 13:37, Ferruh Yigit:
> On 3/30/2017 1:32 PM, Olivier Matz wrote:
> > In rte.lib.mk, the list of libraries passed to the link
> > command (LDLIBS) is generated from the DEPDIRS-xxx variables.
> > If a library is not compiled because it is disabled in
> > configuration, it should not appear in DEPDIRS-xxx.
> > 
> > - librte_port depends on librte_kni only if it is enabled.
> > - librte_table depends on librte_acl only if it is enabled.
> > 
> > Fixes: feb9f680cd2c ("mk: optimize directory dependencies")
> > Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/Makefile b/lib/Makefile
index 456eb38a4..b2545ff70 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -81,10 +81,16 @@  DIRS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += librte_distributor
 DEPDIRS-librte_distributor := librte_eal librte_mbuf librte_ether
 DIRS-$(CONFIG_RTE_LIBRTE_PORT) += librte_port
 DEPDIRS-librte_port := librte_eal librte_mempool librte_mbuf librte_ether
-DEPDIRS-librte_port += librte_ip_frag librte_sched librte_kni
+DEPDIRS-librte_port += librte_ip_frag librte_sched
+ifeq ($(CONFIG_RTE_LIBRTE_KNI),y)
+DEPDIRS-librte_port += librte_kni
+endif
 DIRS-$(CONFIG_RTE_LIBRTE_TABLE) += librte_table
 DEPDIRS-librte_table := librte_eal librte_mempool librte_mbuf
-DEPDIRS-librte_table += librte_port librte_lpm librte_acl librte_hash
+DEPDIRS-librte_table += librte_port librte_lpm librte_hash
+ifeq ($(CONFIG_RTE_LIBRTE_ACL),y)
+DEPDIRS-librte_table += librte_acl
+endif
 DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += librte_pipeline
 DEPDIRS-librte_pipeline := librte_eal librte_mempool librte_mbuf
 DEPDIRS-librte_pipeline += librte_table librte_port