###交叉编译qt

  • 安装系统

# linux使用qemu搭配kvm
# 配置本地通信的虚拟网络

# 英文语言
# minimal 安装,且不 download updates
# 全盘安装并使用lvm

# 安装之后进入系统,启动网络
sudo apt install openssh-server
# 查看ip,用ssh连进来
ssh [email protected]
# 关闭防火墙
sudo ufw disable

# 为了方便编码和在线的terminal可以部署code-server
wget https://ghproxy.com/https://github.com/coder/code-server/releases/download/v4.7.0/code-server-4.7.0-linux-amd64.tar.gz
# 解压
tar xf code-server-4.7.0-linux-amd64.tar.gz
# 无密码运行
./code-server-4.7.0-linux-amd64/bin/code-server --auth=none --bind-addr=0.0.0.0:8080
# 访问
http://192.168.33.3:8080
# 换源,只保留4个即可 /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

# 32位兼容层
sudo apt install -y lib32ncurses5 lib32z1
# jcleng@jcleng-pc:~/mipseltools-gcc412-lnx26/bin$ mipsel-linux-gcc --version
# mipsel-linux-gcc (GCC) 4.1.2
# Copyright (C) 2006 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# jcleng@jcleng-pc:~/mipseltools-gcc412-lnx26/bin$ mipsel-linux-g++ --version
# mipsel-linux-g++ (GCC) 4.1.2
# Copyright (C) 2006 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  • 静态编译安装qt

wget https://download.qt.io/archive/qt/4.6/qt-everywhere-opensource-src-4.6.0.tar.gz

tar xf qt-everywhere-opensource-src-4.6.0.tar.gz
cd qt-everywhere-opensource-src-4.6.0/
# 交叉环境 放到环境变量,并重新登录
export PATH=$PATH:/home/jcleng/mipseltools-gcc412-lnx26/bin
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jcleng/mipseltools-gcc412-lnx26/lib

# 修改对应bin的名称
mkspecs/qws/linux-mips-g++/qmake.conf
# 初始化
./configure --help

./configure -v -prefix /home/jcleng/qt-everywhere-opensource-src-4.6.0 \
-force-pkg-config \
-static \
-release \
-opensource \
-confirm-license \
-xplatform \
qws/linux-mips-g++ \
-no-accessibility \
-no-dbus \
-no-openssl \
-no-opengl \
-no-glib \
-no-iconv \
-no-pch \
-verbose