blob: 376f62eb4120770f50de3fde7c06f134ac15a227 [file] [log] [blame]
njn107bc572009-02-16 00:42:10 +00001#! /bin/sh
2
3# This script determines which platforms that this Valgrind installation
4# supports.
5# We return:
6# - 0 if the machine matches the asked-for platform
7# - 1 if it didn't match, but did match the name of another platform
8# - 2 otherwise
9
10# Nb: When updating this file for a new platform, add the name to
11# 'all_platforms'.
12
13all_platforms=
14all_platforms="$all_platforms x86-linux amd64-linux ppc32-linux ppc64-linux"
Elliott Hughesa0664b92017-04-18 17:46:52 -070015all_platforms="$all_platforms arm-linux arm64-linux"
petarj4df0bfc2013-02-27 23:17:33 +000016all_platforms="$all_platforms s390x-linux mips32-linux mips64-linux"
njnf76d27a2009-05-28 01:53:07 +000017all_platforms="$all_platforms x86-darwin amd64-darwin"
sewardj8eb8bab2015-07-21 14:44:28 +000018all_platforms="$all_platforms x86-solaris amd64-solaris"
njn107bc572009-02-16 00:42:10 +000019
20if [ $# -ne 2 ] ; then
21 echo "usage: platform_test <arch-type> <OS-type>"
22 exit 2;
23fi
24
25# Get the directory holding the arch_test and os_test, which will be the same
26# as the one holding this script.
27dir=`dirname $0`
28
njn61485ab2009-03-04 04:15:16 +000029if $dir/arch_test $1 && $dir/os_test $2 ; then
njn107bc572009-02-16 00:42:10 +000030 exit 0; # Matches this platform.
31fi
32
33for p in $all_platforms ; do
34 if [ $1-$2 = $p ] ; then
35 exit 1; # Matches another Valgrind-supported platform.
36 fi
37done
38
39exit 2; # Doesn't match any Valgrind-supported platform.