From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Jarry Subject: [PATCH v2] kni: avoid using lsb_release script Date: Fri, 25 Nov 2016 12:33:54 +0100 Message-ID: <1480073634-14079-1-git-send-email-robin.jarry@6wind.com> References: <1480067361-6208-1-git-send-email-robin.jarry@6wind.com> Cc: dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-wj0-f174.google.com (mail-wj0-f174.google.com [209.85.210.174]) by dpdk.org (Postfix) with ESMTP id CC377567E for ; Fri, 25 Nov 2016 12:34:05 +0100 (CET) Received: by mail-wj0-f174.google.com with SMTP id v7so56511585wjy.2 for ; Fri, 25 Nov 2016 03:34:05 -0800 (PST) In-Reply-To: <1480067361-6208-1-git-send-email-robin.jarry@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The lsb_release script is part of an optional package which is not always installed. On the other hand, /etc/lsb-release is always present even on minimal Ubuntu installations. root@ubuntu1604:~# dpkg -S /etc/lsb-release base-files: /etc/lsb-release Read the file if present and use the variables defined in it. Signed-off-by: Robin Jarry --- lib/librte_eal/linuxapp/kni/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile index 4e99e07e7aec..62a957ce8534 100644 --- a/lib/librte_eal/linuxapp/kni/Makefile +++ b/lib/librte_eal/linuxapp/kni/Makefile @@ -44,8 +44,12 @@ MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/e MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h MODULE_CFLAGS += -Wall -Werror -ifeq ($(shell lsb_release -si 2>/dev/null),Ubuntu) -MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(shell lsb_release -sr | tr -d .) +ifneq ($(wildcard /etc/lsb-release),) +-include /etc/lsb-release +endif + +ifeq ($(DISTRIB_ID),Ubuntu) +MODULE_CFLAGS += -DUBUNTU_RELEASE_CODE=$(subst .,,$(DISTRIB_RELEASE)) UBUNTU_KERNEL_CODE := $(shell echo `grep UTS_RELEASE $(RTE_KERNELDIR)/include/generated/utsrelease.h \ | cut -d '"' -f2 | cut -d- -f1,2 | tr .- ,`,1) MODULE_CFLAGS += -D"UBUNTU_KERNEL_CODE=UBUNTU_KERNEL_VERSION($(UBUNTU_KERNEL_CODE))" -- 2.1.4