Merge remote-tracking branch 'upstream/tags/v4.8.0-rc1' into experimental
[qt:android-lighthouse.git] / mkspecs / features / qt.prf
1 CONFIG *= moc thread
2
3 #handle defines
4 win32 {
5    qt_static:DEFINES += QT_NODLL
6    !contains(DEFINES, QT_NODLL) {
7       QT_ENV_DLL = $$(QT_DLL)
8       QT_ENV_NO_DLL = $$(QT_NODLL)
9       isEmpty(QT_ENV_NO_DLL) {
10           shared|!isEmpty(QT_ENV_DLL):DEFINES += QT_DLL
11       }
12       contains(DEFINES, QT_MAKEDLL)|contains(DEFINES, QT_DLL):QMAKE_QT_DLL = 1
13    }
14 }
15 CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
16 no_keywords:DEFINES += QT_NO_KEYWORDS
17 plugin { #Qt plugins
18    static:DEFINES += QT_STATICPLUGIN
19    DEFINES += QT_PLUGIN
20
21    # Triggers both on Qt being configured with -arch boundschecker,
22    # and if you qmake CONFIG+=boundchecker on your plugin project
23    boundschecker|contains(QT_CONFIG,boundschecker) {
24       # This option is added for plugins when Qt is configured for Boundschecker,
25       # since we want Boundschecker to not instrument the qt_plugin_query_verification_data
26       # function, as we call that function without the plugin's dependent DLLs, thus
27       # Boundscheckers instrumentation will fail. The function only returns a const char *,
28       # so no instrumentation is really needed on that function anyways.
29       QMAKE_CFLAGS += /nmignore:*:qt_plugin_query_verification_data
30       QMAKE_CXXFLAGS += /nmignore:*:qt_plugin_query_verification_data
31    }
32 }
33
34 #handle includes
35 INCLUDEPATH = $$QMAKE_INCDIR_QT $$INCLUDEPATH #prepending prevents us from picking up "stale" includes
36 win32:INCLUDEPATH += $$QMAKE_INCDIR_QT/ActiveQt
37
38 # As order does matter for static libs, we reorder the QT variable here
39 TMPLIBS = declarative webkit phonon multimedia dbus testlib script scripttools svg qt3support sql xmlpatterns xml egl opengl openvg gui network core meegographicssystemhelper android
40 for(QTLIB, $$list($$TMPLIBS)) {
41    contains(QT, $$QTLIB): QT_ORDERED += $$QTLIB
42 }
43
44 contains(CONFIG, android):!contains(QT_ORDERED, android): QT_ORDERED += android
45
46 QT_UNKNOWN = $$QT
47 QT_UNKNOWN -= $$QT_ORDERED
48 QT = $$QT_ORDERED
49 for(QTLIB, $$list($$QT_UNKNOWN)) {
50    !contains(TMPLIBS, $$QTLIB):message("Warning: unknown QT: $$QTLIB")
51 }
52
53 QT_PLUGIN_VERIFY = QTPLUGIN DEPLOYMENT_PLUGIN
54 for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
55     for(QTPLUG, $$list($$lower($$unique($$QT_CURRENT_VERIFY)))) {
56        qplugin_style =
57        !qt_debug:!qt_release {
58           CONFIG(debug, debug|release):qplugin_style = debug
59           else:qplugin_style = release
60        } else:CONFIG(qt_debug, qt_debug|qt_release) {
61           qplugin_style = debug
62        } else {
63           qplugin_style = release
64        }
65
66        # Check if the plugin is known to Qt. We can use this to determine
67        # the plugin path. Unknown plugins must rely on the default link path.
68        ACCESSIBLEPLUGINS = qtaccessiblewidgets qtaccessiblecompatwidgets
69        BEARERPLUGINS = qgenericbearer qnativewifibearer
70        CODECPLUGINS = qcncodecs qjpcodecs qkrcodecs qtwcodecs
71        DECORATIONPLUGINS = qdecorationdefault qdecorationstyled qdecorationwindows
72        GFXDRIVERPLUGINS = qgfxvnc qscreenvfb qgfxtransformed qgfxshadowfb qgfxpvregl qscreenlinuxfb qeglnullws qdirectfbscreen qahiscreen
73        GRAPHICSSYSTEMPLUGINS = qmeegographicssystem qglgraphicssystem qvggraphicssystem qshivavggraphicssystem
74        IMAGEPLUGINS = qgif qico qmng qjpeg qsvg qtiff
75        INPUTPLUGINS = qimsw-multi
76        KBDDRIVERPLUGINS = qlinuxinputkbddriver
77        MOUSEDRIVERPLUGINS = qtslibmousehandler qpcmousedriver qlinuxtpmousedriver
78        SQLPLUGINS = qsqldb2 qsqloci qsqltds qsqlodbc qsqlpsql qsqlibase qsqlmysql qsqlite2 qsqlite
79        PHONONPLUGINS = phonon_waveout phonon_ds9 phonon_gstreamer phonon_qt7 phonon_mmf
80
81        ALLQTPLUGINS = $$ACCESSIBLEPLUGINS $$BEARERPLUGINS $$CODECPLUGINS $$DECORATIONPLUGINS $$GFXDRIVERPLUGINS $$ GRAPHICSSYSTEMPLUGINS $$IMAGEPLUGINS $$INPUTPLUGINS $$KBDDRIVERPLUGINS $$MOUSEDRIVERPLUGINS $$SQLPLUGINS $$PHONONPLUGINS
82
83        QT_PLUGINPATH =
84        contains(ALLQTPLUGINS, $$QTPLUG) {
85            # Determine the plugin path
86            contains(ACCESSIBLEPLUGINS, $$QTPLUG): QT_PLUGINPATH = accessible
87            contains(BEARERPLUGINS, $$QTPLUG): QT_PLUGINPATH = bearer
88            contains(CODECPLUGINS, $$QTPLUG): QT_PLUGINPATH = codecs
89            contains(DECORATIONPLUGINS, $$QTPLUG): QT_PLUGINPATH = decorations
90            contains(GFXDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = gfxdrivers
91            contains(GRAPHICSSYSTEMPLUGINS, $$QTPLUG): QT_PLUGINPATH = graphicssystems
92            contains(IMAGEPLUGINS, $$QTPLUG): QT_PLUGINPATH = imageformats
93            contains(INPUTPLUGINS, $$QTPLUG): QT_PLUGINPATH = inputmethods
94            contains(KBDDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = kbddrivers
95            contains(MOUSEDRIVERPLUGINS, $$QTPLUG): QT_PLUGINPATH = mousedrivers
96            contains(SQLPLUGINS, $$QTPLUG):  QT_PLUGINPATH = sqldrivers
97            contains(PHONONPLUGINS, $$QTPLUG): QT_PLUGINPATH = phonon_backend
98         }
99
100         # Generate the plugin linker line
101         target_qt:isEqual(TARGET, QTPLUG) {
102             warning($$TARGET cannot have a QTPLUGIN of $$QTPLUG)
103         } else {
104             QT_LINKAGE = -l$${QTPLUG}
105             win32 {
106                CONFIG(debug, debug|release):QT_LINKAGE = -l$${QTPLUG}d
107             } else:mac {
108                isEqual(qplugin_style, debug):QT_LINKAGE = -l$${QTPLUG}_debug
109             }
110         }
111
112         # Only link against plugin in static builds
113         isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
114             !isEmpty(QT_PLUGINPATH): LIBS *= -L$$[QT_INSTALL_PLUGINS]/$$QT_PLUGINPATH
115                 LIBS += $$QT_LINKAGE
116             # if the plugin is linked statically there is no need to deploy it
117             DEPLOYMENT_PLUGIN -= $$QT_CURRENT_VERIFY
118         }
119         isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:wince*: {
120             QT_ITEM =
121             CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll
122             else: QT_ITEM = $${QTPLUG}4.dll
123
124             eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM})
125             eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
126
127             DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
128         }
129         isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:symbian: {
130             QT_ITEM = $${QTPLUG}.dll
131
132             eval(qt_additional_plugin_$${QTPLUG}.files = $${QT_ITEM})
133             eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
134
135             DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
136         }
137     }
138 }
139 #specific module settings
140 !isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs
141 QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT
142 for(QTLIB, $$list($$lower($$unique(QT)))) {
143    unset(qlib_style)
144    !qt_debug:!qt_release {
145       CONFIG(debug, debug|release):qlib_style = debug
146       else:qlib_style = release
147    } else:CONFIG(qt_debug, qt_debug|qt_release) {
148       qlib_style = debug
149    } else {
150       qlib_style = release
151    }
152
153    unset(qlib)
154    isEqual(QTLIB, gui):qlib = QtGui
155    else:isEqual(QTLIB, network):qlib = QtNetwork
156    else:isEqual(QTLIB, xml):qlib = QtXml
157    else:isEqual(QTLIB, xmlpatterns):qlib = QtXmlPatterns
158    else:isEqual(QTLIB, opengl):qlib = QtOpenGL
159    else:isEqual(QTLIB, openvg):qlib = QtOpenVG
160    else:isEqual(QTLIB, sql):qlib = QtSql
161    else:isEqual(QTLIB, core):qlib = QtCore
162    else:isEqual(QTLIB, canvas):qlib = QtCanvas
163    else:isEqual(QTLIB, qt3support):qlib = Qt3Support
164    else:isEqual(QTLIB, svg):qlib = QtSvg
165    else:isEqual(QTLIB, script):qlib = QtScript
166    else:isEqual(QTLIB, scripttools):qlib = QtScriptTools
167    else:isEqual(QTLIB, testlib):qlib = QtTest
168    else:isEqual(QTLIB, dbus):qlib = QtDBus
169    else:isEqual(QTLIB, phonon) {
170        qlib = phonon
171        INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat
172
173        # The Helix backend requires this. Since we can't let a plugin set it,
174        # we bump the values for all Symbian Phonon plugins.
175        symbian:isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x040000 0x1600000
176
177    } else:isEqual(QTLIB, webkit) {
178        qlib = QtWebKit
179        aix-xlc {
180            # Flags recommended by IBM when using WebKit
181            QMAKE_LFLAGS -= -bmaxdata:0x80000000
182            QMAKE_LFLAGS += -bmaxdata:0xD0000000/dsa
183        }
184    } else:isEqual(QTLIB, declarative):qlib = QtDeclarative
185    else:isEqual(QTLIB, multimedia):qlib = QtMultimedia
186    else:isEqual(QTLIB, meegographicssystemhelper):qlib = QtMeeGoGraphicsSystemHelper
187    else:isEqual(QTLIB, android) {
188         contains(TEMPLATE, ".*app") {
189             !CONFIG(android_app) {
190                !contains(TARGET, ".so"): TARGET = lib$${TARGET}.so
191                CONFIG(android_qtmain): SOURCES += $$[QT_INSTALL_PREFIX]/src/android/cpp/qtmain_android.cpp
192                QMAKE_LFLAGS += -Wl,--no-undefined -Wl,-z,noexecstack -shared -Wl,-soname,$$TARGET
193
194                contains(NDK_ROOT, ".*r6")|contains(NDK_ROOT, ".*r5.*")|contains(NDK_ROOT, ".*r5") {
195                   !contains(ANDROID_PLATFORM, android-4): !contains(ANDROID_PLATFORM, android-5): !contains(ANDROID_PLATFORM, android-8) {
196                      message("Your NDK-version is out-dated. A work-around is enabled. Consider updating your NDK (workarounds are required until r6(a))")
197                      QMAKE_LFLAGS_SHLIB += $$ANDROID_PLATFORM_PATH/lib/crtbegin_so.o $$ANDROID_PLATFORM_PATH/lib/crtend_so.o
198                   }
199                }
200             }
201         }else {
202             QMAKE_LFLAGS += -Wl,--no-undefined -Wl,-z,noexecstack -shared
203         }
204         isEmpty(QT_BUILD_TREE) {
205             contains(ANDROID_TARGET_ARCH, armeabi-v7a) : target.path=/libs/armeabi-v7a/
206             contains(ANDROID_TARGET_ARCH, armeabi)     : target.path=/libs/armeabi/
207             contains(ANDROID_TARGET_ARCH, x86)         : target.path=/libs/x86/
208             INSTALLS *= target
209         }
210    }
211    else:message("Unknown QT: $$QTLIB"):qlib =
212    !isEmpty(qlib) {
213       target_qt:isEqual(TARGET, qlib) {
214          warning($$TARGET cannot have a QT of $$QTLIB)
215       } else {
216          DEFINES *= $$upper(QT_$${QTLIB}_LIB)
217          isEqual(QTLIB, opengl):CONFIG += opengl
218          isEqual(QTLIB, openvg):CONFIG += openvg
219          isEqual(QTLIB, qt3support):DEFINES *= QT3_SUPPORT
220          isEqual(QTLIB, testlib):CONFIG += console
221          isEqual(QTLIB, dbus):CONFIG += dbusadaptors dbusinterfaces
222          qtAddLibrary($$qlib)
223       }
224    }
225 }
226
227 qt_compat {
228    !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
229    INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
230    DEFINES *= QT_COMPAT
231 }
232
233 wince*:static:gui {
234    QTLIB += qmenu_wce.res
235 }
236
237 !isEmpty(QT_NAMESPACE):DEFINES *= QT_NAMESPACE=$$QT_NAMESPACE
238 mac {
239     !isEmpty(QT_NAMESPACE_MAC_CRC):DEFINES *= QT_NAMESPACE_MAC_CRC=$$QT_NAMESPACE_MAC_CRC
240 }
241
242 #SIMD defines:
243 mmx:DEFINES += QT_HAVE_MMX
244 3dnow:DEFINES += QT_HAVE_3DNOW
245 sse:DEFINES += QT_HAVE_SSE QT_HAVE_MMXEXT
246 sse2:DEFINES += QT_HAVE_SSE2
247 sse3:DEFINES += QT_HAVE_SSE3
248 ssse3:DEFINES += QT_HAVE_SSSE3
249 sse4_1:DEFINES += QT_HAVE_SSE4_1
250 sse4_2:DEFINES += QT_HAVE_SSE4_2
251 avx:DEFINES += QT_HAVE_AVX
252 iwmmxt:DEFINES += QT_HAVE_IWMMXT