⛏️ index : haiku.git

author Alexander von Gluck IV <kallisti5@unixzen.com> 2019-08-01 10:34:54.0 -05:00:00
committer Alexander von Gluck IV <kallisti5@unixzen.com> 2019-10-17 7:49:07.0 -05:00:00
commit
093bda000845988310742ff399744d378d70accd [patch]
tree
a815b95fea21ff54fe05da54be065359c38e2ca1
parent
4d350bfad69b84fec9de880dc56a6506905015e7
download
093bda000845988310742ff399744d378d70accd.tar.gz

build/scripts: Add find_triplet to allow easy solving of arch to gcc triplet



Diff

 build/scripts/find_triplet | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/build/scripts/find_triplet b/build/scripts/find_triplet
new file mode 100755
index 0000000..8b72a34 100755
--- /dev/null
+++ b/build/scripts/find_triplet
@@ -1,0 +1,32 @@
#!/bin/sh
#
# Produce a gcc triplet for the given architecture
# Released under the MIT License.
#
# We have a lot of arbitrary toolchain triplets, this is
# a simple script to decode them.
#

if [[ $# -ne 1 ]]; then
	echo "usage: $0 <architecture>"
	exit 1
fi

case "$1" in
	"arm64")
		echo "aarch64-unknown-haiku"
		;;
	"ppc")
		echo "powerpc-apple-haiku"
		;;
	"sparc")
		echo "sparc64-unknown-haiku"
		;;
	"x86_gcc2" | "x86")
		echo "i586-pc-haiku"
		;;
	*)
		echo "$1-unknown-haiku"
		;;
esac
exit 0