1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- systemname=`uname -a`
- 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
- OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1804")
- fi
- result=$(echo $systemname | grep "${ubuntu1604}")
- if [ "$result" != "" ]
- then
- OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1604")
- fi
-
- result=$(echo $systemname | grep "${ubuntu2004}")
- if [ "$result" != "" ]
- then
- OSDEFINFO=$(echo "DEFINES += SYSTEM_UBUNTU1804")
- fi
-
- fi
- fi
- if [ -f "systemdef.pri" ]; then
- OLDOSDEFINFO=$(sed -n '/DEFINES += SYSTEM/p' systemdef.pri)
- 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
|