systemname=`uname -a` #echo $systemname OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1804") ubuntu1804="18.04." ubuntu1604="16.04." ubuntu2004="20.04." resultos=$(echo $systemname | grep "tegra") if [ "$resultos" != "" ] then OSDEFINFO=$(echo "DEFINES += SYSTEM_AGX") else resultos=$(echo $systemname | grep "Ubuntu") if [ "$resultos" != "" ] then systemname=`lsb_release -a` result=$(echo $systemname | grep "${ubuntu1804}") if [ "$result" != "" ] then # echo "ubuntu 18.04" OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1804") fi result=$(echo $systemname | grep "${ubuntu1604}") if [ "$result" != "" ] then # echo "ubuntu 16.04" OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1604") fi result=$(echo $systemname | grep "${ubuntu2004}") if [ "$result" != "" ] then # echo "ubuntu 20.04" OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1804") # 20210930 parameters of 20.04 temporarily same as 18.04 fi fi fi if [ -f "systemdef.pri" ]; then # echo "file exist." OLDOSDEFINFO=$(sed -n '/DEFINES += SYSTEM/p' systemdef.pri) # echo "old:"$OLDOSDEFINFO if [ ! "$OSDEFINFO"x = "$OLDOSDEFINFO"x ]; then echo "replace DEFINES in systemdef.pri" sed -i "s/^.*DEFINES += SYSTEM.*$/$OSDEFINFO/" systemdef.pri fi else echo "systemdef.pri not exist." echo $OSDEFINFO >> systemdef.pri fi