michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: # You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) michael@0: # This is going to be a framework named "XUL", not an ordinary library named michael@0: # "libxul.dylib" michael@0: SHARED_LIBRARY_NAME=XUL michael@0: # Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when michael@0: # setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX michael@0: # as-is so that dependencies of the form -ltracemalloc still work. michael@0: MAKE_FRAMEWORK=1 michael@0: else michael@0: SHARED_LIBRARY_NAME=xul michael@0: endif michael@0: michael@0: SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,xul,$(DEPTH)/toolkit/library) michael@0: michael@0: EXTRA_DEPS += $(topsrcdir)/toolkit/library/libxul.mk michael@0: michael@0: # dependent libraries michael@0: ifdef MOZ_B2G_BT_BLUEZ #{ michael@0: ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) michael@0: OS_LIBS += -ldbus michael@0: endif michael@0: endif #} michael@0: michael@0: ifdef MOZ_B2G_CAMERA #{ michael@0: OS_LIBS += -lstagefright -lstagefright_omx michael@0: endif #} michael@0: michael@0: ifeq (Linux,$(OS_ARCH)) michael@0: ifneq (Android,$(OS_TARGET)) michael@0: OS_LIBS += -lrt michael@0: EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript michael@0: michael@0: symverscript: $(topsrcdir)/toolkit/library/symverscript.in michael@0: $(call py_action,preprocessor, \ michael@0: -DVERSION='$(SHARED_LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)' $< -o $@) michael@0: michael@0: EXTRA_DEPS += symverscript michael@0: endif michael@0: endif michael@0: michael@0: ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) michael@0: OS_LIBS += -lcups michael@0: endif michael@0: michael@0: EXTRA_DSO_LDOPTS += \ michael@0: $(LIBS_DIR) \ michael@0: $(MOZ_JS_LIBS) \ michael@0: $(NSS_LIBS) \ michael@0: $(MOZ_CAIRO_OSLIBS) \ michael@0: $(MOZ_APP_EXTRA_LIBS) \ michael@0: $(SQLITE_LIBS) \ michael@0: $(NULL) michael@0: michael@0: ifdef ENABLE_INTL_API michael@0: ifdef JS_SHARED_LIBRARY michael@0: EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS) michael@0: endif michael@0: endif michael@0: michael@0: ifdef MOZ_NATIVE_JPEG michael@0: EXTRA_DSO_LDOPTS += $(MOZ_JPEG_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_NATIVE_PNG michael@0: EXTRA_DSO_LDOPTS += $(MOZ_PNG_LIBS) michael@0: endif michael@0: michael@0: ifndef ZLIB_IN_MOZGLUE michael@0: EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_NATIVE_HUNSPELL michael@0: EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_NATIVE_LIBEVENT michael@0: EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_NATIVE_LIBVPX michael@0: EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS) michael@0: endif michael@0: michael@0: ifndef MOZ_TREE_PIXMAN michael@0: EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_DMD michael@0: EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib) michael@0: endif michael@0: michael@0: EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib) michael@0: michael@0: ifdef MOZ_WEBRTC michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: ifndef MOZ_HAS_WINSDK_WITH_D3D michael@0: EXTRA_DSO_LDOPTS += \ michael@0: -LIBPATH:'$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)' \ michael@0: $(NULL) michael@0: endif michael@0: OS_LIBS += $(call EXPAND_LIBNAME,secur32 crypt32 iphlpapi strmiids dmoguids wmcodecdspuuid amstrmid msdmo wininet) michael@0: endif michael@0: endif michael@0: michael@0: ifdef MOZ_ALSA michael@0: EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS) michael@0: endif michael@0: michael@0: ifdef HAVE_CLOCK_MONOTONIC michael@0: EXTRA_DSO_LDOPTS += $(REALTIME_LIBS) michael@0: endif michael@0: michael@0: ifeq (android,$(MOZ_WIDGET_TOOLKIT)) michael@0: OS_LIBS += -lGLESv2 michael@0: endif michael@0: michael@0: ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) michael@0: OS_LIBS += \ michael@0: -lui \ michael@0: -lmedia \ michael@0: -lhardware_legacy \ michael@0: -lhardware \ michael@0: -lutils \ michael@0: -lcutils \ michael@0: -lsysutils \ michael@0: -lcamera_client \ michael@0: -lsensorservice \ michael@0: -lstagefright \ michael@0: -lstagefright_foundation \ michael@0: -lstagefright_omx \ michael@0: -lbinder \ michael@0: -lgui \ michael@0: $(NULL) michael@0: endif michael@0: michael@0: ifneq (,$(filter rtsp,$(NECKO_PROTOCOLS))) michael@0: OS_LIBS += -lstagefright_foundation michael@0: endif michael@0: michael@0: ifdef MOZ_WMF michael@0: OS_LIBS += $(call EXPAND_LIBNAME,mfuuid wmcodecdspuuid strmiids) michael@0: endif michael@0: michael@0: ifdef MOZ_DIRECTSHOW michael@0: OS_LIBS += $(call EXPAND_LIBNAME,dmoguids wmcodecdspuuid strmiids msdmo) michael@0: endif michael@0: michael@0: EXTRA_DSO_LDOPTS += $(LIBS_DIR) michael@0: michael@0: EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) michael@0: michael@0: ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) michael@0: OS_LIBS += \ michael@0: $(TK_LIBS) \ michael@0: $(NULL) michael@0: endif michael@0: michael@0: ifeq (OpenBSD,$(OS_ARCH)) michael@0: EXTRA_DSO_LDOPTS += -lsndio michael@0: endif michael@0: michael@0: ifdef MOZ_ENABLE_DBUS michael@0: EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_WIDGET_GTK michael@0: EXTRA_DSO_LDOPTS += $(TK_LIBS) michael@0: EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(XT_LIBS) -lgthread-2.0 michael@0: EXTRA_DSO_LDOPTS += $(FT2_LIBS) michael@0: endif michael@0: michael@0: ifeq (qt,$(MOZ_WIDGET_TOOLKIT)) michael@0: EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS) michael@0: EXTRA_DSO_LDOPTS += $(FT2_LIBS) $(MOZ_PANGO_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_TREE_FREETYPE michael@0: EXTRA_DSO_LDOPTS += $(FT2_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_ENABLE_STARTUP_NOTIFICATION michael@0: EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS) michael@0: endif michael@0: michael@0: ifdef MOZ_ENABLE_LIBPROXY michael@0: EXTRA_DSO_LDOPTS += $(MOZ_LIBPROXY_LIBS) michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),SunOS) michael@0: ifdef GNU_CC michael@0: EXTRA_DSO_LDOPTS += -lelf michael@0: else michael@0: EXTRA_DSO_LDOPTS += -lelf -ldemangle michael@0: endif michael@0: endif michael@0: michael@0: ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH))) michael@0: OS_LIBS += $(call EXPAND_LIBNAME,kvm) michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),FreeBSD) michael@0: OS_LIBS += $(call EXPAND_LIBNAME,util) michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: 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) michael@0: ifdef ACCESSIBILITY michael@0: OS_LIBS += $(call EXPAND_LIBNAME,oleacc) michael@0: endif michael@0: ifdef MOZ_METRO michael@0: OS_LIBS += $(call EXPAND_LIBNAME,uiautomationcore runtimeobject) michael@0: endif michael@0: ifdef MOZ_GAMEPAD michael@0: ifdef MOZ_HAS_WINSDK_WITH_D3D michael@0: OS_LIBS += $(call EXPAND_LIBNAME,dxguid dinput8) michael@0: else michael@0: OS_LIBS += $(call EXPAND_LIBNAME_PATH,dxguid dinput8, '$(subst \,/,$(MOZ_DIRECTX_SDK_PATH))/Lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)') michael@0: endif michael@0: endif michael@0: endif # WINNT michael@0: michael@0: ifdef MOZ_JPROF michael@0: EXTRA_DSO_LDOPTS += -ljprof michael@0: endif michael@0: michael@0: ifdef MOZ_ENABLE_QT michael@0: EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS) $(XEXT_LIBS) michael@0: endif michael@0: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: ifdef MOZ_GSTREAMER michael@0: EXTRA_DSO_LDOPTS += $(GSTREAMER_LIBS) michael@0: endif michael@0: endif michael@0: michael@0: # Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is michael@0: # too old to support Python pretty-printers; if this changes, we could make michael@0: # this 'ifdef GNU_CC'. michael@0: ifeq (Linux,$(OS_ARCH)) michael@0: # Create a GDB Python auto-load file alongside the libxul shared library in michael@0: # the build directory. michael@0: PP_TARGETS += LIBXUL_AUTOLOAD michael@0: LIBXUL_AUTOLOAD = $(topsrcdir)/toolkit/library/libxul.so-gdb.py.in michael@0: LIBXUL_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir)) michael@0: endif michael@0: michael@0: OS_LIBS += $(LIBICONV) michael@0: michael@0: ifeq ($(MOZ_WIDGET_TOOLKIT),windows) michael@0: OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32) michael@0: endif