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