Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0
-
None
-
Ubuntu 14.04 64bit, android-ndk-r11b-linux-x86_64
-
798b09ffe61b6b7f490b7d530f0e89501bbc89fd
Description
To compile Qt 5.6 with Android NDK, I wrote a script (qtandroid.sh).
everything goes fine till the configuration step, here is how it looks :
./configure \
-opensource -confirm-license \
-release \
-xplatform ${QMAKESPEC} \
-nomake tests -nomake examples \
-android-ndk ${ANDROID_NDK_ROOT} \
-android-sdk ${ANDROID_SDK_ROOT} \
-android-ndk-host ${ANDROID_NDK_HOST} \
-android-toolchain-version ${ANDROID_NDK_TOOLCHAIN_VERSION} \
-skip qttranslations -skip qtserialport \
-no-warnings-are-errors \
-prefix ${QT_ANDROID_ARM} \
&& make -j6 && make install \
&& echo "y" | rm -rf /tmp/qt_src
here is the error I got :
Running configuration tests (phase 1)...
Done running configuration tests.
Creating qmake...
./bin/sh: 1: ANDROID_NDK_TOOLCHAIN_PREFIX: not found
/bin/sh: 1: ANDROID_NDK_TOOLCHAIN_VERSION: not found
/bin/sh: 1: ANDROID_NDK_HOST: not found
/bin/sh: 1: ANDROID_NDK_TOOLS_PREFIX: not found
/bin/sh: 1: /tmp/android_ndk/toolchains/-/prebuilt//bin/-g++: not found
make: *** [project.o] Erreur 127
While investigating, I found out that the Makefile was not well generated.
CC = /tmp/android_ndk/toolchains/$$(ANDROID_NDK_TOOLCHAIN_PREFIX)-$$(ANDROID_NDK_TOOLCHAIN_VERSION)/prebuilt/$$(ANDROID_NDK_HOST)/bin/$$(ANDROID_NDK_TOOLS_PREFIX)-gcc CXX = /tmp/android_ndk/toolchains/$$(ANDROID_NDK_TOOLCHAIN_PREFIX)-$$(ANDROID_NDK_TOOLCHAIN_VERSION)/prebuilt/$$(ANDROID_NDK_HOST)/bin/$$(ANDROID_NDK_TOOLS_PREFIX)-g++ QMAKE_CFLAGS = -pipe QMAKE_CFLAGS_SPLIT_SECTIONS = -ffunction-sections QMAKE_CXXFLAGS = -pipe -std=c++11 QMAKE_CXXFLAGS_SPLIT_SECTIONS = -ffunction-sections QMAKE_LFLAGS = --sysroot=/tmp/android_ndk/platforms/$$(ANDROID_NDK_PLATFORM)/arch-/ QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections ...
So make can't interpret $$( )
But when I modified mkspec/android-g++/qmake.conf by replacing all $$( ) with ${ } , make can now interpret the Makefile without the previously mentioned error.
But yet, it's doesn't configure successfully as now I have error related to missing headers that are in NDK.
In file included from /tmp/qt_src/qtbase/include/QtCore/qglobal.h:1:0, from /tmp/qt_src/qtbase/qmake/library/qmake_global.h:37, from /tmp/qt_src/qtbase/qmake/library/qmakeparser.h:37, from /tmp/qt_src/qtbase/qmake/library/qmakeevaluator.h:41, from /tmp/qt_src/qtbase/qmake/project.h:37, from /tmp/qt_src/qtbase/qmake/project.cpp:34: /tmp/qt_src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:39:21: fatal error: cstddef: No such file or directory # include <cstddef>
the source of this problem is that :
QMAKE_INCDIR = $$ANDROID_SOURCES_CXX_STL_INCDIR $$QMAKE_ANDROID_PLATFORM_INCDIR QMAKE_LIBDIR = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$QMAKE_ANDROID_PLATFORM_LIBDIR $$LIBGCC_PATH
are not added to the Makefile. At the end of the qmake.conf they are stored in :
QMAKE_DEFAULT_LIBDIRS = $$QMAKE_LIBDIR QMAKE_DEFAULT_INCDIRS = $$QMAKE_INCDIR
But in qtbase/qmake/configure (~ line 4006) they are not added when generating the Makefile
These problems were generated in my local machine and also in a docker image having Ubuntu 14.04.4 as base image.
here is the log https://hub.docker.com/r/theshadowx/dockerfile_tests/builds/bqldh8zikrxjxzj577hbaoh/