Skip to contentSkip to conversation

mlx5: use pkg-config to handle SUSE libmnl

PATCH Applied Stephen Hemminger 3 participants 3 messages Oct 25, 2018 – Oct 28, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 mlx5: use pkg-config to handle SUSE libmnl

SUSE decided to install the libmnl include file in a non-standard
place: /usr/include/libmnl/libmnl/libmnl.h

This was probably a mistake by the SUSE package maintainer, but hard to get fixed. Workaround the problem by pkg-config to find the necessary include directive for libmnl.

Fixes 20b71e92ef8e ("net/mlx5: lay groundwork for switch offloads")

---
v3 - Tested on SLES 15, needs $(shell pkg-config ...)

 drivers/net/mlx5/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/Makefile +2 -1
index 1e9c0b42ac16..8497c98ef86e 100644
@@ -51,6 +51,7 @@ CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-strict-prototypes
+CFLAGS += $(shell pkg-config --cflags libmnl)
 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
 CFLAGS += -DMLX5_GLUE='"$(LIB_GLUE)"'
 CFLAGS += -DMLX5_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
@@ -59,7 +60,7 @@ LDLIBS += -ldl
 else
 LDLIBS += -libverbs -lmlx5
 endif
-LDLIBS += -lmnl
+LDLIBS += $(shell pkg-config --libs libmnl)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
 LDLIBS += -lrte_bus_pci
Signature · 1 line
2.19.1
Acked-by on v3 1/1
#1 lore raw
Quoted 10 lines · Stephen Hemminger

SUSE decided to install the libmnl include file in a non-standard
place: /usr/include/libmnl/libmnl/libmnl.h

This was probably a mistake by the SUSE package maintainer, but hard to get fixed. Workaround the problem by pkg-config to find the necessary include directive for libmnl.

Fixes 20b71e92ef8e ("net/mlx5: lay groundwork for switch offloads")

---

Thanks

Quoted 29 lines

v3 - Tested on SLES 15, needs $(shell pkg-config ...)

 drivers/net/mlx5/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/Makefile +2 -1
index 1e9c0b42ac16..8497c98ef86e 100644
@@ -51,6 +51,7 @@ CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-strict-prototypes
+CFLAGS += $(shell pkg-config --cflags libmnl)
 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
 CFLAGS += -DMLX5_GLUE='"$(LIB_GLUE)"'
 CFLAGS += -DMLX5_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
@@ -59,7 +60,7 @@ LDLIBS += -ldl
 else
 LDLIBS += -libverbs -lmlx5
 endif
-LDLIBS += -lmnl
+LDLIBS += $(shell pkg-config --libs libmnl)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
 LDLIBS += -lrte_bus_pci
Signature · 1 line
2.19.1
#2 lore raw

Saturday, October 27, 2018 12:49 AM, Yongseok Koh:

Quoted 7 lines

Subject: Re: [dpdk-dev] [PATCH v3] mlx5: use pkg-config to handle SUSE libmnl

Quoted 3 lines · Stephen Hemminger

SUSE decided to install the libmnl include file in a non-standard
place: /usr/include/libmnl/libmnl/libmnl.h

Quoted 8 lines
Quoted 7 lines

This was probably a mistake by the SUSE package maintainer, but hard to get fixed. Workaround the problem by pkg-config to find the necessary include directive for libmnl.

Fixes 20b71e92ef8e ("net/mlx5: lay groundwork for switch offloads")

---

Applied to next-net-mlx, with addition of Cc:[email protected]. thanks.

Quoted 30 lines

Thanks

Quoted 27 lines

v3 - Tested on SLES 15, needs $(shell pkg-config ...)

 drivers/net/mlx5/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/Makefile +2 -5
index 1e9c0b42ac16..8497c98ef86e 100644
@@ -51,6 +51,7 @@ CFLAGS += -D_DEFAULT_SOURCE  CFLAGS +=
-D_XOPEN_SOURCE=600  CFLAGS += $(WERROR_FLAGS)  CFLAGS +=
-Wno-strict-prototypes
+CFLAGS += $(shell pkg-config --cflags libmnl)
 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
 CFLAGS += -DMLX5_GLUE='"$(LIB_GLUE)"'
 CFLAGS += -DMLX5_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
@@ -59,7 +60,7 @@ LDLIBS += -ldl
 else
 LDLIBS += -libverbs -lmlx5
 endif
-LDLIBS += -lmnl
+LDLIBS += $(shell pkg-config --libs libmnl)
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring  LDLIBS +=
-lrte_ethdev -lrte_net -lrte_kvargs  LDLIBS += -lrte_bus_pci
--

2.19.1