2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2018 Intel Corporation
5 # Run meson to auto-configure the various builds.
6 # * all builds get put in a directory whose name starts with "build-"
7 # * if a build-directory already exists we assume it was properly configured
8 # Run ninja after configuration is done.
10 srcdir=$(dirname $(readlink -m $0))/..
13 build () # <directory> <meson options>
17 if [ ! -d "$builddir" ] ; then
18 options="--werror -Dexamples=all $*"
19 echo "$MESON $options $srcdir $builddir"
20 $MESON $options $srcdir $builddir
23 echo "ninja -C $builddir"
27 # shared and static linked builds with gcc and clang
28 for c in gcc clang ; do
29 for s in static shared ; do
31 build build-$c-$s --default-library=$s
35 # test compilation with minimal x86 instruction set
36 build build-x86-default -Dmachine=nehalem
38 # enable cross compilation if gcc cross-compiler is found
39 for f in config/arm/arm*gcc ; do
40 c=aarch64-linux-gnu-gcc
41 if ! command -v $c >/dev/null 2>&1 ; then
44 build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) --cross-file $f