Bug 1897978 - Move MOZ_ANDROID_NDK from old-configure to moz.configure r=glandium

Also remove the rustc < 1.68 hack, as we no longer support that version.

Differential Revision: https://phabricator.services.mozilla.com/D211091
This commit is contained in:
serge-sans-paille 2024-06-04 09:42:11 +00:00
parent 8467fcc705
commit 6193636f9b
7 changed files with 50 additions and 30 deletions

1
aclocal.m4 vendored
View file

@ -11,7 +11,6 @@ builtin(include, build/autoconf/mozprog.m4)dnl
builtin(include, build/autoconf/mozheader.m4)dnl
builtin(include, build/autoconf/compiler-opts.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
builtin(include, build/autoconf/sanitize.m4)dnl

View file

@ -1 +0,0 @@
INPUT(-lunwind)

View file

@ -1,20 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_ANDROID_NDK],
[
case "$target" in
*-android*|*-linuxandroid*)
dnl $extra_android_flags will be set for us by Python configure.
dnl $_topsrcdir/build/android is a hack for versions of rustc < 1.68
LDFLAGS="$extra_android_flags -L$_topsrcdir/build/android $LDFLAGS"
CPPFLAGS="$extra_android_flags $CPPFLAGS"
CFLAGS="-fno-short-enums $CFLAGS"
CXXFLAGS="-fno-short-enums $CXXFLAGS"
ASFLAGS="$extra_android_flags -DANDROID $ASFLAGS"
;;
esac
])

View file

@ -262,7 +262,31 @@ def extra_toolchain_flags(android_sysroot, toolchain_dir):
return flags
add_old_configure_assignment("extra_android_flags", extra_toolchain_flags)
@depends(extra_toolchain_flags)
def android_flags(extra_toolchain_flags):
return namespace(
cflags=extra_toolchain_flags + ["-fno-short-enums"],
cxxflags=extra_toolchain_flags + ["-fno-short-enums"],
ldflags=extra_toolchain_flags,
asflags=extra_toolchain_flags + ["-DANDROID"],
)
add_old_configure_assignment(
"ANDROID_CFLAGS", depends(android_flags)(lambda f: f.cflags)
)
add_old_configure_assignment(
"ANDROID_CXXFLAGS", depends(android_flags)(lambda f: f.cxxflags)
)
add_old_configure_assignment(
"ANDROID_LDFLAGS", depends(android_flags)(lambda f: f.ldflags)
)
add_old_configure_assignment(
"ANDROID_ASFLAGS", depends(android_flags)(lambda f: f.asflags)
)
@depends(extra_toolchain_flags)

1
js/src/aclocal.m4 vendored
View file

@ -11,7 +11,6 @@ builtin(include, ../../build/autoconf/mozprog.m4)dnl
builtin(include, ../../build/autoconf/mozheader.m4)dnl
builtin(include, ../../build/autoconf/compiler-opts.m4)dnl
builtin(include, ../../build/autoconf/arch.m4)dnl
builtin(include, ../../build/autoconf/android.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
builtin(include, ../../build/autoconf/sanitize.m4)dnl

View file

@ -26,6 +26,18 @@ HOST_CFLAGS="${HOST_CFLAGS=}"
HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
HOST_LDFLAGS="${HOST_LDFLAGS=}"
dnl Propagate extra android flags
dnl =============================
case "$target" in
*-android*|*-linuxandroid*)
LDFLAGS="$ANDROID_LDFLAGS $LDFLAGS"
CFLAGS="$ANDROID_CFLAGS $CFLAGS"
CXXFLAGS="$ANDROID_CXXFLAGS $CXXFLAGS"
ASFLAGS="$ANDROID_ASFLAGS -DANDROID $ASFLAGS"
;;
esac
dnl Set the minimum version of toolkit libs used by mozilla
dnl ========================================================
W32API_VERSION=3.14
@ -40,8 +52,6 @@ AC_SUBST(autoconfmk)
jsconfdefs=$_objdir/js/src/js-confdefs.h
MOZ_ANDROID_NDK
dnl ========================================================
dnl Checks for compilers.
dnl ========================================================

View file

@ -26,6 +26,19 @@ HOST_CFLAGS="${HOST_CFLAGS=}"
HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
HOST_LDFLAGS="${HOST_LDFLAGS=}"
dnl Propagate extra android flags
dnl =============================
case "$target" in
*-android*|*-linuxandroid*)
LDFLAGS="$ANDROID_LDFLAGS $LDFLAGS"
CFLAGS="$ANDROID_CFLAGS $CFLAGS"
CXXFLAGS="$ANDROID_CXXFLAGS $CXXFLAGS"
ASFLAGS="$ANDROID_ASFLAGS -DANDROID $ASFLAGS"
;;
esac
dnl Set the minimum version of toolkit libs used by mozilla
dnl ========================================================
W32API_VERSION=3.14
@ -34,10 +47,6 @@ W32API_VERSION=3.14
LDFLAGS="$LDFLAGS $LINKER_LDFLAGS $PACK_REL_RELOC_FLAGS"
HOST_LDFLAGS="$HOST_LDFLAGS $HOST_LINKER_LDFLAGS"
if test "$COMPILE_ENVIRONMENT"; then
MOZ_ANDROID_NDK
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Checks for compilers.
dnl ========================================================