summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-27 15:57:18 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-27 15:57:18 +0200
commitd990d8ab2cade6c928e8bbe56ae038d020cef599 (patch)
treec7561ae0f303cb0d4a7a7507178531b4852e4dea /build
parent0c36b27511c1fbca594f0426c493ef601fda3e4c (diff)
parent8d5ec757ece850fb7ad5c712868f305636e41177 (diff)
downloadUXP-d990d8ab2cade6c928e8bbe56ae038d020cef599.tar
UXP-d990d8ab2cade6c928e8bbe56ae038d020cef599.tar.gz
UXP-d990d8ab2cade6c928e8bbe56ae038d020cef599.tar.lz
UXP-d990d8ab2cade6c928e8bbe56ae038d020cef599.tar.xz
UXP-d990d8ab2cade6c928e8bbe56ae038d020cef599.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into js_array_values_1
Diffstat (limited to 'build')
-rw-r--r--build/directive4.py31
-rw-r--r--build/moz.configure/old.configure2
-rw-r--r--build/moz.configure/rust.configure166
-rw-r--r--build/moz.configure/toolchain.configure1
-rw-r--r--build/mozconfig.rust10
-rw-r--r--build/templates.mozbuild8
6 files changed, 13 insertions, 205 deletions
diff --git a/build/directive4.py b/build/directive4.py
index 2a49f3028..8f05eeed5 100644
--- a/build/directive4.py
+++ b/build/directive4.py
@@ -4,11 +4,9 @@
# Imports
from __future__ import print_function, unicode_literals
-from collections import OrderedDict
import os
import sys
-import json
# Sanity check
if not len(sys.argv) > 1:
@@ -19,6 +17,7 @@ if not len(sys.argv) > 1:
listConfigure = sys.argv[1:]
listConfig = []
strBrandingDirectory = ""
+listViolations = []
# Build a list of set configure variables
for _value in listConfigure:
@@ -33,8 +32,8 @@ for _value in listConfigure:
if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("branding/official")) or (strBrandingDirectory.endswith("branding/unstable")):
# Applies to Pale Moon and Basilisk
if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig):
- # Define a list of system libs
- listSystemLibs = [
+ listViolations += [
+ 'MOZ_SANDBOX',
'MOZ_SYSTEM_LIBEVENT',
'MOZ_SYSTEM_NSS',
'MOZ_SYSTEM_NSPR',
@@ -47,25 +46,17 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br
'MOZ_SYSTEM_JEMALLOC'
]
- # Iterate through system libs and output 1 to DIRECTIVE4 if any are found
- for _value in listSystemLibs:
- if _value in listConfig:
- sys.stdout.write("1")
- sys.exit(1)
-
- # Applies only to Pale Moon
+ # Applies to Pale Moon Only
if 'MC_PALEMOON' in listConfig:
- # Define a list of configure features that are in violation of Official branding
- listFeatureViolations = [
- 'MOZ_SANDBOX',
+ listViolations += [
'MOZ_WEBRTC'
]
-
- # Iterate through features and output 1 to DIRECTIVE4 if any violations are found
- for _value in listFeatureViolations:
- if _value in listConfig:
- sys.stdout.write("1")
- sys.exit(1)
+
+ # Iterate through enabled violations and output 1 to DIRECTIVE4 if any are found
+ for _value in listViolations:
+ if _value in listConfig:
+ sys.stdout.write("1")
+ sys.exit(1)
# Exit outputting nothing to DIRECTIVE4 being empty because there are no violations
sys.exit(0)
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index b33f18623..ffdea81b0 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -175,6 +175,7 @@ def old_configure_options(*options):
'--enable-directshow',
'--enable-dtrace',
'--enable-dump-painting',
+ '--enable-eme',
'--enable-elf-hack',
'--enable-extensions',
'--enable-faststripe',
@@ -213,6 +214,7 @@ def old_configure_options(*options):
'--enable-png-arm-neon-support',
'--enable-posix-nspr-emulation',
'--enable-pref-extensions',
+ '--enable-private-build',
'--enable-pulseaudio',
'--enable-raw',
'--enable-readline',
diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
deleted file mode 100644
index 261768f64..000000000
--- a/build/moz.configure/rust.configure
+++ /dev/null
@@ -1,166 +0,0 @@
-# -*- 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/.
-
-option('--enable-rust', help='Include Rust language sources')
-
-@depends('--enable-rust')
-def rust_compiler_names(value):
- if value:
- return ['rustc']
-
-@depends('--enable-rust')
-def cargo_binary_names(value):
- if value:
- return ['cargo']
-
-rustc = check_prog('RUSTC', rust_compiler_names, allow_missing=True)
-cargo = check_prog('CARGO', cargo_binary_names, allow_missing=True)
-
-@depends_if(rustc)
-@checking('rustc version', lambda info: info.version)
-def rustc_info(rustc):
- out = check_cmd_output(rustc, '--version', '--verbose').splitlines()
- info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
- return namespace(
- version=Version(info.get('release', '0')),
- commit=info.get('commit-hash', 'unknown'),
- )
-
-@depends_if(cargo)
-@checking('cargo support for --frozen')
-@imports('subprocess')
-@imports('os')
-def cargo_supports_frozen(cargo):
- try:
- lines = subprocess.check_output(
- [cargo, 'help', 'build']
- ).splitlines()
- supported = any(' --frozen' in l for l in lines)
- if 'MOZ_AUTOMATION' in os.environ and not supported:
- die('cargo in automation must support --frozen')
- return supported
- except subprocess.CalledProcessError as e:
- die('Failed to call cargo: %s', e.message)
-
-set_config('MOZ_CARGO_SUPPORTS_FROZEN', cargo_supports_frozen)
-
-@depends('--enable-rust', rustc, rustc_info)
-@imports(_from='textwrap', _import='dedent')
-def rust_compiler(value, rustc, rustc_info):
- if value:
- if not rustc:
- die(dedent('''\
- Rust compiler not found.
- To compile rust language sources, you must have 'rustc' in your path.
- See https//www.rust-lang.org/ for more information.
- '''))
- version = rustc_info.version
- min_version = Version('1.10')
- if version < min_version:
- die(dedent('''\
- Rust compiler {} is too old.
- To compile Rust language sources please install at least
- version {} of the 'rustc' toolchain and make sure it is
- first in your path.
- You can verify this by typing 'rustc --version'.
- '''.format(version, min_version)))
- return True
-
-set_config('MOZ_RUST', rust_compiler)
-
-@depends(rust_compiler, rustc, target, cross_compiling)
-@imports('os')
-@imports('subprocess')
-@imports(_from='mozbuild.configure.util', _import='LineIO')
-@imports(_from='mozbuild.shellutil', _import='quote')
-@imports(_from='tempfile', _import='mkstemp')
-def rust_target(rust_compiler, rustc, target, cross_compiling):
- if rust_compiler:
- # Rust's --target options are similar to, but not exactly the same
- # as, the autoconf-derived targets we use. An example would be that
- # Rust uses distinct target triples for targetting the GNU C++ ABI
- # and the MSVC C++ ABI on Win32, whereas autoconf has a single
- # triple and relies on the user to ensure that everything is
- # compiled for the appropriate ABI. We need to perform appropriate
- # munging to get the correct option to rustc.
- #
- # The canonical list of targets supported can be derived from:
- #
- # https://github.com/rust-lang/rust/tree/master/mk/cfg
-
- # Avoid having to write out os+kernel for all the platforms where
- # they don't differ.
- os_or_kernel = target.kernel if target.kernel == 'Linux' and target.os != 'Android' else target.os
- rustc_target = {
- # DragonFly
- ('x86_64', 'DragonFly'): 'x86_64-unknown-dragonfly',
- # FreeBSD
- ('x86', 'FreeBSD'): 'i686-unknown-freebsd',
- ('x86_64', 'FreeBSD'): 'x86_64-unknown-freebsd',
- # NetBSD
- ('x86_64', 'NetBSD'): 'x86_64-unknown-netbsd',
- # OpenBSD
- ('x86_64', 'OpenBSD'): 'x86_64-unknown-openbsd',
- # Linux
- ('x86', 'Linux'): 'i586-unknown-linux-gnu',
- # Linux
- ('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
- # OS X and iOS
- ('x86', 'OSX'): 'i686-apple-darwin',
- ('x86', 'iOS'): 'i386-apple-ios',
- ('x86_64', 'OSX'): 'x86_64-apple-darwin',
- # Android
- ('x86', 'Android'): 'i686-linux-android',
- ('arm', 'Android'): 'armv7-linux-androideabi',
- # Windows
- # XXX better detection of CXX needed here, to figure out whether
- # we need i686-pc-windows-gnu instead, since mingw32 builds work.
- ('x86', 'WINNT'): 'i686-pc-windows-msvc',
- ('x86_64', 'WINNT'): 'x86_64-pc-windows-msvc',
- }.get((target.cpu, os_or_kernel), None)
-
- if rustc_target is None:
- die("Don't know how to translate {} for rustc".format(target.alias))
-
- # Check to see whether our rustc has a reasonably functional stdlib
- # for our chosen target.
- target_arg = '--target=' + rustc_target
- in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs')
- out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
- os.close(out_fd)
- try:
- source = 'pub extern fn hello() { println!("Hello world"); }'
- log.debug('Creating `%s` with content:', in_path)
- with LineIO(lambda l: log.debug('| %s', l)) as out:
- out.write(source)
-
- os.write(in_fd, source)
- os.close(in_fd)
-
- cmd = [
- rustc,
- '--crate-type', 'staticlib',
- target_arg,
- '-o', out_path,
- in_path,
- ]
- def failed():
- die('Cannot compile for {} with {}'.format(target.alias, rustc))
- check_cmd_output(*cmd, onerror=failed)
- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0:
- failed()
- finally:
- os.remove(in_path)
- os.remove(out_path)
- # This target is usable.
- return rustc_target
-
-set_config('RUST_TARGET', rust_target)
-
-# Until we remove all the other Rust checks in old-configure.
-add_old_configure_assignment('MOZ_RUST', rust_compiler)
-add_old_configure_assignment('RUSTC', rustc)
-add_old_configure_assignment('RUST_TARGET', rust_target)
diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
index 5e9fcc384..7aa94f9e1 100644
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -907,4 +907,3 @@ set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
set_config('VISIBILITY_FLAGS', visibility_flags)
include('windows.configure')
-include('rust.configure')
diff --git a/build/mozconfig.rust b/build/mozconfig.rust
deleted file mode 100644
index 65177a6bd..000000000
--- a/build/mozconfig.rust
+++ /dev/null
@@ -1,10 +0,0 @@
-# Options to enable rust in automation builds.
-
-# Tell configure to use the tooltool rustc.
-# Assume this is compiled with --enable-rpath so we don't
-# have to set LD_LIBRARY_PATH.
-RUSTC="$topsrcdir/rustc/bin/rustc"
-CARGO="$topsrcdir/cargo/bin/cargo"
-
-# Enable rust in the build.
-ac_add_options --enable-rust
diff --git a/build/templates.mozbuild b/build/templates.mozbuild
index 85b700c2a..196acd34b 100644
--- a/build/templates.mozbuild
+++ b/build/templates.mozbuild
@@ -61,14 +61,6 @@ def Library(name):
@template
-def RustLibrary(name):
- '''Template for Rust libraries.'''
- Library(name)
-
- IS_RUST_LIBRARY = True
-
-
-@template
def SharedLibrary(name):
'''Template for shared libraries.'''
Library(name)