VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/mesa/mesa-24.0.2/.gitlab-ci/container/create-cross-file.sh

最後變更 在這個檔案是 103996,由 vboxsync 提交於 11 月 前

Additions/3D/mesa: export mesa-24.0.2 to OSE. bugref:10606

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:executable 設為 *
檔案大小: 2.0 KB
 
1#!/bin/bash
2
3arch=$1
4cross_file="/cross_file-$arch.txt"
5meson env2mfile --cross --debarch "$arch" -o "$cross_file"
6
7# Explicitly set ccache path for cross compilers
8sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
9
10# Rely on qemu-user being configured in binfmt_misc on the host
11# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
12sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
13
14# Add a line for rustc, which meson env2mfile is missing.
15cc=$(sed -n "s|^c\s*=\s*\[?'\(.*\)'\]?|\1|p" < "$cross_file")
16
17if [[ "$arch" = "arm64" ]]; then
18 rust_target=aarch64-unknown-linux-gnu
19elif [[ "$arch" = "armhf" ]]; then
20 rust_target=armv7-unknown-linux-gnueabihf
21elif [[ "$arch" = "i386" ]]; then
22 rust_target=i686-unknown-linux-gnu
23elif [[ "$arch" = "ppc64el" ]]; then
24 rust_target=powerpc64le-unknown-linux-gnu
25elif [[ "$arch" = "s390x" ]]; then
26 rust_target=s390x-unknown-linux-gnu
27else
28 echo "Needs rustc target mapping"
29fi
30
31# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
32sed -i -e '/\[binaries\]/a\' -e "rust = ['rustc', '--target=$rust_target', '-C', 'linker=$cc']" "$cross_file"
33
34# Set up cmake cross compile toolchain file for dEQP builds
35toolchain_file="/toolchain-$arch.cmake"
36if [[ "$arch" = "arm64" ]]; then
37 GCC_ARCH="aarch64-linux-gnu"
38 DE_CPU="DE_CPU_ARM_64"
39elif [[ "$arch" = "armhf" ]]; then
40 GCC_ARCH="arm-linux-gnueabihf"
41 DE_CPU="DE_CPU_ARM"
42fi
43
44if [[ -n "$GCC_ARCH" ]]; then
45 {
46 echo "set(CMAKE_SYSTEM_NAME Linux)";
47 echo "set(CMAKE_SYSTEM_PROCESSOR arm)";
48 echo "set(CMAKE_C_COMPILER /usr/lib/ccache/$GCC_ARCH-gcc)";
49 echo "set(CMAKE_CXX_COMPILER /usr/lib/ccache/$GCC_ARCH-g++)";
50 echo "set(CMAKE_CXX_FLAGS_INIT \"-Wno-psabi\")"; # makes ABI warnings quiet for ARMv7
51 echo "set(ENV{PKG_CONFIG} \"/usr/bin/$GCC_ARCH-pkgconf\")";
52 echo "set(DE_CPU $DE_CPU)";
53 } > "$toolchain_file"
54fi
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette