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 test "$DPDK_DEP_ZLIB" != y || \
157 sed -ri 's,(COMPRESSDEV_TEST=)n,\1y,' $1/.config
158 test "$DPDK_DEP_PCAP" != y || \
159 sed -ri 's,(PCAP=)n,\1y,' $1/.config
160 test -z "$ARMV8_CRYPTO_LIB_PATH" || \
161 sed -ri 's,(PMD_ARMV8_CRYPTO=)n,\1y,' $1/.config
162 test "$DPDK_DEP_IPSEC_MB" != y || \
163 sed -ri 's,(PMD_AESNI_MB=)n,\1y,' $1/.config
164 test "$DPDK_DEP_IPSEC_MB" != y || \
165 sed -ri 's,(PMD_AESNI_GCM=)n,\1y,' $1/.config
166 test -z "$LIBSSO_SNOW3G_PATH" || \
167 sed -ri 's,(PMD_SNOW3G=)n,\1y,' $1/.config
168 test -z "$LIBSSO_KASUMI_PATH" || \
169 sed -ri 's,(PMD_KASUMI=)n,\1y,' $1/.config
170 test -z "$LIBSSO_ZUC_PATH" || \
171 sed -ri 's,(PMD_ZUC=)n,\1y,' $1/.config
172 test "$DPDK_DEP_SSL" != y || \
173 sed -ri 's,(PMD_CCP=)n,\1y,' $1/.config
174 test "$DPDK_DEP_SSL" != y || \
175 sed -ri 's,(PMD_OPENSSL=)n,\1y,' $1/.config
176 test "$DPDK_DEP_SSL" != y || \
177 sed -ri 's,(PMD_QAT=)n,\1y,' $1/.config
178 test -z "$FLEXRAN_SDK" || \
179 sed -ri 's,(BBDEV_TURBO_SW=)n,\1y,' $1/.config
180 sed -ri 's,(SCHED_.*=)n,\1y,' $1/.config
181 test -z "$LIBMUSDK_PATH" || \
182 sed -ri 's,(PMD_MVSAM_CRYPTO=)n,\1y,' $1/.config
183 test -z "$LIBMUSDK_PATH" || \
184 sed -ri 's,(MVPP2_PMD=)n,\1y,' $1/.config
185 build_config_hook $1 $2 $3
187 # Explicit enabler/disabler (uppercase)
188 for option in $(echo $3 | sed 's,[~+], &,g') ; do
189 pattern=$(echo $option | cut -c2-)
190 if echo $option | grep -q '^~' ; then
191 sed -ri "s,($pattern=)y,\1n," $1/.config
192 elif echo $option | grep -q '^+' ; then
193 sed -ri "s,($pattern=)n,\1y," $1/.config
199 # default empty hook to override in devel config
200 build_config_hook () # <directory> <target> <options>
205 for conf in $configs ; do
206 target=$(echo $conf | sed 's,[~+].*,,')
207 # reload config with DPDK_TARGET set
210 . $(dirname $(readlink -e $0))/load-devel-config
212 options=$(echo $conf | sed 's,[^~+]*,,')
214 config $dir $target $options
216 echo "================== Build $dir"
217 make -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
218 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
220 echo "================== Build tests for $dir"
221 make test-build -j$J EXTRA_CFLAGS="$maxerr $DPDK_DEP_CFLAGS" \
222 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose O=$dir
223 echo "================== Build examples for $dir"
224 export RTE_SDK=$(pwd)
225 export RTE_TARGET=$dir
226 make -j$J -sC examples \
227 EXTRA_LDFLAGS="$DPDK_DEP_LDFLAGS" $verbose \
228 O=$(readlink -m $dir/examples)
230 echo "################## $dir done."
236 echo "================== Build doxygen HTML API"
237 make doc-api-html >/dev/null 2>.check/doc.txt
238 echo "================== Build sphinx HTML guides"
239 make doc-guides-html >/dev/null 2>>.check/doc.txt
240 echo "================== Check docs"
241 diff -u /dev/null .check/doc.txt