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