2011-04-22 Yi Shen <yi.4.shen@nokia.com>
[WebKit-https.git] / 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 isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
32
33 contains(QT_CONFIG, embedded):CONFIG += embedded
34
35 win32*:!win32-msvc* {
36     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
37     contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
38 }
39
40 moduleFile=$$PWD/qt_webkit_version.pri
41 isEmpty(QT_BUILD_TREE):include($$moduleFile)
42 VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
43
44 include_webinspector: RESOURCES += $$SOURCE_DIR/WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc
45
46 # Extract sources to build from the generator definitions
47 defineTest(addExtraCompiler) {
48     isEqual($${1}.wkAddOutputToSources, false): return(true)
49
50     outputRule = $$eval($${1}.output)
51     input = $$eval($${1}.input)
52     input = $$eval($$input)
53
54     for(file,input) {
55         base = $$basename(file)
56         base ~= s/\\..+//
57         newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
58         SOURCES += $$newfile
59     }
60     SOURCES += $$eval($${1}.wkExtraSources)
61     export(SOURCES)
62
63     return(true)
64 }
65
66 include($$SOURCE_DIR/WebCore/CodeGenerators.pri)
67
68 CONFIG(release):!CONFIG(standalone_package) {
69     contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
70     unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
71 }
72
73 CONFIG(QTDIR_build) {
74     include($$QT_SOURCE_TREE/src/qbase.pri)
75 } else {
76     DESTDIR = $$OUTPUT_DIR/lib
77     symbian: TARGET =$$TARGET$${QT_LIBINFIX}
78 }
79
80
81 symbian {
82     TARGET.EPOCALLOWDLLDATA=1
83     # DRM and Allfiles capabilites need to be audited to be signed on Symbian
84     # For regular users that is not possible, so use the CONFIG(production) flag is added
85     # To use all capabilies add CONFIG+=production
86     # If building from QT source tree, also add CONFIG-=QTDIR_build as qbase.pri defaults capabilities to All -Tcb.    
87     CONFIG(production) {
88         TARGET.CAPABILITY = All -Tcb
89     } else {
90         TARGET.CAPABILITY = All -Tcb -DRM -AllFiles
91     }
92     isEmpty(QT_LIBINFIX) {
93         TARGET.UID3 = 0x200267C2
94     } else {
95         TARGET.UID3 = 0xE00267C2
96     }
97     
98     sisheader = "; SIS header: name, uid, version" \
99                 "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU"
100     webkitsisheader.pkg_prerules = sisheader
101
102     webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
103     v8:webkitlibs.sources += v8.dll
104
105     CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
106     webkitlibs.path = /sys/bin
107     vendorinfo = \
108         "; Localised Vendor name" \
109         "%{\"Nokia\"}" \
110         " " \
111         "; Unique Vendor name" \
112         ":\"Nokia, Qt\"" \
113         " "
114     webkitlibs.pkg_prerules = vendorinfo
115
116     webkitbackup.sources = symbian/backup_registration.xml
117     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
118
119     contains(QT_CONFIG, declarative) {
120          declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
121          declarativeImport.sources += declarative/qmldir
122          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
123          DEPLOYMENT += declarativeImport
124     }
125
126     platformplugin.sources = $$OUTPUT_DIR/plugins/QtWebKit/platformplugin$${QT_LIBINFIX}.dll
127     platformplugin.path = c:$$QT_PLUGINS_BASE_DIR/QtWebKit
128
129     DEPLOYMENT += webkitsisheader webkitlibs webkitbackup platformplugin
130     !CONFIG(production):CONFIG-=def_files
131
132     # Need to build these sources here because of exported symbols
133     SOURCES += \
134         $$SOURCE_DIR/WebCore/plugins/symbian/PluginViewSymbian.cpp \
135         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.cpp
136
137     HEADERS += \
138         $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.h \
139         $$SOURCE_DIR/WebCore/plugins/symbian/npinterface.h
140 }
141
142 !static: DEFINES += QT_MAKEDLL
143
144 SOURCES += \
145     $$PWD/Api/qwebframe.cpp \
146     $$PWD/Api/qgraphicswebview.cpp \
147     $$PWD/Api/qwebpage.cpp \
148     $$PWD/Api/qwebview.cpp \
149     $$PWD/Api/qwebelement.cpp \
150     $$PWD/Api/qwebhistory.cpp \
151     $$PWD/Api/qwebsettings.cpp \
152     $$PWD/Api/qwebhistoryinterface.cpp \
153     $$PWD/Api/qwebplugindatabase.cpp \
154     $$PWD/Api/qwebpluginfactory.cpp \
155     $$PWD/Api/qwebsecurityorigin.cpp \
156     $$PWD/Api/qwebscriptworld.cpp \
157     $$PWD/Api/qwebdatabase.cpp \
158     $$PWD/Api/qwebinspector.cpp \
159     $$PWD/Api/qwebkitversion.cpp \
160     \
161     $$PWD/WebCoreSupport/QtFallbackWebPopup.cpp \
162     $$PWD/WebCoreSupport/ChromeClientQt.cpp \
163     $$PWD/WebCoreSupport/ContextMenuClientQt.cpp \
164     $$PWD/WebCoreSupport/DragClientQt.cpp \
165     $$PWD/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
166     $$PWD/WebCoreSupport/EditorClientQt.cpp \
167     $$PWD/WebCoreSupport/EditCommandQt.cpp \
168     $$PWD/WebCoreSupport/FrameLoaderClientQt.cpp \
169     $$PWD/WebCoreSupport/FrameNetworkingContextQt.cpp \
170     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.cpp \
171     $$PWD/WebCoreSupport/InspectorClientQt.cpp \
172     $$PWD/WebCoreSupport/InspectorServerQt.cpp \
173     $$PWD/WebCoreSupport/NotificationPresenterClientQt.cpp \
174     $$PWD/WebCoreSupport/PageClientQt.cpp \
175     $$PWD/WebCoreSupport/PopupMenuQt.cpp \
176     $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \
177     $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \
178     $$PWD/WebCoreSupport/WebPlatformStrategies.cpp
179
180 HEADERS += \
181     $$WEBKIT_API_HEADERS \
182     $$PWD/Api/qwebplugindatabase_p.h \
183     \
184     $$PWD/WebCoreSupport/InspectorServerQt.h \
185     $$PWD/WebCoreSupport/QtFallbackWebPopup.h \
186     $$PWD/WebCoreSupport/FrameLoaderClientQt.h \
187     $$PWD/WebCoreSupport/FrameNetworkingContextQt.h \
188     $$PWD/WebCoreSupport/GeolocationPermissionClientQt.h \
189     $$PWD/WebCoreSupport/NotificationPresenterClientQt.h \
190     $$PWD/WebCoreSupport/PageClientQt.h \
191     $$PWD/WebCoreSupport/QtPlatformPlugin.h \
192     $$PWD/WebCoreSupport/PopupMenuQt.h \
193     $$PWD/WebCoreSupport/SearchPopupMenuQt.h \
194     $$PWD/WebCoreSupport/WebPlatformStrategies.h
195
196 webkit2 {
197     HEADERS += $$WEBKIT2_API_HEADERS
198     SOURCES += $$WEBKIT2_API_SOURCES
199 }
200
201 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
202     unix:!symbian {
203         maemo5 {
204             HEADERS += $$PWD/WebCoreSupport/QtMaemoWebPopup.h
205             SOURCES += $$PWD/WebCoreSupport/QtMaemoWebPopup.cpp
206         }
207     }
208 }
209
210 contains(DEFINES, ENABLE_VIDEO=1) {
211     !contains(DEFINES, USE_GSTREAMER=1):contains(MOBILITY_CONFIG, multimedia) {
212         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
213         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
214     }
215
216     contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
217         HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
218         SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
219     }
220 }
221
222 contains(DEFINES, ENABLE_ICONDATABASE=1) {
223     HEADERS += \
224         $$SOURCE_DIR/WebCore/loader/icon/IconDatabaseClient.h \
225         $$PWD/WebCoreSupport/IconDatabaseClientQt.h
226
227     SOURCES += \
228         $$PWD/WebCoreSupport/IconDatabaseClientQt.cpp
229 }
230
231 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
232     HEADERS += \
233         $$PWD/WebCoreSupport/DeviceMotionClientQt.h \
234         $$PWD/WebCoreSupport/DeviceMotionProviderQt.h \
235         $$PWD/WebCoreSupport/DeviceOrientationClientQt.h \
236         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.h \
237         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.h
238
239     SOURCES += \
240         $$PWD/WebCoreSupport/DeviceMotionClientQt.cpp \
241         $$PWD/WebCoreSupport/DeviceMotionProviderQt.cpp \
242         $$PWD/WebCoreSupport/DeviceOrientationClientQt.cpp \
243         $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
244         $$PWD/WebCoreSupport/DeviceOrientationProviderQt.cpp
245 }
246
247 contains(DEFINES, ENABLE_GEOLOCATION=1) {
248      HEADERS += \
249         $$PWD/WebCoreSupport/GeolocationClientQt.h
250      SOURCES += \
251         $$PWD/WebCoreSupport/GeolocationClientQt.cpp
252 }
253
254 contains(CONFIG, texmap) {
255     DEFINES += WTF_USE_TEXTURE_MAPPER=1
256 }
257
258 !symbian-abld:!symbian-sbsv2 {
259     modfile.files = $$moduleFile
260     modfile.path = $$[QMAKE_MKSPECS]/modules
261
262     INSTALLS += modfile
263 } else {
264     # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
265
266     inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
267     inst_modfile.input = moduleFile
268     inst_modfile.output = $$[QMAKE_MKSPECS]/modules
269     inst_modfile.CONFIG = no_clean
270
271     QMAKE_EXTRA_COMPILERS += inst_modfile
272
273     install.depends += compiler_inst_modfile_make_all
274     QMAKE_EXTRA_TARGETS += install
275 }
276
277 !CONFIG(QTDIR_build) {
278     exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
279     WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
280
281     !symbian-abld:!symbian-sbsv2 {
282         headers.files = $$WEBKIT_INSTALL_HEADERS
283
284         !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
285         else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
286
287         !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
288         else: target.path = $$[QT_INSTALL_LIBS]
289
290         INSTALLS += target headers
291     } else {
292         # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
293         inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
294         inst_headers.input = WEBKIT_INSTALL_HEADERS
295         inst_headers.CONFIG = no_clean
296
297         !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
298         else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
299
300         QMAKE_EXTRA_COMPILERS += inst_headers
301
302         install.depends += compiler_inst_headers_make_all
303     }
304
305     unix {
306         CONFIG += create_pc create_prl
307         QMAKE_PKGCONFIG_LIBDIR = $$target.path
308         QMAKE_PKGCONFIG_INCDIR = $$headers.path
309         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
310         lib_replace.match = $$re_escape($$DESTDIR)
311         lib_replace.replace = $$[QT_INSTALL_LIBS]
312         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
313     }
314
315     mac {
316         !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
317             !build_pass {
318                 message("Building QtWebKit as a framework, as that's how Qt was built. You can")
319                 message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")
320
321                 CONFIG += build_all
322             } else {
323                 isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
324             }
325
326             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
327             FRAMEWORK_HEADERS.version = Versions
328             FRAMEWORK_HEADERS.files = $${headers.files}
329             FRAMEWORK_HEADERS.path = Headers
330             QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
331         }
332
333         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
334     }
335 }
336
337 symbian {
338     shared {
339         contains(CONFIG, def_files) {
340             DEF_FILE=symbian
341             # defFilePath is for Qt4.6 compatibility
342             defFilePath=symbian
343         } else {
344             MMP_RULES += EXPORTUNFROZEN
345         }
346     }
347 }