summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/qt/QtWebKit.pro
blob: 7529aced2b06ba673ac5a6be8f04d26f7e0405cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# QtWebKit - qmake build info
CONFIG += building-libs
CONFIG += depend_includepath

TARGET = QtWebKit
TEMPLATE = lib

DEFINES += BUILDING_WEBKIT

RESOURCES += \
    $$PWD/../../WebCore/WebCore.qrc

CONFIG(debug, debug|release) : CONFIG_DIR = debug
else: CONFIG_DIR = release

SOURCE_DIR = $$replace(PWD, /WebKit/qt, "")

CONFIG(standalone_package) {
    isEmpty(WEBKIT2_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/../../JavaScriptCore/generated
    isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/../../WebCore/generated
    isEmpty(WC_GENERATED_SOURCES_DIR):WEBKIT2_GENERATED_SOURCES_DIR = $$PWD/../../WebKit2/generated
} else {
    isEmpty(WEBKIT2_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = ../../JavaScriptCore/generated
    isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = ../../WebCore/generated
    isEmpty(WC_GENERATED_SOURCES_DIR):WEBKIT2_GENERATED_SOURCES_DIR = ../../WebKit2/generated
}

include($$PWD/Api/headers.pri)
include($$SOURCE_DIR/WebKit.pri)
include($$SOURCE_DIR/JavaScriptCore/JavaScriptCore.pri)
webkit2 {
    include($$SOURCE_DIR/WebKit2/WebKit2.pri)
    include($$SOURCE_DIR/WebKit2/WebKit2API.pri)
    INCLUDEPATH += $$OUTPUT_DIR/WebKit2/generated
}
include($$SOURCE_DIR/WebCore/WebCore.pri)

!v8:prependJavaScriptCoreLib(../../JavaScriptCore)
prependWebCoreLib(../../WebCore)
webkit2:prependWebKit2Lib(../../WebKit2)

isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..

contains(QT_CONFIG, embedded):CONFIG += embedded

win32*:!win32-msvc* {
    # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
    contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap): LIBS += $$QMAKE_LIBS_OPENGL
}

moduleFile=$$PWD/qt_webkit_version.pri
isEmpty(QT_BUILD_TREE):include($$moduleFile)
VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}

include_webinspector: RESOURCES += $$SOURCE_DIR/WebCore/inspector/front-end/WebKit.qrc $$WC_GENERATED_SOURCES_DIR/InspectorBackendStub.qrc

# Extract sources to build from the generator definitions
defineTest(addExtraCompiler) {
    isEqual($${1}.wkAddOutputToSources, false): return(true)

    outputRule = $$eval($${1}.output)
    input = $$eval($${1}.input)
    input = $$eval($$input)

    for(file,input) {
        base = $$basename(file)
        base ~= s/\\..+//
        newfile=$$replace(outputRule,\\$\\{QMAKE_FILE_BASE\\},$$base)
        SOURCES += $$newfile
    }
    SOURCES += $$eval($${1}.wkExtraSources)
    export(SOURCES)

    return(true)
}

include($$SOURCE_DIR/WebCore/CodeGenerators.pri)

CONFIG(release):!CONFIG(standalone_package) {
    contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
    unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
}

CONFIG(QTDIR_build) {
    include($$QT_SOURCE_TREE/src/qbase.pri)
} else {
    DESTDIR = $$OUTPUT_DIR/lib
    symbian: TARGET =$$TARGET$${QT_LIBINFIX}
}


symbian {
    TARGET.EPOCALLOWDLLDATA=1
    # DRM and Allfiles capabilites need to be audited to be signed on Symbian
    # For regular users that is not possible, so use the CONFIG(production) flag is added
    # To use all capabilies add CONFIG+=production
    # If building from QT source tree, also add CONFIG-=QTDIR_build as qbase.pri defaults capabilities to All -Tcb.    
    CONFIG(production) {
        TARGET.CAPABILITY = All -Tcb
    } else {
        TARGET.CAPABILITY = All -Tcb -DRM -AllFiles
    }
    isEmpty(QT_LIBINFIX) {
        TARGET.UID3 = 0x200267C2
    } else {
        TARGET.UID3 = 0xE00267C2
    }
    
    sisheader = "; SIS header: name, uid, version" \
                "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU"
    webkitsisheader.pkg_prerules = sisheader

    webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll
    v8:webkitlibs.sources += v8.dll

    CONFIG(QTDIR_build): webkitlibs.sources = $$QMAKE_LIBDIR_QT/$$webkitlibs.sources
    webkitlibs.path = /sys/bin
    vendorinfo = \
        "; Localised Vendor name" \
        "%{\"Nokia\"}" \
        " " \
        "; Unique Vendor name" \
        ":\"Nokia, Qt\"" \
        " "
    webkitlibs.pkg_prerules = vendorinfo

    webkitbackup.sources = symbian/backup_registration.xml
    webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)

    contains(QT_CONFIG, declarative) {
         declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
         declarativeImport.sources += declarative/qmldir
         declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
         DEPLOYMENT += declarativeImport
    }

    DEPLOYMENT += webkitsisheader webkitlibs webkitbackup
    !CONFIG(production):CONFIG-=def_files

    # Need to build these sources here because of exported symbols
    SOURCES += \
        $$SOURCE_DIR/WebCore/plugins/symbian/PluginViewSymbian.cpp \
        $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.cpp

    HEADERS += \
        $$SOURCE_DIR/WebCore/plugins/symbian/PluginContainerSymbian.h \
        $$SOURCE_DIR/WebCore/plugins/symbian/npinterface.h
}

!static: DEFINES += QT_MAKEDLL

SOURCES += \
    $$PWD/Api/qwebframe.cpp \
    $$PWD/Api/qgraphicswebview.cpp \
    $$PWD/Api/qwebpage.cpp \
    $$PWD/Api/qwebview.cpp \
    $$PWD/Api/qwebelement.cpp \
    $$PWD/Api/qwebhistory.cpp \
    $$PWD/Api/qwebsettings.cpp \
    $$PWD/Api/qwebhistoryinterface.cpp \
    $$PWD/Api/qwebplugindatabase.cpp \
    $$PWD/Api/qwebpluginfactory.cpp \
    $$PWD/Api/qwebsecurityorigin.cpp \
    $$PWD/Api/qwebscriptworld.cpp \
    $$PWD/Api/qwebdatabase.cpp \
    $$PWD/Api/qwebinspector.cpp \
    $$PWD/Api/qwebkitversion.cpp \
    \
    $$PWD/WebCoreSupport/QtFallbackWebPopup.cpp \
    $$PWD/WebCoreSupport/ChromeClientQt.cpp \
    $$PWD/WebCoreSupport/ContextMenuClientQt.cpp \
    $$PWD/WebCoreSupport/DragClientQt.cpp \
    $$PWD/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
    $$PWD/WebCoreSupport/EditorClientQt.cpp \
    $$PWD/WebCoreSupport/EditCommandQt.cpp \
    $$PWD/WebCoreSupport/FrameLoaderClientQt.cpp \
    $$PWD/WebCoreSupport/FrameNetworkingContextQt.cpp \
    $$PWD/WebCoreSupport/GeolocationPermissionClientQt.cpp \
    $$PWD/WebCoreSupport/InspectorClientQt.cpp \
    $$PWD/WebCoreSupport/InspectorServerQt.cpp \
    $$PWD/WebCoreSupport/NotificationPresenterClientQt.cpp \
    $$PWD/WebCoreSupport/PageClientQt.cpp \
    $$PWD/WebCoreSupport/PopupMenuQt.cpp \
    $$PWD/WebCoreSupport/QtPlatformPlugin.cpp \
    $$PWD/WebCoreSupport/SearchPopupMenuQt.cpp \
    $$PWD/WebCoreSupport/WebPlatformStrategies.cpp

HEADERS += \
    $$WEBKIT_API_HEADERS \
    $$PWD/Api/qwebplugindatabase_p.h \
    \
    $$PWD/WebCoreSupport/InspectorServerQt.h \
    $$PWD/WebCoreSupport/QtFallbackWebPopup.h \
    $$PWD/WebCoreSupport/FrameLoaderClientQt.h \
    $$PWD/WebCoreSupport/FrameNetworkingContextQt.h \
    $$PWD/WebCoreSupport/GeolocationPermissionClientQt.h \
    $$PWD/WebCoreSupport/NotificationPresenterClientQt.h \
    $$PWD/WebCoreSupport/PageClientQt.h \
    $$PWD/WebCoreSupport/QtPlatformPlugin.h \
    $$PWD/WebCoreSupport/PopupMenuQt.h \
    $$PWD/WebCoreSupport/SearchPopupMenuQt.h \
    $$PWD/WebCoreSupport/WebPlatformStrategies.h

webkit2 {
    HEADERS += $$WEBKIT2_API_HEADERS
    SOURCES += $$WEBKIT2_API_SOURCES
}

contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
    unix:!symbian {
        maemo5 {
            HEADERS += $$PWD/WebCoreSupport/QtMaemoWebPopup.h
            SOURCES += $$PWD/WebCoreSupport/QtMaemoWebPopup.cpp
        }
    }
}

contains(DEFINES, ENABLE_VIDEO=1) {
    !contains(DEFINES, USE_GSTREAMER=1):contains(MOBILITY_CONFIG, multimedia) {
        HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
        SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
    }

    contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) {
        HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
        SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
    }
}

contains(DEFINES, ENABLE_ICONDATABASE=1) {
    HEADERS += \
        $$SOURCE_DIR/WebCore/loader/icon/IconDatabaseClient.h \
        $$PWD/WebCoreSupport/IconDatabaseClientQt.h

    SOURCES += \
        $$PWD/WebCoreSupport/IconDatabaseClientQt.cpp
}

contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
    HEADERS += \
        $$PWD/WebCoreSupport/DeviceMotionClientQt.h \
        $$PWD/WebCoreSupport/DeviceMotionProviderQt.h \
        $$PWD/WebCoreSupport/DeviceOrientationClientQt.h \
        $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.h \
        $$PWD/WebCoreSupport/DeviceOrientationProviderQt.h

    SOURCES += \
        $$PWD/WebCoreSupport/DeviceMotionClientQt.cpp \
        $$PWD/WebCoreSupport/DeviceMotionProviderQt.cpp \
        $$PWD/WebCoreSupport/DeviceOrientationClientQt.cpp \
        $$PWD/WebCoreSupport/DeviceOrientationClientMockQt.cpp \
        $$PWD/WebCoreSupport/DeviceOrientationProviderQt.cpp
}

contains(DEFINES, ENABLE_GEOLOCATION=1) {
     HEADERS += \
        $$PWD/WebCoreSupport/GeolocationClientQt.h
     SOURCES += \
        $$PWD/WebCoreSupport/GeolocationClientQt.cpp
}

contains(CONFIG, texmap) {
    DEFINES += WTF_USE_TEXTURE_MAPPER=1
}

!symbian-abld:!symbian-sbsv2 {
    modfile.files = $$moduleFile
    modfile.path = $$[QMAKE_MKSPECS]/modules

    INSTALLS += modfile
} else {
    # INSTALLS is not implemented in qmake's mmp generators, copy headers manually

    inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
    inst_modfile.input = moduleFile
    inst_modfile.output = $$[QMAKE_MKSPECS]/modules
    inst_modfile.CONFIG = no_clean

    QMAKE_EXTRA_COMPILERS += inst_modfile

    install.depends += compiler_inst_modfile_make_all
    QMAKE_EXTRA_TARGETS += install
}

!CONFIG(QTDIR_build) {
    exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
    WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS

    !symbian-abld:!symbian-sbsv2 {
        headers.files = $$WEBKIT_INSTALL_HEADERS

        !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
        else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit

        !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
        else: target.path = $$[QT_INSTALL_LIBS]

        INSTALLS += target headers
    } else {
        # INSTALLS is not implemented in qmake's mmp generators, copy headers manually
        inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
        inst_headers.input = WEBKIT_INSTALL_HEADERS
        inst_headers.CONFIG = no_clean

        !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
        else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}

        QMAKE_EXTRA_COMPILERS += inst_headers

        install.depends += compiler_inst_headers_make_all
    }

    unix {
        CONFIG += create_pc create_prl
        QMAKE_PKGCONFIG_LIBDIR = $$target.path
        QMAKE_PKGCONFIG_INCDIR = $$headers.path
        QMAKE_PKGCONFIG_DESTDIR = pkgconfig
        lib_replace.match = $$re_escape($$DESTDIR)
        lib_replace.replace = $$[QT_INSTALL_LIBS]
        QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
    }

    mac {
        !static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
            !build_pass {
                message("Building QtWebKit as a framework, as that's how Qt was built. You can")
                message("override this by passing CONFIG+=webkit_no_framework to build-webkit.")

                CONFIG += build_all
            } else {
                isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET)
            }

            CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
            FRAMEWORK_HEADERS.version = Versions
            FRAMEWORK_HEADERS.files = $${headers.files}
            FRAMEWORK_HEADERS.path = Headers
            QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
        }

        QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
    }
}

symbian {
    shared {
        contains(CONFIG, def_files) {
            DEF_FILE=symbian
            # defFilePath is for Qt4.6 compatibility
            defFilePath=symbian
        } else {
            MMP_RULES += EXPORTUNFROZEN
        }
    }
}