aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-02-01 17:12:38 +0100
committerMauro Sardara <msardara@cisco.com>2019-02-01 18:41:39 +0100
commite8fabe3f6313a3b9050fe16458e4714d9dce426e (patch)
treeb379acde21e48a0f2e047d47f79ea30e8d43bd80 /scripts
parentc00bc6fc2af9a54fe339f8d6a3ec1ab889c2931e (diff)
[HICN-10] Compile libtransport with libmemif support
Change-Id: I81d1cb4d5f16a61c35f66fe347985f05d8c97383 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-packages.sh43
1 files changed, 36 insertions, 7 deletions
diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh
index e41eccc8a..95f1fe043 100644
--- a/scripts/build-packages.sh
+++ b/scripts/build-packages.sh
@@ -21,6 +21,9 @@ apt_get=${APT_PATH:-"/usr/local/bin/apt-get"}
PACKAGECLOUD_RELEASE_REPO_DEB="https://packagecloud.io/install/repositories/fdio/release/script.deb.sh"
PACKAGECLOUD_RELEASE_REPO_RPM="https://packagecloud.io/install/repositories/fdio/release/script.rpm.sh"
+VPP_GIT_REPO="https://git.fd.io/vpp"
+VPP_BRANCH="stable/1901"
+
VPP_VERSION_DEB="19.01-release"
VPP_VERSION_RPM="19.01-release.x86_64"
@@ -33,8 +36,10 @@ DEPS_CENTOS="vpp-devel-${VPP_VERSION_RPM} vpp-lib-${VPP_VERSION_RPM} libparc-dev
LATEST_EPEL_REPO="http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
install_cmake() {
- cat /etc/resolv.conf
- echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
+ if ! grep -q "8.8.8.8" /etc/resolv.conf; then
+ echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
+ fi
+
cat /etc/resolv.conf
CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh"
@@ -66,6 +71,19 @@ setup_fdio_repo() {
fi
}
+MEMIF_HOME=""
+build_libmemif_static() {
+ git clone ${VPP_GIT_REPO} -b ${VPP_BRANCH} vpp
+ pushd vpp
+ sed 's/SHARED/STATIC/g' src/cmake/library.cmake -i
+ mkdir -p build-root/build-libmemif && pushd build-root/build-libmemif
+ cmake ../../extras/libmemif/ -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_INSTALL_PREFIX=.
+ make install
+ MEMIF_HOME="$(pwd)"
+ popd
+ popd
+}
+
setup() {
# Figure out what system we are running on
if [ -f /etc/os-release ]; then
@@ -105,6 +123,8 @@ setup() {
${CC_COMPILER} --version
export CC=${CC_COMPILER} CXX=${CXX_COMPILER}
+
+ build_libmemif_static
fi
# do nothing but check compiler version
@@ -122,13 +142,24 @@ build_package() {
echo "*******************************************************************"
# Make the package
- mkdir -p ${SCRIPT_PATH}/../build && pushd ${SCRIPT_PATH}/../build
+ mkdir -p build && pushd build
rm -rf *
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_VPP_PLUGIN=ON ..
+ cmake -DCMAKE_INSTALL_PREFIX=/usr ${SCRIPT_PATH}/..
+ make package
+
+ rm -rf libtransport
+
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_HICNPLUGIN=ON \
+ -DBUILD_LIBTRANSPORT=ON \
+ -DLIBMEMIF_HOME=${MEMIF_HOME} \
+ ${SCRIPT_PATH}/..
+
make package
- find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
+ # find . -name '.*Unspecified.*' -print0 | xargs -0 rm -rf -- || true
+ rm *Unspecified*
popd
@@ -139,8 +170,6 @@ build_package() {
exit 0
}
-pushd ${SCRIPT_PATH}/..
build_package
-popd
exit 0