toolkit/library/libxul.mk

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:e778121a2afe
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 # You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
6 # This is going to be a framework named "XUL", not an ordinary library named
7 # "libxul.dylib"
8 SHARED_LIBRARY_NAME=XUL
9 # Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when
10 # setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX
11 # as-is so that dependencies of the form -ltracemalloc still work.
12 MAKE_FRAMEWORK=1
13 else
14 SHARED_LIBRARY_NAME=xul
15 endif
16
17 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,xul,$(DEPTH)/toolkit/library)
18
19 EXTRA_DEPS += $(topsrcdir)/toolkit/library/libxul.mk
20
21 # dependent libraries
22 ifdef MOZ_B2G_BT_BLUEZ #{
23 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
24 OS_LIBS += -ldbus
25 endif
26 endif #}
27
28 ifdef MOZ_B2G_CAMERA #{
29 OS_LIBS += -lstagefright -lstagefright_omx
30 endif #}
31
32 ifeq (Linux,$(OS_ARCH))
33 ifneq (Android,$(OS_TARGET))
34 OS_LIBS += -lrt
35 EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript
36
37 symverscript: $(topsrcdir)/toolkit/library/symverscript.in
38 $(call py_action,preprocessor, \
39 -DVERSION='$(SHARED_LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)' $< -o $@)
40
41 EXTRA_DEPS += symverscript
42 endif
43 endif
44
45 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
46 OS_LIBS += -lcups
47 endif
48
49 EXTRA_DSO_LDOPTS += \
50 $(LIBS_DIR) \
51 $(MOZ_JS_LIBS) \
52 $(NSS_LIBS) \
53 $(MOZ_CAIRO_OSLIBS) \
54 $(MOZ_APP_EXTRA_LIBS) \
55 $(SQLITE_LIBS) \
56 $(NULL)
57
58 ifdef ENABLE_INTL_API
59 ifdef JS_SHARED_LIBRARY
60 EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS)
61 endif
62 endif
63
64 ifdef MOZ_NATIVE_JPEG
65 EXTRA_DSO_LDOPTS += $(MOZ_JPEG_LIBS)
66 endif
67
68 ifdef MOZ_NATIVE_PNG
69 EXTRA_DSO_LDOPTS += $(MOZ_PNG_LIBS)
70 endif
71
72 ifndef ZLIB_IN_MOZGLUE
73 EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
74 endif
75
76 ifdef MOZ_NATIVE_HUNSPELL
77 EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
78 endif
79
80 ifdef MOZ_NATIVE_LIBEVENT
81 EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
82 endif
83
84 ifdef MOZ_NATIVE_LIBVPX
85 EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
86 endif
87
88 ifndef MOZ_TREE_PIXMAN
89 EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
90 endif
91
92 ifdef MOZ_DMD
93 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
94 endif
95
96 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
97
98 ifdef MOZ_WEBRTC
99 ifeq (WINNT,$(OS_TARGET))
100 ifndef MOZ_HAS_WINSDK_WITH_D3D
101 EXTRA_DSO_LDOPTS += \
102 -LIBPATH:'$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)' \
103 $(NULL)
104 endif
105 OS_LIBS += $(call EXPAND_LIBNAME,secur32 crypt32 iphlpapi strmiids dmoguids wmcodecdspuuid amstrmid msdmo wininet)
106 endif
107 endif
108
109 ifdef MOZ_ALSA
110 EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
111 endif
112
113 ifdef HAVE_CLOCK_MONOTONIC
114 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
115 endif
116
117 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
118 OS_LIBS += -lGLESv2
119 endif
120
121 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
122 OS_LIBS += \
123 -lui \
124 -lmedia \
125 -lhardware_legacy \
126 -lhardware \
127 -lutils \
128 -lcutils \
129 -lsysutils \
130 -lcamera_client \
131 -lsensorservice \
132 -lstagefright \
133 -lstagefright_foundation \
134 -lstagefright_omx \
135 -lbinder \
136 -lgui \
137 $(NULL)
138 endif
139
140 ifneq (,$(filter rtsp,$(NECKO_PROTOCOLS)))
141 OS_LIBS += -lstagefright_foundation
142 endif
143
144 ifdef MOZ_WMF
145 OS_LIBS += $(call EXPAND_LIBNAME,mfuuid wmcodecdspuuid strmiids)
146 endif
147
148 ifdef MOZ_DIRECTSHOW
149 OS_LIBS += $(call EXPAND_LIBNAME,dmoguids wmcodecdspuuid strmiids msdmo)
150 endif
151
152 EXTRA_DSO_LDOPTS += $(LIBS_DIR)
153
154 EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
155
156 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
157 OS_LIBS += \
158 $(TK_LIBS) \
159 $(NULL)
160 endif
161
162 ifeq (OpenBSD,$(OS_ARCH))
163 EXTRA_DSO_LDOPTS += -lsndio
164 endif
165
166 ifdef MOZ_ENABLE_DBUS
167 EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
168 endif
169
170 ifdef MOZ_WIDGET_GTK
171 EXTRA_DSO_LDOPTS += $(TK_LIBS)
172 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(XT_LIBS) -lgthread-2.0
173 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
174 endif
175
176 ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
177 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS)
178 EXTRA_DSO_LDOPTS += $(FT2_LIBS) $(MOZ_PANGO_LIBS)
179 endif
180
181 ifdef MOZ_TREE_FREETYPE
182 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
183 endif
184
185 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
186 EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
187 endif
188
189 ifdef MOZ_ENABLE_LIBPROXY
190 EXTRA_DSO_LDOPTS += $(MOZ_LIBPROXY_LIBS)
191 endif
192
193 ifeq ($(OS_ARCH),SunOS)
194 ifdef GNU_CC
195 EXTRA_DSO_LDOPTS += -lelf
196 else
197 EXTRA_DSO_LDOPTS += -lelf -ldemangle
198 endif
199 endif
200
201 ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
202 OS_LIBS += $(call EXPAND_LIBNAME,kvm)
203 endif
204
205 ifeq ($(OS_ARCH),FreeBSD)
206 OS_LIBS += $(call EXPAND_LIBNAME,util)
207 endif
208
209 ifeq ($(OS_ARCH),WINNT)
210 OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet wbemuuid wintrust)
211 ifdef ACCESSIBILITY
212 OS_LIBS += $(call EXPAND_LIBNAME,oleacc)
213 endif
214 ifdef MOZ_METRO
215 OS_LIBS += $(call EXPAND_LIBNAME,uiautomationcore runtimeobject)
216 endif
217 ifdef MOZ_GAMEPAD
218 ifdef MOZ_HAS_WINSDK_WITH_D3D
219 OS_LIBS += $(call EXPAND_LIBNAME,dxguid dinput8)
220 else
221 OS_LIBS += $(call EXPAND_LIBNAME_PATH,dxguid dinput8, '$(subst \,/,$(MOZ_DIRECTX_SDK_PATH))/Lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)')
222 endif
223 endif
224 endif # WINNT
225
226 ifdef MOZ_JPROF
227 EXTRA_DSO_LDOPTS += -ljprof
228 endif
229
230 ifdef MOZ_ENABLE_QT
231 EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS) $(XEXT_LIBS)
232 endif
233
234 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
235 ifdef MOZ_GSTREAMER
236 EXTRA_DSO_LDOPTS += $(GSTREAMER_LIBS)
237 endif
238 endif
239
240 # Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
241 # too old to support Python pretty-printers; if this changes, we could make
242 # this 'ifdef GNU_CC'.
243 ifeq (Linux,$(OS_ARCH))
244 # Create a GDB Python auto-load file alongside the libxul shared library in
245 # the build directory.
246 PP_TARGETS += LIBXUL_AUTOLOAD
247 LIBXUL_AUTOLOAD = $(topsrcdir)/toolkit/library/libxul.so-gdb.py.in
248 LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
249 endif
250
251 OS_LIBS += $(LIBICONV)
252
253 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
254 OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
255 endif

mercurial