WebHTTPBody: Keep track of whether the data includes passwords.
[WebKit-https.git] / Source / api.pri
1 # -------------------------------------------------------------------
2 # Project file for the QtWebKit C++ APIs
3 #
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
6
7 TEMPLATE = lib
8 TARGET = QtWebKit
9
10 WEBKIT_DESTDIR = $${ROOT_BUILD_DIR}/lib
11
12 haveQt(5) {
13     # Use Qt5's module system
14     load(qt_module)
15     MODULE = webkit
16     MODULE_PRI = $$QT.webkit.module_pri
17     CONFIG += module
18
19     BASE_TARGET = $$TARGET
20
21     load(qt_module_config)
22
23     # Make sure the module config doesn't override our preferred build config
24     debug_and_release:if(!debug|!release): CONFIG -= debug_and_release
25
26     # Allow doing a debug-only build of WebKit (not supported by Qt)
27     macx:!debug_and_release:debug: TARGET = $$BASE_TARGET
28
29     # ---------------- Custom developer-build handling -------------------
30     #
31     # The assumption for Qt developer builds is that the module file
32     # will be put into qtbase/mkspecs/modules, and the libraries into
33     # qtbase/lib, with rpath/install_name set to the Qt lib dir.
34     #
35     # For WebKit we don't want that behavior for the libraries, as we want
36     # them to be self-contained in the WebKit build dir. To achive that we
37     # trick Qt into thinking it's not a developer build, but setting QTDIR
38     # to a bogus path in default_pre.prf.
39     #
40     # We still want the module file to live in the Qt dir so the module can
41     # be used by setting QT += webkit, so we copy the file manually. We also
42     # have to make sure the rpath/install_name of the libraries are relative
43     # to the webkit build dir.
44
45     # We use private_tests to detect developer build, since the destdir will
46     # always be our webkit build dir. This might change as configure changes.
47     contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
48
49     !build_pass {
50         # Make a more accessible copy of the module forward file
51         # in the WebKit build directory.
52         convenience_module_path = $${ROOT_BUILD_DIR}/modules
53         module_filename = $$basename(QT.webkit.module_pri)
54
55         make_module_fwd_convenience.target = $$convenience_module_path/$$module_filename
56         make_module_fwd_convenience.commands = $$QMAKE_MKDIR $$convenience_module_path \
57             && echo \"include($$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename)\" > $$convenience_module_path/$$module_filename
58         make_module_fwd_convenience.depends = $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename
59
60         QMAKE_EXTRA_TARGETS += make_module_fwd_convenience
61         DEFAULT_TARGETS += make_module_fwd_convenience
62
63         qt_developer_build {
64             # Copy the module forward file into Qt so that the module
65             # is immediately accessible.
66             qt_modules_path = $$[QT_INSTALL_PREFIX]/mkspecs/modules
67
68             copy_module_fwd_file.target = $$qt_modules_path/$$module_filename
69             copy_module_fwd_file.commands = $$QMAKE_COPY $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename $$qt_modules_path
70             # FIXME: Add dependendy that ensures we copy the forward file if the target is updated
71             copy_module_fwd_file.depends = $$QMAKE_EXTRA_MODULE_FORWARDS/$$module_filename
72
73             QMAKE_EXTRA_TARGETS += copy_module_fwd_file
74             DEFAULT_TARGETS += copy_module_fwd_file
75         }
76     }
77
78     # Make sure the install_name of the QtWebKit library point to webkit
79     macx {
80         # We do our own absolute path so that we can trick qmake into
81         # using the webkit build path instead of the Qt install path.
82         CONFIG -= absolute_library_soname
83         QMAKE_LFLAGS_SONAME = $$QMAKE_LFLAGS_SONAME$$WEBKIT_DESTDIR/
84
85         !debug_and_release|build_pass {
86             # We also have to make sure the install_name is correct when
87             # the library is installed.
88             change_install_name.depends = install_target
89
90             # The install rules generated by qmake for frameworks are busted in
91             # that both the debug and the release makefile copy QtWebKit.framework
92             # into the install dir, so whatever changes we did to the release library
93             # will get overwritten when the debug library is installed. We work around
94             # that by running install_name on both, for both configs.
95             change_install_name.commands = framework_dir=\$\$(dirname $(TARGETD)); \
96                 for file in \$\$(ls $$[QT_INSTALL_LIBS]/\$\$framework_dir/$$BASE_TARGET*); do \
97                     install_name_tool -id \$\$file \$\$file; \
98                 done
99             default_install_target.target = install
100             default_install_target.depends += change_install_name
101
102             QMAKE_EXTRA_TARGETS += change_install_name default_install_target
103         }
104     }
105 } else {
106     VERSION = $$QT_VERSION
107     DESTDIR = $$WEBKIT_DESTDIR
108 }
109
110 runSyncQt() # Generate forwarding headers for the QtWebKit API
111
112 load(features)
113
114 include(WebKit/WebKit.pri)
115
116 WEBKIT += wtf
117
118 !v8:WEBKIT += javascriptcore
119
120 WEBKIT += webcore
121
122 !no_webkit2 {
123     WEBKIT += webkit2
124     QT += declarative
125
126     # Ensure that changes to the WebKit2 API will trigger a qmake of this
127     # file, which in turn runs syncqt to update the forwarding headers.
128     QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri
129 }
130
131 QT += network
132 haveQt(5): QT += widgets printsupport quick
133
134 contains(DEFINES, WTF_USE_TEXTURE_MAPPER_GL=1)|contains(DEFINES, ENABLE_WEBGL=1) {
135     QT *= opengl
136     # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
137     win32*:!win32-msvc*: LIBS += $$QMAKE_LIBS_OPENGL
138 }
139
140 !static: DEFINES += QT_MAKEDLL
141
142 SOURCES += \
143     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp \
144     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.cpp \
145     $$PWD/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp \
146     $$PWD/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp \
147     $$PWD/WebKit/qt/WebCoreSupport/DragClientQt.cpp \
148     $$PWD/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp \
149     $$PWD/WebKit/qt/WebCoreSupport/EditorClientQt.cpp \
150     $$PWD/WebKit/qt/WebCoreSupport/UndoStepQt.cpp \
151     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \
152     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \
153     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \
154     $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp \
155     $$PWD/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \
156     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \
157     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \
158     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.cpp \
159     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp \
160     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp \
161     $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.cpp \
162     $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.cpp \
163     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp \
164     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.cpp \
165     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp \
166     $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.cpp
167
168 HEADERS += \
169     $$PWD/WebKit/qt/WebCoreSupport/InitWebCoreQt.h \
170     $$PWD/WebKit/qt/WebCoreSupport/InspectorServerQt.h \
171     $$PWD/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \
172     $$PWD/WebKit/qt/WebCoreSupport/QtWebComboBox.h \
173     $$PWD/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \
174     $$PWD/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \
175     $$PWD/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \
176     $$PWD/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \
177     $$PWD/WebKit/qt/WebCoreSupport/PageClientQt.h \
178     $$PWD/WebKit/qt/WebCoreSupport/PopupMenuQt.h \
179     $$PWD/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \
180     $$PWD/WebKit/qt/WebCoreSupport/RenderThemeQStyle.h \
181     $$PWD/WebKit/qt/WebCoreSupport/ScrollbarThemeQStyle.h \
182     $$PWD/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h \
183     $$PWD/WebKit/qt/WebCoreSupport/TextCheckerClientQt.h \
184     $$PWD/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.h \
185     $$PWD/WebKit/qt/WebCoreSupport/WebEventConversion.h
186
187 INCLUDEPATH += \
188     $$PWD/WebKit/qt/Api \
189     $$PWD/WebKit/qt/WebCoreSupport
190
191 contains(DEFINES, ENABLE_VIDEO=1) {
192     !contains(DEFINES, WTF_USE_QTKIT=1):!contains(DEFINES, WTF_USE_GSTREAMER=1):contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
193         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.h
194         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoWidget.cpp
195     }
196
197     contains(DEFINES, WTF_USE_QTKIT=1) | contains(DEFINES, WTF_USE_GSTREAMER=1) | contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
198         HEADERS += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
199         SOURCES += $$PWD/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
200     }
201
202     contains(DEFINES, WTF_USE_QTKIT=1) {
203         INCLUDEPATH += \
204             $$PWD/WebCore/platform/qt/ \
205             $$PWD/WebCore/platform/mac/ \
206             $$PWD/../WebKitLibraries/
207
208         DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
209
210         contains(CONFIG, "x86") {
211             DEFINES+=NS_BUILD_32_LIKE_64
212         }
213
214         HEADERS += \
215             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.h \
216             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.h
217
218         OBJECTIVE_SOURCES += \
219             $$PWD/WebKit/qt/WebCoreSupport/WebSystemInterface.mm \
220             $$PWD/WebKit/qt/WebCoreSupport/QTKitFullScreenVideoHandler.mm
221
222         LIBS += -framework Security -framework IOKit
223
224         # We can know the Mac OS version by using the Darwin major version
225         DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
226         DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
227         equals(DARWIN_MAJOR_VERSION, "11") {
228             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a
229         } else:equals(DARWIN_MAJOR_VERSION, "10") {
230             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
231         } else:equals(DARWIN_MAJOR_VERSION, "9") {
232             LIBS += $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
233         }
234     }
235 }
236
237 contains(DEFINES, ENABLE_ICONDATABASE=1) {
238     HEADERS += \
239         $$PWD/WebCore/loader/icon/IconDatabaseClient.h \
240         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.h
241
242     SOURCES += \
243         $$PWD/WebKit/qt/WebCoreSupport/IconDatabaseClientQt.cpp
244 }
245
246 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
247     haveQt(5): QT += sensors
248 }
249
250 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
251     HEADERS += \
252         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \
253         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h \
254         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.h \
255         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
256
257     SOURCES += \
258         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp \
259         $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp \
260         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp \
261         $$PWD/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
262 }
263
264 contains(DEFINES, ENABLE_GEOLOCATION=1) {
265      haveQt(5): QT += location
266
267      HEADERS += \
268         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.h
269      SOURCES += \
270         $$PWD/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
271 }
272
273 contains(CONFIG, texmap) {
274     DEFINES += WTF_USE_TEXTURE_MAPPER=1
275 }
276
277 plugin_backend_xlib: PKGCONFIG += x11
278
279 # ------------- Install rules -------------
280
281 haveQt(5) {
282     # Install rules handled by Qt's module system
283 } else {
284     # For Qt4 we have to set up install rules manually
285
286     # Syncqt has already run at this point, so we can use headers.pri
287     # as a basis for our install-rules
288     HEADERS_PRI = $${ROOT_BUILD_DIR}/include/$${QT.webkit.name}/headers.pri
289     !include($$HEADERS_PRI): error(Failed to resolve install headers)
290
291     headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
292     !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/$${TARGET}
293     else: headers.path = $$[QT_INSTALL_HEADERS]/$${TARGET}
294     INSTALLS += headers
295
296     !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
297     else: target.path = $$[QT_INSTALL_LIBS]
298     INSTALLS += target
299
300     unix {
301         CONFIG += create_pc create_prl
302         QMAKE_PKGCONFIG_LIBDIR = $$target.path
303         QMAKE_PKGCONFIG_INCDIR = $$headers.path
304         QMAKE_PKGCONFIG_DESTDIR = pkgconfig
305         lib_replace.match = $$re_escape($$DESTDIR)
306         lib_replace.replace = $$[QT_INSTALL_LIBS]
307         QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
308     }
309
310     mac {
311         !static:contains(QT_CONFIG, qt_framework) {
312             # Build QtWebKit as a framework, to match how Qt was built
313             CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
314
315             # For debug_and_release configs, only copy headers in release
316             !debug_and_release|if(build_pass:CONFIG(release, debug|release)) {
317                 FRAMEWORK_HEADERS.version = Versions
318                 FRAMEWORK_HEADERS.files = $${headers.files}
319                 FRAMEWORK_HEADERS.path = Headers
320                 QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
321             }
322         }
323
324         QMAKE_LFLAGS_SONAME = "$${QMAKE_LFLAGS_SONAME}$${DESTDIR}$${QMAKE_DIR_SEP}"
325     }
326 }