[Qt] Rollout r102769, because it broke Qt-4.8 builds.
[WebKit-https.git] / Tools / qmake / mkspecs / features / webcore.prf
1 # -------------------------------------------------------------------
2 # This file contains shared rules used both when building WebCore
3 # itself, and by targets that use WebCore.
4 #
5 # See 'Tools/qmake/README' for an overview of the build system
6 # -------------------------------------------------------------------
7
8 load(features)
9
10 # We enable TextureMapper by default; remove this line to enable GraphicsLayerQt.
11 CONFIG += texmap
12
13 QT *= network sql
14
15 SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source
16
17 # Use a config-specific target to prevent parallel builds file clashes on Mac
18 mac: CONFIG(debug, debug|release): WEBCORE_TARGET = webcored
19 else: WEBCORE_TARGET = webcore
20
21 # Output in WebCore/<config>
22 CONFIG(debug, debug|release) : WEBCORE_DESTDIR = debug
23 else: WEBCORE_DESTDIR = release
24
25 WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR}
26
27 v8 {
28     DEFINES *= V8_BINDING=1
29
30     WEBCORE_INCLUDEPATH = \
31         $$SOURCE_DIR/WebCore/bindings/v8 \
32         $$SOURCE_DIR/WebCore/bindings/v8/custom \
33         $$SOURCE_DIR/WebCore/bindings/v8/specialization \
34         $$SOURCE_DIR/WebCore/bridge/qt/v8 \
35         $$SOURCE_DIR/WebCore/testing/v8
36
37 } else {
38     WEBCORE_INCLUDEPATH = \
39         $$SOURCE_DIR/WebCore/bridge/jsc \
40         $$SOURCE_DIR/WebCore/bindings/js \
41         $$SOURCE_DIR/WebCore/bindings/js/specialization \
42         $$SOURCE_DIR/WebCore/bridge/c \
43         $$SOURCE_DIR/WebCore/testing/js
44 }
45
46 WEBCORE_INCLUDEPATH = \
47     $$SOURCE_DIR/WebCore \
48     $$SOURCE_DIR/WebCore/accessibility \
49     $$SOURCE_DIR/WebCore/bindings \
50     $$SOURCE_DIR/WebCore/bindings/generic \
51     $$SOURCE_DIR/WebCore/bridge \
52     $$SOURCE_DIR/WebCore/css \
53     $$SOURCE_DIR/WebCore/dom \
54     $$SOURCE_DIR/WebCore/dom/default \
55     $$SOURCE_DIR/WebCore/editing \
56     $$SOURCE_DIR/WebCore/fileapi \
57     $$SOURCE_DIR/WebCore/history \
58     $$SOURCE_DIR/WebCore/html \
59     $$SOURCE_DIR/WebCore/html/canvas \
60     $$SOURCE_DIR/WebCore/html/parser \
61     $$SOURCE_DIR/WebCore/html/shadow \
62     $$SOURCE_DIR/WebCore/html/track \
63     $$SOURCE_DIR/WebCore/inspector \
64     $$SOURCE_DIR/WebCore/loader \
65     $$SOURCE_DIR/WebCore/loader/appcache \
66     $$SOURCE_DIR/WebCore/loader/archive \
67     $$SOURCE_DIR/WebCore/loader/cache \
68     $$SOURCE_DIR/WebCore/loader/icon \
69     $$SOURCE_DIR/WebCore/mathml \
70     $$SOURCE_DIR/WebCore/notifications \
71     $$SOURCE_DIR/WebCore/page \
72     $$SOURCE_DIR/WebCore/page/animation \
73     $$SOURCE_DIR/WebCore/platform \
74     $$SOURCE_DIR/WebCore/platform/animation \
75     $$SOURCE_DIR/WebCore/platform/audio \
76     $$SOURCE_DIR/WebCore/platform/graphics \
77     $$SOURCE_DIR/WebCore/platform/graphics/filters \
78     $$SOURCE_DIR/WebCore/platform/graphics/filters/arm \
79     $$SOURCE_DIR/WebCore/platform/graphics/texmap \
80     $$SOURCE_DIR/WebCore/platform/graphics/transforms \
81     $$SOURCE_DIR/WebCore/platform/image-decoders \
82     $$SOURCE_DIR/WebCore/platform/leveldb \
83     $$SOURCE_DIR/WebCore/platform/mock \
84     $$SOURCE_DIR/WebCore/platform/network \
85     $$SOURCE_DIR/WebCore/platform/sql \
86     $$SOURCE_DIR/WebCore/platform/text \
87     $$SOURCE_DIR/WebCore/platform/text/transcoder \
88     $$SOURCE_DIR/WebCore/plugins \
89     $$SOURCE_DIR/WebCore/rendering \
90     $$SOURCE_DIR/WebCore/rendering/mathml \
91     $$SOURCE_DIR/WebCore/rendering/style \
92     $$SOURCE_DIR/WebCore/rendering/svg \
93     $$SOURCE_DIR/WebCore/storage \
94     $$SOURCE_DIR/WebCore/svg \
95     $$SOURCE_DIR/WebCore/svg/animation \
96     $$SOURCE_DIR/WebCore/svg/graphics \
97     $$SOURCE_DIR/WebCore/svg/graphics/filters \
98     $$SOURCE_DIR/WebCore/svg/properties \
99     $$SOURCE_DIR/WebCore/testing \
100     $$SOURCE_DIR/WebCore/webaudio \
101     $$SOURCE_DIR/WebCore/websockets \
102     $$SOURCE_DIR/WebCore/workers \
103     $$SOURCE_DIR/WebCore/xml \
104     $$SOURCE_DIR/WebCore/xml/parser \
105     $$SOURCE_DIR/ThirdParty \
106     $$WEBCORE_INCLUDEPATH
107
108 WEBCORE_INCLUDEPATH = \
109     $$SOURCE_DIR/WebCore/bridge/qt \
110     $$SOURCE_DIR/WebCore/page/qt \
111     $$SOURCE_DIR/WebCore/platform/graphics/opengl \
112     $$SOURCE_DIR/WebCore/platform/graphics/qt \
113     $$SOURCE_DIR/WebCore/platform/network/qt \
114     $$SOURCE_DIR/WebCore/platform/qt \
115     $$SOURCE_DIR/WebKit/qt/Api \
116     $$SOURCE_DIR/WebKit/qt/WebCoreSupport \
117     $$WEBCORE_INCLUDEPATH
118
119
120 INCLUDEPATH = $$WEBCORE_INCLUDEPATH $$WEBCORE_GENERATED_SOURCES_DIR $$INCLUDEPATH
121
122 contains(DEFINES, ENABLE_XSLT=1) {
123     contains(DEFINES, WTF_USE_LIBXML2=1) {
124         PKGCONFIG += libxslt
125     } else {
126         QT *= xmlpatterns
127     }
128 }
129
130 contains(DEFINES, WTF_USE_LIBXML2=1) {
131     PKGCONFIG += libxml-2.0
132 }
133
134 contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
135     unix {
136         mac {
137             INCLUDEPATH += platform/mac
138             # Note: XP_MACOSX is defined in npapi.h
139         } else {
140             !embedded {
141                 CONFIG += x11
142                 LIBS += -lXrender
143             }
144             DEFINES += XP_UNIX
145             DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1
146         }
147     }
148     win32-* {
149         LIBS += \
150             -ladvapi32 \
151             -lgdi32 \
152             -lshell32 \
153             -lshlwapi \
154             -luser32 \
155             -lversion
156     }
157 }
158
159 contains(DEFINES, ENABLE_GEOLOCATION=1) {
160     CONFIG *= mobility
161     MOBILITY *= location
162 }
163
164 contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
165     CONFIG *= mobility
166     MOBILITY *= sensors
167 }
168
169 contains(DEFINES, WTF_USE_QT_MOBILITY_SYSTEMINFO=1) {
170      CONFIG *= mobility
171      MOBILITY *= systeminfo
172 }
173
174 contains(DEFINES, ENABLE_VIDEO=1) {
175     contains(DEFINES, WTF_USE_QTKIT=1) {
176         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/graphics/mac
177
178         LIBS += -framework AppKit -framework AudioUnit \
179                 -framework AudioToolbox -framework CoreAudio \
180                 -framework QuartzCore -framework QTKit
181
182     } else:contains(DEFINES, WTF_USE_GSTREAMER=1) {
183         DEFINES += ENABLE_GLIB_SUPPORT=1
184
185         INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/graphics/gstreamer
186
187         PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
188     } else:contains(DEFINES, WTF_USE_QT_MULTIMEDIA=1) {
189         CONFIG   *= mobility
190         MOBILITY *= multimedia
191     }
192 }
193
194 contains(DEFINES, ENABLE_WEBGL=1) {
195     !contains(QT_CONFIG, opengl) {
196         error( "This configuration needs an OpenGL enabled Qt. Your Qt is missing OpenGL.")
197     }
198     QT *= opengl
199 }
200
201 contains(CONFIG, texmap) {
202     DEFINES += WTF_USE_TEXTURE_MAPPER=1
203     !win32-*:contains(QT_CONFIG, opengl) {
204         DEFINES += WTF_USE_TEXTURE_MAPPER_GL
205         QT *= opengl
206     }
207 }
208
209 !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
210     INCLUDEPATH += $${SQLITE3SRCDIR}
211     DEFINES += SQLITE_CORE SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE
212     CONFIG(release, debug|release): DEFINES *= NDEBUG
213 } else {
214     INCLUDEPATH += $${SQLITE3SRCDIR}
215     LIBS += -lsqlite3
216 }
217
218 win32-*|wince* {
219     DLLDESTDIR = $${ROOT_BUILD_DIR}/bin
220     isEmpty(QT_SOURCE_TREE):build_pass: TARGET = $$qtLibraryTarget($$TARGET)
221
222     dlltarget.commands = $(COPY_FILE) $(DESTDIR_TARGET) $$[QT_INSTALL_BINS]
223     dlltarget.CONFIG = no_path
224     INSTALLS += dlltarget
225 }
226 mac {
227     LIBS += -framework Carbon -framework AppKit
228 }
229
230 win32-* {
231     INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/win
232     LIBS += -lgdi32
233     LIBS += -lole32
234     LIBS += -luser32
235 }
236
237 # Remove whole program optimizations due to miscompilations
238 win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{
239     QMAKE_CFLAGS_RELEASE -= -GL
240     QMAKE_CXXFLAGS_RELEASE -= -GL
241
242     # Disable incremental linking for windows 32bit OS debug build as WebKit is so big
243     # that linker failes to link incrementally in debug mode.
244     ARCH = $$(PROCESSOR_ARCHITECTURE)
245     WOW64ARCH = $$(PROCESSOR_ARCHITEW6432)
246     equals(ARCH, x86):{
247         isEmpty(WOW64ARCH): QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
248     }
249 }
250
251 wince* {
252     DEFINES += HAVE_LOCALTIME_S=0
253     LIBS += -lmmtimer
254     LIBS += -lole32
255 }
256
257 mac {
258     LIBS_PRIVATE += -framework Carbon -framework AppKit
259 }
260
261 unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
262 unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections
263 linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
264
265 unix|win32-g++* {
266     QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork
267     haveQt(5): QMAKE_PKGCONFIG_REQUIRES += QtWidgets
268 }
269
270 # Disable C++0x mode in WebCore for those who enabled it in their Qt's mkspec
271 *-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x
272
273 enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1
274
275 needToLinkLibrary(WebCore) {
276     pathToWebCoreOutput = $${ROOT_BUILD_DIR}/Source/WebCore/$$WEBCORE_DESTDIR
277     linkLibrary($$pathToWebCoreOutput, $$WEBCORE_TARGET)
278 }