5 # Copyright 2015 6WIND S.A.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
17 # * Neither the name of 6WIND S.A. nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 # Load config options:
36 # - AESNI_MULTI_BUFFER_LIB_PATH
37 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
41 # - DPDK_DEP_MOFED (y/[n])
42 # - DPDK_DEP_PCAP (y/[n])
43 # - DPDK_DEP_SSL (y/[n])
44 # - DPDK_DEP_SZE (y/[n])
45 # - DPDK_DEP_ZLIB (y/[n])
46 # - DPDK_MAKE_JOBS (int)
47 # - DPDK_NOTIFY (notify-send)
48 # - LIBSSO_SNOW3G_PATH
49 # - LIBSSO_KASUMI_PATH
50 . $(dirname $(readlink -e $0))/load-devel-config.sh
53 echo "usage: $(basename $0) [-h] [-jX] [-s] [config1 [config2] ...]]"
57 echo 'Test building several targets with different options'
64 -jX use X parallel jobs in "make"
65 -s short test with only first config without examples/doc
68 config: defconfig[[~][+]option1[[~][+]option2...]]
69 Example: x86_64-native-linuxapp-gcc+debug~RXTX_CALLBACKS
70 The lowercase options are defined inside $(basename $0).
71 The uppercase options can be the end of a defconfig option
72 to enable if prefixed with '+' or to disable if prefixed with '~'.
73 Default is to automatically enable most of the options.
74 The external dependencies are setup with DPDK_DEP_* variables.
75 If no config on command line, DPDK_BUILD_TEST_CONFIGS is used.
83 while getopts hj:sv ARG ; do
88 h ) print_help ; exit 0 ;;
89 ? ) print_usage ; exit 1 ;;
92 shift $(($OPTIND - 1))
93 configs=${*:-$DPDK_BUILD_TEST_CONFIGS}
98 if [ "$DPDK_NOTIFY" = notify-send ] ; then
100 notify-send -u low --icon=dialog-information 'DPDK build' 'finished'
101 elif [ -z "$signal" ] ; then
102 notify-send -u low --icon=dialog-error 'DPDK build' 'failed'
106 # catch manual interrupt to ignore notification
107 trap "signal=INT ; trap - INT ; kill -INT $$" INT
108 # notify result on exit
111 cd $(dirname $(readlink -m $0))/..
115 export PATH=$default_path
117 unset DPDK_DEP_ARCHIVE
118 unset DPDK_DEP_CFLAGS
119 unset DPDK_DEP_LDFLAGS
125 unset AESNI_MULTI_BUFFER_LIB_PATH
126 unset LIBSSO_SNOW3G_PATH
127 unset LIBSSO_KASUMI_PATH
128 unset PQOS_INSTALL_PATH
131 config () # <directory> <target> <options>
133 if [ ! -e $1/.config ] ; then
134 echo "================== Configure $1"
135 make T=$2 O=$1 config
137 echo 'Customize configuration'
138 # Built-in options (lowercase)
139 ! echo $3 | grep -q '+default' || \
140 sed -ri 's,(RTE_MACHINE=")native,\1default,' $1/.config
141 echo $3 | grep -q '+next' || \
142 sed -ri 's,(NEXT_ABI=)y,\1n,' $1/.config
143 ! echo $3 | grep -q '+shared' || \
144 sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config
145 ! echo $3 | grep -q '+debug' || ( \
146 sed -ri 's,(RTE_LOG_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
147 sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config
148 sed -ri 's,(_STAT.*=)n,\1y,' $1/.config
149 sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
151 # Automatic configuration
152 ! echo $2 | grep -q '^x86_64' || \
153 sed -ri 's,(NUMA=)n,\1y,' $1/.config
154 sed -ri 's,(PCI_CONFIG=)n,\1y,' $1/.config
155 sed -ri 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
156 sed -ri 's,(BYPASS=)n,\1y,' $1/.config
157 test "$DPDK_DEP_ARCHIVE" != y || \
158 sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config
159 test "$DPDK_DEP_MOFED" != y || \
160 sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config
161 test "$DPDK_DEP_SZE" != y || \
162 sed -ri 's,(PMD_SZEDATA2=)n,\1y,' $1/.config
163 test "$DPDK_DEP_ZLIB" != y || \
164 sed -ri 's,(BNX2X_PMD=)n,\1y,' $1/.config
165 test "$DPDK_DEP_ZLIB" != y || \
166 sed -ri 's,(QEDE_PMD=)n,\1y,' $1/.config
167 sed -ri 's,(NFP_PMD=)n,\1y,' $1/.config
168 test "$DPDK_DEP_PCAP" != y || \
169 sed -ri 's,(PCAP=)n,\1y,' $1/.config
170 test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
171 sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
172 test -z "$AESNI_MULTI_BUFFER_LIB_PATH" || \
173 sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
174 test -z "$LIBSSO_SNOW3G_PATH" || \
175 sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
176 test -z "$LIBSSO_KASUMI_PATH" || \
177 sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config
178 test "$DPDK_DEP_SSL" != y || \
179 sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config
180 sed -ri 's,(KNI_VHOST.*=)n,\1y,' $1/.config
181 sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
182 build_config_hook $1 $2 $3
184 # Explicit enabler/disabler (uppercase)
185 for option in $(echo $3 | sed 's,[~+], &,g') ; do
186 pattern=$(echo $option | cut -c2-)
187 if echo $option | grep -q '^~' ; then
188 sed -ri "s,($pattern=)y,\1n," $1/.config
189 elif echo $option | grep -q '^+' ; then
190 sed -ri "s,($pattern=)n,\1y," $1/.config
196 # default empty hook to override in devel config
197 build_config_hook () # <directory> <target> <options>
202 for conf in $configs ; do
203 target=$(echo $conf | sed 's,[~+].*,,')
204 # reload config with DPDK_TARGET set
207 . $(dirname $(readlink -e $0))/load-devel-config.sh
209 options=$(echo $conf | sed 's,[^~+]*,,')
211 config $dir $target $options
213 echo "================== Build $dir"
214 make -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
215 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
217 echo "================== Build examples for $dir"
218 export RTE_SDK=$(pwd)
219 export RTE_TARGET=$dir
220 make -j$J -sC examples \
221 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
222 O=$(readlink -m $dir/examples)
223 ! echo $target | grep -q '^x86_64' || \
224 make -j$J -sC examples/performance-thread \
225 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
226 O=$(readlink -m $dir/examples/performance-thread)
228 echo "################## $dir done."
233 echo "================== Build doxygen HTML API"
234 make doc-api-html >/dev/null 2>.check/doc.txt
235 echo "================== Build sphinx HTML guides"
236 make doc-guides-html >/dev/null 2>>.check/doc.txt
237 echo "================== Check docs"
238 diff -u /dev/null .check/doc.txt