Skip to contentSkip to conversation

net/mlx5: quietly fallback if pkg-config is unavailable

PATCH Applied Luca Boccassi 2 participants 2 messages Nov 9, 2018 – Nov 11, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: quietly fallback if pkg-config is unavailable

Don't fail the build if pkg-config can't be found, instead print the linker flag as it was doing before the change.

Fixes b6b87939193a ("net/mlx5: use pkg-config to handle SUSE libmnl")
---
 drivers/net/mlx5/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/Makefile +2 -2
index 7a50bccd2..895cdfeed 100644
@@ -51,7 +51,7 @@ CFLAGS += -D_DEFAULT_SOURCE
 CFLAGS += -D_XOPEN_SOURCE=600
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -Wno-strict-prototypes
-CFLAGS += $(shell pkg-config --cflags libmnl)
+CFLAGS += $(shell command -v pkg-config > /dev/null 2>&1 && pkg-config --cflags libmnl)
 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
 CFLAGS += -DMLX5_GLUE='"$(LIB_GLUE)"'
 CFLAGS += -DMLX5_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
@@ -60,7 +60,7 @@ LDLIBS += -ldl
 else
 LDLIBS += -libverbs -lmlx5
 endif
-LDLIBS += $(shell pkg-config --libs libmnl)
+LDLIBS += $(shell command -v pkg-config > /dev/null 2>&1 && pkg-config --libs libmnl || echo "-lmnl")
 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
#1 lore raw

Saturday, November 10, 2018 12:48 AM, Luca Boccassi:

Quoted 10 lines

Subject: [PATCH] net/mlx5: quietly fallback if pkg-config is unavailable

Don't fail the build if pkg-config can't be found, instead print the linker flag as it was doing before the change.

Fixes b6b87939193a ("net/mlx5: use pkg-config to handle SUSE libmnl")

Applied to next-net-mlx, thanks.