Dactyloidae/toolkit/library/moz.build

344 lines
8.2 KiB
INI
Raw Normal View History

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.
@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
@template
def Libxul(name):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
# This is going to be a framework named "XUL", not an ordinary library named
# "libxul.dylib"
GeckoFramework(name, linkage=None)
SHARED_LIBRARY_NAME = 'XUL'
else:
GeckoSharedLibrary(name, linkage=None)
SHARED_LIBRARY_NAME = 'xul'
DELAYLOAD_DLLS += [
'comdlg32.dll',
'dbghelp.dll',
'netapi32.dll',
'PowrProf.dll',
'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']
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',
]
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'
Libxul_defines()
if CONFIG['MOZ_NEEDS_LIBATOMIC']:
OS_LIBS += ['atomic']
# 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']
Libxul('xul')
SDK_LIBRARY = True
FORCE_STATIC_LIB = True
STATIC_LIBRARY_NAME = 'xul_s'
SOURCES += [
'StaticXULComponentsStart.cpp',
]
# 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
# Don't let LTO reorder StaticXULComponentsStart.o.
if '-flto' in CONFIG['OS_CXXFLAGS']:
SOURCES['StaticXULComponentsStart.cpp'].flags += ['-fno-lto']
if CONFIG['OS_ARCH'] == 'WINNT':
SOURCES += [
'nsDllMain.cpp',
]
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',
]
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',
'lgpllibs',
'nspr',
'nss',
'psshparser',
'sqlite',
'zlib',
]
if CONFIG['USE_ICU']:
USE_LIBS += [
'icu',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
USE_LIBS += [
'mozgtk_stub',
]
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \
CONFIG['MOZ_TREE_FREETYPE']:
USE_LIBS += [
'freetype',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
CXXFLAGS += CONFIG['TK_CFLAGS']
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',
'-framework AVFoundation',
'-framework CoreMedia',
'-framework IOKit',
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
'-framework CoreUI',
'-framework CoreSymbolication',
'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 += [
'crypt32',
'shell32',
'ole32',
'version',
'winspool',
]
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']
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']
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
if CONFIG['MOZ_SYSTEM_PNG']:
OS_LIBS += CONFIG['MOZ_PNG_LIBS']
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
if CONFIG['MOZ_SYSTEM_LIBVPX']:
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 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
OS_LIBS += [
'stagefright_foundation',
]
OS_LIBS += CONFIG['ICONV_LIBS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
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']
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
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']
MoonchildProductions#1251 - Part 1: Restore initial Solaris support, fixed up. Compared with what Pale Moon had for Solaris originally, this is mostly the same zero point I started patching from, but I've made the following changes here after reviewing all this initial code I never looked at closely before. 1. In package-manifest.in for both Basilisk and Pale Moon, I've made the SPARC code for libfreebl not interefere with the x86 code, use the proper build flags, and also updated it to allow a SPARC64 build which is more likely to be used than the 32-bit SPARC code we had there. 2. See Mozilla bug #832272 and the old rules.mk patch from around Firefox 30 in oracle/solaris-userland. I believe they screwed up NSINSTALL on Solaris when they were trying to streamline the NSS buildsystem, because they started having unexplained issues with it around that time after Firefox 22 that they never properly resolved until Mozilla began building NSS with gyp files. I'm actually not even sure how relevant the thing they broke actually is to Solaris at this point, bug 665509 is so old it predates Firefox itself and goes back to the Mozilla suite days. I believe $(INSTALL) -t was wrong, and they meant $(NSINSTALL) -t because that makes more sense and is closer to what was there originally. It's what they have for WINNT, and it's possible a fix more like that could serve for Solaris as well. Alternatively, we could get rid of all these half-broken Makefiles and start building NSS with gyp files like Mozilla did. 3. I've completely cut out support for the Sun compiler and taken into account the reality that everyone builds Firefox (and therefore its forks) with GCC now on Solaris. This alone helped clean up a lot of the uglier parts of the code. 4. I've updated all remaining SOLARIS build flags to the newer XP_SOLARIS, because the SOLARIS flag is no longer set when building Solaris. 5. I've confirmed the workaround in gtxFontconfigFonts.cpp is no longer necessary. The Solaris people got impatient about implementing a half-baked patch for a fontconfig feature that wasn't ready yet back in 2009, and somehow convinced Mozilla to patch their software to work around it when really they should have just fixed or removed their broken fontconfig patch. The feature they wanted has since been implemented properly, and no version of Solaris still uses the broken patch that required this fix. If anyone had ever properly audited this code, it would have been removed a long time ago.
2019-10-01 06:07:31 -05:00
if CONFIG['OS_ARCH'] == 'SunOS':
OS_LIBS += [
'elf',
'demangle',
'sendfile',
MoonchildProductions#1251 - Part 1: Restore initial Solaris support, fixed up. Compared with what Pale Moon had for Solaris originally, this is mostly the same zero point I started patching from, but I've made the following changes here after reviewing all this initial code I never looked at closely before. 1. In package-manifest.in for both Basilisk and Pale Moon, I've made the SPARC code for libfreebl not interefere with the x86 code, use the proper build flags, and also updated it to allow a SPARC64 build which is more likely to be used than the 32-bit SPARC code we had there. 2. See Mozilla bug #832272 and the old rules.mk patch from around Firefox 30 in oracle/solaris-userland. I believe they screwed up NSINSTALL on Solaris when they were trying to streamline the NSS buildsystem, because they started having unexplained issues with it around that time after Firefox 22 that they never properly resolved until Mozilla began building NSS with gyp files. I'm actually not even sure how relevant the thing they broke actually is to Solaris at this point, bug 665509 is so old it predates Firefox itself and goes back to the Mozilla suite days. I believe $(INSTALL) -t was wrong, and they meant $(NSINSTALL) -t because that makes more sense and is closer to what was there originally. It's what they have for WINNT, and it's possible a fix more like that could serve for Solaris as well. Alternatively, we could get rid of all these half-broken Makefiles and start building NSS with gyp files like Mozilla did. 3. I've completely cut out support for the Sun compiler and taken into account the reality that everyone builds Firefox (and therefore its forks) with GCC now on Solaris. This alone helped clean up a lot of the uglier parts of the code. 4. I've updated all remaining SOLARIS build flags to the newer XP_SOLARIS, because the SOLARIS flag is no longer set when building Solaris. 5. I've confirmed the workaround in gtxFontconfigFonts.cpp is no longer necessary. The Solaris people got impatient about implementing a half-baked patch for a fontconfig feature that wasn't ready yet back in 2009, and somehow convinced Mozilla to patch their software to work around it when really they should have just fixed or removed their broken fontconfig patch. The feature they wanted has since been implemented properly, and no version of Solaris still uses the broken patch that required this fix. If anyone had ever properly audited this code, it would have been removed a long time ago.
2019-10-01 06:07:31 -05:00
]
if CONFIG['OS_ARCH'] == 'FreeBSD':
OS_LIBS += [
'util',
]
if CONFIG['OS_ARCH'] == 'WINNT':
OS_LIBS += [
'shell32',
'ole32',
'version',
'winspool',
'comdlg32',
'imm32',
'msimg32',
'netapi32',
'shlwapi',
'psapi',
'ws2_32',
'dbghelp',
'rasapi32',
'rasdlg',
'iphlpapi',
'uxtheme',
'setupapi',
'secur32',
'sensorsapi',
'portabledeviceguids',
'windowscodecs',
'wininet',
'wbemuuid',
'wintrust',
'wtsapi32',
'locationapi',
'sapi',
'dxguid',
]
if CONFIG['ACCESSIBILITY']:
OS_LIBS += [
'oleacc',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
OS_LIBS += [
'usp10',
'oleaut32',
]
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']
# This library needs to be last to make XPCOM module registration work.
USE_LIBS += ['StaticXULComponentsEnd']