我有一台运行 Ubuntu 12.04 LTS 的服务器。
我想将服务器用于为 Android ARMv6 平台构建 Qt5。如何在 headless 服务器上执行此操作?
最佳答案
在 Ubuntu 12.04 LTS 上编译 Qt5 for Android 所需的步骤如下所述。为了方便起见,我假设以下所有命令都在目录 /opt/qt5-android
中运行。如果不是这种情况,您将需要相应地调整路径。
首先,您需要确保安装了适当的软件包:
sudo apt-get install build-essential openjdk-6-jdk
获取最新的 Android SDK:
wget http://dl.google.com/android/android-sdk_r21.1-linux.tgz tar -xf android-sdk_r21.1-linux.tgz
SDK 不附带任何平台,因此您需要获取它们:
android-sdk-linux/tools/android update sdk --no-ui
获取最新版本的 NDK:
32 位 (i686):
wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2 tar -xf android-ndk-r8e-linux-x86.tar.bz2
64 位 (amd64):
wget http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2 tar -xf android-ndk-r8e-linux-x86_64.tar.bz2
现在克隆以下 Git 存储库:
git clone git://gitorious.org/qt/qt5.git qt5 cd qt5 perl init-repository --no-webkit
我们快到了。现在我们需要
配置
和制作
Qt5:./configure \ -developer-build \ -xplatform android-g++ \ -nomake tests \ -nomake examples \ -android-ndk /opt/qt5-android/android-ndk-r8e \ -android-sdk /opt/qt5-android/android-sdk-linux \ -skip qttools \ -skip qttranslations \ -skip qtwebkit \ -skip qtserialport \ -skip qtwebkit-examples-and-demos make
就是这样!您现在应该会得到一个适用于 Android 的 Qt5 版本。
引用资料:
关于android - 如何为 Android 构建 Qt5?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16313314/