diff 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
line wrap: on
line diff
--- a/configure.sh	Sun Oct 06 22:25:10 2019 +0000
+++ b/configure.sh	Mon Oct 07 02:09:53 2019 +0000
@@ -30,9 +30,20 @@
 	exit 1
 fi
 
-TARGET="$1"
+TARGET_FULL="$1"
 CONFIG="$2"
 
+case "$TARGET_FULL" in
+	*-*)
+		TARGET=`echo $TARGET_FULL | sed -e 's/-.*$//'`
+		CHIP_OVERRIDE=`echo $TARGET_FULL | sed -e 's/^.*-//'`
+		;;
+	*)
+		TARGET="$TARGET_FULL"
+		CHIP_OVERRIDE=
+		;;
+esac
+
 if [ ! -f "targets/$TARGET.conf" -o ! -f "targets/$TARGET.h" ]
 then
 	echo "Error: target $TARGET not known" 1>&2
@@ -47,8 +58,7 @@
 
 # target defaults that can be overridden by $TARGET.conf
 
-CHIPSET=10
-DSP=36
+CALYPSO_VER=dsp36
 RF=12
 DISABLE_SLEEP=0
 RVTMUX_ON_MODEM=0
@@ -56,24 +66,37 @@
 
 . "targets/$TARGET.conf"
 
-# settings derived from the target-defined DSP version
+# possible Calypso chip version override
+
+if [ -n "$CHIP_OVERRIDE" ]
+then
+	CALYPSO_VER="$CHIP_OVERRIDE"
+fi
 
-case "$DSP" in
-	33)
+# settings derived from the Calypso chip version
+
+case "$CALYPSO_VER" in
+	c05b)
+		CHIPSET=8
+		DSP=33
 		AMR=0
 		L1_DYN_DSP_DWNLD=0
 		L1_VOICE_MEMO_AMR=0
 		MELODY_E2=0
 		SPEECH_RECO=0
 		;;
-	34)
+	dsp34)
+		CHIPSET=10
+		DSP=34
 		AMR=1
 		L1_DYN_DSP_DWNLD=0
 		L1_VOICE_MEMO_AMR=0
 		MELODY_E2=0
 		SPEECH_RECO=0
 		;;
-	36)
+	dsp36)
+		CHIPSET=10
+		DSP=36
 		AMR=1
 		L1_DYN_DSP_DWNLD=1
 		L1_VOICE_MEMO_AMR=1
@@ -81,7 +104,7 @@
 		SPEECH_RECO=1
 		;;
 	*)
-		echo "Error: DSP=$DSP setting not understood" 1>&2
+	     echo "Error: CALYPSO_VER=$CALYPSO_VER setting not understood" 1>&2
 		exit 1
 esac
 
@@ -109,9 +132,9 @@
 	shift
 done
 
-BUILD_DIR="build-$TARGET-$CONFIG$SUFFIX"
+BUILD_DIR="build-$TARGET_FULL-$CONFIG$SUFFIX"
 
-echo "Building configuration $CONFIG for target $TARGET in $BUILD_DIR"
+echo "Building configuration $CONFIG for target $TARGET_FULL in $BUILD_DIR"
 
 if [ "$clean_flag" = 1 ]
 then
@@ -236,7 +259,7 @@
 
 helpers/makeline def CONFIG_NAME "$CONFIG$SUFFIX" > $BUILD_DIR/Makefile
 echo >> $BUILD_DIR/Makefile
-helpers/makeline def TARGET $TARGET >> $BUILD_DIR/Makefile
+helpers/makeline def TARGET $TARGET_FULL >> $BUILD_DIR/Makefile
 echo >> $BUILD_DIR/Makefile
 helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile
 echo >> $BUILD_DIR/Makefile