Symbian-linux crosscompilation case changes
[qt:qt.git] / src / 3rdparty / webkit / Source / WebKit / qt / QtWebKit.pro
1 # QtWebKit - qmake build info
2 CONFIG += building-libs
3 CONFIG += depend_includepath
4
5 TARGET = QtWebKit
6 TEMPLATE = lib
7
8 DEFINES += BUILDING_WEBKIT
9
10 RESOURCES += \
11     $$PWD/../../WebCore/WebCore.qrc
12
13 CONFIG(debug, debug|release) : CONFIG_DIR = debug
14 else: CONFIG_DIR = release
15
16 SOURCE_DIR = $$replace(PWD, /WebKit/qt, "")
17
18 include($$PWD/Api/headers.pri)
19 include($$SOURCE_DIR/WebKit.pri)
20 include($$SOURCE_DIR/JavaScriptCore/JavaScriptCore.pri)
21 webkit2 {
22     include($$SOURCE_DIR/WebKit2/WebKit2.pri)
23     include($$SOURCE_DIR/WebKit2/WebKit2API.pri)
24 }
25 include($$SOURCE_DIR/WebCore/WebCore.pri)
26
27 !v8:prependJavaScriptCoreLib(../../JavaScriptCore)
28 prependWebCoreLib(../../WebCore)
29 webkit2:prependWebKit2Lib(../../WebKit2)
30
31 # This is needed for syncqt when it parses the dependencies on module's main pro file so
32 # the generated includes are containing the dependencies.
33 # It used to be in WebCore.pro but now that this is the main pro file it has to be here.
34 QT += network
35
36 isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
37
38 contains(QT_CONFIG, embedded):CONFIG += embedded
39
40 win32*:!win32-msvc* {
41     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
42     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
43 }
44
45 include_webinspector: RESOURCES += $$SOURCE_DIR/WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc
46
47 # Extract sources to build from the generator definitions
48 defineTest(addExtraCompiler) {
49     isEqual($${1}.wkAddOutputToSources, false): return(true)
50
51     outputRule = $$eval($${1}.output)
52     input = $$eval($${1}.input)
53     input = $$eval($$input)
54
55     for(file,input) {
56         base = $$basename(file)
57         base ~= s/\\..+//
58         newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
59         SOURCES += $$newfile
60     }
61     SOURCES += $$eval($${1}.wkExtraSources)
62     export(SOURCES)
63
64     return(true)
65 }
66
67 include($$SOURCE_DIR/WebCore/CodeGenerators.pri)
68
69 CONFIG(release):!CONFIG(standalone_package) {
70     contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
71     unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
72 }
73
74 CONFIG(QTDIR_build) {
75     include($$QT_SOURCE_TREE/src/qbase.pri)
76     # The following lines are to prevent qmake from adding the jscore, webcore and webkit2 libs to libQtWebKit's prl dependencies.
77     # The compromise we have to accept by disabling explicitlib is to drop support to link QtWebKit and QtScript
78     # statically in applications (which isn't used often because, among other things, of licensing obstacles).
79     CONFIG -= explicitlib
80     CONFIG -= staticlib
81 } else {
82     DESTDIR = $$OUTPUT_DIR/lib
83     symbian: TARGET =$$TARGET$${QT_LIBINFIX}
84 }
85
86 moduleFile=$$PWD/qt_webkit_version.pri
87 isEmpty(QT_BUILD_TREE):include($$moduleFile)
88 VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
89
90 symbian {
91     TARGET.EPOCALLOWDLLDATA=1
92     # DRM and Allfiles capabilites need to be audited to be signed on Symbian
93     # For regular users that is not possible, so use the CONFIG(production) flag is added
94     # To use all capabilies add CONFIG+=production
95     # If building from QT source tree, also add CONFIG-=QTDIR_build as qbase.pri defaults capabilities to All -Tcb.    
96     CONFIG(production) {
97         TARGET.CAPABILITY = All -Tcb
98     } else {
99         TARGET.CAPABILITY = All -Tcb -DRM -AllFiles
100     }
101     isEmpty(QT_LIBINFIX) {
102         TARGET.UID3 = 0x200267C2
103     } else {
104         TARGET.UID3 = 0xE00267C2
105     }
106     
107     sisheader = "; SIS header: name, uid, version" \
108                 "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU"
109     webkitsisheader.pkg_prerules = sisheader
110
111     webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
112     v8:webkitlibs.sources += v8.dll
113
114     CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
115     webkitlibs.path = /sys/bin
116     vendorinfo = \
117         "; Localised Vendor name" \
118         "%{\"Nokia\"}" \
119         " " \
120         "; Unique Vendor name" \
121         ":\"Nokia, Qt\"" \
122         " "
123     webkitlibs.pkg_prerules = vendorinfo
124
125     webkitbackup.sources = symbian/backup_registration.xml
126     webkitbackup.path = /private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,)
127
128     contains(QT_CONFIG, declarative) {
129          declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
130          declarativeImport.sources += declarative/qmldir
131          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
132          DEPLOYMENT += declarativeImport
133     }
134
135     platformplugin.sources = $$OUTPUT_DIR/plugins/QtWebKit/platformplugin$${QT_LIBINFIX}.dll
136     platformplugin.path = c:$$QT_PLUGINS_BASE_DIR/QtWebKit
137
138     DEPLOYMENT += webkitsisheader webkitlibs webkitbackup platformplugin
139     !CONFIG(production):CONFIG-=def_files
140
141     # Need to build these sources here because of exported symbols
142     SOURCES += \
143         $$SOURCE_DIR/WebCore/plugins/symbian/PluginViewSymbian.cpp \
144         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.cpp
145
146     HEADERS += \
147         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.h \
148         $$SOURCE_DIR/WebCore/plugins/symbian/npinterface.h
149 }
150
151 !static: DEFINES += QT_MAKEDLL
152
153 SOURCES += \
154     $$PWD/Api/qwebframe.cpp \
155     $$PWD/Api/qgraphicswebview.cpp \
156     $$PWD/Api/qwebpage.cpp \
157     $$PWD/Api/qwebview.cpp \
158     $$PWD/Api/qwebelement.cpp \
159     $$PWD/Api/qwebhistory.cpp \
160     $$PWD/Api/qwebsettings.cpp \
161     $$PWD/Api/qwebhistoryinterface.cpp \
162     $$PWD/Api/qwebplugindatabase.cpp \
163     $$PWD/Api/qwebpluginfactory.cpp \
164     $$PWD/Api/qwebsecurityorigin.cpp \
165     $$PWD/Api/qwebscriptworld.cpp \
166     $$PWD/Api/qwebdatabase.cpp \
167     $$PWD/Api/qwebinspector.cpp \
168     $$PWD/Api/qwebkitversion.cpp \
169     \
170     $$PWD/WebCoreSupport/QtFallbackWebPopup.cpp \
171     $$PWD/WebCoreSupport/ChromeClientQt.cpp \
172     $$PWD/WebCoreSupport/ContextMenuClientQt.cpp \
173     $$PWD/WebCoreSupport/DragClientQt.cpp \
174     $$PWD/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
175     $$PWD/WebCoreSupport/EditorClientQt.cpp \
176     $$PWD/WebCoreSupport/EditCommandQt.cpp \
177     $$PWD/WebCoreSupport/FrameLoaderClientQt.cpp \
178     $$PWD/WebCoreSupport/FrameNetworkingContextQt.cpp \
179     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.cpp \
180     $$PWD/WebCoreSupport/InspectorClientQt.cpp \
181     $$PWD/WebCoreSupport/InspectorServerQt.cpp \
182     $$PWD/WebCoreSupport/NotificationPresenterClientQt.cpp \
183     $$PWD/WebCoreSupport/PageClientQt.cpp \
184     $$PWD/WebCoreSupport/PopupMenuQt.cpp \
185     $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \
186     $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \
187     $$PWD/WebCoreSupport/WebPlatformStrategies.cpp
188
189 HEADERS += \
190     $$WEBKIT_API_HEADERS \
191     $$PWD/Api/qwebplugindatabase_p.h \
192     \
193     $$PWD/WebCoreSupport/InspectorServerQt.h \
194     $$PWD/WebCoreSupport/QtFallbackWebPopup.h \
195     $$PWD/WebCoreSupport/FrameLoaderClientQt.h \
196     $$PWD/WebCoreSupport/FrameNetworkingContextQt.h \
197     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.h \
198     $$PWD/WebCoreSupport/NotificationPresenterClientQt.h \
199     $$PWD/WebCoreSupport/PageClientQt.h \
200     $$PWD/WebCoreSupport/QtPlatformPlugin.h \
201     $$PWD/WebCoreSupport/PopupMenuQt.h \
202     $$PWD/WebCoreSupport/SearchPopupMenuQt.h \
203     $$PWD/WebCoreSupport/WebPlatformStrategies.h
204
205 webkit2 {
206     HEADERS += $$WEBKIT2_API_HEADERS
207     SOURCES += $$WEBKIT2_API_SOURCES
208 }
209
210 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
211     unix:!symbian {
212         maemo5 {
213             HEADERS += $$PWD/WebCoreSupport/QtMaemoWebPopup.h
214             SOURCES += $$PWD/WebCoreSupport/QtMaemoWebPopup.cpp
215         }
216     }
217 }
218
219 contains(DEFINES, ENABLE_VIDEO=1) {
220     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
221         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
222         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
223     }
224
225     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
226         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
227         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
228     }
229
230     contains(DEFINES, WTF_USE_QTKIT=1) {
231         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/ \
232                        $$SOURCE_DIR/WebCore/platform/mac/ \
233                        $$SOURCE_DIR/../WebKitLibraries/
234
235         DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
236         contains(CONFIG, "x86") {
237             DEFINES+=NS_BUILD_32_LIKE_64
238         }
239
240         HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h \
241                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.h
242
243         OBJECTIVE_SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm \
244                    $$PWD/WebCoreSupport/QTKitFullScreenVideoHandler.mm
245
246         LIBS+= -framework Security -framework IOKit
247         # We can know the Mac OS version by using the Darwin major version
248         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
249         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
250         equals(DARWIN_MAJOR_VERSION, "9") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.5.sdk") {
251             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a
252         } else: equals(DARWIN_MAJOR_VERSION, "10") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") {
253             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
254         } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.7.sdk") {
255             LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
256         }
257     }
258 }
259
260 contains(DEFINES, ENABLE_ICONDATABASE=1) {
261     HEADERS += \
262         $$SOURCE_DIR/WebCore/loader/icon/IconDatabaseClient.h \
263         $$PWD/WebCoreSupport/IconDatabaseClientQt.h
264
265     SOURCES += \
266         $$PWD/WebCoreSupport/IconDatabaseClientQt.cpp
267 }
268
269 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
270     HEADERS += \
271         $$PWD/WebCoreSupport/DeviceMotionClientQt.h \
272         $$PWD/WebCoreSupport/DeviceMotionProviderQt.h \
273         $$PWD/WebCoreSupport/DeviceOrientationClientQt.h \
274         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.h \
275         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.h
276
277     SOURCES += \
278         $$PWD/WebCoreSupport/DeviceMotionClientQt.cpp \
279         $$PWD/WebCoreSupport/DeviceMotionProviderQt.cpp \
280         $$PWD/WebCoreSupport/DeviceOrientationClientQt.cpp \
281         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
282         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.cpp
283 }
284
285 contains(DEFINES, ENABLE_GEOLOCATION=1) {
286      HEADERS += \
287         $$PWD/WebCoreSupport/GeolocationClientQt.h
288      SOURCES += \
289         $$PWD/WebCoreSupport/GeolocationClientQt.cpp
290 }
291
292 contains(CONFIG, texmap) {
293     DEFINES += WTF_USE_TEXTURE_MAPPER=1
294 }
295
296 !symbian-abld:!symbian-sbsv2 {
297     modfile.files = $$moduleFile
298     modfile.path = $$[QMAKE_MKSPECS]/modules
299
300     INSTALLS += modfile
301 } else {
302     # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
303
304     inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
305     inst_modfile.input = moduleFile
306     inst_modfile.output = $$[QMAKE_MKSPECS]/modules
307     inst_modfile.CONFIG = no_clean
308
309     QMAKE_EXTRA_COMPILERS += inst_modfile
310
311     install.depends += compiler_inst_modfile_make_all
312     QMAKE_EXTRA_TARGETS += install
313 }
314
315 !CONFIG(QTDIR_build) {
316     exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
317     WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
318
319     !symbian-abld:!symbian-sbsv2 {
320         headers.files = $$WEBKIT_INSTALL_HEADERS
321
322         !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
323         else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
324
325         !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
326         else: target.path = $$[QT_INSTALL_LIBS]
327
328         INSTALLS += target headers
329     } else {
330         # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
331         inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
332         inst_headers.input = WEBKIT_INSTALL_HEADERS
333         inst_headers.CONFIG = no_clean no_link target_predeps
334
335         !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
336         else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
337
338         QMAKE_EXTRA_COMPILERS += inst_headers
339
340         install.depends += compiler_inst_headers_make_all
341     }
342
343     unix {
344         CONFIG += create_pc create_prl
345         QMAKE_PKGCONFIG_LIBDIR = $$target.path
346         QMAKE_PKGCONFIG_INCDIR = $$headers.path
347         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
348         lib_replace.match = $$re_escape($$DESTDIR)
349         lib_replace.replace = $$[QT_INSTALL_LIBS]
350         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
351     }
352
353     mac {
354         !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
355             !build_pass {
356                 message("Building QtWebKit as a framework, as that's how Qt was built. You can")
357                 message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
358
359                 CONFIG += build_all
360             } else {
361                 isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
362             }
363
364             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
365             FRAMEWORK_HEADERS.version = Versions
366             FRAMEWORK_HEADERS.files = $${headers.files}
367             FRAMEWORK_HEADERS.path = Headers
368             QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
369         }
370
371         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
372     }
373 }
374
375 symbian {
376     shared {
377         contains(CONFIG, def_files) {
378             DEF_FILE=symbian
379             # defFilePath is for Qt4.6 compatibility
380             defFilePath=symbian
381         } else {
382             MMP_RULES += EXPORTUNFROZEN
383         }
384     }
385 }