summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-04-08 13:07:17 +0000
committerMoonchild <moonchild@palemoon.org>2022-04-08 13:07:17 +0000
commit330b866f465f58e1fed01e819eef7043d6c9f628 (patch)
tree5a8caddcfa6a0d09733daa403da974a5032ceb4a /build
parentedcbb85f5e53802ab9bbe92132be241265036d32 (diff)
parent4f6406f03320be7c01e5866455ec392aacd0b123 (diff)
downloaduxp-330b866f465f58e1fed01e819eef7043d6c9f628.tar.gz
Merge pull request 'Land final NSS-gyp work' (#1850) from nss-gyp-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1850
Diffstat (limited to 'build')
-rw-r--r--build/autoconf/nspr-build.m42
-rw-r--r--build/gyp.mozbuild39
-rw-r--r--build/gyp_base.mozbuild36
-rw-r--r--build/moz.configure/init.configure1
4 files changed, 47 insertions, 31 deletions
diff --git a/build/autoconf/nspr-build.m4 b/build/autoconf/nspr-build.m4
index b53fb4d37f..2858d1f2bd 100644
--- a/build/autoconf/nspr-build.m4
+++ b/build/autoconf/nspr-build.m4
@@ -138,6 +138,8 @@ if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
,
AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
CFLAGS=$_SAVE_CFLAGS
+ NSPR_INCLUDE_DIR=`echo ${NSPR_CFLAGS} | sed -e 's/.*-I\([^ ]*\).*/\1/'`
+ NSPR_LIB_DIR=`echo ${NSPR_LIBS} | sed -e 's/.*-L\([^ ]*\).*/\1/'`
elif test -z "$JS_POSIX_NSPR"; then
NSPR_INCLUDE_DIR="${DIST}/include/nspr"
NSPR_CFLAGS="-I${NSPR_INCLUDE_DIR}"
diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild
index 9e6b63d7ad..f61772ecc3 100644
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -3,7 +3,9 @@
# 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/.
-gyp_vars = {
+include('gyp_base.mozbuild')
+
+gyp_vars.update({
'lsan': 0,
'asan': 0,
'build_with_mozilla': 1,
@@ -65,42 +67,17 @@ gyp_vars = {
# linker to throw away uneeded bits.
'include_isac': 1,
'include_pcm16b': 1,
-}
-
-os = CONFIG['OS_TARGET']
-
-if os == 'WINNT':
- gyp_vars.update(
- MSVS_VERSION=CONFIG['_MSVS_VERSION'],
- MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
- )
-
-flavors = {
- 'WINNT': 'win',
- 'Linux': 'linux',
- 'SunOS': 'solaris',
- 'GNU/kFreeBSD': 'freebsd',
- 'DragonFly': 'dragonfly',
- 'FreeBSD': 'freebsd',
- 'NetBSD': 'netbsd',
- 'OpenBSD': 'openbsd',
-}
-gyp_vars['OS'] = flavors.get(os)
-
-arches = {
- 'x86_64': 'x64',
- 'x86': 'ia32',
- 'aarch64': 'arm64',
-}
-
-gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
+})
if CONFIG['ARM_ARCH']:
if int(CONFIG['ARM_ARCH']) < 7:
gyp_vars['armv7'] = 0
gyp_vars['arm_neon_optional'] = 0
+ elif os == 'Android':
+ gyp_vars['armv7'] = 1
else:
- # armv7 always uses CPU detection, so we have to set armv7=0
+ # CPU detection for ARM works on Android only. armv7 always uses CPU
+ # detection, so we have to set armv7=0 for non-Android target
gyp_vars['armv7'] = 0
# For libyuv
gyp_vars['arm_version'] = int(CONFIG['ARM_ARCH'])
diff --git a/build/gyp_base.mozbuild b/build/gyp_base.mozbuild
new file mode 100644
index 0000000000..a1f8acb099
--- /dev/null
+++ b/build/gyp_base.mozbuild
@@ -0,0 +1,36 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# 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/.
+
+gyp_vars = {}
+
+os = CONFIG['OS_TARGET']
+
+if os == 'WINNT':
+ gyp_vars.update(
+ MSVS_VERSION=CONFIG['_MSVS_VERSION'],
+ MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
+ )
+
+flavors = {
+ 'WINNT': 'win',
+ 'Linux': 'linux',
+ 'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
+ 'SunOS': 'solaris',
+ 'GNU/kFreeBSD': 'freebsd',
+ 'DragonFly': 'dragonfly',
+ 'FreeBSD': 'freebsd',
+ 'NetBSD': 'netbsd',
+ 'OpenBSD': 'openbsd',
+}
+gyp_vars['OS'] = flavors.get(os)
+
+arches = {
+ 'x86_64': 'x64',
+ 'x86': 'ia32',
+ 'aarch64': 'arm64',
+}
+
+gyp_vars['host_arch'] = arches.get(CONFIG['HOST_CPU_ARCH'], CONFIG['HOST_CPU_ARCH'])
+gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
index 8f275aee01..6c4f74c0d8 100644
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -518,6 +518,7 @@ def host_variables(host):
HOST_OS_ARCH=os_arch,
)
+set_config('HOST_CPU_ARCH', delayed_getattr(host, 'cpu'))
set_config('HOST_OS_ARCH', delayed_getattr(host_variables, 'HOST_OS_ARCH'))
add_old_configure_assignment('HOST_OS_ARCH',
delayed_getattr(host_variables, 'HOST_OS_ARCH'))