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