diff options
author | Maryam Tahhan <maryam.tahhan@intel.com> | 2017-05-06 22:44:32 +0100 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2017-05-23 08:19:46 +0000 |
commit | db68b7e767351f8b59db586e4035f501facf92a9 (patch) | |
tree | 519f80a4bec935d62e42df1654e21f944ddf6be6 /src/dpdk/Makefile | |
parent | 386995473879eb0502c502ad69d06e2d5bd9d7a9 (diff) |
src: build and install collectd on centos/rhel
Modify build and dependency scripts for centos/rhel builds.
Change-Id: I1fafaf3392d9f22837ce4ed3fa0f84c13ead0698
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Diffstat (limited to 'src/dpdk/Makefile')
-rw-r--r-- | src/dpdk/Makefile | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/src/dpdk/Makefile b/src/dpdk/Makefile index a23a6290..f13449c8 100644 --- a/src/dpdk/Makefile +++ b/src/dpdk/Makefile @@ -1,7 +1,7 @@ # makefile to manage dpdk package # -# Copyright 2015-2016 OPNFV +# Copyright 2015-2017 OPNFV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,17 +19,42 @@ # Contributors: # Aihua Li, Huawei Technologies. # Martin Klozik, Intel Corporation. +# Christian Trautman, Red Hat Inc. +# Maryam Tahhan, Intel Corporation. include ../mk/master.mk include ../package-list.mk +include /etc/os-release .PHONY: install force_make WORK_DIR = dpdk TAG_DONE_FLAG = $(WORK_DIR)/.$(DPDK_TAG).tag.done -DPDK_TARGET = x86_64-native-linuxapp-gcc -CONFIG_FILE_LINUXAPP = $(WORK_DIR)/config/common_base +# VHOST configuration options are stored in different files based on DPDK version +# v1.2.3r0-v1.6.0r2 - configuration inside config/defconfig_x86_64-default-linuxapp-gcc +# v1.7.0-rc1-v2.2.0 - configuration inside config/common_linuxapp +# v16 and newer - configuration split between config/common_linuxapp and config/common_base +DPDK_TAG_MAJOR = $(shell echo $(DPDK_TAG) | cut -d. -f1) +DPDK_TAG_MINOR = $(shell echo $(DPDK_TAG) | cut -d. -f2) +ifeq ($(DPDK_TAG_MAJOR),v1) +ifeq ($(DPDK_TAG_MINOR), $(filter $(DPDK_TAG_MINOR), 7 8)) + DPDK_TARGET = x86_64-native-linuxapp-gcc + CONFIG_FILE_LINUXAPP = $(WORK_DIR)/config/common_linuxapp +else + DPDK_TARGET = x86_64-default-linuxapp-gcc + CONFIG_FILE_LINUXAPP = $(WORK_DIR)/config/defconfig_x86_64-default-linuxapp-gcc +endif +else +ifeq ($(DPDK_TAG_MAJOR),v2) + DPDK_TARGET = x86_64-native-linuxapp-gcc + CONFIG_FILE_LINUXAPP = $(WORK_DIR)/config/common_linuxapp +else + DPDK_TARGET = x86_64-native-linuxapp-gcc + CONFIG_FILE_BASE = $(WORK_DIR)/config/common_base + CONFIG_FILE_LINUXAPP = $(WORK_DIR)/config/common_linuxapp +endif +endif all: force_make install @echo "Finished making $(WORK_DIR) " @@ -39,14 +64,33 @@ INSTALL_TARGET = force_make # modify CONFIG_FILE to enable SHARED_LIB build and restore original CONFIG_FILE after the build # DPDK v16 comments: ## CONFIG_RTE_BUILD_COMBINE_LIBS has been obsoleted -## CONFIG_RTE_LIBRTE_VHOST and CONFIG_RTE_LIBRTE_KNI are listed in both config_base and config_linuxapp, +## CONFIG_RTE_LIBRTE_KNI is listed in both config_base and config_linuxapp, ## values from config_linuxapp will be used, but options are modified at both places to avoid confusion. force_make: $(TAG_DONE_FLAG) $(AT)cd $(WORK_DIR) && git pull $(DPDK_URL) $(DPDK_TAG) +ifdef CONFIG_FILE_BASE + $(AT)sed -i -e 's/CONFIG_RTE_BUILD_SHARED_LIB=./CONFIG_RTE_BUILD_SHARED_LIB=y/g' $(CONFIG_FILE_BASE) + $(AT)sed -i -e 's/CONFIG_RTE_EAL_PMD_PATH=.*/CONFIG_RTE_EAL_PMD_PATH=\"\/usr\/lib\/dpdk-pmd\/\"/g' $(CONFIG_FILE_BASE) + $(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_KNI=./CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE_BASE) +else $(AT)sed -i -e 's/CONFIG_RTE_BUILD_SHARED_LIB=./CONFIG_RTE_BUILD_SHARED_LIB=y/g' $(CONFIG_FILE_LINUXAPP) $(AT)sed -i -e 's/CONFIG_RTE_EAL_PMD_PATH=.*/CONFIG_RTE_EAL_PMD_PATH=\"\/usr\/lib\/dpdk-pmd\/\"/g' $(CONFIG_FILE_LINUXAPP) + $(AT)sed -i -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=./CONFIG_RTE_BUILD_COMBINE_LIBS=y/g' $(CONFIG_FILE_LINUXAPP) +endif +# CentOS 7.3 specific config changes to compile +ifeq ($(ID),"centos") +ifeq ($(VERSION_ID),"7") + $(AT)sed -i.bak s@'SRCS-y += ethtool/igb/igb_main.c'@'#SRCS-y += ethtool/igb/igb_main.c'@g $(WORK_DIR)/lib/librte_eal/linuxapp/kni/Makefile +endif +endif +# RHEL 7.3 specific config changes to compile +ifeq ($(ID),"rhel") +ifeq ($(VERSION_ID),"7.3") + $(AT)sed -i.bak s@'SRCS-y += ethtool/igb/igb_main.c'@'#SRCS-y += ethtool/igb/igb_main.c'@g $(WORK_DIR)/lib/librte_eal/linuxapp/kni/Makefile +endif +endif $(AT)sed -i -e 's/CONFIG_RTE_LIBRTE_KNI=./CONFIG_RTE_LIBRTE_KNI=n/g' $(CONFIG_FILE_LINUXAPP) - $(AT)cd $(WORK_DIR); make config T=$(DPDK_TARGET) -j; make -j + $(AT)cd $(WORK_DIR); make config T=$(DPDK_TARGET) -j; make -j DESTDIR=$(WORK_DIR) $(AT)cd `dirname $(CONFIG_FILE_LINUXAPP)` && git checkout `basename $(CONFIG_FILE_LINUXAPP)` && cd - @echo "Make done" |