#!/bin/bash

export ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export REPOS="${REPOS:-${ROOT_DIR}}"

cd ${REPOS}

# Clone check-odp
rm -Rf ./check-odp/
git clone https://git.linaro.org/lng/check-odp.git
pushd check-odp
git checkout 1dd2ba791b298b9e1f8a0e4339c079979db8b587
popd


# Clone odp-dpdk: v1.7.0.0 + multi-queue support
rm -Rf ./odp-dpdk/
git clone https://git.linaro.org/lng/odp-dpdk.git
pushd odp-dpdk
git checkout fdc4c0b40f0b4c856524e86d38a7ffefbb8cd8e5
popd

# Clone/build DPDK
echo '#include "pcap.h"' | cpp -H -o /dev/null 2>&1
if [ "$?" != "0" ]; then
    echo "Error: pcap is not installed. You may need to install libpcap-dev package."
    exit 1
fi

rm -Rf ./dpdk/
odp-dpdk/scripts/devbuild.sh dpdk
if [ "$?" != "0" ]; then
    echo "Instaling dpdk failed" 1>$2
    exit 1
fi

# Build ODP-DPDK
export CONFIGURE_FLAGS="--enable-debug --enable-debug-print --enable-cunit-support --enable-test-vald --enable-shared=yes"
odp-dpdk/scripts/devbuild.sh odp
if [ "$?" != "0" ]; then
    echo "Instaling dpdk failed"
    exit 1
fi

pushd ${ROOT_DIR}/..
./bootstrap
./configure --with-odp=$REPOS/check-odp/new-build --enable-cunit --enable-debug --prefix=$REPOS/check-odp/new-build
make clean
make
make install
popd

Add ODP-DPDK 1.7 devbuild script
Add ODP-DPDK 1.7 devbuild script

Signed-off-by: Bogdan Pricope <385103c4eae27e55111df6ab7856eefb0647e14e@enea.com>
Reviewed-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com>
