ccc3a7ccd9769b2ac41b7ed514b3be96fca42177
[dpdk.git] / .ci / linux-build.sh
1 #!/bin/sh -xe
2
3 on_error() {
4     if [ $? = 0 ]; then
5         exit
6     fi
7     FILES_TO_PRINT="build/meson-logs/testlog.txt build/.ninja_log build/meson-logs/meson-log.txt"
8
9     for pr_file in $FILES_TO_PRINT; do
10         if [ -e "$pr_file" ]; then
11             cat "$pr_file"
12         fi
13     done
14 }
15 trap on_error EXIT
16
17 if [ "$AARCH64" = "1" ]; then
18     # convert the arch specifier
19     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
20 fi
21
22 if [ "$BUILD_DOCS" = "1" ]; then
23     OPTS="$OPTS -Denable_docs=true"
24 fi
25
26 if [ "$BUILD_32BIT" = "1" ]; then
27     OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
28     export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
29 fi
30
31 OPTS="$OPTS --default-library=$DEF_LIB"
32 meson build --werror -Dexamples=all $OPTS
33 ninja -C build
34
35 if [ "$AARCH64" != "1" ]; then
36     devtools/test-null.sh
37 fi
38
39 if [ "$RUN_TESTS" = "1" ]; then
40     sudo meson test -C build --suite fast-tests -t 3
41 fi