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_ISAL (y/[n])
13 # - DPDK_DEP_JSON (y/[n])
15 # - DPDK_DEP_MLX (y/[n])
16 # - DPDK_DEP_NUMA ([y]/n)
17 # - DPDK_DEP_PCAP (y/[n])
18 # - DPDK_DEP_SSL (y/[n])
19 # - DPDK_DEP_IPSEC_MB (y/[n])
20 # - DPDK_DEP_SZE (y/[n])
21 # - DPDK_DEP_ZLIB (y/[n])
22 # - DPDK_MAKE_JOBS (int)
23 # - DPDK_NOTIFY (notify-send)
26 # - LIBSSO_SNOW3G_PATH
27 # - LIBSSO_KASUMI_PATH
29 . $(dirname $(readlink -e $0))/load-devel-config
32 echo "usage: $(basename $0) [-h] [-jX] [-s] [config1 [config2] ...]]"
36 echo 'Test building several targets with different options'
43 -jX use X parallel jobs in "make"
44 -s short test only first config without tests|examples|doc
47 config: defconfig[[~][+]option1[[~][+]option2...]]
48 Example: x86_64-native-linuxapp-gcc+debug~RXTX_CALLBACKS
49 The lowercase options are defined inside $(basename $0).
50 The uppercase options can be the end of a defconfig option
51 to enable if prefixed with '+' or to disable if prefixed with '~'.
52 Default is to automatically enable most of the options.
53 The external dependencies are setup with DPDK_DEP_* variables.
54 If no config on command line, DPDK_BUILD_TEST_CONFIGS is used.
62 while getopts hj:sv ARG ; do
67 h ) print_help ; exit 0 ;;
68 ? ) print_usage ; exit 1 ;;
71 shift $(($OPTIND - 1))
72 configs=${*:-$DPDK_BUILD_TEST_CONFIGS}
78 [ "$DPDK_NOTIFY" != notify-send ] || \
79 notify-send -u low --icon=dialog-information 'DPDK build' 'finished'
80 elif [ -z "$signal" ] ; then
81 [ -z "$dir" ] || echo "failed to build $dir" >&2
82 [ "$DPDK_NOTIFY" != notify-send ] || \
83 notify-send -u low --icon=dialog-error 'DPDK build' 'failed'
86 # catch manual interrupt to ignore notification
87 trap "signal=INT ; trap - INT ; kill -INT $$" INT
88 # notify result on exit
91 cd $(dirname $(readlink -m $0))/..
95 export PATH=$default_path
97 unset DPDK_DEP_ARCHIVE
101 unset DPDK_DEP_LDFLAGS
106 unset DPDK_DEP_IPSEC_MB
109 unset ARMV8_CRYPTO_LIB_PATH
112 unset LIBSSO_SNOW3G_PATH
113 unset LIBSSO_KASUMI_PATH
114 unset LIBSSO_ZUC_PATH
115 unset PQOS_INSTALL_PATH
118 config () # <directory> <target> <options>
121 if git rev-parse 2>&- && [ -n "$(git diff HEAD~ -- config)" ] ; then
122 echo 'Default config may have changed'
125 if [ ! -e $1/.config ] || $reconfig ; then
126 echo "================== Configure $1"
127 make T=$2 O=$1 config
129 echo 'Customize configuration'
130 # Built-in options (lowercase)
131 ! echo $3 | grep -q '+default' || \
132 sed -ri 's,(RTE_MACHINE=")native,\1default,' $1/.config
133 echo $3 | grep -q '+next' || \
134 sed -ri 's,(NEXT_ABI=)y,\1n,' $1/.config
135 ! echo $3 | grep -q '+shared' || \
136 sed -ri 's,(SHARED_LIB=)n,\1y,' $1/.config
137 ! echo $3 | grep -q '+debug' || ( \
138 sed -ri 's,(RTE_LOG_DP_LEVEL=).*,\1RTE_LOG_DEBUG,' $1/.config
139 sed -ri 's,(_DEBUG.*=)n,\1y,' $1/.config
140 sed -ri 's,(_STAT.*=)n,\1y,' $1/.config
141 sed -ri 's,(TEST_PMD_RECORD_.*=)n,\1y,' $1/.config )
143 # Automatic configuration
144 test "$DPDK_DEP_NUMA" != n || \
145 sed -ri 's,(NUMA.*=)y,\1n,' $1/.config
146 sed -ri 's,(LIBRTE_IEEE1588=)n,\1y,' $1/.config
147 sed -ri 's,(BYPASS=)n,\1y,' $1/.config
148 test "$DPDK_DEP_ARCHIVE" != y || \
149 sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config
150 test "$DPDK_DEP_ISAL" != y || \
151 sed -ri 's,(ISAL_PMD=)n,\1y,' $1/.config
152 test "$DPDK_DEP_MLX" != y || \
153 sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config
154 test "$DPDK_DEP_SZE" != y || \
155 sed -ri 's,(PMD_SZEDATA2=)n,\1y,' $1/.config
156 test "$DPDK_DEP_ZLIB" != y || \
157 sed -ri 's,(BNX2X_PMD=)n,\1y,' $1/.config
158 test "$DPDK_DEP_ZLIB" != y || \
159 sed -ri 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
160 test "$DPDK_DEP_PCAP" != y || \
161 sed -ri 's,(PCAP=)n,\1y,' $1/.config
162 test -z "$ARMV8_CRYPTO_LIB_PATH" || \
163 sed -ri 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
164 test "$DPDK_DEP_IPSEC_MB" != y || \
165 sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
166 test "$DPDK_DEP_IPSEC_MB" != y || \
167 sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
168 test -z "$LIBSSO_SNOW3G_PATH" || \
169 sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
170 test -z "$LIBSSO_KASUMI_PATH" || \
171 sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config
172 test -z "$LIBSSO_ZUC_PATH" || \
173 sed -ri 's,(PMD_ZUC=)n,\1y,' $1/.config
174 test "$DPDK_DEP_SSL" != y || \
175 sed -ri 's,(PMD_CCP=)n,\1y,' $1/.config
176 test "$DPDK_DEP_SSL" != y || \
177 sed -ri 's,(PMD_OPENSSL=)n,\1y,' $1/.config
178 test "$DPDK_DEP_SSL" != y || \
179 sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config
180 test -z "$FLEXRAN_SDK" || \
181 sed -ri 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
182 sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
183 test -z "$LIBMUSDK_PATH" || \
184 sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
185 test -z "$LIBMUSDK_PATH" || \
186 sed -ri 's,(MVPP2_PMD=)n,\1y,' $1/.config
187 test -z "$LIBMUSDK_PATH" || \
188 sed -ri 's,(MVNETA_PMD=)n,\1y,' $1/.config
189 test -z "$DPDK_DEP_JSON" || \
190 sed -ri 's,(TELEMETRY=)n,\1y,' $1/.config
191 build_config_hook $1 $2 $3
193 # Explicit enabler/disabler (uppercase)
194 for option in $(echo $3 | sed 's,[~+], &,g') ; do
195 pattern=$(echo $option | cut -c2-)
196 if echo $option | grep -q '^~' ; then
197 sed -ri "s,($pattern=)y,\1n," $1/.config
198 elif echo $option | grep -q '^+' ; then
199 sed -ri "s,($pattern=)n,\1y," $1/.config
205 # default empty hook to override in devel config
206 build_config_hook () # <directory> <target> <options>
211 for conf in $configs ; do
212 target=$(echo $conf | sed 's,[~+].*,,')
213 # reload config with DPDK_TARGET set
216 . $(dirname $(readlink -e $0))/load-devel-config
218 options=$(echo $conf | sed 's,[^~+]*,,')
220 config $dir $target $options
222 echo "================== Build $dir"
223 make -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
224 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
226 echo "================== Build tests for $dir"
227 make test-build -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
228 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
229 echo "================== Build examples for $dir"
230 export RTE_SDK=$(pwd)
231 export RTE_TARGET=$dir
232 make -j$J -sC examples \
233 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
234 O=$(readlink -m $dir/examples)
236 echo "################## $dir done."
242 echo "================== Build doxygen HTML API"
243 make doc-api-html >/dev/null 2>.check/doc.txt
244 echo "================== Build sphinx HTML guides"
245 make doc-guides-html >/dev/null 2>>.check/doc.txt
246 echo "================== Check docs"
247 diff -u /dev/null .check/doc.txt