2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2015 6WIND S.A.
8 # - ARMV8_CRYPTO_LIB_PATH
9 # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2)
12 # - DPDK_DEP_ELF (y/[n])
13 # - DPDK_DEP_ISAL (y/[n])
14 # - DPDK_DEP_JSON (y/[n])
16 # - DPDK_DEP_MLX (y/[n])
17 # - DPDK_DEP_NUMA ([y]/n)
18 # - DPDK_DEP_PCAP (y/[n])
19 # - DPDK_DEP_SSL (y/[n])
20 # - DPDK_DEP_IPSEC_MB (y/[n])
21 # - DPDK_DEP_SZE (y/[n])
22 # - DPDK_DEP_ZLIB (y/[n])
23 # - DPDK_MAKE_JOBS (int)
24 # - DPDK_NOTIFY (notify-send)
27 # - LIBSSO_SNOW3G_PATH
28 # - LIBSSO_KASUMI_PATH
30 . $(dirname $(readlink -e $0))/load-devel-config
33 echo "usage: $(basename $0) [-h] [-jX] [-s] [config1 [config2] ...]]"
37 echo 'Test building several targets with different options'
44 -jX use X parallel jobs in "make"
45 -s short test only first config without tests|examples|doc
48 config: defconfig[[~][+]option1[[~][+]option2...]]
49 Example: x86_64-native-linuxapp-gcc+debug~RXTX_CALLBACKS
50 The lowercase options are defined inside $(basename $0).
51 The uppercase options can be the end of a defconfig option
52 to enable if prefixed with '+' or to disable if prefixed with '~'.
53 Default is to automatically enable most of the options.
54 The external dependencies are setup with DPDK_DEP_* variables.
55 If no config on command line, DPDK_BUILD_TEST_CONFIGS is used.
63 while getopts hj:sv ARG ; do
68 h ) print_help ; exit 0 ;;
69 ? ) print_usage ; exit 1 ;;
72 shift $(($OPTIND - 1))
73 configs=${*:-$DPDK_BUILD_TEST_CONFIGS}
79 [ "$DPDK_NOTIFY" != notify-send ] || \
80 notify-send -u low --icon=dialog-information 'DPDK build' 'finished'
81 elif [ -z "$signal" ] ; then
82 [ -z "$dir" ] || echo "failed to build $dir" >&2
83 [ "$DPDK_NOTIFY" != notify-send ] || \
84 notify-send -u low --icon=dialog-error 'DPDK build' 'failed'
87 # catch manual interrupt to ignore notification
88 trap "signal=INT ; trap - INT ; kill -INT $$" INT
89 # notify result on exit
92 cd $(dirname $(readlink -m $0))/..
96 export PATH=$default_path
98 unset DPDK_DEP_ARCHIVE
103 unset DPDK_DEP_LDFLAGS
108 unset DPDK_DEP_IPSEC_MB
111 unset ARMV8_CRYPTO_LIB_PATH
114 unset LIBSSO_SNOW3G_PATH
115 unset LIBSSO_KASUMI_PATH
116 unset LIBSSO_ZUC_PATH
117 unset PQOS_INSTALL_PATH
120 config () # <directory> <target> <options>
123 if git rev-parse 2>&- && [ -n "$(git diff HEAD~ -- config)" ] ; then
124 echo 'Default config may have changed'
127 if [ ! -e $1/.config ] || $reconfig ; then
128 echo "================== Configure $1"
129 make T=$2 O=$1 config
131 echo 'Customize configuration'
132 # Built-in options (lowercase)
133 ! echo $3 | grep -q '+default' || \
134 sed -ri 's,(RTE_MACHINE=")native,\1default,' $1/.config
135 echo $3 | grep -q '+next' || \
136 sed -ri 's,(NEXT_ABI=)y,\1n,' $1/.config
137 ! echo $3 | grep -q '+shared' || \
138 sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config
139 ! echo $3 | grep -q '+debug' || ( \
140 sed -ri 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
141 sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config
142 sed -ri 's,(_STAT.*=)n,\1y,' $1/.config
143 sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
145 # Automatic configuration
146 test "$DPDK_DEP_NUMA" != n || \
147 sed -ri 's,(NUMA.*=)y,\1n,' $1/.config
148 sed -ri 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
149 sed -ri 's,(BYPASS=)n,\1y,' $1/.config
150 test "$DPDK_DEP_ARCHIVE" != y || \
151 sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config
152 test "$DPDK_DEP_ISAL" != y || \
153 sed -ri 's,(ISAL_PMD=)n,\1y,' $1/.config
154 test "$DPDK_DEP_MLX" != y || \
155 sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config
156 test "$DPDK_DEP_SZE" != y || \
157 sed -ri 's,(PMD_SZEDATA2=)n,\1y,' $1/.config
158 test "$DPDK_DEP_ZLIB" != y || \
159 sed -ri 's,(BNX2X_PMD=)n,\1y,' $1/.config
160 test "$DPDK_DEP_ZLIB" != y || \
161 sed -ri 's,(PMD_ZLIB=)n,\1y,' $1/.config
162 test "$DPDK_DEP_ZLIB" != y || \
163 sed -ri 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
164 test "$DPDK_DEP_PCAP" != y || \
165 sed -ri 's,(PCAP=)n,\1y,' $1/.config
166 test -z "$ARMV8_CRYPTO_LIB_PATH" || \
167 sed -ri 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
168 test "$DPDK_DEP_IPSEC_MB" != y || \
169 sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
170 test "$DPDK_DEP_IPSEC_MB" != y || \
171 sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
172 test -z "$LIBSSO_SNOW3G_PATH" || \
173 sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
174 test -z "$LIBSSO_KASUMI_PATH" || \
175 sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config
176 test -z "$LIBSSO_ZUC_PATH" || \
177 sed -ri 's,(PMD_ZUC=)n,\1y,' $1/.config
178 test "$DPDK_DEP_SSL" != y || \
179 sed -ri 's,(PMD_CCP=)n,\1y,' $1/.config
180 test "$DPDK_DEP_SSL" != y || \
181 sed -ri 's,(PMD_OPENSSL=)n,\1y,' $1/.config
182 test "$DPDK_DEP_SSL" != y || \
183 sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config
184 test -z "$FLEXRAN_SDK" || \
185 sed -ri 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
186 sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
187 test -z "$LIBMUSDK_PATH" || \
188 sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
189 test -z "$LIBMUSDK_PATH" || \
190 sed -ri 's,(MVPP2_PMD=)n,\1y,' $1/.config
191 test -z "$LIBMUSDK_PATH" || \
192 sed -ri 's,(MVNETA_PMD=)n,\1y,' $1/.config
193 test "$DPDK_DEP_ELF" != y || \
194 sed -ri 's,(BPF_ELF=)n,\1y,' $1/.config
195 test -z "$DPDK_DEP_JSON" || \
196 sed -ri 's,(TELEMETRY=)n,\1y,' $1/.config
197 build_config_hook $1 $2 $3
199 # Explicit enabler/disabler (uppercase)
200 for option in $(echo $3 | sed 's,[~+], &,g') ; do
201 pattern=$(echo $option | cut -c2-)
202 if echo $option | grep -q '^~' ; then
203 sed -ri "s,($pattern=)y,\1n," $1/.config
204 elif echo $option | grep -q '^+' ; then
205 sed -ri "s,($pattern=)n,\1y," $1/.config
211 # default empty hook to override in devel config
212 build_config_hook () # <directory> <target> <options>
217 for conf in $configs ; do
218 target=$(echo $conf | sed 's,[~+].*,,')
219 # reload config with DPDK_TARGET set
222 . $(dirname $(readlink -e $0))/load-devel-config
224 options=$(echo $conf | sed 's,[^~+]*,,')
226 config $dir $target $options
228 echo "================== Build $dir"
229 make -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
230 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
232 echo "================== Build tests for $dir"
233 make test-build -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
234 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
235 echo "================== Build examples for $dir"
236 export RTE_SDK=$(pwd)
237 export RTE_TARGET=$dir
238 make -j$J -sC examples \
239 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
240 O=$(readlink -m $dir/examples)
242 echo "################## $dir done."
248 echo "================== Build doxygen HTML API"
249 make doc-api-html >/dev/null 2>.check/doc.txt
250 echo "================== Build sphinx HTML guides"
251 make doc-guides-html >/dev/null 2>>.check/doc.txt
252 echo "================== Check docs"
253 diff -u /dev/null .check/doc.txt