2019-05-03 09:49:43 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
|
2019-10-11 14:43:34 +01:00
|
|
|
CROSS_FILE=/cross_file-"$CROSS".txt
|
|
|
|
|
2019-05-03 09:49:43 +01:00
|
|
|
# We need to control the version of llvm-config we're using, so we'll
|
2019-10-11 14:43:34 +01:00
|
|
|
# tweak the cross file or generate a native file to do so.
|
2019-05-03 09:49:43 +01:00
|
|
|
if test -n "$LLVM_VERSION"; then
|
|
|
|
LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
|
|
|
|
echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
|
2019-10-11 14:43:34 +01:00
|
|
|
if [ -n "$CROSS" ]; then
|
|
|
|
sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
|
|
|
|
fi
|
2019-05-03 09:49:43 +01:00
|
|
|
$LLVM_CONFIG --version
|
|
|
|
else
|
2019-05-03 09:58:48 +01:00
|
|
|
rm -f native.file
|
2019-05-03 09:49:43 +01:00
|
|
|
touch native.file
|
|
|
|
fi
|
|
|
|
|
2019-09-17 01:44:12 +01:00
|
|
|
# cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
|
|
|
|
# to fail for the $CROSS configuration, one per line. you can then mark those
|
|
|
|
# tests in their meson.build with:
|
|
|
|
#
|
|
|
|
# test(...,
|
|
|
|
# should_fail: meson.get_cross_property('xfail', '').contains(t),
|
|
|
|
# )
|
|
|
|
#
|
|
|
|
# where t is the name of the test, and the '' is the string to search when
|
|
|
|
# not cross-compiling (which is empty, because for amd64 everything is
|
|
|
|
# expected to pass).
|
|
|
|
if [ -n "$CROSS" ]; then
|
|
|
|
CROSS_XFAIL=.gitlab-ci/cross-xfail-"$CROSS"
|
|
|
|
if [ -s "$CROSS_XFAIL" ]; then
|
|
|
|
sed -i \
|
|
|
|
-e '/\[properties\]/a\' \
|
|
|
|
-e "xfail = '$(tr '\n' , < $CROSS_XFAIL)'" \
|
|
|
|
"$CROSS_FILE"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-05-03 09:58:48 +01:00
|
|
|
rm -rf _build
|
2019-05-03 09:49:43 +01:00
|
|
|
meson _build --native-file=native.file \
|
2019-10-14 17:04:47 +01:00
|
|
|
--wrap-mode=nofallback \
|
2019-09-17 01:44:12 +01:00
|
|
|
${CROSS+--cross "$CROSS_FILE"} \
|
2019-07-25 19:02:34 +01:00
|
|
|
-D prefix=`pwd`/install \
|
2019-07-23 19:12:07 +01:00
|
|
|
-D libdir=lib \
|
2019-08-01 20:14:15 +01:00
|
|
|
-D buildtype=${BUILDTYPE:-debug} \
|
2019-05-03 09:49:43 +01:00
|
|
|
-D build-tests=true \
|
|
|
|
-D libunwind=${UNWIND} \
|
|
|
|
${DRI_LOADERS} \
|
|
|
|
-D dri-drivers=${DRI_DRIVERS:-[]} \
|
|
|
|
${GALLIUM_ST} \
|
|
|
|
-D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
|
|
|
|
-D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
|
2019-05-08 17:17:23 +01:00
|
|
|
-D I-love-half-baked-turnips=true \
|
|
|
|
${EXTRA_OPTION}
|
2019-05-03 09:49:43 +01:00
|
|
|
cd _build
|
|
|
|
meson configure
|
2019-11-06 19:14:14 +00:00
|
|
|
ninja -j4
|
2019-05-03 09:49:43 +01:00
|
|
|
LC_ALL=C.UTF-8 ninja test
|
2019-07-25 19:02:34 +01:00
|
|
|
ninja install
|
2019-04-10 23:59:12 +01:00
|
|
|
cd ..
|