Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. set -e
  3. set -o xtrace
  4. CROSS_FILE=/cross_file-"$CROSS".txt
  5. # We need to control the version of llvm-config we're using, so we'll
  6. # tweak the cross file or generate a native file to do so.
  7. if test -n "$LLVM_VERSION"; then
  8. LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
  9. echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
  10. if [ -n "$CROSS" ]; then
  11. sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
  12. fi
  13. $LLVM_CONFIG --version
  14. else
  15. rm -f native.file
  16. touch native.file
  17. fi
  18. # cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
  19. # to fail for the $CROSS configuration, one per line. you can then mark those
  20. # tests in their meson.build with:
  21. #
  22. # test(...,
  23. # should_fail: meson.get_cross_property('xfail', '').contains(t),
  24. # )
  25. #
  26. # where t is the name of the test, and the '' is the string to search when
  27. # not cross-compiling (which is empty, because for amd64 everything is
  28. # expected to pass).
  29. if [ -n "$CROSS" ]; then
  30. CROSS_XFAIL=.gitlab-ci/cross-xfail-"$CROSS"
  31. if [ -s "$CROSS_XFAIL" ]; then
  32. sed -i \
  33. -e '/\[properties\]/a\' \
  34. -e "xfail = '$(tr '\n' , < $CROSS_XFAIL)'" \
  35. "$CROSS_FILE"
  36. fi
  37. fi
  38. rm -rf _build
  39. meson _build --native-file=native.file \
  40. --wrap-mode=nofallback \
  41. ${CROSS+--cross "$CROSS_FILE"} \
  42. -D prefix=`pwd`/install \
  43. -D libdir=lib \
  44. -D buildtype=${BUILDTYPE:-debug} \
  45. -D build-tests=true \
  46. -D libunwind=${UNWIND} \
  47. ${DRI_LOADERS} \
  48. -D dri-drivers=${DRI_DRIVERS:-[]} \
  49. ${GALLIUM_ST} \
  50. -D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
  51. -D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
  52. -D I-love-half-baked-turnips=true \
  53. ${EXTRA_OPTION}
  54. cd _build
  55. meson configure
  56. ninja -j4
  57. LC_ALL=C.UTF-8 ninja test
  58. ninja install
  59. cd ..