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/.
6 topsrcdir
= @top_srcdir@
10 include $(DEPTH
)/config
/autoconf.mk
12 include $(topsrcdir
)/rdf
/util
/src
/objs.mk
13 include $(topsrcdir
)/intl
/unicharutil
/util
/objs.mk
18 MOZILLA_INTERNAL_API
= 1
24 ifeq ($(MOZ_WIDGET_TOOLKIT
),cocoa
)
25 # This is going to be a framework named "XUL", not an ordinary library named
28 # Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when
29 # setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX
30 # as-is so that dependencies of the form -ltracemalloc still work.
34 VPATH
+= $(topsrcdir
)/build
/
36 ifeq ($(OS_ARCH
)_
$(GNU_CC
),WINNT_
)
37 CPPSRCS
+= dlldeps-xul.
cpp
41 CPPSRCS
+= dlldeps-xul.
cpp
44 SHARED_LIBRARY_LIBS
+= \
45 $(DEPTH
)/toolkit
/components
/osfile
/$(LIB_PREFIX
)osfile_s.
$(LIB_SUFFIX
) \
46 $(DEPTH
)/toolkit
/xre
/$(LIB_PREFIX
)xulapp_s.
$(LIB_SUFFIX
) \
49 SHARED_LIBRARY_LIBS
+= \
50 $(foreach component
,$(COMPONENT_LIBS
),$(DEPTH
)/staticlib
/components
/$(LIB_PREFIX
)$(component
).
$(LIB_SUFFIX
)) \
51 $(foreach lib
,$(STATIC_LIBS
),$(DEPTH
)/staticlib
/$(LIB_PREFIX
)$(lib
).
$(LIB_SUFFIX
)) \
55 nsStaticXULComponents.
cpp \
58 ifeq ($(OS_ARCH
),WINNT
)
64 ifeq ($(OS_ARCH
)_
$(GNU_CC
),WINNT_
)
69 RCINCLUDE
= xulrunner.rc
71 ifndef MOZ_NATIVE_ZLIB
72 CPPSRCS
+= dlldeps-zlib.
cpp
75 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/widget
/windows
76 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/xpcom
/base
85 ifndef MOZ_NATIVE_ZLIB
86 CPPSRCS
+= dlldeps-zlib.
cpp
89 RESFILE
= xulrunos2.res
90 RCFLAGS
+= -i
$(topsrcdir
)/widget
/os2
92 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/widget
/os2
93 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/xpcom
/base
110 STATIC_LIBS
+= mozril_s
114 STATIC_LIBS
+= mozdbus_s mozipcunixsocket_s
117 ifeq (gonk
,$(MOZ_WIDGET_TOOLKIT
))
118 STATIC_LIBS
+= moznetd_s
121 ifdef MOZ_B2G_CAMERA
#{
122 OS_LIBS
+= -lstagefright
-lstagefright_omx
126 STATIC_LIBS
+= ipdlunittest_s
129 ifeq (Linux
,$(OS_ARCH
))
130 ifneq (Android
,$(OS_TARGET
))
142 # component libraries
148 jar
$(VERSION_NUMBER
) \
189 ifdef MOZ_ENABLE_GTK2
196 ifneq (,$(filter cocoa
,$(MOZ_WIDGET_TOOLKIT
)))
203 ifeq (qt
,$(MOZ_WIDGET_TOOLKIT
))
210 ifneq (,$(filter windows
,$(MOZ_WIDGET_TOOLKIT
)))
217 DEFINES
+= -DMOZ_JSDEBUGGER
223 ifdef MOZ_PREF_EXTENSIONS
224 DEFINES
+= -DMOZ_PREF_EXTENSIONS
230 ifdef MOZ_AUTH_EXTENSION
231 COMPONENT_LIBS
+= auth
232 DEFINES
+= -DMOZ_AUTH_EXTENSION
235 ifdef MOZ_PERMISSIONS
236 COMPONENT_LIBS
+= cookie permissions
237 DEFINES
+= -DMOZ_PERMISSIONS
240 ifdef MOZ_UNIVERSALCHARDET
241 COMPONENT_LIBS
+= universalchardet
242 DEFINES
+= -DMOZ_UNIVERSALCHARDET
245 ifeq (,$(filter android gonk qt os2 cocoa windows
,$(MOZ_WIDGET_TOOLKIT
)))
247 COMPONENT_LIBS
+= fileview
248 DEFINES
+= -DMOZ_FILEVIEW
266 ifdef MOZ_ENABLE_GTK2
267 COMPONENT_LIBS
+= widget_gtk2
270 ifdef MOZ_ENABLE_GTK2
272 STATIC_LIBS
+= gtkxtbin
276 # Platform-specific icon channel stuff - supported mostly-everywhere
277 ifneq (,$(filter windows os2 mac cocoa gtk2 qt android
,$(MOZ_WIDGET_TOOLKIT
)))
278 DEFINES
+= -DICON_DECODER
279 COMPONENT_LIBS
+= imgicon
282 ifeq ($(MOZ_WIDGET_TOOLKIT
),android
)
283 COMPONENT_LIBS
+= widget_android
284 STATIC_LIBS
+= skia_npapi
287 ifeq ($(MOZ_WIDGET_TOOLKIT
),gonk
)
288 COMPONENT_LIBS
+= widget_gonk
291 STATIC_LIBS
+= thebes gl ycbcr
293 ifdef MOZ_ENABLE_PROFILER_SPS
294 COMPONENT_LIBS
+= profiler
297 ifeq (windows
,$(MOZ_WIDGET_TOOLKIT
))
298 COMPONENT_LIBS
+= widget_windows
300 ifeq (os2
,$(MOZ_WIDGET_TOOLKIT
))
301 COMPONENT_LIBS
+= wdgtos2
303 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
304 COMPONENT_LIBS
+= widget_mac
306 ifeq (qt
,$(MOZ_WIDGET_TOOLKIT
))
307 COMPONENT_LIBS
+= widget_qt
311 COMPONENT_LIBS
+= accessibility
314 ifdef MOZ_ENABLE_XREMOTE
315 COMPONENT_LIBS
+= remoteservice
319 DEFINES
+= -DMOZ_SPELLCHECK
320 COMPONENT_LIBS
+= spellchecker
324 DEFINES
+= -DMOZ_ZIPWRITER
325 COMPONENT_LIBS
+= zipwriter
328 COMPONENT_LIBS
+= services-crypto
332 COMPONENT_LIBS
+= gkdebug
336 ifdef MOZ_APP_COMPONENT_LIBS
337 COMPONENT_LIBS
+= $(MOZ_APP_COMPONENT_LIBS
)
340 ifeq ($(MOZ_WIDGET_TOOLKIT
),cocoa
)
341 OS_LIBS
+= -framework OpenGL
-lcups
344 EXTRA_DSO_LDOPTS
+= \
348 $(MOZ_CAIRO_OSLIBS
) \
349 $(MOZ_APP_EXTRA_LIBS
) \
353 ifdef MOZ_NATIVE_JPEG
354 EXTRA_DSO_LDOPTS
+= $(MOZ_JPEG_LIBS
)
358 EXTRA_DSO_LDOPTS
+= $(MOZ_PNG_LIBS
)
361 ifneq (WINNT
,$(OS_ARCH
))
362 EXTRA_DSO_LDOPTS
+= $(MOZ_ZLIB_LIBS
)
365 ifdef MOZ_NATIVE_HUNSPELL
366 EXTRA_DSO_LDOPTS
+= $(MOZ_HUNSPELL_LIBS
)
369 ifdef MOZ_NATIVE_LIBEVENT
370 EXTRA_DSO_LDOPTS
+= $(MOZ_LIBEVENT_LIBS
)
373 ifdef MOZ_NATIVE_LIBVPX
374 EXTRA_DSO_LDOPTS
+= $(MOZ_LIBVPX_LIBS
)
377 ifndef MOZ_TREE_PIXMAN
378 EXTRA_DSO_LDOPTS
+= $(MOZ_PIXMAN_LIBS
)
381 EXTRA_DSO_LDOPTS
+= $(call EXPAND_LIBNAME_PATH
,gkmedias
,$(DIST
)/lib
)
384 ifdef MOZ_PEERCONNECTION
385 COMPONENT_LIBS
+= peerconnection
387 ifdef MOZ_WEBRTC_SIGNALING
388 EXTRA_DSO_LDOPTS
+= \
389 $(DEPTH
)/media
/mtransport
/build
/$(LIB_PREFIX
)mtransport.
$(LIB_SUFFIX
) \
390 $(DEPTH
)/media
/webrtc
/signaling
/signaling_ecc
/$(LIB_PREFIX
)ecc.
$(LIB_SUFFIX
) \
391 $(DEPTH
)/media
/webrtc
/signaling
/signaling_sipcc
/$(LIB_PREFIX
)sipcc.
$(LIB_SUFFIX
) \
394 ifdef MOZ_WEBRTC_IN_LIBXUL
395 include $(topsrcdir
)/media
/webrtc
/shared_libs.mk
396 EXTRA_DSO_LDOPTS
+= $(WEBRTC_LIBS
)
397 ifeq (WINNT
,$(OS_TARGET
))
398 EXTRA_DSO_LDOPTS
+= \
399 -LIBPATH
:"$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)" \
401 OS_LIBS
+= $(call EXPAND_LIBNAME
,secur32 crypt32 iphlpapi strmiids dmoguids wmcodecdspuuid amstrmid msdmo wininet
)
407 ifdef MOZ_SYDNEYAUDIO
408 ifeq ($(OS_ARCH
),Linux
)
409 EXTRA_DSO_LDOPTS
+= $(MOZ_ALSA_LIBS
)
415 EXTRA_DSO_LDOPTS
+= $(MOZ_PULSEAUDIO_LIBS
)
419 ifdef HAVE_CLOCK_MONOTONIC
420 EXTRA_DSO_LDOPTS
+= $(REALTIME_LIBS
)
423 ifeq (android
,$(MOZ_WIDGET_TOOLKIT
))
427 ifeq (gonk
,$(MOZ_WIDGET_TOOLKIT
))
447 $(topsrcdir
)/intl
/unicharutil
/util
/objs.mk \
448 $(topsrcdir
)/rdf
/util
/src
/objs.mk \
452 $(INTL_UNICHARUTIL_UTIL_LCPPSRCS
) \
453 $(RDF_UTIL_SRC_LCPPSRCS
) \
457 $(INTL_UNICHARUTIL_UTIL_LCPPSRCS
) \
458 $(RDF_UTIL_SRC_LCPPSRCS
) \
461 LOCAL_INCLUDES
+= -I
$(topsrcdir
)/intl
/unicharutil
/util \
462 -I
$(topsrcdir
)/intl
/unicharutil
/src
464 ifneq (,$(filter OS2 WINNT
,$(OS_ARCH
)))
465 SDK_LIBRARY
= $(IMPORT_LIBRARY
)
467 SDK_LIBRARY
= $(SHARED_LIBRARY
)
470 # See bug 653662 - some builders are hitting an internal size limit on
471 # incremental builds. Disable incremental linking for debug builds on VC8 or
473 # See: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/c34d5c37-ca4a-4580-9c7c-4379a8c76d1f/
474 ifeq ($(OS_ARCH
),WINNT
)
475 IS_32BIT_HOST
:= $(if
$(filter AMD64
,$(PROCESSOR_ARCHITECTURE
) $(PROCESSOR_ARCHITEW6432
)),,yes
)
476 ifneq (,$(or
$(filter 1400,$(_MSC_VER
)),$(IS_32BIT_HOST
)))
478 EXTRA_DSO_LDOPTS
+= -INCREMENTAL
:NO
483 EXTRA_DSO_LDOPTS
+= $(LIBS_DIR
) $(EXTRA_DSO_LIBS
)
485 DEFINES
+= -DIMPL_XREAPI
487 EXTRA_DSO_LDOPTS
+= $(NSPR_LIBS
) $(MOZALLOC_LIB
)
489 ifeq ($(MOZ_WIDGET_TOOLKIT
),cocoa
)
490 CXXFLAGS
+= $(TK_CFLAGS
)
492 -framework SystemConfiguration \
495 -F
/System
/Library
/PrivateFrameworks
-framework CoreUI \
500 ifeq ($(OS_ARCH
),Darwin
)
501 ifdef MOZ_SYDNEYAUDIO
504 -framework CoreAudio \
505 -framework AudioToolbox \
506 -framework AudioUnit \
508 -framework Foundation \
510 -framework Security \
515 ifneq (,$(filter NetBSD OpenBSD
,$(OS_ARCH
)))
516 ifdef MOZ_SYDNEYAUDIO
517 EXTRA_DSO_LDOPTS
+= -lossaudio
521 ifeq (OpenBSD
,$(OS_ARCH
))
523 EXTRA_DSO_LDOPTS
+= -lsndio
527 ifdef MOZ_PLATFORM_MAEMO
528 EXTRA_DSO_LDOPTS
+= $(MOZ_PLATFORM_MAEMO_LIBS
)
531 ifdef MOZ_ENABLE_LIBCONIC
532 EXTRA_DSO_LDOPTS
+= $(LIBCONIC_LIBS
)
535 ifdef MOZ_ENABLE_DBUS
536 EXTRA_DSO_LDOPTS
+= $(MOZ_DBUS_GLIB_LIBS
)
539 ifeq (gtk2
,$(MOZ_WIDGET_TOOLKIT
))
540 EXTRA_DSO_LDOPTS
+= $(XLDFLAGS
) $(XLIBS
) $(XEXT_LIBS
) $(XCOMPOSITE_LIBS
) $(MOZ_PANGO_LIBS
) $(MOZ_GTK2_LIBS
) $(XT_LIBS
) -lgthread-2.0
541 EXTRA_DSO_LDOPTS
+= $(FT2_LIBS
)
544 ifeq (qt
,$(MOZ_WIDGET_TOOLKIT
))
545 EXTRA_DSO_LDOPTS
+= $(XLDFLAGS
) $(XLIBS
) $(XT_LIBS
) $(MOZ_QT_LIBS
)
546 EXTRA_DSO_LDOPTS
+= $(FT2_LIBS
) $(MOZ_PANGO_LIBS
)
547 EXTRA_DSO_LDOPTS
+= $(LIBXUL_DIST
)/..
/widget
/qt
/faststartupqt
/$(LIB_PREFIX
)faststartupqt.
$(LIB_SUFFIX
)
550 ifdef MOZ_TREE_FREETYPE
551 ifndef MOZ_TREE_CAIRO
552 EXTRA_DSO_LDOPTS
+= $(FT2_LIBS
)
556 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
557 EXTRA_DSO_LDOPTS
+= $(MOZ_STARTUP_NOTIFICATION_LIBS
)
560 ifdef MOZ_ENABLE_LIBPROXY
561 EXTRA_DSO_LDOPTS
+= $(MOZ_LIBPROXY_LIBS
)
564 ifeq ($(OS_ARCH
),SunOS
)
566 EXTRA_DSO_LDOPTS
+= -lelf
568 EXTRA_DSO_LDOPTS
+= -lelf
-ldemangle
572 ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD
,$(OS_ARCH
)))
573 OS_LIBS
+= $(call EXPAND_LIBNAME
,kvm
)
574 # keep `environ' unresolved, see bug 14426 for binutils
575 EXTRA_DSO_LDOPTS
+= -Wl
,--warn-unresolved-symbols
578 ifeq ($(OS_ARCH
),WINNT
)
579 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
)
581 OS_LIBS
+= $(call EXPAND_LIBNAME
,oleacc
)
584 OS_LIBS
+= $(call EXPAND_LIBNAME
,delayimp
)
585 EXTRA_DSO_LDOPTS
+= \
586 -DELAYLOAD
:psapi.dll \
587 -DELAYLOAD
:dbghelp.dll \
588 -DELAYLOAD
:rasapi32.dll \
589 -DELAYLOAD
:rasdlg.dll \
590 -DELAYLOAD
:comdlg32.dll \
591 -DELAYLOAD
:winspool.drv \
592 -DELAYLOAD
:secur32.dll \
593 -DELAYLOAD
:wininet.dll \
596 # See nsDllMain for an explanation
599 EXTRA_DSO_LDOPTS
+= -DELAYLOAD
:VCCORLIB
$(CRTDLLVERSION
)D.DLL
601 EXTRA_DSO_LDOPTS
+= -DELAYLOAD
:VCCORLIB
$(CRTDLLVERSION
).DLL
603 EXTRA_DSO_LDOPTS
+= -DELAYLOAD
:API-MS-WIN-CORE-WINRT-L
$(CRTEXPDLLVERSION
).DLL
604 EXTRA_DSO_LDOPTS
+= -DELAYLOAD
:API-MS-WIN-CORE-WINRT-STRING-L
$(CRTEXPDLLVERSION
).DLL
608 EXTRA_DSO_LDOPTS
+= -DELAYLOAD
:oleacc.dll
614 EXTRA_DSO_LDOPTS
+= -ljprof
618 EXTRA_DSO_LDOPTS
+= $(MOZ_QT_LDFLAGS
) $(XEXT_LIBS
)
622 EXTRA_DSO_LDOPTS
+= $(GSTREAMER_LIBS
)
625 include $(topsrcdir
)/config
/rules.mk
627 export:: $(RDF_UTIL_SRC_CPPSRCS
) $(INTL_UNICHARUTIL_UTIL_CPPSRCS
)
630 # need widget/windows for resource.h (included from widget.rc)
632 -I
$(topsrcdir
)/config \
633 -I
$(topsrcdir
)/widget
/windows \
636 OS_LIBS
+= $(LIBICONV
)
640 -D_IMPL_NS_STRINGAPI \
647 ifeq ($(MOZ_WIDGET_TOOLKIT
),windows
)
648 OS_LIBS
+= $(call EXPAND_LIBNAME
,usp10 oleaut32
)
651 ifeq ($(OS_ARCH
),OpenBSD
)
652 # Needed by nsAuthGSSAPI
653 EXTRA_DSO_LDOPTS
+= -lkrb5
-lcrypto
658 DEFINES
+= -DENABLE_LAYOUTDEBUG
662 ifeq (WINNT_1
,$(OS_TARGET
)_
$(MOZ_PROFILE_USE
))
663 # Wrap linker to measure peak virtual memory usage.
664 LD
:= $(PYTHON
) $(topsrcdir
)/build
/link.py
$(CURDIR
)/linker-vsize
$(LD
)