1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
#
# qmake configuration for building with arm-linux-g++
#
include(g++-unix.conf)
include(linux.conf)
include(qws.conf)
# NDK_ROOT should be defined for qmake
# NDK_HOST should be defined for qmake
# NDK_ABI optionally can be defined to armeabi, armeabi-v7a, mips or x86, by default armeabi will be used
ANDROID_TARGET_ABI=$$(NDK_ABI)
# by default use armv5 architecture
isEmpty( ANDROID_TARGET_ABI ): ANDROID_TARGET_ABI = armeabi
ANDROID_PLATFORM = android-5
TOOLCHAIN_VERSION = 4.6
contains(ANDROID_TARGET_ABI, x86) {
NDK_TOOLCHAIN = x86-$$TOOLCHAIN_VERSION
ANDROID_TARGET_ARCH = x86
ANDROID_CC_PREFIX = i686-linux-android
# NOTE: x86 works only from android-9 and above!
ANDROID_PLATFORM = android-9
} else {
contains(ANDROID_TARGET_ABI, mips) {
NDK_TOOLCHAIN = mipsel-linux-android-$$TOOLCHAIN_VERSION
ANDROID_TARGET_ARCH = mips
ANDROID_CC_PREFIX = mipsel-linux-android
# NOTE: mips works only from android-9 and above!
ANDROID_PLATFORM = android-9
} else {
NDK_TOOLCHAIN = arm-linux-androideabi-$$TOOLCHAIN_VERSION
ANDROID_TARGET_ARCH = arm
ANDROID_CC_PREFIX = arm-linux-androideabi
}
}
NDK_TOOLCHAIN_PATH=$$(NDK_ROOT)/toolchains/$$NDK_TOOLCHAIN/prebuilt/$$(NDK_HOST)
CONFIG += $$ANDROID_PLATFORM
ANDROID_PLATFORM_ROOT_PATH = $$(NDK_ROOT)/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_TARGET_ARCH
ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr
ANDROID_SOURCES_CXX_STL_LIBDIR = $$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$$TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ABI
ANDROID_SOURCES_CXX_STL_INCDIR = $$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$$TOOLCHAIN_VERSION/include $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
QMAKE_CC = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-gcc
QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -ffunction-sections -fdata-sections -fomit-frame-pointer -DANDROID -Wno-psabi
#QMAKE_CFLAGS += -funwind-tables
QMAKE_CFLAGS_DEBUG += -fstack-protector -O0 -g
QMAKE_CFLAGS_RELEASE += -O3
contains(ANDROID_TARGET_ARCH, arm) {
QMAKE_CFLAGS += -fpic -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -mthumb -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack
contains(ANDROID_TARGET_ABI, armeabi-v7a): QMAKE_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
else: QMAKE_CFLAGS += -march=armv5te -mtune=xscale -msoft-float
} else {
contains(ANDROID_TARGET_ARCH, mips) {
QMAKE_CFLAGS += -fpic -fno-strict-aliasing -finline-functions -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -Wno-psabi -fomit-frame-pointer -funswitch-loops -finline-limit=300 -Wa,--noexecstack
} else {
# x86 options
QMAKE_CFLAGS += -fstrict-aliasing -finline-limit=300 -funswitch-loops
}
}
QMAKE_CFLAGS_WARN_ON = -Wall -W
QMAKE_CFLAGS_WARN_OFF =
QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden
QMAKE_CXX = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS += -frtti -fexceptions
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_LINK
# modifications to linux.conf
QMAKE_AR = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-ar cqs
QMAKE_OBJCOPY = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX_PREFIX-objcopy
# don't strip the files!
QMAKE_STRIP = # $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-strip
QMAKE_RANLIB = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_CC_PREFIX-ranlib
QMAKE_INCDIR = $$ANDROID_PLATFORM_PATH/include $$ANDROID_SOURCES_CXX_STL_INCDIR
QMAKE_LIBDIR = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$ANDROID_PLATFORM_PATH/lib
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
QMAKE_INCDIR_OPENGL = $$ANDROID_PLATFORM_PATH/include
QMAKE_LIBDIR_OPENGL = $$ANDROID_PLATFORM_PATH/lib
QMAKE_INCDIR_QTOPIA =
QMAKE_LIBDIR_QTOPIA =
#LIBGCC_PATH = $$system($$QMAKE_CC -mthumb-interwork -print-libgcc-file-name | xargs dirname)
#LIBSTDCPP_PATH = $$system($$QMAKE_CC -mthumb-interwork -print-file-name=libstdc++.a | xargs dirname)
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
#QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -L$$LIBGCC_PATH -Wl,-rpath-link=$$ANDROID_PLATFORM_PATH/lib
QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH -Wl,-rpath-link=$$ANDROID_PLATFORM_PATH/lib
QMAKE_LFLAGS_APP =
QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME =
#-Wl,-soname,
#QMAKE_LFLAGS_THREAD =
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=/system/lib
QMAKE_LIBS = -lstdc++ -lsupc++ -llog -lz -lm -ldl -lc -lgcc
QMAKE_LIBS_X11 =
QMAKE_LIBS_X11SM =
QMAKE_LIBS_QT_THREAD =
QMAKE_LIBS_QT_OPENGL =
QMAKE_LIBS_QTOPIA =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_EGL =
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_OPENGL_QT =
QMAKE_LIBS_OPENGL_ES1 = -lGLESv1_CM
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $$QMAKE_LIBS
load(qt_config)
|