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