2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 01:19:09 +04:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2016-09-02 01:08:16 +03:00
|
|
|
@template
|
|
|
|
def Libxul_defines():
|
|
|
|
LIBRARY_DEFINES['MOZILLA_INTERNAL_API'] = True
|
|
|
|
LIBRARY_DEFINES['IMPL_LIBXUL'] = True
|
|
|
|
if not CONFIG['JS_SHARED_LIBRARY']:
|
|
|
|
LIBRARY_DEFINES['STATIC_EXPORTABLE_JS_API'] = True
|
|
|
|
|
2014-09-04 04:04:45 +04:00
|
|
|
@template
|
2018-08-10 22:07:29 +03:00
|
|
|
def Libxul(name, output_category=None):
|
2015-06-10 18:10:40 +03:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
2014-09-04 04:04:45 +04:00
|
|
|
# This is going to be a framework named "XUL", not an ordinary library named
|
|
|
|
# "libxul.dylib"
|
2018-08-10 22:07:29 +03:00
|
|
|
GeckoFramework(name, output_category=output_category, linkage=None)
|
2014-09-04 04:04:45 +04:00
|
|
|
SHARED_LIBRARY_NAME = 'XUL'
|
|
|
|
else:
|
2018-08-10 22:07:29 +03:00
|
|
|
GeckoSharedLibrary(name, output_category=output_category, linkage=None)
|
2014-09-04 04:04:45 +04:00
|
|
|
SHARED_LIBRARY_NAME = 'xul'
|
|
|
|
|
|
|
|
DELAYLOAD_DLLS += [
|
|
|
|
'comdlg32.dll',
|
2018-06-20 17:24:50 +03:00
|
|
|
'hid.dll',
|
|
|
|
'msimg32.dll',
|
2016-05-11 14:05:25 +03:00
|
|
|
'netapi32.dll',
|
2014-09-04 04:04:45 +04:00
|
|
|
'secur32.dll',
|
|
|
|
'wininet.dll',
|
|
|
|
'winspool.drv'
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['ACCESSIBILITY']:
|
|
|
|
DELAYLOAD_DLLS += ['oleacc.dll']
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WEBRTC']:
|
|
|
|
DELAYLOAD_DLLS += ['msdmo.dll']
|
|
|
|
|
2015-06-16 21:51:29 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
DELAYLOAD_DLLS += [
|
|
|
|
'api-ms-win-core-winrt-l1-1-0.dll',
|
|
|
|
'api-ms-win-core-winrt-string-l1-1-0.dll',
|
|
|
|
]
|
|
|
|
|
2016-11-14 12:14:29 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['ACCESSIBILITY']:
|
|
|
|
LOCAL_INCLUDES += ['!/accessible/interfaces/gecko/']
|
|
|
|
|
2017-12-08 00:09:15 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'):
|
2014-09-04 04:04:45 +04:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/widget/windows',
|
|
|
|
'/xpcom/base',
|
|
|
|
]
|
|
|
|
# config/version.mk says $(srcdir)/$(RCINCLUDE), and this needs to
|
|
|
|
# be valid in both toolkit/library and toolkit/library/gtest.
|
|
|
|
# Eventually, the make backend would do its own path canonicalization
|
|
|
|
# and config/version.mk would lift the $(srcdir)
|
|
|
|
RCINCLUDE = '$(DEPTH)/toolkit/library/xulrunner.rc'
|
|
|
|
|
2017-11-02 21:47:48 +03:00
|
|
|
# BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
|
|
|
|
# exists. Using an implicit linker script to make it fold that section in
|
|
|
|
# .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
|
|
|
|
# script however makes gold misbehave, first because it doesn't like that
|
|
|
|
# the linker script is given after crtbegin.o, and even past that, replaces
|
|
|
|
# the default section rules with those from the script instead of
|
|
|
|
# supplementing them. Which leads to a lib with a huge load of sections.
|
|
|
|
if CONFIG['OS_TARGET'] not in ('OpenBSD', 'WINNT') and CONFIG['LD_IS_BFD']:
|
|
|
|
LDFLAGS += [TOPSRCDIR + '/toolkit/library/StaticXULComponents.ld']
|
|
|
|
|
2016-09-02 01:08:16 +03:00
|
|
|
Libxul_defines()
|
2014-09-05 08:38:54 +04:00
|
|
|
|
2015-12-01 05:56:42 +03:00
|
|
|
if CONFIG['MOZ_NEEDS_LIBATOMIC']:
|
|
|
|
OS_LIBS += ['atomic']
|
2014-09-05 08:38:54 +04:00
|
|
|
|
2016-08-03 11:24:33 +03:00
|
|
|
# This option should go away in bug 1290972, but we need to wait until
|
|
|
|
# Rust 1.12 has been released.
|
2017-06-18 16:39:14 +03:00
|
|
|
# We're also linking against libresolv to solve bug 1367932.
|
2017-05-09 21:36:13 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'Darwin':
|
2018-07-17 17:27:46 +03:00
|
|
|
LDFLAGS += ['-lresolv']
|
2016-08-03 11:24:33 +03:00
|
|
|
|
2018-03-14 21:07:15 +03:00
|
|
|
if CONFIG['MOZ_DEBUG_SYMBOLS'] and CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
|
|
|
|
LDFLAGS += ['-NATVIS:%s/toolkit/library/gecko.natvis' % TOPSRCDIR]
|
|
|
|
|
2014-09-04 04:04:45 +04:00
|
|
|
Libxul('xul')
|
2013-06-18 16:13:42 +04:00
|
|
|
|
2014-07-23 08:33:09 +04:00
|
|
|
FORCE_STATIC_LIB = True
|
|
|
|
|
|
|
|
STATIC_LIBRARY_NAME = 'xul_s'
|
|
|
|
|
2013-04-24 01:54:15 +04:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
2013-10-25 03:23:05 +04:00
|
|
|
SOURCES += [
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsDllMain.cpp',
|
|
|
|
]
|
2013-06-17 23:21:01 +04:00
|
|
|
|
2014-02-10 18:03:53 +04:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/config',
|
|
|
|
# need widget/windows for resource.h (included from widget.rc)
|
|
|
|
'/widget/windows',
|
|
|
|
]
|
|
|
|
|
2017-12-08 00:09:15 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'):
|
2014-02-10 18:03:53 +04:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/xpcom/base',
|
|
|
|
]
|
|
|
|
|
2014-07-23 08:33:09 +04:00
|
|
|
DIRS += ['gtest']
|
|
|
|
|
2016-08-22 14:53:38 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
DIRS += ['dummydll']
|
|
|
|
|
2014-07-23 08:33:09 +04:00
|
|
|
# js needs to come after xul for now, because it is an archive and its content
|
|
|
|
# is discarded when it comes first.
|
|
|
|
USE_LIBS += [
|
|
|
|
'js',
|
|
|
|
]
|
|
|
|
|
|
|
|
USE_LIBS += [
|
2015-07-02 07:11:46 +03:00
|
|
|
'lgpllibs',
|
2014-08-07 09:21:03 +04:00
|
|
|
'nspr',
|
|
|
|
'nss',
|
2016-10-06 10:23:38 +03:00
|
|
|
'psshparser',
|
2014-08-07 09:21:03 +04:00
|
|
|
'sqlite',
|
|
|
|
'zlib',
|
2014-07-23 08:33:09 +04:00
|
|
|
]
|
|
|
|
|
2014-10-10 10:55:00 +04:00
|
|
|
if CONFIG['USE_ICU']:
|
2014-08-07 09:21:03 +04:00
|
|
|
USE_LIBS += [
|
|
|
|
'icu',
|
|
|
|
]
|
|
|
|
|
2016-03-16 07:32:47 +03:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
2014-07-23 08:33:09 +04:00
|
|
|
USE_LIBS += [
|
|
|
|
'mozgtk_stub',
|
|
|
|
]
|
|
|
|
|
2017-10-18 15:34:27 +03:00
|
|
|
if CONFIG['MOZ_WAYLAND']:
|
|
|
|
USE_LIBS += [
|
|
|
|
'mozwayland',
|
|
|
|
]
|
|
|
|
|
2014-07-23 08:33:09 +04:00
|
|
|
if CONFIG['MOZ_JPROF']:
|
|
|
|
USE_LIBS += [
|
|
|
|
'jprof',
|
|
|
|
]
|
|
|
|
|
2016-07-07 19:14:25 +03:00
|
|
|
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \
|
2014-08-07 09:21:03 +04:00
|
|
|
CONFIG['MOZ_TREE_FREETYPE']:
|
|
|
|
USE_LIBS += [
|
|
|
|
'freetype',
|
|
|
|
]
|
2014-07-24 19:55:33 +04:00
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
|
|
|
CXXFLAGS += CONFIG['TK_CFLAGS']
|
2014-08-06 02:25:33 +04:00
|
|
|
|
|
|
|
if CONFIG['MOZ_WEBRTC']:
|
|
|
|
if CONFIG['OS_TARGET'] == 'WINNT':
|
|
|
|
OS_LIBS += [
|
|
|
|
'secur32',
|
|
|
|
'iphlpapi',
|
|
|
|
'strmiids',
|
|
|
|
'dmoguids',
|
|
|
|
'wmcodecdspuuid',
|
|
|
|
'amstrmid',
|
|
|
|
'msdmo',
|
|
|
|
'wininet',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
|
|
|
OS_LIBS += [
|
|
|
|
'-framework OpenGL',
|
|
|
|
'-framework SystemConfiguration',
|
2016-05-19 17:48:55 +03:00
|
|
|
'-framework AVFoundation',
|
|
|
|
'-framework CoreMedia',
|
2014-08-06 02:25:33 +04:00
|
|
|
'-framework IOKit',
|
|
|
|
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
|
|
|
|
'-framework CoreUI',
|
2015-04-30 22:41:21 +03:00
|
|
|
'-framework CoreSymbolication',
|
2014-08-06 02:25:33 +04:00
|
|
|
'cups',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WMF']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'mfuuid',
|
|
|
|
'wmcodecdspuuid',
|
|
|
|
'strmiids',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'FreeBSD':
|
|
|
|
OS_LIBS += [
|
|
|
|
'util',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
OS_LIBS += [
|
2016-04-23 11:55:50 +03:00
|
|
|
'crypt32',
|
2014-08-06 02:25:33 +04:00
|
|
|
'shell32',
|
|
|
|
'ole32',
|
|
|
|
'version',
|
|
|
|
'winspool',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
|
|
|
|
OS_LIBS += [
|
|
|
|
'rt',
|
|
|
|
]
|
|
|
|
|
2017-11-03 03:16:11 +03:00
|
|
|
if CONFIG['MOZ_ANDROID_GOOGLE_VR']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'-L%s' % CONFIG['MOZ_ANDROID_GOOGLE_VR_LIBS'],
|
|
|
|
'-lgvr',
|
|
|
|
]
|
|
|
|
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
|
|
|
|
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
|
2016-08-12 10:14:08 +03:00
|
|
|
|
2018-07-26 17:05:35 +03:00
|
|
|
if CONFIG['MOZ_LIB_SECRET']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_LIB_SECRET_LIBS']
|
|
|
|
|
2016-02-01 18:49:34 +03:00
|
|
|
if CONFIG['MOZ_SYSTEM_JPEG']:
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
|
|
|
|
|
2016-02-01 18:49:34 +03:00
|
|
|
if CONFIG['MOZ_SYSTEM_PNG']:
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
|
|
|
|
|
2016-02-01 18:49:34 +03:00
|
|
|
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
|
|
|
|
|
2016-02-01 18:49:34 +03:00
|
|
|
if CONFIG['MOZ_SYSTEM_LIBVPX']:
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
|
|
|
|
|
|
|
|
if not CONFIG['MOZ_TREE_PIXMAN']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['MOZ_ALSA']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['HAVE_CLOCK_MONOTONIC']:
|
|
|
|
OS_LIBS += CONFIG['REALTIME_LIBS']
|
|
|
|
|
|
|
|
OS_LIBS += CONFIG['ICONV_LIBS']
|
|
|
|
|
2015-06-10 18:10:40 +03:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += CONFIG['TK_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'OpenBSD':
|
|
|
|
OS_LIBS += [
|
|
|
|
'sndio',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_ENABLE_DBUS']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
|
|
|
|
|
2016-03-16 08:06:26 +03:00
|
|
|
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
2016-03-16 07:32:47 +03:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += [l for l in CONFIG['TK_LIBS']
|
|
|
|
if l not in ('-lgtk-3', '-lgdk-3')]
|
|
|
|
else:
|
|
|
|
OS_LIBS += CONFIG['TK_LIBS']
|
|
|
|
OS_LIBS += CONFIG['XLDFLAGS']
|
|
|
|
OS_LIBS += CONFIG['XLIBS']
|
|
|
|
OS_LIBS += CONFIG['XEXT_LIBS']
|
|
|
|
OS_LIBS += CONFIG['MOZ_PANGO_LIBS']
|
|
|
|
OS_LIBS += CONFIG['XT_LIBS']
|
|
|
|
OS_LIBS += [
|
|
|
|
'gthread-2.0',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_STARTUP_NOTIFICATION_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['MOZ_ENABLE_LIBPROXY']:
|
|
|
|
OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'SunOS':
|
|
|
|
OS_LIBS += [
|
|
|
|
'elf',
|
|
|
|
]
|
2017-12-08 00:09:15 +03:00
|
|
|
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
2014-08-06 02:25:33 +04:00
|
|
|
OS_LIBS += [
|
|
|
|
'demangle',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'FreeBSD':
|
|
|
|
OS_LIBS += [
|
|
|
|
'util',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
OS_LIBS += [
|
|
|
|
'shell32',
|
|
|
|
'ole32',
|
|
|
|
'version',
|
|
|
|
'winspool',
|
|
|
|
'comdlg32',
|
|
|
|
'imm32',
|
|
|
|
'msimg32',
|
2016-05-11 14:05:25 +03:00
|
|
|
'netapi32',
|
2014-08-06 02:25:33 +04:00
|
|
|
'shlwapi',
|
|
|
|
'ws2_32',
|
2017-02-10 06:06:23 +03:00
|
|
|
'dwmapi',
|
2014-08-06 02:25:33 +04:00
|
|
|
'iphlpapi',
|
|
|
|
'uxtheme',
|
|
|
|
'setupapi',
|
|
|
|
'secur32',
|
|
|
|
'sensorsapi',
|
|
|
|
'portabledeviceguids',
|
|
|
|
'wininet',
|
|
|
|
'wbemuuid',
|
|
|
|
'wintrust',
|
|
|
|
'wtsapi32',
|
2015-07-29 13:27:22 +03:00
|
|
|
'locationapi',
|
|
|
|
'sapi',
|
2017-02-03 22:38:17 +03:00
|
|
|
'dxguid',
|
2018-08-30 23:17:15 +03:00
|
|
|
'dhcpcsvc',
|
2014-08-06 02:25:33 +04:00
|
|
|
]
|
|
|
|
if CONFIG['ACCESSIBILITY']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'oleacc',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|
|
|
OS_LIBS += [
|
|
|
|
'usp10',
|
|
|
|
'oleaut32',
|
|
|
|
]
|
2014-08-07 09:21:03 +04:00
|
|
|
|
2016-05-10 00:34:13 +03:00
|
|
|
if CONFIG['COMPILE_ENVIRONMENT']:
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
|
|
|
full_libname = SHARED_LIBRARY_NAME
|
|
|
|
else:
|
|
|
|
full_libname = '%s%s%s' % (
|
|
|
|
CONFIG['DLL_PREFIX'],
|
|
|
|
LIBRARY_NAME,
|
|
|
|
CONFIG['DLL_SUFFIX']
|
|
|
|
)
|
2017-02-07 01:34:06 +03:00
|
|
|
GENERATED_FILES += [('dependentlibs.list', 'dependentlibs.list.gtest')]
|
|
|
|
dep_libs_list = GENERATED_FILES[('dependentlibs.list', 'dependentlibs.list.gtest')]
|
|
|
|
dep_libs_list.script = 'dependentlibs.py:gen_list'
|
|
|
|
dep_libs_list.inputs = [
|
2016-05-10 00:34:13 +03:00
|
|
|
'!%s' % full_libname,
|
|
|
|
]
|
2017-02-07 01:34:06 +03:00
|
|
|
FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']
|
2016-05-10 00:34:13 +03:00
|
|
|
|
2017-12-08 23:39:10 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
|
|
|
|
GENERATED_FILES += ['symverscript']
|
2018-08-01 23:25:38 +03:00
|
|
|
GENERATED_FILES['symverscript'].script = '/build/gen_symverscript.py'
|
2017-12-08 23:39:10 +03:00
|
|
|
GENERATED_FILES['symverscript'].inputs = ['symverscript.in']
|
2018-08-01 23:25:38 +03:00
|
|
|
GENERATED_FILES['symverscript'].flags = [
|
|
|
|
'xul%s' % CONFIG['MOZILLA_SYMBOLVERSION']
|
|
|
|
]
|
2017-12-08 23:39:10 +03:00
|
|
|
SYMBOLS_FILE = '!symverscript'
|
|
|
|
|
2018-08-15 17:04:00 +03:00
|
|
|
# Generate GDB pretty printer-autoload files only on Linux. OSX's GDB is
|
|
|
|
# too old to support Python pretty-printers; if this changes, we could
|
|
|
|
# make this 'ifdef GNU_CC'.
|
|
|
|
if CONFIG['OS_ARCH'] == 'Linux':
|
|
|
|
# Create a GDB Python auto-load file alongside the libxul shared library
|
|
|
|
# in the build directory.
|
|
|
|
DEFINES['topsrcdir'] = TOPSRCDIR
|
|
|
|
OBJDIR_PP_FILES.toolkit.library += ['libxul.so-gdb.py.in']
|
|
|
|
|
2018-06-26 08:40:51 +03:00
|
|
|
# This library is entirely composed of Rust code, and needs to come after
|
2016-08-06 07:49:26 +03:00
|
|
|
# all the C++ code so any possible C++ -> Rust calls can be resolved.
|
2017-05-09 21:36:13 +03:00
|
|
|
USE_LIBS += ['gkrust']
|