summaryrefslogtreecommitdiff
path: root/sysselect.sh
blob: 9aa058afd96e54c94e40a6c94ee9958a6652fa08 (plain)
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
#!/bin/sh

uname_sys=`uname -s`
posixy="posixy"
if test $uname_sys = "Linux"; then
	sys="linux"
elif test $uname_sys = "Darwin"; then
	sys="osx"
elif test $uname_sys = "FreeBSD"; then
	sys="freebsd"
elif test $uname_sys = "Plan9"; then
	sys="plan9"
        posixy="NOTPOSIXY"
fi

uname_arch=`uname -m`
if test $uname_arch = "x86_64"; then
	arch="x64"
fi

# check for system prefixes on .myr src
for suffix in myr s; do
	for platform in $posixy-$sys-$arch \
		$posixy-$sys \
		$posixy-$arch \
		$posixy \
		$sys-$arch \
		$sys \
		$arch
	do
		if test -f $1+$platform.$suffix; then
			echo $1+$platform.$suffix 
		fi
	done
done