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_NFB (y/[n])
23 # - DPDK_DEP_ZLIB (y/[n])
24 # - DPDK_MAKE_JOBS (int)
25 # - DPDK_NOTIFY (notify-send)
28 # - LIBSSO_SNOW3G_PATH
29 # - LIBSSO_KASUMI_PATH
31 . $(dirname $(readlink -e $0))/load-devel-config
34 echo "usage: $(basename $0) [-h] [-jX] [-s] [config1 [config2] ...]]"
38 echo 'Test building several targets with different options'
45 -jX use X parallel jobs in "make"
46 -s short test only first config without tests|examples|doc
49 config: defconfig[[~][+]option1[[~][+]option2...]]
50 Example: x86_64-native-linux-gcc+debug~RXTX_CALLBACKS
51 The lowercase options are defined inside $(basename $0).
52 The uppercase options can be the end of a defconfig option
53 to enable if prefixed with '+' or to disable if prefixed with '~'.
54 Default is to automatically enable most of the options.
55 The external dependencies are setup with DPDK_DEP_* variables.
56 If no config on command line, DPDK_BUILD_TEST_CONFIGS is used.
64 while getopts hj:sv ARG ; do
69 h ) print_help ; exit 0 ;;
70 ? ) print_usage ; exit 1 ;;
73 shift $(($OPTIND - 1))
74 configs=${*:-$DPDK_BUILD_TEST_CONFIGS}
80 [ "$DPDK_NOTIFY" != notify-send ] || \
81 notify-send -u low --icon=dialog-information 'DPDK build' 'finished'
82 elif [ -z "$signal" ] ; then
83 [ -z "$dir" ] || echo "failed to build $dir" >&2
84 [ "$DPDK_NOTIFY" != notify-send ] || \
85 notify-send -u low --icon=dialog-error 'DPDK build' 'failed'
88 # catch manual interrupt to ignore notification
89 trap "signal=INT ; trap - INT ; kill -INT $$" INT
90 # notify result on exit
93 cd $(dirname $(readlink -m $0))/..
97 export PATH=$default_path
99 unset DPDK_DEP_ARCHIVE
100 unset DPDK_DEP_CFLAGS
104 unset DPDK_DEP_LDFLAGS
109 unset DPDK_DEP_IPSEC_MB
112 unset ARMV8_CRYPTO_LIB_PATH
115 unset LIBSSO_SNOW3G_PATH
116 unset LIBSSO_KASUMI_PATH
117 unset LIBSSO_ZUC_PATH
118 unset PQOS_INSTALL_PATH
121 config () # <directory> <target> <options>
124 if git rev-parse 2>&- && [ -n "$(git diff HEAD~ -- config)" ] ; then
125 echo 'Default config may have changed'
128 if [ ! -e $1/.config ] || $reconfig ; then
129 echo "================== Configure $1"
130 make T=$2 O=$1 config
132 echo 'Customize configuration'
133 # Built-in options (lowercase)
134 ! echo $3 | grep -q '+default' || \
135 sed -ri 's,(RTE_MACHINE=")native,\1default,' $1/.config
136 echo $3 | grep -q '+next' || \
137 sed -ri 's,(NEXT_ABI=)y,\1n,' $1/.config
138 ! echo $3 | grep -q '+shared' || \
139 sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config
140 ! echo $3 | grep -q '+debug' || ( \
141 sed -ri 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
142 sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config
143 sed -ri 's,(_STAT.*=)n,\1y,' $1/.config
144 sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
146 # Automatic configuration
147 test "$DPDK_DEP_NUMA" != n || \
148 sed -ri 's,(NUMA.*=)y,\1n,' $1/.config
149 sed -ri 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
150 sed -ri 's,(BYPASS=)n,\1y,' $1/.config
151 test "$DPDK_DEP_ARCHIVE" != y || \
152 sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config
153 test "$DPDK_DEP_ISAL" != y || \
154 sed -ri 's,(PMD_ISAL=)n,\1y,' $1/.config
155 test "$DPDK_DEP_MLX" != y || \
156 sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config
157 test "$DPDK_DEP_SZE" != y || \
158 sed -ri 's,(PMD_SZEDATA2=)n,\1y,' $1/.config
159 test "$DPDK_DEP_ZLIB" != y || \
160 sed -ri 's,(BNX2X_PMD=)n,\1y,' $1/.config
161 test "$DPDK_DEP_ZLIB" != y || \
162 sed -ri 's,(PMD_ZLIB=)n,\1y,' $1/.config
163 test "$DPDK_DEP_ZLIB" != y || \
164 sed -ri 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
165 test "$DPDK_DEP_PCAP" != y || \
166 sed -ri 's,(PCAP=)n,\1y,' $1/.config
167 test -z "$ARMV8_CRYPTO_LIB_PATH" || \
168 sed -ri 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
169 test "$DPDK_DEP_IPSEC_MB" != y || \
170 sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
171 test "$DPDK_DEP_IPSEC_MB" != y || \
172 sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
173 test -z "$LIBSSO_SNOW3G_PATH" || \
174 sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
175 test -z "$LIBSSO_KASUMI_PATH" || \
176 sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config
177 test -z "$LIBSSO_ZUC_PATH" || \
178 sed -ri 's,(PMD_ZUC=)n,\1y,' $1/.config
179 test "$DPDK_DEP_SSL" != y || \
180 sed -ri 's,(PMD_CCP=)n,\1y,' $1/.config
181 test "$DPDK_DEP_SSL" != y || \
182 sed -ri 's,(PMD_OPENSSL=)n,\1y,' $1/.config
183 test "$DPDK_DEP_SSL" != y || \
184 sed -ri 's,(QAT_SYM=)n,\1y,' $1/.config
185 test -z "$FLEXRAN_SDK" || \
186 sed -ri 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
187 sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
188 test -z "$LIBMUSDK_PATH" || \
189 sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
190 test -z "$LIBMUSDK_PATH" || \
191 sed -ri 's,(MVPP2_PMD=)n,\1y,' $1/.config
192 test -z "$LIBMUSDK_PATH" || \
193 sed -ri 's,(MVNETA_PMD=)n,\1y,' $1/.config
194 test "$DPDK_DEP_ELF" != y || \
195 sed -ri 's,(BPF_ELF=)n,\1y,' $1/.config
196 test "$DPDK_DEP_JSON" != y || \
197 sed -ri 's,(TELEMETRY=)n,\1y,' $1/.config
198 build_config_hook $1 $2 $3
200 # Explicit enabler/disabler (uppercase)
201 for option in $(echo $3 | sed 's,[~+], &,g') ; do
202 pattern=$(echo $option | cut -c2-)
203 if echo $option | grep -q '^~' ; then
204 sed -ri "s,($pattern=)y,\1n," $1/.config
205 elif echo $option | grep -q '^+' ; then
206 sed -ri "s,($pattern=)n,\1y," $1/.config
212 # default empty hook to override in devel config
213 build_config_hook () # <directory> <target> <options>
218 for conf in $configs ; do
219 target=$(echo $conf | sed 's,[~+].*,,')
220 # reload config with DPDK_TARGET set
223 . $(dirname $(readlink -e $0))/load-devel-config
225 options=$(echo $conf | sed 's,[^~+]*,,')
227 config $dir $target $options
229 echo "================== Build $dir"
230 make -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
231 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
233 echo "================== Build examples for $dir"
234 export RTE_SDK=$(pwd)
235 export RTE_TARGET=$dir
236 make -j$J -sC examples \
237 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
238 O=$(readlink -m $dir/examples)
240 echo "################## $dir done."
246 echo "================== Build doxygen HTML API"
247 make doc-api-html >/dev/null 2>.check/doc.txt
248 echo "================== Build sphinx HTML guides"
249 make doc-guides-html >/dev/null 2>>.check/doc.txt
250 echo "================== Check docs"
251 diff -u /dev/null .check/doc.txt