summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorIntel <intel.com>2012-09-04 13:54:00 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-03-11 17:19:20 +0100
commitaf75078fece3615088e561357c1e97603e43a5fe (patch)
tree1e41a38f4acfbeaa044fa88b0c4d4e0b910bdc8a /scripts
parent0c9a540ed217764aefc5cb645f3cafd4f9e79765 (diff)
downloaddpdk-af75078fece3615088e561357c1e97603e43a5fe.zip
dpdk-af75078fece3615088e561357c1e97603e43a5fe.tar.gz
dpdk-af75078fece3615088e561357c1e97603e43a5fe.tar.xz
first public releasev1.2.3r0
version 1.2.3 Signed-off-by: Intel
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile38
-rwxr-xr-xscripts/depdirs-rule.sh97
-rwxr-xr-xscripts/gen-build-mk.sh55
-rwxr-xr-xscripts/gen-config-h.sh41
-rwxr-xr-xscripts/import_autotest.sh87
-rwxr-xr-xscripts/relpath.sh100
-rwxr-xr-xscripts/test-framework.sh133
-rw-r--r--scripts/testhost/Makefile50
-rw-r--r--scripts/testhost/testhost.c57
9 files changed, 658 insertions, 0 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
new file mode 100644
index 0000000..8557253
--- /dev/null
+++ b/scripts/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+DIRS-y += testhost
+
+include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/scripts/depdirs-rule.sh b/scripts/depdirs-rule.sh
new file mode 100755
index 0000000..3b0ea56
--- /dev/null
+++ b/scripts/depdirs-rule.sh
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+#
+# This (obscure) bash script finds the smallest different path between
+# path1 and path2 given as command line argument. The given paths MUST
+# be relative paths, the script is not designed to work with absolute
+# paths.
+#
+# The script will then generate Makefile code that can be saved in a
+# file and included in build system.
+#
+# For instance:
+# depdirs-rule.sh a/b/c/d a/b/e/f
+# Will print:
+# FULL_DEPDIRS-a/b/c/d += a/b/e/f
+# LOCAL_DEPDIRS-a/b/c += a/b/e
+#
+# The script returns 0 except if invalid arguments are given.
+#
+
+if [ $# -ne 2 ]; then
+ echo "Bad arguments"
+ echo "Usage:"
+ echo " $0 path1 path2"
+ exit 1
+fi
+
+left1=${1%%/*}
+right1=${1#*/}
+prev_right1=$1
+prev_left1=
+
+left2=${2%%/*}
+right2=${2#*/}
+prev_right2=$2
+prev_left2=
+
+while [ "${right1}" != "" -a "${right2}" != "" ]; do
+
+ if [ "$left1" != "$left2" ]; then
+ break
+ fi
+
+ prev_left1=$left1
+ left1=$left1/${right1%%/*}
+ prev_right1=$right1
+ right1=${prev_right1#*/}
+ if [ "$right1" = "$prev_right1" ]; then
+ right1=""
+ fi
+
+ prev_left2=$left2
+ left2=$left2/${right2%%/*}
+ prev_right2=$right2
+ right2=${prev_right2#*/}
+ if [ "$right2" = "$prev_right2" ]; then
+ right2=""
+ fi
+done
+
+echo FULL_DEPDIRS-$1 += $2
+echo LOCAL_DEPDIRS-$left1 += $left2
+
+exit 0
diff --git a/scripts/gen-build-mk.sh b/scripts/gen-build-mk.sh
new file mode 100755
index 0000000..d773210
--- /dev/null
+++ b/scripts/gen-build-mk.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+# Auto-generate a Makefile in build directory
+# Args:
+# $1: path of project src root
+# $2: path of build dir (can be relative to $1)
+
+echo "# Automatically generated by gen-build-mk.sh"
+echo
+echo "ifdef O"
+echo "ifeq (\"\$(origin O)\", \"command line\")"
+echo "\$(error \"Cannot specify O= as you are already in a build directory\")"
+echo "endif"
+echo "endif"
+echo
+echo "MAKEFLAGS += --no-print-directory"
+echo
+echo "all:"
+echo " @\$(MAKE) -C $1 O=$2"
+echo
+echo "%::"
+echo " @\$(MAKE) -C $1 O=$2 \$@"
diff --git a/scripts/gen-config-h.sh b/scripts/gen-config-h.sh
new file mode 100755
index 0000000..4d15e6f
--- /dev/null
+++ b/scripts/gen-config-h.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+grep CONFIG_ $1 \
+| grep -v '^#' \
+| sed 's,CONFIG_\(.*\)=y.*$,#define \1 1,' \
+| sed 's,CONFIG_\(.*\)=n.*$,#undef \1,' \
+| sed 's,CONFIG_\(.*\)=\(.*\)$,#define \1 \2,' \
+| sed 's,\# CONFIG_\(.*\) is not set$,#undef \1,'
diff --git a/scripts/import_autotest.sh b/scripts/import_autotest.sh
new file mode 100755
index 0000000..3b3767b
--- /dev/null
+++ b/scripts/import_autotest.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+#
+# import autotests in documentation
+# called by rte.sdktestall.mk from RTE_SDK root directory
+# arguments are the list of targets
+#
+
+echo "This will overwrite current autotest results in doc/rst/test_report"
+echo "and in doc/images/ directories"
+echo -n "Are you sure ? [y/N] >"
+read ans
+if [ "$ans" != "y" -a "$ans" != "Y" ]; then
+ echo "Aborted"
+ exit 0
+fi
+
+rm doc/images/autotests/Makefile
+
+for t in $*; do
+ echo -------- $t
+ rm -rf doc/rst/test_report/autotests/$t
+
+ # no autotest dir, skip
+ if ! ls -d $t/autotest-*/*.rst 2> /dev/null > /dev/null; then
+ continue;
+ fi
+
+ for f in $t/autotest*/*.rst; do
+ if [ ! -f $f ]; then
+ continue
+ fi
+ mkdir -p doc/rst/test_report/autotests/$t
+ cp $f doc/rst/test_report/autotests/$t
+ done
+ rm -rf doc/images/autotests/$t
+ for f in $t/autotest*/*.svg; do
+ if [ ! -f $f ]; then
+ continue
+ fi
+ mkdir -p doc/images/autotests/$t
+ cp $f doc/images/autotests/$t
+ echo "SVG += `basename $f`" >> doc/images/autotests/$t/Makefile
+ done
+
+ if [ -f doc/images/autotests/$t/Makefile ]; then
+ echo >> doc/images/autotests/$t/Makefile
+ echo 'include $(RTE_SDK)/mk/rte.doc.mk' >> doc/images/autotests/$t/Makefile
+ fi
+
+ echo "DIRS += $t" >> doc/images/autotests/Makefile
+done
+
+echo 'include $(RTE_SDK)/mk/rte.doc.mk' >> doc/images/autotests/Makefile
diff --git a/scripts/relpath.sh b/scripts/relpath.sh
new file mode 100755
index 0000000..9a3440b
--- /dev/null
+++ b/scripts/relpath.sh
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+#
+# print the relative path of $1 from $2 directory
+# $1 and $2 MUST be absolute paths
+#
+
+if [ $# -ne 2 ]; then
+ echo "Bad arguments"
+ echo "Usage:"
+ echo " $0 path1 path2"
+ exit 1
+fi
+
+REL1=${1#/}
+REL2=${2#/}
+
+left1=${REL1%%/*}
+right1=${REL1#*/}
+prev_right1=$REL1
+prev_left1=
+
+left2=${REL2%%/*}
+right2=${REL2#*/}
+prev_right2=$REL2
+prev_left2=
+
+while [ "${right1}" != "" -a "${right2}" != "" ]; do
+
+ if [ "$left1" != "$left2" ]; then
+ break
+ fi
+
+ prev_left1=$left1
+ left1=$left1/${right1%%/*}
+ prev_right1=$right1
+ right1=${prev_right1#*/}
+ if [ "$right1" = "$prev_right1" ]; then
+ right1=""
+ fi
+
+ prev_left2=$left2
+ left2=$left2/${right2%%/*}
+ prev_right2=$right2
+ right2=${prev_right2#*/}
+ if [ "$right2" = "$prev_right2" ]; then
+ right2=""
+ fi
+done
+
+if [ "${left1}" != "${left2}" ]; then
+ right2=${prev_right2}
+ right1=${prev_right1}
+fi
+
+while [ "${right2}" != "" ]; do
+ prefix=${prefix}../
+ prev_right2=$right2
+ right2=${right2#*/}
+ if [ "$right2" = "$prev_right2" ]; then
+ right2=""
+ fi
+done
+
+echo ${prefix}${right1}
+
+exit 0
diff --git a/scripts/test-framework.sh b/scripts/test-framework.sh
new file mode 100755
index 0000000..56cb457
--- /dev/null
+++ b/scripts/test-framework.sh
@@ -0,0 +1,133 @@
+#!/bin/sh
+
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+# script to check that dependancies are working in the framework
+# must be executed from root
+
+# do a first build
+make config T=x86_64-default-linuxapp-gcc O=deptest
+make -j8 O=deptest
+
+MOD_APP_TEST1=`stat deptest/app/test | grep Modify`
+MOD_APP_TEST_MEMPOOL1=`stat deptest/build/app/test/test_mempool.o | grep Modify`
+MOD_LIB_MEMPOOL1=`stat deptest/lib/librte_mempool.a | grep Modify`
+MOD_LIB_MBUF1=`stat deptest/lib/librte_mbuf.a | grep Modify`
+
+echo "----- touch mempool.c, and check that deps are updated"
+sleep 1
+touch lib/librte_mempool/rte_mempool.c
+make -j8 O=deptest
+
+MOD_APP_TEST2=`stat deptest/app/test | grep Modify`
+MOD_APP_TEST_MEMPOOL2=`stat deptest/build/app/test/test_mempool.o | grep Modify`
+MOD_LIB_MEMPOOL2=`stat deptest/lib/librte_mempool.a | grep Modify`
+MOD_LIB_MBUF2=`stat deptest/lib/librte_mbuf.a | grep Modify`
+
+if [ "${MOD_APP_TEST1}" = "${MOD_APP_TEST2}" ]; then
+ echo ${MOD_APP_TEST1} / ${MOD_APP_TEST2}
+ echo "Bad deps on deptest/app/test"
+ exit 1
+fi
+if [ "${MOD_APP_TEST_MEMPOOL1}" != "${MOD_APP_TEST_MEMPOOL2}" ]; then
+ echo "Bad deps on deptest/build/app/test/test_mempool.o"
+ exit 1
+fi
+if [ "${MOD_LIB_MEMPOOL1}" = "${MOD_LIB_MEMPOOL2}" ]; then
+ echo "Bad deps on deptest/lib/librte_mempool.a"
+ exit 1
+fi
+if [ "${MOD_LIB_MBUF1}" != "${MOD_LIB_MBUF2}" ]; then
+ echo "Bad deps on deptest/lib/librte_mbuf.a"
+ exit 1
+fi
+
+echo "----- touch mempool.h, and check that deps are updated"
+sleep 1
+touch lib/librte_mempool/rte_mempool.h
+make -j8 O=deptest
+
+MOD_APP_TEST3=`stat deptest/app/test | grep Modify`
+MOD_APP_TEST_MEMPOOL3=`stat deptest/build/app/test/test_mempool.o | grep Modify`
+MOD_LIB_MEMPOOL3=`stat deptest/lib/librte_mempool.a | grep Modify`
+MOD_LIB_MBUF3=`stat deptest/lib/librte_mbuf.a | grep Modify`
+
+if [ "${MOD_APP_TEST2}" = "${MOD_APP_TEST3}" ]; then
+ echo "Bad deps on deptest/app/test"
+ exit 1
+fi
+if [ "${MOD_APP_TEST_MEMPOOL2}" = "${MOD_APP_TEST_MEMPOOL3}" ]; then
+ echo "Bad deps on deptest/build/app/test/test_mempool.o"
+ exit 1
+fi
+if [ "${MOD_LIB_MEMPOOL2}" = "${MOD_LIB_MEMPOOL3}" ]; then
+ echo "Bad deps on deptest/lib/librte_mempool.a"
+ exit 1
+fi
+if [ "${MOD_LIB_MBUF2}" = "${MOD_LIB_MBUF3}" ]; then
+ echo "Bad deps on deptest/lib/librte_mbuf.a"
+ exit 1
+fi
+
+
+echo "----- change mempool.c's CFLAGS, and check that deps are updated"
+sleep 1
+make -j8 O=deptest CFLAGS_rte_mempool.o="-DDUMMY_TEST"
+
+MOD_APP_TEST4=`stat deptest/app/test | grep Modify`
+MOD_APP_TEST_MEMPOOL4=`stat deptest/build/app/test/test_mempool.o | grep Modify`
+MOD_LIB_MEMPOOL4=`stat deptest/lib/librte_mempool.a | grep Modify`
+MOD_LIB_MBUF4=`stat deptest/lib/librte_mbuf.a | grep Modify`
+
+if [ "${MOD_APP_TEST3}" = "${MOD_APP_TEST4}" ]; then
+ echo "Bad deps on deptest/app/test"
+ exit 1
+fi
+if [ "${MOD_APP_TEST_MEMPOOL3}" != "${MOD_APP_TEST_MEMPOOL4}" ]; then
+ echo "Bad deps on deptest/build/app/test/test_mempool.o"
+ exit 1
+fi
+if [ "${MOD_LIB_MEMPOOL3}" = "${MOD_LIB_MEMPOOL4}" ]; then
+ echo "Bad deps on deptest/lib/librte_mempool.a"
+ exit 1
+fi
+if [ "${MOD_LIB_MBUF3}" != "${MOD_LIB_MBUF4}" ]; then
+ echo "Bad deps on deptest/lib/librte_mbuf.a"
+ exit 1
+fi
+
+
+echo "----- Deps check ok"
+rm -rf deptest
+exit 0
diff --git a/scripts/testhost/Makefile b/scripts/testhost/Makefile
new file mode 100644
index 0000000..c2ac583
--- /dev/null
+++ b/scripts/testhost/Makefile
@@ -0,0 +1,50 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# version: DPDK.L.1.2.3-3
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+HOSTAPP = testhost
+
+HOST_CFLAGS += -I$(SRCDIR)
+
+# HOST_LDFLAGS +=
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-y := testhost.c
+
+include $(RTE_SDK)/mk/rte.hostapp.mk
diff --git a/scripts/testhost/testhost.c b/scripts/testhost/testhost.c
new file mode 100644
index 0000000..bf26822
--- /dev/null
+++ b/scripts/testhost/testhost.c
@@ -0,0 +1,57 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * version: DPDK.L.1.2.3-3
+ */
+
+#include <stdio.h>
+
+struct toto {
+ int x;
+ int y;
+};
+
+int main(int argc, char **argv)
+{
+ struct toto t[] = {
+ { .x = 1, .y = 2 },
+ { .x = 1, .y = 2 },
+ { .x = 1, .y = 2 },
+ { .x = 1, .y = 2 },
+ };
+
+ struct toto u[4];
+
+ printf("%zu %zu\n", sizeof(t), sizeof(u));
+
+ return 0;
+}