Small changes from Andrew
[deliverable/binutils-gdb.git] / sim / ppc / config.hdr
CommitLineData
c143ef62
MM
1#! /bin/sh
2
3# Helper script to turn --enable-sim-xxx switches into defines
4
5# Arg 1 -- header name
6# Arg 2 -- define name
7# Arg 3 -- --enable-sim switch spelling
8# Arg 4 -- --enable-sim switch value
9# the remaining switches are paired, with the first being the value to test arg 4 against
10# and the second is the value to put in the define if it matches
11
12hdr="$1"
13shift
14
15define="$1"
16shift
17
18switch="$1"
19shift
20
21value="$1"
22shift
23
24while test $# -gt 1; do
25 test_value="$1"
26 shift
27
28 set_value="$1"
29 shift
30
31 if test x"$value" = x"$test_value" -o x"$test_value" = x"*"; then
32 echo "Defining $define=$set_value"
33 (echo ""
34 if test x"$value" = x""; then
35 echo "/* no $switch */"
36 elif test x"$value" = x"yes"; then
37 echo "/* $switch */"
38 else
39 echo "/* $switch=$value */"
40 fi
41
42 echo "#ifndef $define"
43 echo "#define $define $set_value"
44 echo "#endif") >> $hdr
45 exit 0;
46 fi
47done
48
49if test x"$value" != x"" -a x"$value" != x"no"; then
50 echo "$switch=$value is not supported" 1>&2
51 exit 1
52fi
This page took 0.024311 seconds and 4 git commands to generate.