FreeCalypso > hg > fc-magnetite
comparison configure.sh @ 620:76f09f1bea5d
config system: generalized mechanism for overriding Calypso chip version
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 07 Oct 2019 02:09:53 +0000 |
parents | f2e752052db5 |
children | 5f00e9afd5d9 |
comparison
equal
deleted
inserted
replaced
619:5a0ddb29c58e | 620:76f09f1bea5d |
---|---|
28 then | 28 then |
29 echo "usage: $0 [--clean] target config [vars]" 1>&2 | 29 echo "usage: $0 [--clean] target config [vars]" 1>&2 |
30 exit 1 | 30 exit 1 |
31 fi | 31 fi |
32 | 32 |
33 TARGET="$1" | 33 TARGET_FULL="$1" |
34 CONFIG="$2" | 34 CONFIG="$2" |
35 | 35 |
36 case "$TARGET_FULL" in | |
37 *-*) | |
38 TARGET=`echo $TARGET_FULL | sed -e 's/-.*$//'` | |
39 CHIP_OVERRIDE=`echo $TARGET_FULL | sed -e 's/^.*-//'` | |
40 ;; | |
41 *) | |
42 TARGET="$TARGET_FULL" | |
43 CHIP_OVERRIDE= | |
44 ;; | |
45 esac | |
46 | |
36 if [ ! -f "targets/$TARGET.conf" -o ! -f "targets/$TARGET.h" ] | 47 if [ ! -f "targets/$TARGET.conf" -o ! -f "targets/$TARGET.h" ] |
37 then | 48 then |
38 echo "Error: target $TARGET not known" 1>&2 | 49 echo "Error: target $TARGET not known" 1>&2 |
39 exit 1 | 50 exit 1 |
40 fi | 51 fi |
45 exit 1 | 56 exit 1 |
46 fi | 57 fi |
47 | 58 |
48 # target defaults that can be overridden by $TARGET.conf | 59 # target defaults that can be overridden by $TARGET.conf |
49 | 60 |
50 CHIPSET=10 | 61 CALYPSO_VER=dsp36 |
51 DSP=36 | |
52 RF=12 | 62 RF=12 |
53 DISABLE_SLEEP=0 | 63 DISABLE_SLEEP=0 |
54 RVTMUX_ON_MODEM=0 | 64 RVTMUX_ON_MODEM=0 |
55 UI_CONFIG=bigcolor | 65 UI_CONFIG=bigcolor |
56 | 66 |
57 . "targets/$TARGET.conf" | 67 . "targets/$TARGET.conf" |
58 | 68 |
59 # settings derived from the target-defined DSP version | 69 # possible Calypso chip version override |
60 | 70 |
61 case "$DSP" in | 71 if [ -n "$CHIP_OVERRIDE" ] |
62 33) | 72 then |
73 CALYPSO_VER="$CHIP_OVERRIDE" | |
74 fi | |
75 | |
76 # settings derived from the Calypso chip version | |
77 | |
78 case "$CALYPSO_VER" in | |
79 c05b) | |
80 CHIPSET=8 | |
81 DSP=33 | |
63 AMR=0 | 82 AMR=0 |
64 L1_DYN_DSP_DWNLD=0 | 83 L1_DYN_DSP_DWNLD=0 |
65 L1_VOICE_MEMO_AMR=0 | 84 L1_VOICE_MEMO_AMR=0 |
66 MELODY_E2=0 | 85 MELODY_E2=0 |
67 SPEECH_RECO=0 | 86 SPEECH_RECO=0 |
68 ;; | 87 ;; |
69 34) | 88 dsp34) |
89 CHIPSET=10 | |
90 DSP=34 | |
70 AMR=1 | 91 AMR=1 |
71 L1_DYN_DSP_DWNLD=0 | 92 L1_DYN_DSP_DWNLD=0 |
72 L1_VOICE_MEMO_AMR=0 | 93 L1_VOICE_MEMO_AMR=0 |
73 MELODY_E2=0 | 94 MELODY_E2=0 |
74 SPEECH_RECO=0 | 95 SPEECH_RECO=0 |
75 ;; | 96 ;; |
76 36) | 97 dsp36) |
98 CHIPSET=10 | |
99 DSP=36 | |
77 AMR=1 | 100 AMR=1 |
78 L1_DYN_DSP_DWNLD=1 | 101 L1_DYN_DSP_DWNLD=1 |
79 L1_VOICE_MEMO_AMR=1 | 102 L1_VOICE_MEMO_AMR=1 |
80 MELODY_E2=1 | 103 MELODY_E2=1 |
81 SPEECH_RECO=1 | 104 SPEECH_RECO=1 |
82 ;; | 105 ;; |
83 *) | 106 *) |
84 echo "Error: DSP=$DSP setting not understood" 1>&2 | 107 echo "Error: CALYPSO_VER=$CALYPSO_VER setting not understood" 1>&2 |
85 exit 1 | 108 exit 1 |
86 esac | 109 esac |
87 | 110 |
88 # display driver configuration | 111 # display driver configuration |
89 | 112 |
107 do | 130 do |
108 eval "$1" | 131 eval "$1" |
109 shift | 132 shift |
110 done | 133 done |
111 | 134 |
112 BUILD_DIR="build-$TARGET-$CONFIG$SUFFIX" | 135 BUILD_DIR="build-$TARGET_FULL-$CONFIG$SUFFIX" |
113 | 136 |
114 echo "Building configuration $CONFIG for target $TARGET in $BUILD_DIR" | 137 echo "Building configuration $CONFIG for target $TARGET_FULL in $BUILD_DIR" |
115 | 138 |
116 if [ "$clean_flag" = 1 ] | 139 if [ "$clean_flag" = 1 ] |
117 then | 140 then |
118 rm -rf $BUILD_DIR | 141 rm -rf $BUILD_DIR |
119 fi | 142 fi |
234 | 257 |
235 # generate the top level Makefile! | 258 # generate the top level Makefile! |
236 | 259 |
237 helpers/makeline def CONFIG_NAME "$CONFIG$SUFFIX" > $BUILD_DIR/Makefile | 260 helpers/makeline def CONFIG_NAME "$CONFIG$SUFFIX" > $BUILD_DIR/Makefile |
238 echo >> $BUILD_DIR/Makefile | 261 echo >> $BUILD_DIR/Makefile |
239 helpers/makeline def TARGET $TARGET >> $BUILD_DIR/Makefile | 262 helpers/makeline def TARGET $TARGET_FULL >> $BUILD_DIR/Makefile |
240 echo >> $BUILD_DIR/Makefile | 263 echo >> $BUILD_DIR/Makefile |
241 helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile | 264 helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile |
242 echo >> $BUILD_DIR/Makefile | 265 echo >> $BUILD_DIR/Makefile |
243 helpers/makeline def LIBS $LIBS >> $BUILD_DIR/Makefile | 266 helpers/makeline def LIBS $LIBS >> $BUILD_DIR/Makefile |
244 echo >> $BUILD_DIR/Makefile | 267 echo >> $BUILD_DIR/Makefile |