changeset 42:dd2ad0037425

configure.sh: USE_CACHE mechanism implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 17 Oct 2020 09:23:31 +0000
parents 58b05205d579
children 01a8b04242af
files configure.sh
diffstat 1 files changed, 56 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/configure.sh	Sat Oct 17 08:57:26 2020 +0000
+++ b/configure.sh	Sat Oct 17 09:23:31 2020 +0000
@@ -142,6 +142,7 @@
 TI_PROFILER=0
 TRACEMASK_IN_FFS=0
 TR_BAUD_CONFIG=TR_BAUD_115200
+USE_CACHE=1
 USE_STR2IND=0
 
 SUFFIX=
@@ -192,6 +193,16 @@
 	LIBS="$LIBS $current_lib"
 }
 
+cache_lib() {
+	if [ $# != 1 ]
+	then
+		echo "Error: cache_lib takes 1 argument" 1>&2
+		exit 1
+	fi
+	current_lib="../cache/$1.lib"
+	LIBS="$LIBS $current_lib"
+}
+
 lib_link_magic() {
 	if [ $# != 1 ]
 	then
@@ -227,7 +238,12 @@
 SPECIAL_LINK_LIBS=
 current_lib=
 
-build_lib ccddata
+if [ "$USE_CACHE" = 1 ]
+then
+	cache_lib ccddata
+else
+	build_lib ccddata
+fi
 
 # ACI libs
 build_lib aci
@@ -307,13 +323,39 @@
 build_lib gdi
 
 # GPF
-build_lib ccd
-build_lib frame_fl
-build_lib frame_ir
+
+if [ "$USE_CACHE" = 1 -a "$MEMSUPER" = 0 ]
+then
+	cache_lib ccd_na7_db
+elif [ "$USE_CACHE" = 1 -a "$MEMSUPER" = 2 ]
+then
+	cache_lib ccd_na7_db_ps
+else
+	build_lib ccd
+fi
+
+if [ "$USE_CACHE" = 1 -a "$MEMSUPER" = 0 -a "$OSL" = 0 ]
+then
+	cache_lib frame_na7_db_fl
+	cache_lib frame_na7_db_ir
+elif [ "$USE_CACHE" = 1 -a "$MEMSUPER" = 2 -a "$OSL" = 0 ]
+then
+	cache_lib frame_na7_db_ps_fl
+	cache_lib frame_na7_db_ps_ir
+else
+	build_lib frame_fl
+	build_lib frame_ir
+fi
 lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))'
 
-build_lib misc_fl
-build_lib misc_ir
+if [ "$USE_CACHE" = 1 ]
+then
+	cache_lib misc_na7_db_fl
+	cache_lib misc_na7_db_ir
+else
+	build_lib misc_fl
+	build_lib misc_ir
+fi
 lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))'
 
 if [ "$OSX" = 1 -o "$MEMSUPER" != 0 ]
@@ -385,8 +427,14 @@
 lib_link_magic '(CONST_BOOT_LIB (.const, .text, .text:v$3) BSS_BOOT_LIB (.bss))'
 
 # Nucleus
-build_lib nucleus_flash
-build_lib nucleus_intram
+if [ "$USE_CACHE" = 1 ]
+then
+	cache_lib nucleus_flash
+	cache_lib nucleus_intram
+else
+	build_lib nucleus_flash
+	build_lib nucleus_intram
+fi
 lib_link_magic '(BSS_LIBS (.bss) CONST_LIBS (.text, .const))'
 
 # TI's libc/libgcc equivalent