xref: /haiku/build/scripts/find_triplet (revision 890224c31c187563ed53b056bba1a37816b4cdb3)
1*890224c3SAlexander von Gluck IV#!/bin/bash
2925d9f19SAlexander von Gluck IV#
3925d9f19SAlexander von Gluck IV# Produce a gcc triplet for the given architecture
4925d9f19SAlexander von Gluck IV# Released under the MIT License.
5925d9f19SAlexander von Gluck IV#
6925d9f19SAlexander von Gluck IV# We have a lot of arbitrary toolchain triplets, this is
7925d9f19SAlexander von Gluck IV# a simple script to decode them.
8925d9f19SAlexander von Gluck IV#
9925d9f19SAlexander von Gluck IV
10925d9f19SAlexander von Gluck IVif [[ $# -ne 1 ]]; then
11925d9f19SAlexander von Gluck IV	echo "usage: $0 <architecture>"
12925d9f19SAlexander von Gluck IV	exit 1
13925d9f19SAlexander von Gluck IVfi
14925d9f19SAlexander von Gluck IV
15925d9f19SAlexander von Gluck IVcase "$1" in
16925d9f19SAlexander von Gluck IV	"arm64")
17925d9f19SAlexander von Gluck IV		echo "aarch64-unknown-haiku"
18925d9f19SAlexander von Gluck IV		;;
19925d9f19SAlexander von Gluck IV	"ppc")
20925d9f19SAlexander von Gluck IV		echo "powerpc-apple-haiku"
21925d9f19SAlexander von Gluck IV		;;
22925d9f19SAlexander von Gluck IV	"sparc")
23925d9f19SAlexander von Gluck IV		echo "sparc64-unknown-haiku"
24925d9f19SAlexander von Gluck IV		;;
25925d9f19SAlexander von Gluck IV	"x86_gcc2" | "x86")
26925d9f19SAlexander von Gluck IV		echo "i586-pc-haiku"
27925d9f19SAlexander von Gluck IV		;;
28925d9f19SAlexander von Gluck IV	*)
29925d9f19SAlexander von Gluck IV		echo "$1-unknown-haiku"
30925d9f19SAlexander von Gluck IV		;;
31925d9f19SAlexander von Gluck IVesac
32925d9f19SAlexander von Gluck IVexit 0
33