xref: /aosp_15_r20/external/ltp/ci/debian.cross-compile.sh (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1#!/bin/sh -eux
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2018-2020 Petr Vorel <[email protected]>
4
5if [ -z "$ARCH" ]; then
6	echo "missing \$ARCH!" >&2
7	exit 1
8fi
9
10case "$ARCH" in
11arm64) gcc_arch="aarch64";;
12ppc64el) gcc_arch="powerpc64le";;
13s390x) gcc_arch="$ARCH";;
14*) echo "unsupported arch: '$ARCH'!" >&2; exit 1;;
15esac
16
17dpkg --add-architecture $ARCH
18apt update
19
20apt install -y --no-install-recommends \
21	gcc-${gcc_arch}-linux-gnu \
22	libc6-dev-${ARCH}-cross \
23	libmnl-dev:$ARCH \
24	libtirpc-dev:$ARCH
25