2016-07-14 16:16:42 +00:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-25 21:19:09 +00: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-01 22:08:16 +00: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 00:04:45 +00:00
|
|
|
@template
|
|
|
|
def Libxul(name):
|
2015-06-10 15:10:40 +00:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
2014-09-04 00:04:45 +00:00
|
|
|
# This is going to be a framework named "XUL", not an ordinary library named
|
|
|
|
# "libxul.dylib"
|
2014-10-30 04:06:12 +00:00
|
|
|
GeckoFramework(name, linkage=None)
|
2014-09-04 00:04:45 +00:00
|
|
|
SHARED_LIBRARY_NAME = 'XUL'
|
|
|
|
else:
|
2014-10-30 04:06:12 +00:00
|
|
|
GeckoSharedLibrary(name, linkage=None)
|
2014-09-04 00:04:45 +00:00
|
|
|
SHARED_LIBRARY_NAME = 'xul'
|
|
|
|
|
|
|
|
DELAYLOAD_DLLS += [
|
|
|
|
'comdlg32.dll',
|
|
|
|
'dbghelp.dll',
|
2016-05-11 11:05:25 +00:00
|
|
|
'netapi32.dll',
|
2015-08-05 14:38:51 +00:00
|
|
|
'PowrProf.dll',
|
2014-09-04 00:04:45 +00:00
|
|
|
'psapi.dll',
|
|
|
|
'rasapi32.dll',
|
|
|
|
'rasdlg.dll',
|
|
|
|
'secur32.dll',
|
|
|
|
'wininet.dll',
|
|
|
|
'winspool.drv'
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['ACCESSIBILITY']:
|
|
|
|
DELAYLOAD_DLLS += ['oleacc.dll']
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WEBRTC']:
|
|
|
|
DELAYLOAD_DLLS += ['msdmo.dll']
|
|
|
|
|
2015-06-16 18:51:29 +00: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',
|
|
|
|
]
|
|
|
|
|
2014-09-04 00:04:45 +00:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
|
|
|
|
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'
|
|
|
|
|
2016-09-01 22:08:16 +00:00
|
|
|
Libxul_defines()
|
2014-09-05 04:38:54 +00:00
|
|
|
|
2015-12-01 02:56:42 +00:00
|
|
|
if CONFIG['MOZ_NEEDS_LIBATOMIC']:
|
|
|
|
OS_LIBS += ['atomic']
|
2014-09-05 04:38:54 +00:00
|
|
|
|
2016-08-03 08:24:33 +00:00
|
|
|
# This option should go away in bug 1290972, but we need to wait until
|
|
|
|
# Rust 1.12 has been released.
|
|
|
|
if CONFIG['MOZ_RUST'] and CONFIG['OS_ARCH'] == 'Darwin':
|
|
|
|
LDFLAGS += ['-Wl,-no_compact_unwind']
|
|
|
|
|
2014-09-04 00:04:45 +00:00
|
|
|
Libxul('xul')
|
2013-06-18 12:13:42 +00:00
|
|
|
|
2014-07-23 04:33:09 +00:00
|
|
|
SDK_LIBRARY = True
|
|
|
|
|
|
|
|
FORCE_STATIC_LIB = True
|
|
|
|
|
|
|
|
STATIC_LIBRARY_NAME = 'xul_s'
|
|
|
|
|
2013-10-24 23:23:05 +00:00
|
|
|
SOURCES += [
|
2013-11-19 04:45:31 +00:00
|
|
|
'StaticXULComponentsStart.cpp',
|
2013-04-23 21:54:15 +00:00
|
|
|
]
|
|
|
|
|
2013-11-19 04:45:31 +00:00
|
|
|
# This, combined with the fact the file is first, makes the start pointer
|
|
|
|
# it contains first in Windows PGO builds.
|
|
|
|
SOURCES['StaticXULComponentsStart.cpp'].no_pgo = True
|
|
|
|
|
2014-08-28 20:41:18 +00:00
|
|
|
# Don't let LTO reorder StaticXULComponentsStart.o.
|
|
|
|
if '-flto' in CONFIG['OS_CXXFLAGS']:
|
|
|
|
SOURCES['StaticXULComponentsStart.cpp'].flags += ['-fno-lto']
|
|
|
|
|
2013-04-23 21:54:15 +00:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
2013-10-24 23:23:05 +00:00
|
|
|
SOURCES += [
|
2013-04-23 21:54:15 +00:00
|
|
|
'nsDllMain.cpp',
|
|
|
|
]
|
2013-06-17 19:21:01 +00:00
|
|
|
|
2014-02-10 14:03:53 +00:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/config',
|
|
|
|
# need widget/windows for resource.h (included from widget.rc)
|
|
|
|
'/widget/windows',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
|
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/xpcom/base',
|
|
|
|
]
|
|
|
|
|
2014-07-23 04:33:09 +00:00
|
|
|
DIRS += ['gtest']
|
|
|
|
|
|
|
|
# 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 += [
|
|
|
|
'gkmedias',
|
2015-07-02 04:11:46 +00:00
|
|
|
'lgpllibs',
|
2014-08-07 05:21:03 +00:00
|
|
|
'nspr',
|
|
|
|
'nss',
|
2016-10-06 07:23:38 +00:00
|
|
|
'psshparser',
|
2014-08-07 05:21:03 +00:00
|
|
|
'sqlite',
|
|
|
|
'zlib',
|
2014-07-23 04:33:09 +00:00
|
|
|
]
|
|
|
|
|
2014-10-10 06:55:00 +00:00
|
|
|
if CONFIG['USE_ICU']:
|
2014-08-07 05:21:03 +00:00
|
|
|
USE_LIBS += [
|
|
|
|
'icu',
|
|
|
|
]
|
|
|
|
|
2016-03-16 04:32:47 +00:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
2014-07-23 04:33:09 +00:00
|
|
|
USE_LIBS += [
|
|
|
|
'mozgtk_stub',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_JPROF']:
|
|
|
|
USE_LIBS += [
|
|
|
|
'jprof',
|
|
|
|
]
|
|
|
|
|
2016-07-07 16:14:25 +00:00
|
|
|
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \
|
2014-08-07 05:21:03 +00:00
|
|
|
CONFIG['MOZ_TREE_FREETYPE']:
|
|
|
|
USE_LIBS += [
|
|
|
|
'freetype',
|
|
|
|
]
|
2014-07-24 15:55:33 +00:00
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
|
|
|
CXXFLAGS += CONFIG['TK_CFLAGS']
|
2014-08-05 22:25:33 +00: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 14:48:55 +00:00
|
|
|
'-framework AVFoundation',
|
|
|
|
'-framework CoreMedia',
|
2014-08-05 22:25:33 +00:00
|
|
|
'-framework IOKit',
|
|
|
|
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
|
|
|
|
'-framework CoreUI',
|
2015-04-30 19:41:21 +00:00
|
|
|
'-framework CoreSymbolication',
|
2014-08-05 22:25:33 +00:00
|
|
|
'cups',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WMF']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'mfuuid',
|
|
|
|
'wmcodecdspuuid',
|
|
|
|
'strmiids',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_DIRECTSHOW']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'dmoguids',
|
|
|
|
'wmcodecdspuuid',
|
|
|
|
'strmiids',
|
|
|
|
'msdmo',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'FreeBSD':
|
|
|
|
OS_LIBS += [
|
|
|
|
'util',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
OS_LIBS += [
|
2016-04-23 08:55:50 +00:00
|
|
|
'crypt32',
|
2014-08-05 22:25:33 +00:00
|
|
|
'shell32',
|
|
|
|
'ole32',
|
|
|
|
'version',
|
|
|
|
'winspool',
|
|
|
|
]
|
|
|
|
|
2016-10-28 21:25:23 +00:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
2014-08-05 22:25:33 +00:00
|
|
|
OS_LIBS += [
|
|
|
|
'dbus',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
|
|
|
|
OS_LIBS += [
|
|
|
|
'rt',
|
|
|
|
]
|
|
|
|
|
|
|
|
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
|
|
|
|
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
|
2016-08-12 07:14:08 +00:00
|
|
|
|
|
|
|
if CONFIG['SERVO_TARGET_DIR']:
|
|
|
|
if CONFIG['_MSC_VER']:
|
|
|
|
OS_LIBS += ['%s/geckoservo' % CONFIG['SERVO_TARGET_DIR']]
|
|
|
|
else:
|
|
|
|
OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo']
|
2014-08-05 22:25:33 +00:00
|
|
|
|
2016-02-01 15:49:34 +00:00
|
|
|
if CONFIG['MOZ_SYSTEM_JPEG']:
|
2014-08-05 22:25:33 +00:00
|
|
|
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
|
|
|
|
|
2016-02-01 15:49:34 +00:00
|
|
|
if CONFIG['MOZ_SYSTEM_PNG']:
|
2014-08-05 22:25:33 +00:00
|
|
|
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
|
|
|
|
|
2016-02-01 15:49:34 +00:00
|
|
|
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
|
2014-08-05 22:25:33 +00:00
|
|
|
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
|
|
|
|
|
2016-02-01 15:49:34 +00:00
|
|
|
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
2014-08-05 22:25:33 +00:00
|
|
|
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
|
|
|
|
|
2016-02-01 15:49:34 +00:00
|
|
|
if CONFIG['MOZ_SYSTEM_LIBVPX']:
|
2014-08-05 22:25:33 +00: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']
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
|
|
|
OS_LIBS += [
|
|
|
|
'GLESv2',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
|
|
|
OS_LIBS += [
|
|
|
|
'ui',
|
|
|
|
'media',
|
|
|
|
'hardware_legacy',
|
|
|
|
'hardware',
|
|
|
|
'utils',
|
|
|
|
'cutils',
|
|
|
|
'sysutils',
|
|
|
|
'camera_client',
|
|
|
|
'sensorservice',
|
|
|
|
'stagefright',
|
|
|
|
'stagefright_foundation',
|
|
|
|
'stagefright_omx',
|
|
|
|
'binder',
|
|
|
|
'gui',
|
|
|
|
'mtp',
|
|
|
|
]
|
|
|
|
|
2015-05-17 05:21:00 +00:00
|
|
|
if int(CONFIG['ANDROID_VERSION']) >= 17:
|
|
|
|
OS_LIBS += [
|
|
|
|
'sync',
|
|
|
|
]
|
|
|
|
|
2015-05-21 03:06:00 +00:00
|
|
|
if CONFIG['ANDROID_VERSION'] >= '16':
|
|
|
|
OS_LIBS += [
|
|
|
|
'mdnssd',
|
|
|
|
]
|
|
|
|
|
2014-08-05 22:25:33 +00:00
|
|
|
if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'stagefright_foundation',
|
|
|
|
]
|
|
|
|
|
|
|
|
OS_LIBS += CONFIG['ICONV_LIBS']
|
|
|
|
|
2015-06-10 15:10:40 +00:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
2014-08-05 22:25:33 +00: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 05:06:26 +00:00
|
|
|
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
2016-03-16 04:32:47 +00:00
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
2014-08-05 22:25:33 +00: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',
|
|
|
|
]
|
|
|
|
if CONFIG['GNU_CC']:
|
|
|
|
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 11:05:25 +00:00
|
|
|
'netapi32',
|
2014-08-05 22:25:33 +00:00
|
|
|
'shlwapi',
|
|
|
|
'psapi',
|
|
|
|
'ws2_32',
|
|
|
|
'dbghelp',
|
|
|
|
'rasapi32',
|
|
|
|
'rasdlg',
|
|
|
|
'iphlpapi',
|
|
|
|
'uxtheme',
|
|
|
|
'setupapi',
|
|
|
|
'secur32',
|
|
|
|
'sensorsapi',
|
|
|
|
'portabledeviceguids',
|
|
|
|
'windowscodecs',
|
|
|
|
'wininet',
|
|
|
|
'wbemuuid',
|
|
|
|
'wintrust',
|
|
|
|
'wtsapi32',
|
2015-07-29 10:27:22 +00:00
|
|
|
'locationapi',
|
|
|
|
'sapi',
|
2014-08-05 22:25:33 +00:00
|
|
|
]
|
|
|
|
if CONFIG['ACCESSIBILITY']:
|
|
|
|
OS_LIBS += [
|
|
|
|
'oleacc',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|
|
|
OS_LIBS += [
|
|
|
|
'usp10',
|
|
|
|
'oleaut32',
|
|
|
|
]
|
2014-08-07 05:21:03 +00:00
|
|
|
|
2016-05-09 21:34:13 +00: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']
|
|
|
|
)
|
|
|
|
GENERATED_FILES += ['dependentlibs.list']
|
|
|
|
GENERATED_FILES['dependentlibs.list'].script = 'dependentlibs.py:gen_list'
|
|
|
|
GENERATED_FILES['dependentlibs.list'].inputs = [
|
|
|
|
'!%s' % full_libname,
|
|
|
|
]
|
|
|
|
FINAL_TARGET_FILES += ['!dependentlibs.list']
|
|
|
|
|
2016-08-06 04:49:26 +00:00
|
|
|
# This library needs to be last to make XPCOM module registration work.
|
2014-08-07 05:21:03 +00:00
|
|
|
USE_LIBS += ['StaticXULComponentsEnd']
|
2016-08-06 04:49:26 +00:00
|
|
|
|
|
|
|
# The above library needs to be last for C++ purposes. This library,
|
|
|
|
# however, is entirely composed of Rust code, and needs to come after
|
|
|
|
# all the C++ code so any possible C++ -> Rust calls can be resolved.
|
|
|
|
if CONFIG['MOZ_RUST']:
|
|
|
|
USE_LIBS += ['gkrust']
|