net/mlx5: fallback quietly if pkg-config is unavailable
authorLuca Boccassi <bluca@debian.org>
Fri, 9 Nov 2018 22:48:07 +0000 (22:48 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 13 Nov 2018 23:35:53 +0000 (00:35 +0100)
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")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/Makefile

index 7a50bcc..895cdfe 100644 (file)
@@ -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