[TCT][Scripts][Non-ACR] Added support for dynamic gcc version selection 54/323754/2
authorTarun Kumar <tarun1.kumar@samsung.com>
Wed, 7 May 2025 06:48:56 +0000 (12:18 +0530)
committerTarun Kumar <tarun1.kumar@samsung.com>
Wed, 7 May 2025 09:00:31 +0000 (14:30 +0530)
Change-Id: I5f57f84bc49c12a03ece0625c65ad015dec32efd
Signed-off-by: Tarun Kumar <tarun1.kumar@samsung.com>
scripts_tpk/tpk_create.sh

index 769d36f3be9e37235b7f9530ae30cf553ef30baa..d758a33266447b56ca79399915af24bdf568ab6e 100755 (executable)
@@ -653,6 +653,30 @@ checkRootstrap() {
        fi
 }
 
+getLatestGccVersion() {
+       # Base path
+       base_path="/home"
+       # Get the list of users
+       users=$(ls $base_path)
+       for user in $users; do
+               user_path="$base_path/$user/tizen-studio/tools/"
+               # Check if the directory exists
+               if [ -d "$user_path" ]; then
+                       highest_version=$(ls -d "$user_path"/*gcc-* | grep 'gcc-' | sed 's/.*gcc-//' | sort -V | tail -n 1)
+                       echo "Highest GCC version is $highest_version"
+                       COMPILER_TYPE="gcc-$highest_version"
+                       echo $COMPILER_TYPE
+               else
+                       echo "Directory $user_path does not exist."
+               fi
+       done
+       if [ -z "$COMPILER_TYPE" ]; then
+               echo "No GCC version found."
+               return
+       fi
+}
+
+
 TESTCASE_TYPE="$1"
 MODULE_NAME="$2"
 TIZENIOTMODULENAME="$2"
@@ -681,7 +705,8 @@ fi
 
 # build command properties
 #COMPILER_TYPE="llvm"
-COMPILER_TYPE="gcc-14.1"
+COMPILER_TYPE=""
+getLatestGccVersion
 BUILD_TYPE="Debug"
 UNSUPPORTED_FILE="tct_unsupported.txt"