summaryrefslogtreecommitdiffstats
path: root/toolchain/sed/sedcheck.sh
blob: 5af1d886bd21b582118d1a79683d78c7cc298bd4 (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
#!/bin/sh

if [ -x /usr/bin/sed ]; then 
    SED="/usr/bin/sed";
else
    if [ -x /bin/sed ]; then 
	SED="/bin/sed";
    fi;
fi;

echo "HELLO" > .sedtest
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1

case "$1" in
	download)
		if [ $? != 0 ] ; then
			echo download-sed-binary
		fi;
	;;
	*)
		if [ $? != 0 ] ; then
			echo build-sed-host-binary
		else
			echo use-sed-host-binary
		fi;
	;;
esac
rm -f .sedtest