# We allow Darwin (MacOS) for docs generation; VPP build will still fail.
ifneq ($(shell uname),Darwin)
OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+ifeq ($(OS_ID),rhel)
+OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/\..*//')
+else
OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+endif
OS_CODENAME = $(shell grep '^VERSION_CODENAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
endif
RPM_DEPENDS += infiniband-diags libibumad
RPM_DEPENDS += libpcap-devel llvm-toolset
RPM_DEPENDS_GROUPS = 'Development Tools'
+else ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8)
+ RPM_DEPENDS += yum-utils
+ RPM_DEPENDS += openssl-devel
+ RPM_DEPENDS += python3-ply # for vppapigen
+ RPM_DEPENDS += python36-devel
+ RPM_DEPENDS += python3-pip
+ RPM_DEPENDS += python3-virtualenv
+ RPM_DEPENDS += python3-jsonschema
+ RPM_DEPENDS += gcc-toolset-9
+ RPM_DEPENDS += gcc-toolset-9-libasan-devel
+ RPM_DEPENDS += cmake
+ RPM_DEPENDS += llvm-toolset
+ RPM_DEPENDS += infiniband-diags
+ RPM_DEPENDS += autoconf automake bison byacc libtool
else ifeq ($(OS_ID)-$(OS_VERSION_ID),anolis-8)
RPM_DEPENDS += yum-utils
RPM_DEPENDS += compat-openssl10 openssl-devel
exit 0
else ifneq ("$(wildcard /etc/redhat-release)","")
@for i in $(RPM_DEPENDS) ; do \
- RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3,4) ; \
+ RPM=$$(basename -s .rpm "$${i##*/}") ; \
MISSING+=$$(rpm -q $$RPM | grep "^package") ; \
done ; \
if [ -n "$$MISSING" ] ; then \
@sudo -E apt-get update
@sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
else ifneq ("$(wildcard /etc/redhat-release)","")
-ifeq ($(OS_ID),rhel)
+ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8)
+ @sudo -E dnf install $(CONFIRM) https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
+ @sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
+ @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
+else ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-7)
@sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
vom_source = extras
vom_configure_subdir = vom
+# OS Detection
+#
+# We allow Darwin (MacOS) for docs generation; VPP build will still fail.
+ifneq ($(shell uname),Darwin)
+OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+ ifeq ($(OS_ID),rhel)
+ OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/\..*//')
+ else
+ OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+ endif
+endif
+
ifneq ($(shell which cmake3 2>/dev/null),)
CMAKE?=cmake3
else
vom_cmake_args += -DCMAKE_SHARED_LINKER_FLAGS="$($(TAG)_TAG_LDFLAGS)"
vom_cmake_args += -DCMAKE_PREFIX_PATH:PATH="$(PACKAGE_INSTALL_DIR)/../vpp"
-# Use devtoolset on centos 7
-ifneq ($(wildcard /opt/rh/devtoolset-9/enable),)
-vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin"
+# Use devtoolset
+ifeq ($(OS_ID)-$(OS_VERSION_ID),rhel-8)
+ ifneq ($(wildcard /opt/rh/gcc-toolset-9/enable),)
+ vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/gcc-toolset-9/root/bin"
+ endif
+else
+ # Use devtoolset on centos 7
+ ifneq ($(wildcard /opt/rh/devtoolset-9/enable),)
+ vom_cmake_args += -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-9/root/bin"
+ endif
endif
vom_configure = \