sedrp.sh 1.1 KB

12345678910111213141516171819202122
  1. if [ "$#" -lt 1 ]; then
  2. echo "没有输入"
  3. echo "$1"
  4. exit
  5. fi
  6. HOSTQTLIB='/opt/qt/5.10.1/gcc_64/lib' #当前qt环境的lib目录
  7. RPATH='/home/root/ADS/lib' #运行依赖库的路径,目标板的qt库配置到该路径
  8. DEVICEQTLIB='/home/yuchuli/tem/qtbase-everywhere-src-5.10.1/lib' #qt的lib路径
  9. gccdir='/home/yuchuli/armgcc/surround_os/gcc-linaro-6.3.1/bin/aarch64-linux-gnu-gcc' #交叉编译的gcc路径
  10. gppdir='/home/yuchuli/armgcc/surround_os/gcc-linaro-6.3.1/bin/aarch64-linux-gnu-g++' #交叉编译的g++路径
  11. protoincdir='/home/yuchuli/tem/proto/protobuf-3.0.2/src' #交叉编译的protobuf路径
  12. yamlinc='/home/yuchuli/tem/yaml-cpp/include' #yaml include路径
  13. yamllib='/home/yuchuli/tem/yaml-cpp/build' #ymal lib路径
  14. sed -i "s:CC = gcc:CC = ${gccdir}:g" $1
  15. sed -i "s:CXX = g++:CXX = ${gppdir}:g" $1
  16. sed -i "s:LINK = g++:LINK = ${gppdir}:g" $1
  17. sed -i "s:INCPATH =:INCPATH =-I${protoincdir} -I${yamlinc} :g" $1
  18. sed -i "s:-rpath,${HOSTQTLIB}:-rpath,${RPATH}:g" $1
  19. sed -i "s:LIBS = :LIBS = -L${DEVICEQTLIB} -L${yamllib} :g" $1