comparison scripts/config-headers.sh @ 13:f10cbd8a51c4

scripts: pruned import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 21:34:56 +0000
parents
children 9658b9bfee5a
comparison
equal deleted inserted replaced
12:e825175be40d 13:f10cbd8a51c4
1 #!/bin/sh
2
3 if [ -z "$TARGET" ]
4 then
5 echo "Error: TARGET= must be passed via environment" 1>&2
6 exit 1
7 fi
8
9 if [ -z "$BUILD_DIR" ]
10 then
11 echo "Error: BUILD_DIR= must be passed via environment" 1>&2
12 exit 1
13 fi
14
15 # The following vars will already be set when this script is invoked
16 # from configure.sh in a production build, but the following defaulting logic
17 # helps with manual invokation during development.
18
19 if [ -z "$CHIPSET" ]
20 then
21 CHIPSET=10
22 fi
23 export CHIPSET
24
25 if [ -z "$DSP" ]
26 then
27 DSP=36
28 fi
29 export DSP
30
31 if [ -z "$RF" ]
32 then
33 RF=12
34 fi
35 export RF
36
37 if [ -z "$AMR" ]
38 then
39 AMR=1
40 fi
41 export AMR
42
43 if [ -z "$L1_DYN_DSP_DWNLD" ]
44 then
45 L1_DYN_DSP_DWNLD=1
46 fi
47 export L1_DYN_DSP_DWNLD
48
49 if [ -z "$L1_VOICE_MEMO_AMR" ]
50 then
51 L1_VOICE_MEMO_AMR=1
52 fi
53 export L1_VOICE_MEMO_AMR
54
55 if [ -z "$MELODY_E2" ]
56 then
57 MELODY_E2=1
58 fi
59 export MELODY_E2
60
61 if [ -z "$SPEECH_RECO" ]
62 then
63 SPEECH_RECO=1
64 fi
65 export SPEECH_RECO
66
67 if [ -z "$GPRS" ]
68 then
69 GPRS=1
70 fi
71 export GPRS
72
73 if [ -z "$SRVC" ]
74 then
75 SRVC=1
76 fi
77 export SRVC
78
79 if [ -z "$ATP_STATE" ]
80 then
81 ATP_STATE=0
82 fi
83 export ATP_STATE
84
85 if [ -z "$FCHG_STATE" ]
86 then
87 FCHG_STATE=1
88 fi
89 export FCHG_STATE
90
91 if [ -z "$LCC_STATE" ]
92 then
93 LCC_STATE=0
94 fi
95 export LCC_STATE
96
97 if [ -z "$MKS_STATE" ]
98 then
99 MKS_STATE=0
100 fi
101 export MKS_STATE
102
103 if [ -z "$PWR_STATE" ]
104 then
105 PWR_STATE=0
106 fi
107 export PWR_STATE
108
109 if [ -z "$R2D_STATE" ]
110 then
111 R2D_STATE=1
112 fi
113 export R2D_STATE
114
115 if [ -z "$DSAMPLE_FULL_COLOR" ]
116 then
117 DSAMPLE_FULL_COLOR=1
118 fi
119 export DSAMPLE_FULL_COLOR
120
121 if [ -z "$TR_BAUD_CONFIG" ]
122 then
123 TR_BAUD_CONFIG=TR_BAUD_115200
124 fi
125 export TR_BAUD_CONFIG
126
127 # Derived settings only for the generation of *.cfg headers
128
129 case "$RF" in
130 10)
131 RF_FAM=10
132 RF_PA=0
133 RF_PG=0
134 ;;
135 12)
136 RF_FAM=12
137 RF_PA=2
138 RF_PG=2
139 ;;
140 *)
141 echo "Error: RF=$RF setting not understood" 1>&2
142 exit 1
143 esac
144 export RF_FAM RF_PA RF_PG
145
146 case "$GPRS" in
147 0)
148 L1_GPRS=0
149 PMODE=1
150 ;;
151 1)
152 L1_GPRS=1
153 PMODE=2
154 ;;
155 *)
156 echo "Error: GPRS=$GPRS setting not understood" 1>&2
157 exit 1
158 esac
159 export L1_GPRS PMODE
160
161 if [ "$SRVC" != 0 ]
162 then
163 IDS=1
164 else
165 IDS=0
166 fi
167 export IDS
168
169 # do it!
170
171 set -e
172
173 rm -rf $BUILD_DIR/config
174 mkdir $BUILD_DIR/config
175 helpers/cfg-hdr-gen scripts/cfg-template $BUILD_DIR/config
176 scripts/make-rv-swe-hdr.sh > $BUILD_DIR/config/rv_swe.h
177 cp targets/$TARGET.h $BUILD_DIR/config/fc-target.cfg