sigrok-cross-mingw: README: Freeze Qt5 to 5.7.x for Windows XP support.
[sigrok-util.git] / cross-compile / android / android.toolchain.cmake.patch
1 --- android.toolchain.cmake.orig        2014-04-06 16:08:25.765699476 +0200
2 +++ android.toolchain.cmake     2014-04-06 16:22:30.671987319 +0200
3 @@ -464,7 +464,7 @@
4   else()\r
5    execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version\r
6     OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )\r
7 -  string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )\r
8 +  string( REGEX MATCH "[0-9]+(\\.[0-9]+)+" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )\r
9   endif()\r
10  endif()\r
11  \r
12 @@ -667,7 +667,12 @@
13  if( BUILD_WITH_STANDALONE_TOOLCHAIN )\r
14   set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )\r
15   set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )\r
16 - set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )\r
17 + if (NOT DEFINED ANDROID_STL_PATH)\r
18 +   set( __stlLibPath "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )\r
19 + else()\r
20 +   set( __stlIncludePath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/include" )\r
21 +   set( __stlLibPath "${ANDROID_STL_PATH}/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}" )\r
22 + endif()\r
23  endif()\r
24  if( BUILD_WITH_ANDROID_NDK )\r
25   set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )\r
26 @@ -732,6 +737,9 @@
27  if( __stlIncludePath AND EXISTS "${__stlIncludePath}" )\r
28   list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlIncludePath}" )\r
29  endif()\r
30 +if( __stlLibPath AND EXISTS "${__stlLibPath}/include" )\r
31 + list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${__stlLibPath}/include" )\r
32 +endif()\r
33  \r
34  # c++ bits includes\r
35  if( __stlLibPath AND EXISTS "${__stlLibPath}/include" )\r
36 @@ -873,7 +881,10 @@
37    set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> \"${__stlLibPath}/libstlport_static.a\"")\r
38   endif()\r
39  else( ANDROID_USE_STLPORT )\r
40 - if( EXISTS "${__stlLibPath}/libgnustl_static.a" )\r
41 + if( EXISTS "${__stlLibPath}/libgnustl_shared.so" )\r
42 +    list( APPEND ANDROID_SYSTEM_LIB_DIRS "${__stlLibPath}" )\r
43 +    set(CMAKE_CXX_STANDARD_LIBRARIES "-lgnustl_shared")\r
44 + elseif( EXISTS "${__stlLibPath}/libgnustl_static.a" )\r
45    __COPY_IF_DIFFERENT( "${__stlLibPath}/libgnustl_static.a" "${__ndklibspath}/libstdc++.a" )\r
46   elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )\r
47    __COPY_IF_DIFFERENT( "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" "${__ndklibspath}/libstdc++.a" )\r