FreeCalypso > hg > fc-magnetite
comparison scripts/config-headers-new.sh @ 389:5addc2943fa2
scripts/config-headers-new.sh: written, to be tested
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Jan 2018 19:54:56 +0000 |
parents | |
children | fd1d9063ad40 |
comparison
equal
deleted
inserted
replaced
388:b8b08c302ace | 389:5addc2943fa2 |
---|---|
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 # Derived settings only for the generation of *.cfg headers | |
116 | |
117 case "$RF" in | |
118 10) | |
119 RF_FAM=10 | |
120 RF_PA=0 | |
121 RF_PG=0 | |
122 ;; | |
123 12) | |
124 RF_FAM=12 | |
125 RF_PA=2 | |
126 RF_PG=2 | |
127 ;; | |
128 *) | |
129 echo "Error: RF=$RF setting not understood" 1>&2 | |
130 exit 1 | |
131 esac | |
132 export RF_FAM RF_PA RF_PG | |
133 | |
134 case "$GPRS" in | |
135 0) | |
136 L1_GPRS=0 | |
137 PMODE=1 | |
138 ;; | |
139 1) | |
140 L1_GPRS=1 | |
141 PMODE=2 | |
142 ;; | |
143 *) | |
144 echo "Error: GPRS=$GPRS setting not understood" 1>&2 | |
145 exit 1 | |
146 esac | |
147 export L1_GPRS PMODE | |
148 | |
149 if [ "$SRVC" != 0 ] | |
150 then | |
151 IDS=1 | |
152 else | |
153 IDS=0 | |
154 fi | |
155 export IDS | |
156 | |
157 # do it! | |
158 | |
159 set -e | |
160 | |
161 rm -rf $BUILD_DIR/config | |
162 mkdir $BUILD_DIR/config | |
163 helpers/cfg-hdr-gen scripts/cfg-template $BUILD_DIR/config | |
164 scripts/make-rv-swe-hdr.sh > $BUILD_DIR/config/rv_swe.h | |
165 cp targets/$TARGET.h $BUILD_DIR/config/fc-target.cfg |