File: platform_test

package info (click to toggle)
valgrind 1:3.10.0-4~bpo7+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 97,940 kB
  • sloc: ansic: 589,429; xml: 21,096; exp: 8,751; cpp: 7,366; asm: 6,526; perl: 5,656; sh: 5,334; makefile: 4,946; haskell: 195
file content (38 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh

# This script determines which platforms that this Valgrind installation
# supports.
# We return:
# - 0 if the machine matches the asked-for platform
# - 1 if it didn't match, but did match the name of another platform
# - 2 otherwise

# Nb: When updating this file for a new platform, add the name to
# 'all_platforms'.

all_platforms=
all_platforms="$all_platforms x86-linux amd64-linux ppc32-linux ppc64-linux"
all_platforms="$all_platforms arm-linux"
all_platforms="$all_platforms s390x-linux mips32-linux mips64-linux"
all_platforms="$all_platforms x86-darwin amd64-darwin"

if [ $# -ne 2 ] ; then
    echo "usage: platform_test <arch-type> <OS-type>"
    exit 2;
fi

# Get the directory holding the arch_test and os_test, which will be the same
# as the one holding this script.
dir=`dirname $0`

if $dir/arch_test $1 && $dir/os_test $2 ; then
    exit 0;         # Matches this platform.
fi

for p in $all_platforms ; do
    if [ $1-$2 = $p ] ; then
        exit 1;     # Matches another Valgrind-supported platform.
    fi
done

exit 2;             # Doesn't match any Valgrind-supported platform.