#!/bin/sh -xe
+# Builds are run as root in containers, no need for sudo
+[ "$(id -u)" != '0' ] || alias sudo=
+
on_error() {
if [ $? = 0 ]; then
exit
return 1
}
+cross_file=
+
if [ "$AARCH64" = "true" ]; then
- # Note: common/cnxk is disabled for Ubuntu 18.04
- # https://bugs.dpdk.org/show_bug.cgi?id=697
- OPTS="$OPTS -Ddisable_drivers=common/cnxk"
if [ "${CC%%clang}" != "$CC" ]; then
- OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804"
+ cross_file=config/arm/arm64_armv8_linux_clang_ubuntu
else
- OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
+ cross_file=config/arm/arm64_armv8_linux_gcc
fi
fi
+if [ "$MINGW" = "true" ]; then
+ cross_file=config/x86/cross-mingw
+fi
+
if [ "$PPC64LE" = "true" ]; then
- OPTS="$OPTS --cross-file config/ppc/ppc64le-power8-linux-gcc-ubuntu1804"
+ cross_file=config/ppc/ppc64le-power8-linux-gcc-ubuntu
+fi
+
+if [ "$RISCV64" = "true" ]; then
+ cross_file=config/riscv/riscv64_linux_gcc
+fi
+
+if [ -n "$cross_file" ]; then
+ OPTS="$OPTS --cross-file $cross_file"
fi
if [ "$BUILD_DOCS" = "true" ]; then
export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
fi
-if [ "$DEF_LIB" = "static" ]; then
+if [ "$MINGW" = "true" ]; then
+ OPTS="$OPTS -Dexamples=helloworld"
+elif [ "$DEF_LIB" = "static" ]; then
OPTS="$OPTS -Dexamples=l2fwd,l3fwd"
else
OPTS="$OPTS -Dexamples=all"
OPTS="$OPTS --buildtype=debugoptimized"
OPTS="$OPTS -Dcheck_includes=true"
if [ "$MINI" = "true" ]; then
- OPTS="$OPTS -Denable_drivers=bus/vdev,mempool/ring,net/null"
+ OPTS="$OPTS -Denable_drivers=net/null"
OPTS="$OPTS -Ddisable_libs=*"
fi
+
+if [ "$ASAN" = "true" ]; then
+ OPTS="$OPTS -Db_sanitize=address"
+ if [ "${CC%%clang}" != "$CC" ]; then
+ OPTS="$OPTS -Db_lundef=false"
+ fi
+fi
+
meson build --werror $OPTS
ninja -C build
-if [ "$AARCH64" != "true" ] && [ "$PPC64LE" != "true" ]; then
+if [ -z "$cross_file" ]; then
failed=
configure_coredump
devtools/test-null.sh || failed="true"