aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/config.make
blob: 388fe360476fd23e9e2a733e91474f75c86e473b (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/sh

# Helper script to turn --enable-sim-xxx switches into make variables

# Arg 1 -- header name
# Arg 2 -- define name
# Arg 3 -- --enable-sim switch spelling
# Arg 4 -- --enable-sim switch value
# the remaining switches are paired, with the first being the value to test arg 4 against
# and the second is the value to put in the define if it matches

make="$1"
shift

makevar="$1"
shift

switch="$1"
shift

value="$1"
shift

while test $# -gt 1; do
	test_value="$1"
	shift

	set_value="$1"
	shift

	if test x"$value" = x"$test_value" -o x"$test_value" = x"*"; then
		echo "Setting $makevar=$set_value"
		(echo "";
		 if test x"$value" = x""; then
			 echo "# no $switch";
		 elif test x"$value" = x"yes"; then
			 echo "# $switch";
		 else
			 echo "# $switch=$value";
		 fi
		 if test x"$set_value" = x""; then
			 echo "$makevar ="
		 else
			 echo "$makevar = $set_value"
		 fi) >> $make
		exit 0;
	fi
done

if test x"$value" != x"" -a x"$value" != x"no"; then
	echo "$switch=$value is not supported" 1>&2
	exit 1
fi