]> sigrok.org Git - sigrok-util.git/commitdiff
sigrok-cross-android: Build Qt5
authorMarcus Comstedt <redacted>
Sat, 17 May 2014 10:54:45 +0000 (12:54 +0200)
committerUwe Hermann <redacted>
Mon, 25 Aug 2014 20:38:43 +0000 (22:38 +0200)
cross-compile/android/android-qt.patch
cross-compile/android/sigrok-cross-android

index 33ac8b2d8a958fd38faedb0aa0d5de188b5b8607..f284284f34188ae5413ca491370ed3ab3f4d8307 100644 (file)
@@ -1,61 +1,14 @@
-diff --git a/android/androidconfigbuild.sh b/android/androidconfigbuild.sh
-index 12ad414..b78f907 100755
---- a/android/androidconfigbuild.sh
-+++ b/android/androidconfigbuild.sh
-@@ -281,7 +281,7 @@ then
-       $SRC_DIR_QT/configure -v -opensource -qpa -arch $ANDROID_ARCHITECTURE \
-               -no-phonon -freetype -fast -xplatform android-g++ \
--              -host-arch i386 $PLATFORM -host-little-endian \
-+              $PLATFORM \
-               -little-endian -no-qt3support -no-largefile \
-               -openssl -pch \
-               -nomake demos -no-multimedia -nomake examples -confirm-license \
-diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
-index db28cb6..bc8802f 100644
---- a/mkspecs/android-g++/qmake.conf
-+++ b/mkspecs/android-g++/qmake.conf
-@@ -74,8 +74,8 @@ ANDROID_PLATFORM_PATH  = $$ANDROID_PLATFORM_ROOT_PATH/usr
- QMAKE_ANDROID_PLATFORM_INCDIR = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/usr/include
- QMAKE_ANDROID_PLATFORM_LIBDIR = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/usr/lib
--ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl$$ANDROID_CXXSTL_SUFFIX/gnu-libstdc++/libs/$$ANDROID_TARGET_ARCH
--ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl$$ANDROID_CXXSTL_SUFFIX/gnu-libstdc++/include $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
-+ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH
-+ANDROID_SOURCES_CXX_STL_INCDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/include $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
- # modifications to g++.conf
- QMAKE_CC                = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-gcc
-@@ -159,7 +159,7 @@ QMAKE_LFLAGS_NOUNDEF    =  -Wl,--no-undefined
- QMAKE_LFLAGS_RPATH      =  -Wl,-rpath=
--QMAKE_LIBS              = -lstdc++ -lsupc++ -llog -lz -lm -ldl -lc -lgcc
-+QMAKE_LIBS              = -lgnustl_shared -lstdc++ -lsupc++ -llog -lz -lm -ldl -lc -lgcc
- QMAKE_LIBS_X11          =
- QMAKE_LIBS_X11SM        =
- QMAKE_LIBS_QT_THREAD    =
-diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
-index 9309db1..1df9f06 100644
---- a/src/tools/moc/moc.cpp
-+++ b/src/tools/moc/moc.cpp
-@@ -525,12 +525,18 @@ void Moc::parse()
-             case NAMESPACE: {
-                 int rewind = index;
-                 if (test(IDENTIFIER)) {
-+                  QByteArray name = lexem();
-+                  if (index + 1 < symbols.size() && symbols.at(index).token == IDENTIFIER &&
-+                      symbols.at(index).lexem() == "_GLIBCXX_VISIBILITY" &&
-+                      symbols.at(index+1).token == LPAREN) {
-+                      until(RPAREN);
-+                  }
-                     if (test(EQ)) {
-                         // namespace Foo = Bar::Baz;
-                         until(SEMIC);
-                     } else if (!test(SEMIC)) {
-                         NamespaceDef def;
--                        def.name = lexem();
-+                        def.name = name;
-                         next(LBRACE);
-                         def.begin = index - 1;
-                         until(RBRACE);
+diff --git a/qtbase/mkspecs/features/qt_common.prf b/qtbase/mkspecs/features/qt_common.prf
+--- a/qtbase/mkspecs/features/qt_common.prf    2014-05-16 18:41:54.964880350 +0200
++++ b/qtbase/mkspecs/features/qt_common.prf    2014-05-16 18:44:21.529590747 +0200
+@@ -56,7 +56,9 @@
+             QMAKE_CXXFLAGS += -Wno-error=strict-overflow
+             # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
+-            android: QMAKE_CXXFLAGS += -Wno-error=literal-suffix
++            contains(ver, "4\\.8") {
++                android: QMAKE_CXXFLAGS += -Wno-error=literal-suffix
++            }
+         }
+     }
+     unset(ver)
index 130afda5494bad44ef70c4f5b194e058f700afd7..5e08bda3fc69fd593ddc9147ad3e2bc506e69504 100755 (executable)
@@ -63,7 +63,7 @@ VER_LIBFTDI1=1.1
 VER_LIBUSBX=1.0.17
 VER_PYTHON=3.3.3
 VER_BOOST=1.55.0
-VER_QT=n0.31
+VER_QT=5.2.1
 
 SF_MIRROR=switch.dl.sourceforge.net
 
@@ -271,11 +271,12 @@ if [ -z "$ANDROID_NDK" -o ! -d "$ANDROID_NDK" ]; then
   exit 0
 fi
 
-if [ -z "$ANDROID_SDK" -o ! -d "$ANDROID_SDK"/platforms/android-4 -o \
-     ! -d "$ANDROID_SDK"/platforms/android-7 -o \
-     ! -d "$ANDROID_SDK"/platforms/android-8 -o \
-     ! -d "$ANDROID_SDK"/platforms/android-14 ]; then
-  echo "Android SDK with platforms 4 7 8 14 not available, not building PulseView"
+if [ -z "$ANDROID_SDK" -o ! -d "$ANDROID_SDK"/platforms/android-8 -o \
+     ! -d "$ANDROID_SDK"/platforms/android-10 -o \
+     ! -d "$ANDROID_SDK"/platforms/android-11 -o \
+     ! -d "$ANDROID_SDK"/platforms/android-14 -o \
+     ! -d "$ANDROID_SDK"/platforms/android-16 ]; then
+  echo "Android SDK with platforms 8 10 11 14 16 not available, not building PulseView"
   exit 0
 fi
 
@@ -302,10 +303,13 @@ echo "using gcc : $NDK_TOOLCHAIN_VERSION : \"${TOOLCHAIN_TRIPLET}-g++\" : <cxxfl
 cd ..
 
 # qt (needed for PulseView)
-$GIT_CLONE -b $VER_QT git://anongit.kde.org/android-qt.git
-cd android-qt
+$WGET http://download.qt-project.org/official_releases/qt/${VER_QT%.*}/${VER_QT}/single/qt-everywhere-opensource-src-${VER_QT}.tar.gz
+tar xfz qt-everywhere-opensource-src-${VER_QT}.tar.gz
+cd qt-everywhere-opensource-src-${VER_QT}
 patch -p1 < ../../android-qt.patch
-ANDROID_SDK_PLATFORM_TOOLS_PATH=$ANDROID_BUILD_TOOLS ANDROID_SDK_TOOLS_PATH=$ANDROID_TOOLS ./android/androidconfigbuild.sh -n $ANDROID_NDK -a $TARGET_ARCH -l 14 -q 1 -d 1 -i $PREFIX -k 1 -o $NDK_HOST -v $NDK_TOOLCHAIN_VERSION
+./configure --prefix="$PREFIX" -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-sdk "$ANDROID_SDK" -android-ndk "$ANDROID_NDK" -android-ndk-host "$NDK_HOST" -android-arch "$TARGET_ARCH" -android-toolchain-version "$NDK_TOOLCHAIN_VERSION" -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -opensource -confirm-license
+make $PARALLEL
+make install
 cd ..
 
 # PulseView