我有一台运行Ubuntu 12.04 LTS的服务器。
我想让服务器使用构建Qt5用于Android ARMv6平台。如何在无头服务器上进行此操作?
我有一台运行Ubuntu 12.04 LTS的服务器。
我想让服务器使用构建Qt5用于Android ARMv6平台。如何在无头服务器上进行此操作?
在Ubuntu 12.04 LTS上为Android编译Qt5所需的步骤如下所述。为方便起见,我假设下面的所有命令都在目录中运行 /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
我们快到了。现在我们需要 configure
和 make
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版本。
参考文献:
我不是故意回答另一个答案,但这是我的第一篇文章:-(我认为这使我无法在评论中发布这个帖子。 (所以认为它是对所述答案的引用,而不是对它的回复) 内森自己的回答并不适合我。
我的配置行看起来更像是这样:
./configure \
-developer-build -platform linux-g++-64 \
-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 \
-android-ndk-host linux-x86_64
原因如下:
-skip qtwebkit-examples-and-demos
在配置中导致错误...它不喜欢我正在跳过无法构建的东西(对不起,我丢失了确切的错误消息)
-android-ndk-host linux-x86_64
停止配置从中止“
Can not detect the android host. Please use -android-ndk-host option to specify one
“
-platform linux-g++-64
关于configure是否会添加,我是否是偏执狂 -m64
旗帜或任何为我工作的魔法
除了这种差异,内森的手术似乎有点像魅力。我现在的当地环境建设(感谢提示,奥斯曼先生:-)