mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-16 14:11:10 +08:00
fix[build]: Avoid exporting toolchain to system PATH
Change-Id: Ic85b4a20df81d4a430ca9563d3555e38cfe97338 Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:

committed by
Herman Chen

parent
3ea5eb5a51
commit
975a0b3e69
@@ -1,14 +1,9 @@
|
||||
|
||||
cmake_minimum_required( VERSION 2.6.3 )
|
||||
|
||||
if(NOT TOOLCHAIN)
|
||||
set(TOOLCHAIN "aarch64-linux-gnu-")
|
||||
endif()
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_C_COMPILER "${TOOLCHAIN}gcc")
|
||||
SET(CMAKE_CXX_COMPILER "${TOOLCHAIN}g++")
|
||||
#SET(CMAKE_SYSTEM_PROCESSOR "armv7-a")
|
||||
SET(CMAKE_SYSTEM_PROCESSOR "armv8-a")
|
||||
|
||||
add_definitions(-fPIC)
|
||||
|
@@ -5,21 +5,30 @@ set +e
|
||||
|
||||
MPP_PWD=`pwd`
|
||||
MPP_TOP=${MPP_PWD}/../../..
|
||||
DEFAULT_TOOLCHAIN=aarch64-linux-gnu-
|
||||
|
||||
# toolchain detection
|
||||
check_cmd(){
|
||||
"$@" >> /dev/null 2>&1
|
||||
}
|
||||
check_system_arm_linux_gcc(){
|
||||
check_cmd aarch64-linux-gnu-gcc -v
|
||||
check_gcc(){
|
||||
check_cmd ${TOOLCHAIN}gcc -v
|
||||
}
|
||||
|
||||
source ../opt_proc.sh
|
||||
|
||||
check_system_arm_linux_gcc
|
||||
if [ -z "${TOOLCHAIN}" ]; then
|
||||
echo "Using system ${DEFAULT_TOOLCHAIN} as toolchain."
|
||||
TOOLCHAIN=$DEFAULT_TOOLCHAIN
|
||||
fi
|
||||
|
||||
check_gcc
|
||||
|
||||
if [ $? -eq 127 ];then
|
||||
MPP_TOOLCHAIN=/usr/bin
|
||||
export PATH=$PATH:${MPP_TOOLCHAIN}
|
||||
echo -e "\e[31m${TOOLCHAIN}gcc is not found!\e[0m"
|
||||
echo -e "Please specify valid toolchain path and it's prefix to variable 'TOOLCHAIN' with argument --toolchain."
|
||||
echo -e "For example:\n \t./make-Makefiles.bin --toolchain /path-to-toolchain/arm-linux-gnueabi-"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# generate Makefile
|
||||
|
@@ -1,10 +1,6 @@
|
||||
|
||||
cmake_minimum_required( VERSION 2.6.3 )
|
||||
|
||||
if(NOT TOOLCHAIN)
|
||||
set(TOOLCHAIN "arm-linux-gnueabi-")
|
||||
endif()
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_C_COMPILER "${TOOLCHAIN}gcc")
|
||||
SET(CMAKE_CXX_COMPILER "${TOOLCHAIN}g++")
|
||||
|
@@ -5,21 +5,30 @@ set +e
|
||||
|
||||
MPP_PWD=`pwd`
|
||||
MPP_TOP=${MPP_PWD}/../../..
|
||||
DEFAULT_TOOLCHAIN=arm-linux-gnueabi-
|
||||
|
||||
# toolchain detection
|
||||
check_cmd(){
|
||||
"$@" >> /dev/null 2>&1
|
||||
}
|
||||
check_system_arm_linux_gcc(){
|
||||
check_cmd arm-linux-gcc -v
|
||||
check_gcc(){
|
||||
check_cmd ${TOOLCHAIN}gcc -v
|
||||
}
|
||||
|
||||
source ../opt_proc.sh
|
||||
|
||||
check_system_arm_linux_gcc
|
||||
if [ -z "${TOOLCHAIN}" ]; then
|
||||
echo "Using system ${DEFAULT_TOOLCHAIN} as toolchain."
|
||||
TOOLCHAIN=$DEFAULT_TOOLCHAIN
|
||||
fi
|
||||
|
||||
check_gcc
|
||||
|
||||
if [ $? -eq 127 ];then
|
||||
MPP_TOOLCHAIN=${MPP_TOP}/../prebuilts/toolschain/usr/bin
|
||||
export PATH=$PATH:${MPP_TOOLCHAIN}
|
||||
echo -e "\e[31m${TOOLCHAIN}gcc is not found!\e[0m"
|
||||
echo -e "Please specify valid toolchain path and it's prefix to variable 'TOOLCHAIN' with argument --toolchain."
|
||||
echo -e "For example:\n \t./make-Makefiles.bin --toolchain /path-to-toolchain/arm-linux-gnueabi-"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# generate Makefile
|
||||
|
Reference in New Issue
Block a user