blob: e91b9f7ab699eab330e1f9e956afbde2e6c44312 [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"
15all_platforms="$all_platforms ppc32-aix5 ppc64-aix5"
njn107bc572009-02-16 00:42:10 +000016
17if [ $# -ne 2 ] ; then
18 echo "usage: platform_test <arch-type> <OS-type>"
19 exit 2;
20fi
21
22# Get the directory holding the arch_test and os_test, which will be the same
23# as the one holding this script.
24dir=`dirname $0`
25
njn61485ab2009-03-04 04:15:16 +000026if $dir/arch_test $1 && $dir/os_test $2 ; then
njn107bc572009-02-16 00:42:10 +000027 exit 0; # Matches this platform.
28fi
29
30for p in $all_platforms ; do
31 if [ $1-$2 = $p ] ; then
32 exit 1; # Matches another Valgrind-supported platform.
33 fi
34done
35
36exit 2; # Doesn't match any Valgrind-supported platform.